private void SetupWebcam()
{
// Instead of getting a WebCamTexture from a WebCamSource,
// rely entirely on the ImageSource.
var imageSource = ImageSourceProvider.ImageSource;
if (imageSource == null)
{
Debug.LogError("[RunYOLO9n] No valid ImageSource found!");
return;
}
// Optionally, if you need to prime any texture frame, do it here.
// For example, you might want to do an initial read:
var tex = imageSource.GetCurrentTexture();
if (tex == null)
{
Debug.LogWarning("[RunYOLO9n] The current texture is not yet available.");
}
else
{
Debug.Log("[RunYOLO9n] Using current texture from ImageSource.");
}
}
The Issue:
- When I run the app on Android, the log prints the rotation as 270 degrees. The log also states that the device is in portrait mode, but the detection only works correctly in Landscape Left.
Is there a proper way to handle this rotation automatically in Unity (without manually adjusting bounding boxes)?
How can I ensure the app works properly in both Portrait and Landscape orientations?
Any insights or suggestions would be greatly appreciated! Thanks in advance.