Open kowshik1234 opened 1 year ago
Requires ESP32 with PARAM and ESP-IDF V4.4.x. This is a record of when I built a library for ESP32S3.
$ idf.py --version
ESP-IDF v4.4.5-104-g8b94183c9c-dirty
$ cd $HOME
$ find . -name toolchain-esp32s3.cmake -print
./esp-idf/tools/cmake/toolchain-esp32s3.cmake
$ git clone https://github.com/joachimBurket/esp32-opencv
$ cd esp32-opencv/esp32/scripts
$ ./build_opencv_for_esp32.sh $HOME/esp-idf/tools/cmake/toolchain-esp32s3.cmake
$ ls -l ../lib/opencv
合計 17892
drwxr-xr-x 1 nop nop 40 1月 20 12:40 3rdparty
-rw-r--r-- 1 nop nop 859226 1月 20 12:40 libade.a
-rw-r--r-- 1 nop nop 8682766 1月 20 12:40 libopencv_core.a
-rw-r--r-- 1 nop nop 500044 1月 20 12:40 libopencv_imgcodecs.a
-rw-r--r-- 1 nop nop 8270242 1月 20 12:40 libopencv_imgproc.a
drwxr-xr-x 1 nop nop 180 1月 20 12:40 opencv2
$ cd ../lib
$ cp -r opencv ../examples/hello_opencv/main/
$ cd ../examples/hello_opencv
$ idf.py set-target esp32s3
$ idf.py menuconfig
Change Flash size to 4M.
Add Parition Table
$ idf.py flash monitor
I (490) hello_opencv: Starting main
M1 =
[ 0, 0, 255, 0, 0, 255;
0, 0, 255, 0, 0, 255]
M2 =
[ 0, 0, 111, 0, 0, 111;
0, 0, 111, 0, 0, 111]
eye =
[0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0.1, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0.1, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0.1, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0.1, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0.1, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1]
ones =
[ 3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3;
3, 3, 3, 3]
floats vector =
[3.1415927;
2;
3.01]
Gray matrix =
[ 1, 2, 3, 4, 5;
6, 7, 8, 9, 10;
11, 12, 13, 14, 15]
Thresholded matrix =
[ 0, 0, 0, 0, 0;
0, 0, 255, 255, 255;
255, 255, 255, 255, 255]
Resized matrix =
[ 2, 3, 4, 6;
9, 10, 11, 13]
Thank you @nopnop2002 your excellent example saved a ton of time for me! There should be "idf.py build" before the last comment to make your guide perfect.
@joachimBurket I have followed everything as stated in this wikipage here. The configuring and the generation part is fine. When I tried compiling, after making the
alloc.cpp
fix as stated in the documentation when I proceeded with the build I got the following errors regarding the std::mutex and thread related.Attaching entire build log.
Please let me know how to fix this? What causes this and I have seen similar error when I tried to build opencv standalone with
arm-none-eabi-gcc
compiler.Thanks, G Kowshik