ESP32 CAM direct access to image data
-
- Posts: 6
- Joined: Tue Jun 11, 2019 12:16 pm
Re: ESP32 CAM direct access to image data
From:XenonXenon wrote: ↑Wed Jun 12, 2019 2:38 pmBut I cannot find the code for dl_matrix3du_alloc anywhere and whilst the calling context makes clear that parameters 2 & 3 are width & height I do not know what parms 1 & 4 are.
https://github.com/espressif/esp-face/b ... ix3d.h#L68
Code: Select all
...
/*
* @brief Allocate a 3D matrix with 8-bits items, the access sequence is NHWC
*
* @param n Number of matrix3d, for filters it is out channels, for others it is 1
* @param w Width of matrix3d
* @param h Height of matrix3d
* @param c Channel of matrix3d
* @return 3d matrix
*/
dl_matrix3du_t *dl_matrix3du_alloc(int n, int w, int h, int c);
...
https://github.com/espressif/arduino-es ... d.cpp#L218
this is how you get rgb888 encoded frame that you can directly access (CameraWebServer "Get Still" requests JPEG, "Start Stream" requests for MJPEG stream):
Code: Select all
...
fb = esp_camera_fb_get();
...
s = fmt2rgb888(fb->buf, fb->len, fb->format, out_buf);
...
https://github.com/espressif/esp32-came ... ers.h#L110
Code: Select all
...
/**
* @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);
...
Who is online
Users browsing this forum: No registered users and 9 guests