I'm getting frame by frame with startImageStream, but I would like to avoid doing the conversion from YUV420 to RGB with C++ code (using ffi), which adds a substantial overhead. therefore I have used the imageFormatGroup while instantiating the controller (link).
The ImageFormatGroup describes the output of the raw image format (link):
cameraController = CameraController(cameras[0],
ResolutionPreset.medium,
imageFormatGroup: ImageFormatGroup.bgra8888);
BUT still I keep getting yuv420 format although I have passed ImageFormatGroup.bgra8888 (I'm using android).
according to this wiki - RGBA8888 I should get three planes of the exact size, but I keep getting:
plane0.bytes.length - 368592
plane1.bytes.length - 184271
plane2.bytes.length - 184271
Eventually I'd like to pass the frame from flutter to C++ for processing the RGB image with OpenCV.
I also have tried ImageFormatGroup.jpeg, which holds a single plane.
Can someone suggest a way of using CameraController.startImageStream(...)
to get "out of the box" a frame in a RGB format?