ESP32 CAM real time image processing.

FrankIQ
Posts: 5
Joined: Tue Jun 18, 2019 8:31 pm

ESP32 CAM real time image processing.

Postby FrankIQ » Tue Jun 18, 2019 8:36 pm

Hi,
I have been playing around with the cameraweb example. But what i need is not the webservercam application, i only need to get red , blue and green value of each pixel to do some simple real time image processing . Any tip or help in how to get his buffer data?

Thank you in advance.
Franco

FrankIQ
Posts: 5
Joined: Tue Jun 18, 2019 8:31 pm

Re: ESP32 CAM real time image processing.

Postby FrankIQ » Wed Jun 19, 2019 7:57 pm

* @brief Convert image buffer to RGB888 buffer (used for face detection)
*
* @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format
* @param src_len Length in bytes of the source buffer
* @param format Format of the source image
* @param rgb_buf Pointer to the output buffer (width * height * 3)
*
* @return true on success
*/
bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf);

I'm trying with this method, what is the RGB values order in rgb_buf?, the first 3 values are the RGB values for pixel 0,0?, and the next 3 values are the RGB values for pixel 0,1 and so on?. Thank you.

ESP_GXC
Posts: 17
Joined: Wed Nov 21, 2018 6:06 am

Re: ESP32 CAM real time image processing.

Postby ESP_GXC » Thu Jun 20, 2019 2:48 am

FrankIQ wrote: * @brief Convert image buffer to RGB888 buffer (used for face detection)
*
* @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format
* @param src_len Length in bytes of the source buffer
* @param format Format of the source image
* @param rgb_buf Pointer to the output buffer (width * height * 3)
*
* @return true on success
*/
bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf);

I'm trying with this method, what is the RGB values order in rgb_buf?, the first 3 values are the RGB values for pixel 0,0?, and the next 3 values are the RGB values for pixel 0,1 and so on?. Thank you.
Yes, it's the format as you have said.

FrankIQ
Posts: 5
Joined: Tue Jun 18, 2019 8:31 pm

Re: ESP32 CAM real time image processing.

Postby FrankIQ » Thu Jun 20, 2019 2:24 pm

ESP_GXC wrote:
Thu Jun 20, 2019 2:48 am
FrankIQ wrote: * @brief Convert image buffer to RGB888 buffer (used for face detection)
*
* @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format
* @param src_len Length in bytes of the source buffer
* @param format Format of the source image
* @param rgb_buf Pointer to the output buffer (width * height * 3)
*
* @return true on success
*/
bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf);

I'm trying with this method, what is the RGB values order in rgb_buf?, the first 3 values are the RGB values for pixel 0,0?, and the next 3 values are the RGB values for pixel 0,1 and so on?. Thank you.
Yes, it's the format as you have said.
Thank you very usefull =). I love this module cam.

rero04
Posts: 1
Joined: Wed Oct 21, 2020 9:53 am

Re: ESP32 CAM real time image processing.

Postby rero04 » Wed Oct 21, 2020 9:58 am

hello, could you send me code? i cant work with that buffer functions :| . many thanks

alanesq
Posts: 86
Joined: Thu Dec 14, 2017 8:38 pm

Re: ESP32 CAM real time image processing.

Postby alanesq » Thu Nov 12, 2020 8:47 am

Hi,

In case of use/interest I have recently been experimenting with getting RGB data from the camera and I have a sketch which does this and I hope clearly demonstrates how.
BTW - It seems the data is stored in reverse order (i.e. first blue then green then red)
Also you may want to disable auto white balance as this confused me for a while as if you put a solid colour in front of the camera it just tries to adjust it to white - lol

see: https://github.com/alanesq/esp32cam-demo
The procedure for reading RGB is "readRGBImage()"

Who is online

Users browsing this forum: No registered users and 68 guests