Open e135193 opened 2 years ago
Hi,
I am not familiar with the esp32-cam. The separation of the R, G and B channels are in the decoded output, not the jpeg encoded data. I suspect you can make it work by using the jpeg_decode_from_buffer()
function and pointing the raw_image
struct to your jpeg encoded buffer. When you want to display the image you might have to shuffle around the order of the pixels to get the format your display requires. If you require an RGB565 image you need to recalculate the values too, the output from the library is 8-bit depth per channel, RGB565 has 5-bit for R and B and 6-bit for G. This can be done as a for-loop over all the pixels, copying from the output buffer to an RGB565 buffer.
If you want to debug while developing the code, I recommend to dump the decoded frame over serial port or some other means to get it to the computer, there you can put it into a ppm file and verify that it looks OK. That way you can isolate any issue to either the decoder or the raw color space conversion.
Hi I wish to use it in my esp32-cam project.
The camera driver does not work properly so I can not get raw data. Therefore I want to use the camera in JPEG mode.
I will have a buf array. In this library we have R G B data separately. How could be the usage in my case ?