joachimBurket / esp32-opencv

Shrinked OpenCV for ESP32
Other
346 stars 76 forks source link

Examples for converting between esp32 image formats and opencv Mat #12

Closed jimwormold closed 1 year ago

jimwormold commented 1 year ago

Hi

Fantastic project!

I'm really struggling with performing any opencv operation (such as the canny edge detection in the examples) on the m5stack cameraf - in particular incorporating the operation into the M5CameraExample http-stream at around ln228 after the frame has been successfully grabbed from the camera.

Following the example ttgo code, I am able to get the buffer into the cv::Mat, do the operations but am unsure how to convert the cv::Mat back to a valid camera_fb_t * in order to pass into the handler.

Any pointers would be great!

jimwormold commented 1 year ago

Actually, this was a bit of a red herring. The problem I was encountering was simply due to stack(s) being too small.

Fixed by changing the main stack size via run idf.py menuconfig and set → Component config → ESP System Settings -> Main task stack size to 16000 and then in the code changing the httpd stack size via

   httpd_config_t config = HTTPD_DEFAULT_CONFIG();
   config.stack_size=20480
EdrZero commented 1 year ago

Hi, I'm trying to implent the canny detector with a http server, but can´t figured out how to convert the opencv MAT file into a camera_fb_t*

did you solve it?

ucfncouch commented 1 year ago

Actually, this was a bit of a red herring. The problem I was encountering was simply due to stack(s) being too small.

Fixed by changing the main stack size via run idf.py menuconfig and set → Component config → ESP System Settings -> Main task stack size to 16000 and then in the code changing the httpd stack size via

   httpd_config_t config = HTTPD_DEFAULT_CONFIG();
   config.stack_size=20480

@jimwormold I have a couple M5Stack cameras but I have been unable to get any of them to do a basic flash of even example scripts in esp-idf. How did you get M5Stack boards working in IDF? I have not been able to find any helpful guides or information on this.