Hi all,
My robotics UWP application uses a web camera for vision. Photos are captured with pretty standard code:
ImageEncodingProperties imageProperties = ImageEncodingProperties.CreateUncompressed(MediaPixelFormat.Bgra8);
photoCapture = await mediaCapture.PrepareLowLagPhotoCaptureAsync(imageProperties);
photo = await photoCapture.CaptureAsync();
SWBitmap = photo.Frame.SoftwareBitmap;
// Display photo
if (SWBitmap.BitmapPixelFormat != BitmapPixelFormat.Bgra8 || SWBitmap.BitmapAlphaMode == BitmapAlphaMode.Straight)
{
SWBitmap = SoftwareBitmap.Convert(SWBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);
}
The web camera looks like this:
These cameras usually produce 640x480 pixel images, and all was well on both Raspberry PI running the IoT, and regular Windows.
Recently, these types of cameras have started generating 1280x720 pixel images. The code above still generates perfect images on the regular Windows 10, but on Raspberry PI the image comes out all green:
Only the top few lines are colored while everything else below is green.
Does anyone have any ideas?
Thanks in advance.