Need help determining number of black/dark pixels in a still image
I am trying take a picture and determine the saturation of the image, but the picture format support for still capture is JPEG and there is no easy way to read without decoding it. Is there a way to set the format to BMP and determine the percentage of black/dark pixels in an image.
I am able successfully capture a sill image and store it a SD card.
Thanks for your help
Are you using Arduino or SDK?
You can choose the picture format for still capture between RGB565, YUV422, JPG and Grayscale.
You can also transform between those formats.
There is no predefined function to transform to BMP though.
@CamilaSouza I am currently using Aurdino and able to take still images from the camera, but the format supported for still images is JPEG format and not able to change it to YUV, RGB or Gray. The underling implementation does format conversion for image formats other than JPEG.
I need now trying to do the same with capturing a frame using Video stream which is in YUV4.2.2 format and change it.
Let me know if you can think of any other approach that would help me in reading the pixels and determining the color of it.
I am able to access pixels using the video stream. I could also convert the format.
Might it be that you try to take large images that do not fit into the 1.5MB memory?
Conversion should be independent of still images or stream because that works on the image object. It might be that initially you can choose only jpeg for the still images though.
If you do that periodically, you can sleep the callback function. With that you can be below the minimum setting of 5 FPS.