mirror of
https://gitcode.com/gh_mirrors/es/esp32-opencv.git
synced 2025-08-14 18:50:49 +08:00
trying to convert README to rst
This commit is contained in:
@ -26,12 +26,12 @@ Benchmark
|
|||||||
|
|
||||||
Below is a summary of the OpenCV features tested on the ESP32 and the time they took (adding the heap/stack used could also be useful).
|
Below is a summary of the OpenCV features tested on the ESP32 and the time they took (adding the heap/stack used could also be useful).
|
||||||
|
|
||||||
|
All measures are in milliseconds.
|
||||||
|
|
||||||
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
||||||
| Function name and arguments | BUILD_TYPE=Debug | BUILD_TYPE=Release |
|
| Function name and arguments | BUILD_TYPE=Debug | BUILD_TYPE=Release |
|
||||||
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
||||||
| | 160x120 | 320x240 | 640x480 | 1024x768 | 160x120 | 320x240 | 640x480 | 1024x768 |
|
| | 160x120 | 320x240 | 640x480 | 1024x768 | 160x120 | 320x240 | 640x480 | 1024x768 |
|
||||||
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
|
||||||
| All measures are in [ms] | |
|
|
||||||
+================================================+=============+=============+=============+=============+=============+=============+=============+=============+
|
+================================================+=============+=============+=============+=============+=============+=============+=============+=============+
|
||||||
| | |
|
| | |
|
||||||
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
||||||
@ -90,7 +90,9 @@ Below is a summary of the OpenCV features tested on the ESP32 and the time they
|
|||||||
| HoughLines probabilistic | 699 | 1652 | ERR | ERR | 608 | 1358 | 3766 | ERR |
|
| HoughLines probabilistic | 699 | 1652 | ERR | ERR | 608 | 1358 | 3766 | ERR |
|
||||||
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
+------------------------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|
||||||
|
|
||||||
|
The benchmark code can be found in esp_opencv_tests_.
|
||||||
|
|
||||||
|
.. _esp_opencv_tests: esp32/examples/esp_opencv_tests/
|
||||||
|
|
||||||
Installing esp-idf toolchain
|
Installing esp-idf toolchain
|
||||||
============================
|
============================
|
||||||
@ -113,7 +115,9 @@ First thing to do is to install the toolchain for the esp32 (see https://docs.es
|
|||||||
export IDF_PATH=$INSTALLDIR/esp-idf
|
export IDF_PATH=$INSTALLDIR/esp-idf
|
||||||
. $INSTALLDIR/esp-idf/export.sh
|
. $INSTALLDIR/esp-idf/export.sh
|
||||||
|
|
||||||
This script can be found in esp32/scripts/install_esp32_toolchain.sh.
|
This script can be found in install_esp_toolchain.sh_.
|
||||||
|
|
||||||
|
.. _install_esp_toolchain.sh: esp32/scripts/install_esp32_toolchain.sh.
|
||||||
|
|
||||||
|
|
||||||
OpenCV cross-compilation:
|
OpenCV cross-compilation:
|
||||||
@ -124,18 +128,19 @@ This is the interesting part. OpenCV is statically cross-compiled. There are 3 w
|
|||||||
Faster way:
|
Faster way:
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
The first way is to simply get the pre-built OpenCV library in esp32/lib, and copy it into your project (see Compiling-esp-idf-project-using-opencv)
|
The first way is to simply get the pre-built OpenCV library in lib_ folder, and copy it into your project (see Compiling-esp-idf-project-using-opencv)
|
||||||
|
|
||||||
|
.. _lib: esp32/lib/
|
||||||
|
|
||||||
|
|
||||||
Fast way:
|
Fast way:
|
||||||
---------
|
---------
|
||||||
|
|
||||||
The second way is by using the script in esp32/scripts/build_opencv_for_esp32.sh. This script automatically compiles OpenCV from this repository sources, and install the needed files into the desired project. It can tweaked as needed to add and remove some parts.
|
The second way is by using the script in build_opencv_for_esp32.sh_. This script automatically compiles OpenCV from this repository sources, and install the needed files into the desired project. It can tweaked as needed to add and remove some parts.
|
||||||
|
|
||||||
The script has 2 arguments. The first is the path to the `toolchain-esp32.cmake` (default is `$HOME/esp/esp-idf/tools/cmake/toolchain-esp32.cmake`), and the second is the path where the OpenCV library is installed (default is in esp32/lib).
|
|
||||||
|
|
||||||
|
The script has 2 arguments. The first is the path to the ``toolchain-esp32.cmake`` (default is ``$HOME/esp/esp-idf/tools/cmake/toolchain-esp32.cmake``), and the second is the path where the OpenCV library is installed (default is in esp32/lib).
|
||||||
|
|
||||||
|
.. _build_opencv_for_esp32.sh: esp32/scripts/build_opencv_for_esp32.sh
|
||||||
|
|
||||||
Detailed way:
|
Detailed way:
|
||||||
-------------
|
-------------
|
||||||
@ -156,7 +161,7 @@ At compilation time:
|
|||||||
|
|
||||||
$ xtensa-esp32-elf-size -d -A build/<project-name>.elf
|
$ xtensa-esp32-elf-size -d -A build/<project-name>.elf
|
||||||
|
|
||||||
- The file `build/<project-name>.map` is also very useful. It indicates the memory mapping of the variables and can be used to find big variables in the application.
|
- The file ``build/<project-name>.map`` is also very useful. It indicates the memory mapping of the variables and can be used to find big variables in the application.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -179,17 +184,19 @@ Things done to read/writes images in JPEG, PNG, etc..
|
|||||||
PNG
|
PNG
|
||||||
---
|
---
|
||||||
|
|
||||||
- Remove `-DWITH_PNG=OFF` and add `-DBUILD_PNG=ON` and `-DBUILD_ZLIB=ON` of the cmake command
|
- Remove ``-DWITH_PNG=OFF`` and add ``-DBUILD_PNG=ON`` and ``-DBUILD_ZLIB=ON`` of the cmake command
|
||||||
- => The lib `opencv_imgcodecs.a` build pass
|
|
||||||
|
|
||||||
The library is compiled in the `3rdparty/` folder. Copy this folder into the esp32 example project folder.
|
- => The lib ``opencv_imgcodecs.a`` build pass
|
||||||
|
|
||||||
|
The library is compiled in the ``3rdparty/`` folder. Copy this folder into the esp32 example project folder.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JPEG
|
JPEG
|
||||||
----
|
----
|
||||||
|
|
||||||
- Remove `-DWITH_JPEG=OFF` and add `-DBUILD_JPEG=ON` of the cmake command
|
- Remove ``-DWITH_JPEG=OFF`` and add ``-DBUILD_JPEG=ON`` of the cmake command
|
||||||
|
|
||||||
- => Problem at compilation time. TODO
|
- => Problem at compilation time. TODO
|
||||||
|
|
||||||
|
|
||||||
@ -224,17 +231,17 @@ Colorspaces
|
|||||||
|
|
||||||
Opencv supports multiple colorspaces (RGB, BGR, RGB565, RGBA, CIELAB, CIEXYZ, Luv, YUV, HSV, HLS, YCrCb, Bayer, Gray). All these colorspaces are not mandatory for an embedded system, so some are removed.
|
Opencv supports multiple colorspaces (RGB, BGR, RGB565, RGBA, CIELAB, CIEXYZ, Luv, YUV, HSV, HLS, YCrCb, Bayer, Gray). All these colorspaces are not mandatory for an embedded system, so some are removed.
|
||||||
|
|
||||||
- `color_lab.cpp`: This file contains conversion for CIELAB and CIEXYZ (https://en.wikipedia.org/wiki/CIELAB_color_space). The conversion tables takes a lot of space in the .bss segment (~88kB) , which is already overflowing. Here are the steps done to disable this code:
|
- ``color_lab.cpp``: This file contains conversion for CIELAB and CIEXYZ (https://en.wikipedia.org/wiki/CIELAB_color_space). The conversion tables takes a lot of space in the .bss segment (~88kB) , which is already overflowing. Here are the steps done to disable this code:
|
||||||
|
|
||||||
- Move `color_lab.cpp` to `color_lab.cpp.bak`
|
- Move ``color_lab.cpp`` to ``color_lab.cpp.bak``
|
||||||
|
|
||||||
- In `color.hpp` disable :
|
- In ``color.hpp`` disable :
|
||||||
|
|
||||||
.. code:: c++
|
.. code:: c++
|
||||||
|
|
||||||
// todo
|
// todo
|
||||||
|
|
||||||
- In `color.cpp` disable:
|
- In ``color.cpp`` disable:
|
||||||
|
|
||||||
.. code:: c++
|
.. code:: c++
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user