Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenCV support for IDF (IEC-35) #94

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dmitry1945
Copy link
Contributor

@dmitry1945 dmitry1945 commented Sep 16, 2022

Checklist

  • Component contains License
  • Component contains README.md
  • Component contains idf_component.yml file with url field defined
  • Component was added to upload job
  • Component was added to build job
  • Optional: Component contains unit tests
  • CI passing

Change description

The component include opencv as a component for the esp-idf.
The component could be used now with idf 4.x. The build of test_app not passed because some problems with /bdc_motor component, not with opencv.

Regards,
Dmitry

@CLAassistant
Copy link

CLAassistant commented Sep 16, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dmitry1945 dmitry1945 changed the title Feature/opencv Add OpenCV support for IDF Sep 16, 2022
@igrr igrr self-requested a review September 19, 2022 19:36
Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @dmitry1945 , I left few comments.

It is difficult for me to review the functional part, I have not worked with OpenCV... :/

This project used to build and include OpenCV library into the esp-idf as a component for esp32, esp32s2 and esp32s3 CPUs.
Now the opencv could be build with IDF version 4.4.
This component was tested with opencv V 4.6.0
The build is working only on Linux machines.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix the build for Windows and macOS before release

Comment on lines +15 to +20
# 2.1. Add here if the component is compatible with IDF == v4.3
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_EQUAL "4.3")
if(NOT ((${IDF_TARGET} MATCHES "esp32c3") OR (${IDF_TARGET} MATCHES "esp32c2")))
list(APPEND EXTRA_COMPONENT_DIRS ../opencv)
endif()
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Readme and in idf_component.yml you claim that OpenCV is compatible with IDF 4.4 only.

  • What is the limitation for other versions?
  • Why do you add it to v4.3 test_app here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we can't get OpenCV to build with IDF v5.x because OpenCV source code has some issues with uint32_t == unsigned long.
We'll add a patch to make it work with IDF 5.x and then update this PR.

@ucfncouch
Copy link

Apologies if I shouldn't be posting here, I am just wondering if this is still in the works.

@igrr
Copy link
Member

igrr commented Jul 25, 2023

@ucfncouch This is still in the works, currently blocked on an upstream PR.

We speed things up, we are going to release opencv component to components.espressif.com first, and handle upstreaming of these small fixes later.

@dmitry1945
Copy link
Contributor Author

@ucfncouch yes, it still in work. The release depends on pull request for OpenCV.

@github-actions github-actions bot changed the title Add OpenCV support for IDF Add OpenCV support for IDF (IEC-35) Jul 25, 2023
@ucfncouch
Copy link

@dmitry1945 @igrr Great! Thanks for the response. I have been doing some work with OpenCV on the ESP32 & ESP32s3 using a modified build, and many things had to be disabled to get it working correctly. Glad to see this is in the works. In your testing, are there many things that have to be disabled to get it working?

@dmitry1945
Copy link
Contributor Author

@ucfncouch Here the list of enabled opencv features:
https://github.com/espressif/idf-extra-components/pull/94/files#diff-8870c4f272f57c475cb9dbb281ba53934c2b09235fe02869a79bffe361587907R118
And here list of the components from opencv:
https://github.com/espressif/idf-extra-components/pull/94/files#diff-8870c4f272f57c475cb9dbb281ba53934c2b09235fe02869a79bffe361587907R78

If you will create your application, you should just include opencv as an idf component to the list of components in the CMakeLists.txt, for example:

idf_component_register(SRCS "main.c" "test_opencv.cpp"
                    INCLUDE_DIRS "."
                    REQUIRES opencv  esp32-camera esp_timer)

, and it should work without any changes of opencv or removing something. Even now you can use this component with upstream opencv, but with IDF-5.1. And, you will need to adjust partition table like this:

# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs,      data, nvs,     0x9000,  0x6000,
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 3M,
storage,  data, fat,     ,        500k, 

because opencv take some space inside of memory.

We will release the component soon with examples.

Regards,
Dmitry

@ucfncouch
Copy link

ucfncouch commented Jul 25, 2023

Incredible! I am going to be doing some extensive testing with this soon after it is released to compare to the OpenCV build I am using. As I said the way I am doing it currently is extremely limiting and a lot of core functionality is either broken or takes some large workarounds. I very much appreciate this!

@igrr
Copy link
Member

igrr commented Aug 16, 2023

@ucfncouch OpenCV component has been published: https://components.espressif.com/components/espressif/opencv. Please give it a try, feedback is welcome!

@NathanG-Wyca
Copy link

Hello little update I've tried to add this dependency to the esp-idf blink example project and I get this error in the build:

Executing action: menuconfig
Running cmake in directory /home/wyca/esp/esp-idf/examples/get-started/features2d/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/wyca/esp/esp-idf/examples/get-started/features2d"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: /usr/bin/git (found version "2.34.1")
-- Component directory /home/wyca/esp/esp-idf/examples/bluetooth does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/build_system does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/common_components does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/custom_bootloader does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/cxx does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/ethernet does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/get-started does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/mesh does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/network does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/openthread does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/peripherals does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/protocols does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/provisioning does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/security does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/storage does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/system does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/wifi does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/wyca/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/wyca/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/wyca/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
Manifest files have changed, solving dependencies.
....Updating lock file at /home/wyca/esp/esp-idf/examples/get-started/features2d/dependencies.lock
Processing 3 dependencies:
[1/3] espressif/esp32-camera (2.0.5)
[2/3] espressif/opencv (4.7.0~2)
[3/3] idf (4.4.5)
-- Project sdkconfig file /home/wyca/esp/esp-idf/examples/get-started/features2d/sdkconfig
Loading defaults file /home/wyca/esp/esp-idf/examples/get-started/features2d/sdkconfig.defaults...
Loading defaults file /home/wyca/esp/esp-idf/examples/get-started/features2d/sdkconfig.defaults.esp32...
-- Found Python3: /home/wyca/.espressif/python_env/idf4.4_py3.10_env/bin/python3.10 (found version "3.10.12") found components: Interpreter
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "features2d-test" version: v4.4.5-343-gd89b1e45fa
-- Adding linker script /home/wyca/esp/esp-idf/examples/get-started/features2d/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_system/ld/esp32/sections.ld.in
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-time.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- Components: app_trace app_update asio bootloader bootloader_support bt cbor cmock coap console cxx driver efuse esp-tls esp32 esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_ipc esp_lcd esp_local_ctrl esp_netif esp_phy esp_pm esp_ringbuf esp_rom esp_serial_slave_link esp_system esp_timer esp_websocket_client esp_wifi espcoredump espressif__esp32-camera espressif__opencv esptool_py expat fatfs freemodbus freertos hal heap idf_test ieee802154 jsmn json libsodium log lwip main mbedtls mdns mqtt newlib nghttp nvs_flash openssl openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport tcpip_adapter tinyusb ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /home/wyca/esp/esp-idf/components/app_trace /home/wyca/esp/esp-idf/components/app_update /home/wyca/esp/esp-idf/components/asio /home/wyca/esp/esp-idf/components/bootloader /home/wyca/esp/esp-idf/components/bootloader_support /home/wyca/esp/esp-idf/components/bt /home/wyca/esp/esp-idf/components/cbor /home/wyca/esp/esp-idf/components/cmock /home/wyca/esp/esp-idf/components/coap /home/wyca/esp/esp-idf/components/console /home/wyca/esp/esp-idf/components/cxx /home/wyca/esp/esp-idf/components/driver /home/wyca/esp/esp-idf/components/efuse /home/wyca/esp/esp-idf/components/esp-tls /home/wyca/esp/esp-idf/components/esp32 /home/wyca/esp/esp-idf/components/esp_adc_cal /home/wyca/esp/esp-idf/components/esp_common /home/wyca/esp/esp-idf/components/esp_eth /home/wyca/esp/esp-idf/components/esp_event /home/wyca/esp/esp-idf/components/esp_gdbstub /home/wyca/esp/esp-idf/components/esp_hid /home/wyca/esp/esp-idf/components/esp_http_client /home/wyca/esp/esp-idf/components/esp_http_server /home/wyca/esp/esp-idf/components/esp_https_ota /home/wyca/esp/esp-idf/components/esp_https_server /home/wyca/esp/esp-idf/components/esp_hw_support /home/wyca/esp/esp-idf/components/esp_ipc /home/wyca/esp/esp-idf/components/esp_lcd /home/wyca/esp/esp-idf/components/esp_local_ctrl /home/wyca/esp/esp-idf/components/esp_netif /home/wyca/esp/esp-idf/components/esp_phy /home/wyca/esp/esp-idf/components/esp_pm /home/wyca/esp/esp-idf/components/esp_ringbuf /home/wyca/esp/esp-idf/components/esp_rom /home/wyca/esp/esp-idf/components/esp_serial_slave_link /home/wyca/esp/esp-idf/components/esp_system /home/wyca/esp/esp-idf/components/esp_timer /home/wyca/esp/esp-idf/components/esp_websocket_client /home/wyca/esp/esp-idf/components/esp_wifi /home/wyca/esp/esp-idf/components/espcoredump /home/wyca/esp/esp-idf/examples/get-started/features2d/managed_components/espressif__esp32-camera /home/wyca/esp/esp-idf/examples/get-started/features2d/managed_components/espressif__opencv /home/wyca/esp/esp-idf/components/esptool_py /home/wyca/esp/esp-idf/components/expat /home/wyca/esp/esp-idf/components/fatfs /home/wyca/esp/esp-idf/components/freemodbus /home/wyca/esp/esp-idf/components/freertos /home/wyca/esp/esp-idf/components/hal /home/wyca/esp/esp-idf/components/heap /home/wyca/esp/esp-idf/components/idf_test /home/wyca/esp/esp-idf/components/ieee802154 /home/wyca/esp/esp-idf/components/jsmn /home/wyca/esp/esp-idf/components/json /home/wyca/esp/esp-idf/components/libsodium /home/wyca/esp/esp-idf/components/log /home/wyca/esp/esp-idf/components/lwip /home/wyca/esp/esp-idf/examples/get-started/features2d/main /home/wyca/esp/esp-idf/components/mbedtls /home/wyca/esp/esp-idf/components/mdns /home/wyca/esp/esp-idf/components/mqtt /home/wyca/esp/esp-idf/components/newlib /home/wyca/esp/esp-idf/components/nghttp /home/wyca/esp/esp-idf/components/nvs_flash /home/wyca/esp/esp-idf/components/openssl /home/wyca/esp/esp-idf/components/openthread /home/wyca/esp/esp-idf/components/partition_table /home/wyca/esp/esp-idf/components/perfmon /home/wyca/esp/esp-idf/components/protobuf-c /home/wyca/esp/esp-idf/components/protocomm /home/wyca/esp/esp-idf/components/pthread /home/wyca/esp/esp-idf/components/sdmmc /home/wyca/esp/esp-idf/components/soc /home/wyca/esp/esp-idf/components/spi_flash /home/wyca/esp/esp-idf/components/spiffs /home/wyca/esp/esp-idf/components/tcp_transport /home/wyca/esp/esp-idf/components/tcpip_adapter /home/wyca/esp/esp-idf/components/tinyusb /home/wyca/esp/esp-idf/components/ulp /home/wyca/esp/esp-idf/components/unity /home/wyca/esp/esp-idf/components/usb /home/wyca/esp/esp-idf/components/vfs /home/wyca/esp/esp-idf/components/wear_levelling /home/wyca/esp/esp-idf/components/wifi_provisioning /home/wyca/esp/esp-idf/components/wpa_supplicant /home/wyca/esp/esp-idf/components/xtensa
-- Configuring done
CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command):
Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found.
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command)
managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command):
Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found.
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command)
managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command):
Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found.
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command)
managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command):
Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found.
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command)
managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command):
Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found.
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command)
managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command):
Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found.
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language)
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command)
managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
cmake failed with exit code 1

@Ncouch64
Copy link

Ncouch64 commented Jan 8, 2024

@ucfncouch OpenCV component has been published: https://components.espressif.com/components/espressif/opencv. Please give it a try, feedback is welcome!

Great! Thanks for the work on this. I will be testing it here over the next few days/weeks. I will open an issue if I encounter anything out of the ordinary that I cannot fix myself.

@Ncouch64
Copy link

Ncouch64 commented Jan 9, 2024

Hello little update I've tried to add this dependency to the esp-idf blink example project and I get this error in the build:

Executing action: menuconfig
Running cmake in directory /home/wyca/esp/esp-idf/examples/get-started/features2d/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/wyca/esp/esp-idf/examples/get-started/features2d"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: /usr/bin/git (found version "2.34.1")
-- Component directory /home/wyca/esp/esp-idf/examples/bluetooth does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/build_system does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/common_components does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/custom_bootloader does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/cxx does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/ethernet does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/get-started does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/mesh does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/network does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/openthread does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/peripherals does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/protocols does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/provisioning does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/security does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/storage does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/system does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/wyca/esp/esp-idf/examples/wifi does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/wyca/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/wyca/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/wyca/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
Manifest files have changed, solving dependencies.
....Updating lock file at /home/wyca/esp/esp-idf/examples/get-started/features2d/dependencies.lock
Processing 3 dependencies:
[1/3] espressif/esp32-camera (2.0.5)
[2/3] espressif/opencv (4.7.0~2)
[3/3] idf (4.4.5)
-- Project sdkconfig file /home/wyca/esp/esp-idf/examples/get-started/features2d/sdkconfig
Loading defaults file /home/wyca/esp/esp-idf/examples/get-started/features2d/sdkconfig.defaults...
Loading defaults file /home/wyca/esp/esp-idf/examples/get-started/features2d/sdkconfig.defaults.esp32...
-- Found Python3: /home/wyca/.espressif/python_env/idf4.4_py3.10_env/bin/python3.10 (found version "3.10.12") found components: Interpreter
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "features2d-test" version: v4.4.5-343-gd89b1e45fa
-- Adding linker script /home/wyca/esp/esp-idf/examples/get-started/features2d/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_system/ld/esp32/sections.ld.in
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-time.ld
-- Adding linker script /home/wyca/esp/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- Components: app_trace app_update asio bootloader bootloader_support bt cbor cmock coap console cxx driver efuse esp-tls esp32 esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_ipc esp_lcd esp_local_ctrl esp_netif esp_phy esp_pm esp_ringbuf esp_rom esp_serial_slave_link esp_system esp_timer esp_websocket_client esp_wifi espcoredump espressif__esp32-camera espressif__opencv esptool_py expat fatfs freemodbus freertos hal heap idf_test ieee802154 jsmn json libsodium log lwip main mbedtls mdns mqtt newlib nghttp nvs_flash openssl openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport tcpip_adapter tinyusb ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /home/wyca/esp/esp-idf/components/app_trace /home/wyca/esp/esp-idf/components/app_update /home/wyca/esp/esp-idf/components/asio /home/wyca/esp/esp-idf/components/bootloader /home/wyca/esp/esp-idf/components/bootloader_support /home/wyca/esp/esp-idf/components/bt /home/wyca/esp/esp-idf/components/cbor /home/wyca/esp/esp-idf/components/cmock /home/wyca/esp/esp-idf/components/coap /home/wyca/esp/esp-idf/components/console /home/wyca/esp/esp-idf/components/cxx /home/wyca/esp/esp-idf/components/driver /home/wyca/esp/esp-idf/components/efuse /home/wyca/esp/esp-idf/components/esp-tls /home/wyca/esp/esp-idf/components/esp32 /home/wyca/esp/esp-idf/components/esp_adc_cal /home/wyca/esp/esp-idf/components/esp_common /home/wyca/esp/esp-idf/components/esp_eth /home/wyca/esp/esp-idf/components/esp_event /home/wyca/esp/esp-idf/components/esp_gdbstub /home/wyca/esp/esp-idf/components/esp_hid /home/wyca/esp/esp-idf/components/esp_http_client /home/wyca/esp/esp-idf/components/esp_http_server /home/wyca/esp/esp-idf/components/esp_https_ota /home/wyca/esp/esp-idf/components/esp_https_server /home/wyca/esp/esp-idf/components/esp_hw_support /home/wyca/esp/esp-idf/components/esp_ipc /home/wyca/esp/esp-idf/components/esp_lcd /home/wyca/esp/esp-idf/components/esp_local_ctrl /home/wyca/esp/esp-idf/components/esp_netif /home/wyca/esp/esp-idf/components/esp_phy /home/wyca/esp/esp-idf/components/esp_pm /home/wyca/esp/esp-idf/components/esp_ringbuf /home/wyca/esp/esp-idf/components/esp_rom /home/wyca/esp/esp-idf/components/esp_serial_slave_link /home/wyca/esp/esp-idf/components/esp_system /home/wyca/esp/esp-idf/components/esp_timer /home/wyca/esp/esp-idf/components/esp_websocket_client /home/wyca/esp/esp-idf/components/esp_wifi /home/wyca/esp/esp-idf/components/espcoredump /home/wyca/esp/esp-idf/examples/get-started/features2d/managed_components/espressif__esp32-camera /home/wyca/esp/esp-idf/examples/get-started/features2d/managed_components/espressif__opencv /home/wyca/esp/esp-idf/components/esptool_py /home/wyca/esp/esp-idf/components/expat /home/wyca/esp/esp-idf/components/fatfs /home/wyca/esp/esp-idf/components/freemodbus /home/wyca/esp/esp-idf/components/freertos /home/wyca/esp/esp-idf/components/hal /home/wyca/esp/esp-idf/components/heap /home/wyca/esp/esp-idf/components/idf_test /home/wyca/esp/esp-idf/components/ieee802154 /home/wyca/esp/esp-idf/components/jsmn /home/wyca/esp/esp-idf/components/json /home/wyca/esp/esp-idf/components/libsodium /home/wyca/esp/esp-idf/components/log /home/wyca/esp/esp-idf/components/lwip /home/wyca/esp/esp-idf/examples/get-started/features2d/main /home/wyca/esp/esp-idf/components/mbedtls /home/wyca/esp/esp-idf/components/mdns /home/wyca/esp/esp-idf/components/mqtt /home/wyca/esp/esp-idf/components/newlib /home/wyca/esp/esp-idf/components/nghttp /home/wyca/esp/esp-idf/components/nvs_flash /home/wyca/esp/esp-idf/components/openssl /home/wyca/esp/esp-idf/components/openthread /home/wyca/esp/esp-idf/components/partition_table /home/wyca/esp/esp-idf/components/perfmon /home/wyca/esp/esp-idf/components/protobuf-c /home/wyca/esp/esp-idf/components/protocomm /home/wyca/esp/esp-idf/components/pthread /home/wyca/esp/esp-idf/components/sdmmc /home/wyca/esp/esp-idf/components/soc /home/wyca/esp/esp-idf/components/spi_flash /home/wyca/esp/esp-idf/components/spiffs /home/wyca/esp/esp-idf/components/tcp_transport /home/wyca/esp/esp-idf/components/tcpip_adapter /home/wyca/esp/esp-idf/components/tinyusb /home/wyca/esp/esp-idf/components/ulp /home/wyca/esp/esp-idf/components/unity /home/wyca/esp/esp-idf/components/usb /home/wyca/esp/esp-idf/components/vfs /home/wyca/esp/esp-idf/components/wear_levelling /home/wyca/esp/esp-idf/components/wifi_provisioning /home/wyca/esp/esp-idf/components/wpa_supplicant /home/wyca/esp/esp-idf/components/xtensa
-- Configuring done
CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command):
Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command) managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command): Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command) managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command): Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command) managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command): Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command) managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command): Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command) managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406:EVAL:2 (add_custom_command): Error evaluating generator expression:

$<TARGET_PROPERTY:idf::opencv,INCLUDE_DIRECTORIES>

Target "idf::opencv" not found. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2406 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306:EVAL:2 (ExternalProject_Add_Step) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3306 (cmake_language) /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3719 (_ep_add_configure_command) managed_components/espressif__opencv/CMakeLists.txt:110 (ExternalProject_Add)

-- Generating done CMake Generate step failed. Build files cannot be regenerated correctly. cmake failed with exit code 1

I am also getting a similar problem @igrr.

@Ncouch64
Copy link

Ncouch64 commented Jan 9, 2024

Ok, it seems I was able to resolve one of the problems but am now running into another. If you create a project from one of the opencv examples as recommended on the IDF Component Page you will run into a problem because of the main CMakeLists. It is setting the component directory as: set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/../..") which is causing it to back out of the project, I am assuming this is because these examples are originally buried within the managed components folder. I changed it to: set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/..") which is solving the problem of the components not being added to the project but I am encountering a separate issue as mentioned.

This is also the same output I get if I run from the example within managed components instead of creating a new project.

-- Found Git: C:/Users/na258588/.espressif/tools/idf-git/2.39.2/cmd/git.exe (found version "2.39.2.windows.1")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/na258588/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/na258588/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/na258588/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s3
Processing 3 dependencies:
[1/3] espressif/esp32-camera (2.0.6)
[2/3] espressif/opencv (4.7.0~3)
[3/3] idf (5.1.2)
-- Found Git: C:/Users/na258588/.espressif/tools/idf-git/2.39.2/cmd/git.exe (found version "2.39.2.windows.1")
CMake Error at C:/Users/na258588/esp/esp-idf/tools/cmake/component.cmake:224 (message):
CMake Warning (dev) at build_properties.temp.cmake:8:

Syntax Warning in cmake code at column 47



Argument not separated from preceding token by whitespace.

Call Stack (most recent call first):

C:/Users/na258588/esp/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:3 (include)

This warning is for project developers. Use -Wno-dev to suppress it.

fatal: not a git repository (or any of the parent directories): .git

CMake Error at
C:/Users/na258588/.espressif/tools/cmake/3.24.0/share/cmake-3.24/Modules/ExternalProject.cmake:1253
(define_property):

define_property command is not scriptable

Call Stack (most recent call first):

C:/Users/na258588/esp/esp-idf/tools/cmake/kconfig.cmake:1 (include)
C:/Users/na258588/esp/esp-idf/tools/cmake/idf.cmake:43 (include)
C:/Users/na258588/esp/esp-idf/tools/cmake/project.cmake:29 (include)
E:/work/Project/features2d/CMakeLists.txt:5 (include)
C:/Users/na258588/esp/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:106 (include)
C:/Users/na258588/esp/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:124 (__component_get_requirements)

Call Stack (most recent call first):
C:/Users/na258588/esp/esp-idf/tools/cmake/build.cmake:574 (__component_get_requirements)
C:/Users/na258588/esp/esp-idf/tools/cmake/project.cmake:547 (idf_build_process)
CMakeLists.txt:6 (project)

-- Configuring incomplete, errors occurred!
See also "E:/work/Project/features2d/build/CMakeFiles/CMakeOutput.log".

  • The terminal process "C:\Windows\System32\cmd.exe /d /c cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B e:\work\Project\features2d\build -S e:\work\Project\features2d" terminated with exit code: 1.

@Ncouch64
Copy link

Ncouch64 commented Jan 10, 2024

Actually just did a sanity check and tried to build a fresh project with only esp32-camera as a dependency and I ran into the exact same error message. I am a little bit confused about what I am overlooking.

Edit: Was able to get hello_world to build so I knew IDF wasn't borked. Seems that whenever I try and add a component using the IDF component manager I get the build errors that are linked above ^. I must be doing something wrong...

Edit 1/22/24 - I still have not been able to find a solution to this problem, I have been digging through various posts and the documentation with no change. Not sure what I am doing wrong here.

@ahmetcobanoglu
Copy link

@Ncouch64 @NathanG-Wyca Please change the directory of opencv to "components" and change the file name to "opencv".

@igrr you can set COMPONENT_NAME variable as "opencv" before calling "idf_component_register" macro. This will solve the build error.

@igrr
Copy link
Member

igrr commented Jan 30, 2024

Thanks for the tip @ahmetcobanoglu, we'll fix that as well as other related issues and will release the new version soon.

@Ncouch64
Copy link

@Ncouch64 @NathanG-Wyca Please change the directory of opencv to "components" and change the file name to "opencv".

@igrr you can set COMPONENT_NAME variable as "opencv" before calling "idf_component_register" macro. This will solve the build error.

I will test this out today, thanks for the response. I was pulling my hair out trying to figure out what I was doing wrong.

@dmitry1945
Copy link
Contributor Author

I will test this out today, thanks for the response. I was pulling my hair out trying to figure out what I was doing wrong.

@Ncouch64 I will update opencv component today. You will be able to use it.

@Ncouch64
Copy link

I will test this out today, thanks for the response. I was pulling my hair out trying to figure out what I was doing wrong.

@Ncouch64 I will update opencv component today. You will be able to use it.

Thank you! Very excited.

@nopnop2002
Copy link

nopnop2002 commented Feb 1, 2024

@dmitry1945

I will update opencv component today. You will be able to use it.

Thanks for the useful library.
I built the code below:

$ cat main.cpp
#include <stdio.h>
#include <stdlib.h>

#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/core/ocl.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/imgcodecs/legacy/constants_c.h>
#include <opencv2/core.hpp>
#include <opencv2/objdetect.hpp>
#include <opencv2/imgproc.hpp>

#include "opencv2/imgcodecs.hpp"

#include <opencv2/core/utility.hpp>

#include "opencv2/opencv_modules.hpp"

#include "opencv2/core.hpp"
#include <opencv2/core/cuda.hpp>
#include <opencv2/core/cvstd.hpp>
#include <opencv2/core/softfloat.hpp>
#include <opencv2/imgproc/types_c.h>

#include <iostream>
#include <math.h>
#include <tuple>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_vfs.h"
#include "esp_spiffs.h"


using namespace cv;
using namespace std;

extern "C" long int sysconf(int);

long int sysconf(int wtf)
{
	return 1;
}


const char* TAG="MAIN";

extern "C" {
void app_main(void);
}



static int getFileSize(char *fullPath) {
	struct stat st;
	if (stat(fullPath, &st) == 0)
		return st.st_size;
	return -1;
}

static void printDirectory(char * path) {
	DIR* dir = opendir(path);
	assert(dir != NULL);
	while (true) {
		struct dirent *pe = readdir(dir);
		if (!pe) break;
		ESP_LOGI(__FUNCTION__,"%s d_name=%s d_ino=%d d_type=%x", path, pe->d_name, pe->d_ino, pe->d_type);
		if (pe->d_type == 1) {
			char fullPath[64];
			strcpy(fullPath, path);
			strcat(fullPath, "/");
			strcat(fullPath, pe->d_name);
			int size = getFileSize(fullPath);
			ESP_LOGI(__FUNCTION__,"size=%d", size);
		}
		if (pe->d_type == 2) {
			char subDir[127];
			sprintf(subDir,"%s%.64s", path, pe->d_name);
			ESP_LOGI(TAG, "subDir=[%s]", subDir);
			printDirectory(subDir);

		}
	}
	closedir(dir);
}

esp_err_t init_spiffs(char * base_path) {
	ESP_LOGI("spiffs_init", "Initializing SPIFFS");

	esp_vfs_spiffs_conf_t conf = {
			//.base_path = "/spiffs",
			.base_path = base_path,
			.partition_label = "storage",
			.max_files = 10,
			.format_if_mount_failed = false
	};

	// Use settings defined above to initialize and mount SPIFFS filesystem.
	// Note: esp_vfs_spiffs_register is an all-in-one convenience function.
	esp_err_t ret = esp_vfs_spiffs_register(&conf);

	if (ret != ESP_OK) {
		if (ret == ESP_FAIL) {
			ESP_LOGE("spiffs_init", "Failed to mount or format filesystem");
		} else if (ret == ESP_ERR_NOT_FOUND) {
			ESP_LOGE("spiffs_init", "Failed to find SPIFFS partition");
		} else {
			ESP_LOGE("spiffs_init", "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret));
		}
		return ret;
	}

	size_t total = 0, used = 0;
	ret = esp_spiffs_info("storage", &total, &used);
	if (ret != ESP_OK) {
		ESP_LOGE("spiffs_init", "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret));
	} else {
		ESP_LOGI("spiffs_init", "Partition size: total: %d, used: %d", total, used);
	}
	return ESP_OK;
}

void app_main(void)
{
	ESP_LOGI(TAG, "Starting main");

	/* Initialize SPIFFS */
	char basePath[] = "/spiffs";
	init_spiffs(basePath);
	printDirectory(basePath);

	/* Read the images for the tests */
	const vector<string> images_res = {"160x120", "320x240", "640x480", "1024x768"};
	for(const String &res : images_res) {
		String fileName = "/spiffs/"+res+".png";
		cout << "fileName = " << fileName << endl;
#if 0
		Mat img = imread(fileName, IMREAD_GRAYSCALE);
		if(img.empty()) {
			ESP_LOGW(TAG, "cannot read the image: %s", fileName.c_str());
		} else {
			ESP_LOGI(TAG, "Image read of %dx%dx%d, with %d pixel depth", img.rows, img.cols, img.channels(), img.depth());
		}
#endif
	}
}

It works correctly if I disable the IF block at the end of the code.

I (847) spiffs_init: Initializing SPIFFS
I (937) spiffs_init: Partition size: total: 1404596, used: 1400831
I (937) printDirectory: /spiffs d_name=1024x768.png d_ino=0 d_type=1
I (937) printDirectory: size=826271
I (967) printDirectory: /spiffs d_name=hello.txt d_ino=0 d_type=1
I (997) printDirectory: size=13
I (997) printDirectory: /spiffs d_name=320x240.png d_ino=0 d_type=1
I (997) printDirectory: size=122604
I (1007) printDirectory: /spiffs d_name=160x120.png d_ino=0 d_type=1
I (1007) printDirectory: size=37178
I (1007) printDirectory: /spiffs d_name=640x480.png d_ino=0 d_type=1
I (1017) printDirectory: size=401789
fileName = /spiffs/160x120.png
fileName = /spiffs/320x240.png
fileName = /spiffs/640x480.png
fileName = /spiffs/1024x768.png

Enabling an IF block at the end of the code will cause a build error.

My Environment:

$ idf.py --version
ESP-IDF v5.1.2-602-gdb1e54a0c5-dirty

imread function is not supported.

/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg.cpp.obj):(.text._ZN2cvL10error_exitEP18jpeg_common_struct+0x0): undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg.cpp.obj): in function `_ZN2cvL10error_exitEP18jpeg_common_struct':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg.cpp:173: undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `isJasperEnabled':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:91: undefined reference to `jas_cleanup'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv17JasperInitializerD4Ev':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:92: undefined reference to `jas_cleanup'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:78: undefined reference to `jas_init'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cvL11_initJasperEv':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:79: undefined reference to `jas_init'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:131: undefined reference to `jas_stream_close'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:131: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KDecoder5closeEv':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:134: undefined reference to `jas_stream_close'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:141: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZNSt15__new_allocatorIcED4Ev':
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/xtensa-esp32s3-elf/include/c++/12.2.0/bits/new_allocator.h:90: undefined reference to `jas_stream_fopen'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/xtensa-esp32s3-elf/include/c++/12.2.0/bits/new_allocator.h:90: undefined reference to `jas_image_decode'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KDecoder10readHeaderEv':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:150: undefined reference to `jas_stream_fopen'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:150: undefined reference to `jas_image_decode'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoderC2Ev':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:495: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoder16writeComponent8uEPvRKNS_3MatE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:588: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:602: undefined reference to `jas_image_writecmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:602: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:601: undefined reference to `jas_image_writecmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:603: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoder17writeComponent16uEPvRKNS_3MatE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:614: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:628: undefined reference to `jas_image_writecmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:628: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:627: undefined reference to `jas_image_writecmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:629: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:546: undefined reference to `jas_image_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:548: undefined reference to `jas_image_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_stream_fopen'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_image_strtofmt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_image_encode'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_stream_close'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:565: undefined reference to `jas_stream_fopen'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:572: undefined reference to `jas_image_strtofmt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv':
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/xtensa-esp32s3-elf/include/c++/12.2.0/sstream:1137: undefined reference to `jas_image_encode'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:574: undefined reference to `jas_stream_close'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:576: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:242: undefined reference to `jas_cmprof_createfromclrspc'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:242: undefined reference to `jas_image_chclrspc'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:242: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:242: undefined reference to `jas_cmprof_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:249: undefined reference to `jas_cmprof_createfromclrspc'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:249: undefined reference to `jas_image_chclrspc'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:253: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:260: undefined reference to `jas_cmprof_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:263: undefined reference to `jas_cmprof_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:275: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:275: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:275: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:275: undefined reference to `jas_cmprof_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:273: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:279: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:279: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:291: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:292: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:294: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:294: undefined reference to `jas_image_readcmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:310: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:313: undefined reference to `jas_image_readcmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:324: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:324: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:326: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:327: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(png.c.obj): in function `png_compare_ICC_profile_with_sRGB':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2318: undefined reference to `adler32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2318: undefined reference to `adler32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2318: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2318: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2362: undefined reference to `adler32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2363: undefined reference to `adler32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2375: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2376: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(png.c.obj): in function `png_reset_crc':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:130: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(png.c.obj): in function `png_calculate_crc':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:167: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:173: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(png.c.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:253: undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngread.c.obj):(.text.png_read_destroy+0x0): undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngread.c.obj): in function `png_read_destroy':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngread.c:965: undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngrutil.c.obj): in function `png_inflate_claim':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:385: undefined reference to `inflateReset2'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:404: undefined reference to `inflateReset2'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:407: undefined reference to `inflateInit2_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:407: undefined reference to `inflateValidate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:416: undefined reference to `inflateInit2_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:427: undefined reference to `inflateValidate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngrutil.c.obj): in function `png_zlib_inflate':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:461: undefined reference to `inflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:467: undefined reference to `inflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngrutil.c.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:614: undefined reference to `inflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngrutil.c.obj): in function `png_decompress_chunk':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:649: undefined reference to `inflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwrite.c.obj):(.text.png_write_destroy+0x0): undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwrite.c.obj):(.text.png_write_destroy+0x12): undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwutil.c.obj): in function `png_deflate_claim':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:378: undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:380: undefined reference to `deflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:393: undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:407: undefined reference to `deflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:413: undefined reference to `deflateInit2_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:417: undefined reference to `deflateInit2_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwutil.c.obj): in function `png_text_compress':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:580: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:580: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwutil.c.obj): in function `png_compress_IDAT':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:945: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:978: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_jpeg.c.obj): in function `TIFFjpeg_error_exit':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_jpeg.c:223: undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_jpeg.c.obj): in function `TIFFjpeg_progress_monitor':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_jpeg.c:262: undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPCleanup':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:503: undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:506: undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:507: undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPEncode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:335: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:433: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPPostEncode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:451: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPPreEncode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:316: undefined reference to `deflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:322: undefined reference to `deflateInit_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPSetupEncode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:281: undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:283: undefined reference to `deflateInit_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPDecode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:232: undefined reference to `inflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:242: undefined reference to `inflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPPreDecode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:142: undefined reference to `inflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:148: undefined reference to `inflateInit_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPSetupDecode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:102: undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:107: undefined reference to `inflateInit_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPVSetField':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:540: undefined reference to `deflateParams'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:547: undefined reference to `deflateParams'

@Ncouch64
Copy link

Ncouch64 commented Feb 1, 2024

@dmitry1945

I will update opencv component today. You will be able to use it.

Thanks for the useful library. I built the code below:

$ cat main.cpp
#include <stdio.h>
#include <stdlib.h>

#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/core/ocl.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/imgcodecs/legacy/constants_c.h>
#include <opencv2/core.hpp>
#include <opencv2/objdetect.hpp>
#include <opencv2/imgproc.hpp>

#include "opencv2/imgcodecs.hpp"

#include <opencv2/core/utility.hpp>

#include "opencv2/opencv_modules.hpp"

#include "opencv2/core.hpp"
#include <opencv2/core/cuda.hpp>
#include <opencv2/core/cvstd.hpp>
#include <opencv2/core/softfloat.hpp>
#include <opencv2/imgproc/types_c.h>

#include <iostream>
#include <math.h>
#include <tuple>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_vfs.h"
#include "esp_spiffs.h"


using namespace cv;
using namespace std;

extern "C" long int sysconf(int);

long int sysconf(int wtf)
{
	return 1;
}


const char* TAG="MAIN";

extern "C" {
void app_main(void);
}



static int getFileSize(char *fullPath) {
	struct stat st;
	if (stat(fullPath, &st) == 0)
		return st.st_size;
	return -1;
}

static void printDirectory(char * path) {
	DIR* dir = opendir(path);
	assert(dir != NULL);
	while (true) {
		struct dirent *pe = readdir(dir);
		if (!pe) break;
		ESP_LOGI(__FUNCTION__,"%s d_name=%s d_ino=%d d_type=%x", path, pe->d_name, pe->d_ino, pe->d_type);
		if (pe->d_type == 1) {
			char fullPath[64];
			strcpy(fullPath, path);
			strcat(fullPath, "/");
			strcat(fullPath, pe->d_name);
			int size = getFileSize(fullPath);
			ESP_LOGI(__FUNCTION__,"size=%d", size);
		}
		if (pe->d_type == 2) {
			char subDir[127];
			sprintf(subDir,"%s%.64s", path, pe->d_name);
			ESP_LOGI(TAG, "subDir=[%s]", subDir);
			printDirectory(subDir);

		}
	}
	closedir(dir);
}

esp_err_t init_spiffs(char * base_path) {
	ESP_LOGI("spiffs_init", "Initializing SPIFFS");

	esp_vfs_spiffs_conf_t conf = {
			//.base_path = "/spiffs",
			.base_path = base_path,
			.partition_label = "storage",
			.max_files = 10,
			.format_if_mount_failed = false
	};

	// Use settings defined above to initialize and mount SPIFFS filesystem.
	// Note: esp_vfs_spiffs_register is an all-in-one convenience function.
	esp_err_t ret = esp_vfs_spiffs_register(&conf);

	if (ret != ESP_OK) {
		if (ret == ESP_FAIL) {
			ESP_LOGE("spiffs_init", "Failed to mount or format filesystem");
		} else if (ret == ESP_ERR_NOT_FOUND) {
			ESP_LOGE("spiffs_init", "Failed to find SPIFFS partition");
		} else {
			ESP_LOGE("spiffs_init", "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret));
		}
		return ret;
	}

	size_t total = 0, used = 0;
	ret = esp_spiffs_info("storage", &total, &used);
	if (ret != ESP_OK) {
		ESP_LOGE("spiffs_init", "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret));
	} else {
		ESP_LOGI("spiffs_init", "Partition size: total: %d, used: %d", total, used);
	}
	return ESP_OK;
}

void app_main(void)
{
	ESP_LOGI(TAG, "Starting main");

	/* Initialize SPIFFS */
	char basePath[] = "/spiffs";
	init_spiffs(basePath);
	printDirectory(basePath);

	/* Read the images for the tests */
	const vector<string> images_res = {"160x120", "320x240", "640x480", "1024x768"};
	for(const String &res : images_res) {
		String fileName = "/spiffs/"+res+".png";
		cout << "fileName = " << fileName << endl;
#if 0
		Mat img = imread(fileName, IMREAD_GRAYSCALE);
		if(img.empty()) {
			ESP_LOGW(TAG, "cannot read the image: %s", fileName.c_str());
		} else {
			ESP_LOGI(TAG, "Image read of %dx%dx%d, with %d pixel depth", img.rows, img.cols, img.channels(), img.depth());
		}
#endif
	}
}

It works correctly if I disable the IF block at the end of the code.

I (847) spiffs_init: Initializing SPIFFS
I (937) spiffs_init: Partition size: total: 1404596, used: 1400831
I (937) printDirectory: /spiffs d_name=1024x768.png d_ino=0 d_type=1
I (937) printDirectory: size=826271
I (967) printDirectory: /spiffs d_name=hello.txt d_ino=0 d_type=1
I (997) printDirectory: size=13
I (997) printDirectory: /spiffs d_name=320x240.png d_ino=0 d_type=1
I (997) printDirectory: size=122604
I (1007) printDirectory: /spiffs d_name=160x120.png d_ino=0 d_type=1
I (1007) printDirectory: size=37178
I (1007) printDirectory: /spiffs d_name=640x480.png d_ino=0 d_type=1
I (1017) printDirectory: size=401789
fileName = /spiffs/160x120.png
fileName = /spiffs/320x240.png
fileName = /spiffs/640x480.png
fileName = /spiffs/1024x768.png

Enabling an IF block at the end of the code will cause a build error.

My Environment:

$ idf.py --version
ESP-IDF v5.1.2-602-gdb1e54a0c5-dirty

imread function is not supported.

/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg.cpp.obj):(.text._ZN2cvL10error_exitEP18jpeg_common_struct+0x0): undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg.cpp.obj): in function `_ZN2cvL10error_exitEP18jpeg_common_struct':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg.cpp:173: undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `isJasperEnabled':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:91: undefined reference to `jas_cleanup'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv17JasperInitializerD4Ev':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:92: undefined reference to `jas_cleanup'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:78: undefined reference to `jas_init'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cvL11_initJasperEv':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:79: undefined reference to `jas_init'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:131: undefined reference to `jas_stream_close'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:131: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KDecoder5closeEv':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:134: undefined reference to `jas_stream_close'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:141: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZNSt15__new_allocatorIcED4Ev':
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/xtensa-esp32s3-elf/include/c++/12.2.0/bits/new_allocator.h:90: undefined reference to `jas_stream_fopen'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/xtensa-esp32s3-elf/include/c++/12.2.0/bits/new_allocator.h:90: undefined reference to `jas_image_decode'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KDecoder10readHeaderEv':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:150: undefined reference to `jas_stream_fopen'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:150: undefined reference to `jas_image_decode'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoderC2Ev':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:495: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoder16writeComponent8uEPvRKNS_3MatE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:588: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:602: undefined reference to `jas_image_writecmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:602: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:601: undefined reference to `jas_image_writecmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:603: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoder17writeComponent16uEPvRKNS_3MatE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:614: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:628: undefined reference to `jas_image_writecmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:628: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:627: undefined reference to `jas_image_writecmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:629: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:546: undefined reference to `jas_image_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:548: undefined reference to `jas_image_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_stream_fopen'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_image_strtofmt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_image_encode'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_stream_close'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:563: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:565: undefined reference to `jas_stream_fopen'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:572: undefined reference to `jas_image_strtofmt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv':
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/xtensa-esp32s3-elf/include/c++/12.2.0/sstream:1137: undefined reference to `jas_image_encode'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:574: undefined reference to `jas_stream_close'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:576: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/libopencv_imgcodecs.a(grfmt_jpeg2000.cpp.obj): in function `_ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:242: undefined reference to `jas_cmprof_createfromclrspc'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:242: undefined reference to `jas_image_chclrspc'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:242: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:242: undefined reference to `jas_cmprof_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:249: undefined reference to `jas_cmprof_createfromclrspc'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:249: undefined reference to `jas_image_chclrspc'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:253: undefined reference to `jas_image_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:260: undefined reference to `jas_cmprof_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:263: undefined reference to `jas_cmprof_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:275: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:275: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:275: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:275: undefined reference to `jas_cmprof_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:273: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:279: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:279: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:291: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:292: undefined reference to `jas_image_getcmptbytype'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:294: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:294: undefined reference to `jas_image_readcmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:310: undefined reference to `jas_matrix_create'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:313: undefined reference to `jas_image_readcmpt'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:324: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:324: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:326: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/modules/imgcodecs/src/grfmt_jpeg2000.cpp:327: undefined reference to `jas_matrix_destroy'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(png.c.obj): in function `png_compare_ICC_profile_with_sRGB':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2318: undefined reference to `adler32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2318: undefined reference to `adler32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2318: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2318: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2362: undefined reference to `adler32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2363: undefined reference to `adler32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2375: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:2376: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(png.c.obj): in function `png_reset_crc':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:130: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(png.c.obj): in function `png_calculate_crc':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:167: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:173: undefined reference to `crc32'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(png.c.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/png.c:253: undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngread.c.obj):(.text.png_read_destroy+0x0): undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngread.c.obj): in function `png_read_destroy':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngread.c:965: undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngrutil.c.obj): in function `png_inflate_claim':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:385: undefined reference to `inflateReset2'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:404: undefined reference to `inflateReset2'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:407: undefined reference to `inflateInit2_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:407: undefined reference to `inflateValidate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:416: undefined reference to `inflateInit2_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:427: undefined reference to `inflateValidate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngrutil.c.obj): in function `png_zlib_inflate':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:461: undefined reference to `inflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:467: undefined reference to `inflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngrutil.c.obj):/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:614: undefined reference to `inflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngrutil.c.obj): in function `png_decompress_chunk':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngrutil.c:649: undefined reference to `inflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwrite.c.obj):(.text.png_write_destroy+0x0): undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwrite.c.obj):(.text.png_write_destroy+0x12): undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwutil.c.obj): in function `png_deflate_claim':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:378: undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:380: undefined reference to `deflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:393: undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:407: undefined reference to `deflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:413: undefined reference to `deflateInit2_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:417: undefined reference to `deflateInit2_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwutil.c.obj): in function `png_text_compress':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:580: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:580: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibpng.a(pngwutil.c.obj): in function `png_compress_IDAT':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:945: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libpng/pngwutil.c:978: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_jpeg.c.obj): in function `TIFFjpeg_error_exit':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_jpeg.c:223: undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_jpeg.c.obj): in function `TIFFjpeg_progress_monitor':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_jpeg.c:262: undefined reference to `__wrap_longjmp'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPCleanup':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:503: undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:506: undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:507: undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPEncode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:335: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:433: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPPostEncode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:451: undefined reference to `deflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPPreEncode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:316: undefined reference to `deflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:322: undefined reference to `deflateInit_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPSetupEncode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:281: undefined reference to `inflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:283: undefined reference to `deflateInit_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPDecode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:232: undefined reference to `inflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:242: undefined reference to `inflate'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPPreDecode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:142: undefined reference to `inflateReset'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:148: undefined reference to `inflateInit_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPSetupDecode':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:102: undefined reference to `deflateEnd'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:107: undefined reference to `inflateInit_'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/espressif__opencv/opencv-build/install/lib/opencv4/3rdparty/liblibtiff.a(tif_zip.c.obj): in function `ZIPVSetField':
/home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:540: undefined reference to `deflateParams'
/home/nop/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/nop/rtos/esp-idf-opencv/read_image/managed_components/espressif__opencv/opencv/3rdparty/libtiff/tif_zip.c:547: undefined reference to `deflateParams'

Yes, I have worked with OpenCV on ESP devices before the component was released and there as well IM and related functions were not going to work. You will need to write a function to output the data to MicroSD if you are trying to save it. If you are just trying to work with images captured from the sensor you will need to turn the data to CV.Mat. The features 2d example should show how to do this pretty well.

@nopnop2002
Copy link

@https://github.com/Ncouch64

You will need to write a function to output the data to MicroSD if you are trying to save it.

What makes me wonder is that the source for these functions exists.

$ ls espressif__opencv/opencv/3rdparty/libjasper/
CMakeLists.txt  jas_getopt.c   jas_stream.c   jp2_cod.h  jpc_cs.c   jpc_flt.h    jpc_mqdec.c  jpc_t1cod.h  jpc_t2dec.c    jpc_tsfb.h
LICENSE         jas_icc.c      jas_string.c   jp2_dec.c  jpc_cs.h   jpc_math.c   jpc_mqdec.h  jpc_t1dec.c  jpc_t2dec.h    jpc_util.c
README          jas_iccdata.c  jas_tmr.c      jp2_dec.h  jpc_dec.c  jpc_math.h   jpc_mqenc.c  jpc_t1dec.h  jpc_t2enc.c    jpc_util.h
changelog       jas_image.c    jas_tvp.c      jp2_enc.c  jpc_dec.h  jpc_mct.c    jpc_mqenc.h  jpc_t1enc.c  jpc_t2enc.h
copyright       jas_init.c     jas_version.c  jpc_bs.c   jpc_enc.c  jpc_mct.h    jpc_qmfb.c   jpc_t1enc.h  jpc_tagtree.c
jas_cm.c        jas_malloc.c   jasper         jpc_bs.h   jpc_enc.h  jpc_mqcod.c  jpc_qmfb.h   jpc_t2cod.c  jpc_tagtree.h
jas_debug.c     jas_seq.c      jp2_cod.c      jpc_cod.h  jpc_fix.h  jpc_mqcod.h  jpc_t1cod.c  jpc_t2cod.h  jpc_tsfb.c

@Ncouch64
Copy link

Ncouch64 commented Feb 2, 2024

@https://github.com/Ncouch64

You will need to write a function to output the data to MicroSD if you are trying to save it.

What makes me wonder is that the source for these functions exists.

$ ls espressif__opencv/opencv/3rdparty/libjasper/
CMakeLists.txt  jas_getopt.c   jas_stream.c   jp2_cod.h  jpc_cs.c   jpc_flt.h    jpc_mqdec.c  jpc_t1cod.h  jpc_t2dec.c    jpc_tsfb.h
LICENSE         jas_icc.c      jas_string.c   jp2_dec.c  jpc_cs.h   jpc_math.c   jpc_mqdec.h  jpc_t1dec.c  jpc_t2dec.h    jpc_util.c
README          jas_iccdata.c  jas_tmr.c      jp2_dec.h  jpc_dec.c  jpc_math.h   jpc_mqenc.c  jpc_t1dec.h  jpc_t2enc.c    jpc_util.h
changelog       jas_image.c    jas_tvp.c      jp2_enc.c  jpc_dec.h  jpc_mct.c    jpc_mqenc.h  jpc_t1enc.c  jpc_t2enc.h
copyright       jas_init.c     jas_version.c  jpc_bs.c   jpc_enc.c  jpc_mct.h    jpc_qmfb.c   jpc_t1enc.h  jpc_tagtree.c
jas_cm.c        jas_malloc.c   jasper         jpc_bs.h   jpc_enc.h  jpc_mqcod.c  jpc_qmfb.h   jpc_t2cod.c  jpc_tagtree.h
jas_debug.c     jas_seq.c      jp2_cod.c      jpc_cod.h  jpc_fix.h  jpc_mqcod.h  jpc_t1cod.c  jpc_t2cod.h  jpc_tsfb.c

Yeah I am not quite sure why this is the case, I am sure @igrr or @dmitry1945 would be able to explain better. All I know is that in both cases where I have used OpenCV on esp im functions could not be utilized. Maybe there is a way to get them working? Maybe it cannot be done on ESP?

@nopnop2002
Copy link

Maybe there is a way to get them working? Maybe it cannot be done on ESP?

ESP-IDF doesn't have these libraries, so I think it's probably not possible.

--     3rdparty dependencies:       libjpeg-turbo libwebp libpng libtiff libjasper zlib quirc

@dmitry1945
Copy link
Contributor Author

@nopnop2002 the OpenCV component has this library in the list (libjpeg-turbo libwebp libpng libtiff libjasper zlib). It should work.

@nopnop2002
Copy link

nopnop2002 commented Feb 5, 2024

@dmitry1945

Pls try to build this code:

#include <stdio.h>
#include <stdlib.h>

#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/core/ocl.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/imgcodecs/legacy/constants_c.h>
#include <opencv2/core.hpp>
#include <opencv2/objdetect.hpp>
#include <opencv2/imgproc.hpp>

#include "opencv2/imgcodecs.hpp"

#include <opencv2/core/utility.hpp>

#include "opencv2/opencv_modules.hpp"

#include "opencv2/core.hpp"
#include <opencv2/core/cuda.hpp>
#include <opencv2/core/cvstd.hpp>
#include <opencv2/core/softfloat.hpp>
#include <opencv2/imgproc/types_c.h>

#include <iostream>
#include <math.h>
#include <tuple>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_vfs.h"
#include "esp_spiffs.h"


using namespace cv;
using namespace std;

extern "C" long int sysconf(int);

long int sysconf(int wtf)
{
	return 1;
}


const char* TAG="MAIN";

extern "C" {
void app_main(void);
}



static int getFileSize(char *fullPath) {
	struct stat st;
	if (stat(fullPath, &st) == 0)
		return st.st_size;
	return -1;
}

static void printDirectory(char * path) {
	DIR* dir = opendir(path);
	assert(dir != NULL);
	while (true) {
		struct dirent *pe = readdir(dir);
		if (!pe) break;
		ESP_LOGI(__FUNCTION__,"%s d_name=%s d_ino=%d d_type=%x", path, pe->d_name, pe->d_ino, pe->d_type);
		if (pe->d_type == 1) {
			char fullPath[64];
			strcpy(fullPath, path);
			strcat(fullPath, "/");
			strcat(fullPath, pe->d_name);
			int size = getFileSize(fullPath);
			ESP_LOGI(__FUNCTION__,"size=%d", size);
		}
		if (pe->d_type == 2) {
			char subDir[127];
			sprintf(subDir,"%s%.64s", path, pe->d_name);
			ESP_LOGI(TAG, "subDir=[%s]", subDir);
			printDirectory(subDir);

		}
	}
	closedir(dir);
}

esp_err_t init_spiffs(char * base_path) {
	ESP_LOGI("spiffs_init", "Initializing SPIFFS");

	esp_vfs_spiffs_conf_t conf = {
			//.base_path = "/spiffs",
			.base_path = base_path,
			.partition_label = "storage",
			.max_files = 10,
			.format_if_mount_failed = false
	};

	// Use settings defined above to initialize and mount SPIFFS filesystem.
	// Note: esp_vfs_spiffs_register is an all-in-one convenience function.
	esp_err_t ret = esp_vfs_spiffs_register(&conf);

	if (ret != ESP_OK) {
		if (ret == ESP_FAIL) {
			ESP_LOGE("spiffs_init", "Failed to mount or format filesystem");
		} else if (ret == ESP_ERR_NOT_FOUND) {
			ESP_LOGE("spiffs_init", "Failed to find SPIFFS partition");
		} else {
			ESP_LOGE("spiffs_init", "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret));
		}
		return ret;
	}

	size_t total = 0, used = 0;
	ret = esp_spiffs_info("storage", &total, &used);
	if (ret != ESP_OK) {
		ESP_LOGE("spiffs_init", "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret));
	} else {
		ESP_LOGI("spiffs_init", "Partition size: total: %d, used: %d", total, used);
	}
	return ESP_OK;
}

void app_main(void)
{
	ESP_LOGI(TAG, "Starting main");

	/* Initialize SPIFFS */
	char basePath[] = "/spiffs";
	init_spiffs(basePath);
	printDirectory(basePath);

	/* Read the images for the tests */
	const vector<string> images_res = {"160x120", "320x240", "640x480", "1024x768"};
	for(const String &res : images_res) {
		String fileName = "/spiffs/"+res+".png";
		cout << "fileName = " << fileName << endl;
#if 1
		Mat img = imread(fileName, IMREAD_GRAYSCALE);
		if(img.empty()) {
			ESP_LOGW(TAG, "cannot read the image: %s", fileName.c_str());
		} else {
			ESP_LOGI(TAG, "Image read of %dx%dx%d, with %d pixel depth", img.rows, img.cols, img.channels(), img.depth());
		}
#endif
	}
}

@dmitry1945
Copy link
Contributor Author

@nopnop2002 yes, I did it. The update will be soon.
It's possible to build, and for that you will need to include libopenjp2 to the 3rdparty_libraries list. But, then you will have some other problem that we are now trying to fix...

@Ncouch64
Copy link

Ncouch64 commented Feb 5, 2024

@nopnop2002 yes, I did it. The update will be soon. It's possible to build, and for that you will need to include libopenjp2 to the 3rdparty_libraries list. But, then you will have some other problem that we are now trying to fix...

Wow this is great to hear, so we should be able to use imwrite to save to SD instead of a function workaround that ive been using?

@dmitry1945
Copy link
Contributor Author

@nopnop2002, @Ncouch64, the component is ready. Please download the latest one.

Regards,
Dmitry

@nopnop2002
Copy link

nopnop2002 commented Feb 6, 2024

@dmitry1945

Do I need to make any changes to main/CMakeLists.txt?

If you have any changes, please share the main/CMakeLists.txt you used.

I used 4.7.0~5.
In my environment, BUILD results in an error.

If you need build logging, I'll share it.

@Ncouch64
Copy link

@dmitry1945

Do I need to make any changes to main/CMakeLists.txt?

If you have any changes, please share the main/CMakeLists.txt you used.

I used 4.7.0~5. In my environment, BUILD results in an error.

If you need build logging, I'll share it.

Did you fix your problem with the component?

@REEASD
Copy link

REEASD commented Feb 18, 2024

Hi,I noticed that HAVE_OPENCV_DNN is undefined in the current project, is ESP32 unable to support this option?

@nicklasb
Copy link

Hi, so I am throwing my hat into some OpenCV stuff.
But it seems like the espressif/opencv-repo doesn't exist even though the component links to it?
It would be great with official support, great if that was gotten to work, that would really leverage the ESP32, however I am confused of the state of it...any news?

Note to others about joachimBurket/esp32-opencv and ESP32-CAM, I made a PR fixing that and added IDF 5.3.0 support:
joachimBurket/esp32-opencv#23

@Ncouch64
Copy link

Ncouch64 commented Aug 12, 2024

Hi, so I am throwing my hat into some OpenCV stuff. But it seems like the espressif/opencv-repo doesn't exist even though the component links to it? It would be great with official support, great if that was gotten to work, that would really leverage the ESP32, however I am confused of the state of it...any news?

Note to others about joachimBurket/esp32-opencv and ESP32-CAM, I made a PR fixing that and added IDF 5.3.0 support: joachimBurket/esp32-opencv#23

As far as I know, and have tested, much of OpenCV is available to use as part of this component. There are currently some issues with it, for example I cannot save to SD card when using the component and FAST corner detection does not work, but other aspects of OpenCV does work. I believe this is something that is still being worked on. Depending on what you are looking to do, it may already be possible on ESP.

https://github.com/joachimBurket/esp32-opencv/ | is what I was using before they released the component. There are many base issues with it and I had to do a lot of work-arounds to get what I wanted to do working with it. If the remaining issues with the component can be smoothed out, its absolutely the way to go. Much easier to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.