Hi everybody,
I've tried the example shown on the url "https://docs.luxonis.com/software/depthai/examples/mono_preview/#Mono%20Preview-Demo" in C++, but unfortunately the compilation failed with these errors :
[main] Génération du dossier : /home/bourdelle/ros2_ws/src/camera_oak/build
[build] Démarrage de la build
[proc] Exécution de la commande : /usr/bin/cmake --build /home/bourdelle/ros2_ws/src/camera_oak/build --config Debug --target all -j 8 --
[build] Consolidate compiler generated dependencies of target camera_oak
[build] [ 50%] Building CXX object CMakeFiles/camera_oak.dir/src/camera_oak.cpp.o
[build] /home/bourdelle/ros2_ws/src/camera_oak/src/camera_oak.cpp: In function ‘int main()’:
[build] /home/bourdelle/ros2_ws/src/camera_oak/src/camera_oak.cpp:42:13: error: ‘cv’ has not been declared
[build] 42 | cv::imshow("left", inLeft->getCvFrame());
[build] | ~
[build] /home/bourdelle/ros2_ws/src/camera_oak/src/camera_oak.cpp:46:13: error: ‘cv’ has not been declared
[build] 46 | cv::imshow("right", inRight->getCvFrame());
[build] | ~
[build] /home/bourdelle/ros2_ws/src/camera_oak/src/camera_oak.cpp:49:19: error: ‘cv’ has not been declared
[build] 49 | int key = cv::waitKey(1);
[build] | ~
[build] In file included from /usr/local/include/depthai/pipeline/node/Camera.hpp:6,
[build] from /usr/local/include/depthai/pipeline/nodes.hpp:5,
[build] from /usr/local/include/depthai/depthai.hpp:17,
[build] from /home/bourdelle/ros2_ws/src/camera_oak/src/camera_oak.cpp:4:
[build] /usr/local/include/depthai/pipeline/datatype/ImgFrame.hpp: In instantiation of ‘void dai::ImgFrame::getCvFrame(T ...) [with T = {}]’:
[build] /home/bourdelle/ros2_ws/src/camera_oak/src/camera_oak.cpp:42:50: required from here
[build] /usr/local/include/depthai/pipeline/datatype/ImgFrame.hpp:223:46: error: static assertion failed: Library not configured with OpenCV support
[build] 223 | static_assert(dependent_false<T...>::value, "Library not configured with OpenCV support");
[build] | ~~~~
[build] /usr/local/include/depthai/pipeline/datatype/ImgFrame.hpp:223:46: note: ‘dai::ImgFrame::dependent_false<>::value’ evaluates to false
[build] gmake[2]: *** [CMakeFiles/camera_oak.dir/build.make:76: CMakeFiles/camera_oak.dir/src/camera_oak.cpp.o] Error 1
[build] gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/camera_oak.dir/all] Error 2
[build] gmake: *** [Makefile:146: all] Error 2
[proc] La commande « /usr/bin/cmake --build /home/bourdelle/ros2_ws/src/camera_oak/build --config Debug --target all -j 8 -- » s’est arrêtée avec le code 2.
[driver] Build terminée : 00:00:05.344
[build] La build s'est achevée avec le code de sortie 2
Sorry, I work with a French platform, so I hope you will be able to perform the troubles.
Thank for you helping !
Best regards,
Mathis.