fatal error: opencv/dnn/dnn.hpp: No such file or directory

asked 2020-10-08 01:35:33 -0600

Hiroaki-K4 gravatar image

Hi! When I run catkin build, I get the following error: How can I solve it?

Errors     << tkdnn_ros:make /home/nvidia/catkin_ws/logs/tkdnn_ros/build.make.000.log
/home/nvidia/catkin_ws/src/tkdnn_ros/tkdnn/src/Int8BatchStream.cpp:4:10: fatal error: opencv2/dnn/dnn.hpp: No such file or directory
 #include <opencv2/dnn/dnn.hpp>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/tkdnn.dir/home/nvidia/catkin_ws/src/tkdnn_ros/tkdnn/src/Int8BatchStream.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/tkdnn.dir/all] Error 2
make: *** [all] Error 2

opencv is installed with the following command.

$ sudo apt install cmake libavcodec-dev libavformat-dev libavutil-dev libeigen3-dev libglew-dev
libgtk2.0-dev libgtk-3-dev libjpeg-dev libpng-dev libpostproc-dev libswscale-dev libtbb-dev libtiff5-dev
libv4l-dev libxvidcore-dev libx264-dev libraw1394-dev libdc1394-22-dev libgdcm2-dev libgdcm2.8
libgphoto2-dev libopenexr-dev liblapack-dev liblapacke-dev libopenblas-dev libatlas-base-dev
libtesseract-dev qt5-default zlib1g-dev libgl1 libglvnd-dev pkg-config ccache python-dev python-numpy
python-py python-pytest python3-dev python3-numpy python3-py python3-pytest libgstreamer1.0-dev
libgstreamer-plugins-base1.0-dev libgoogle-glog-dev libcaffe-cpu-dev libhdf5-dev libharfbuzz-dev
libwebp-dev libvtk6-dev
$ sudo dpkg -P --force-all $(dpkg -l | grep -oP 'libopencv[^: ]*' | sort -u)
$ sudo dpkg -P --force-all opencv-data python-opencv python3-opencv
$ tar xf opencv-3.4.6-aarch64-full.tgz
$ cd opencv-3.4.6-aarch64
$ sudo dpkg -i OpenCV-3.4.6-aarch64-*.deb
$ sudo dpkg -i *_3.2.0+dummy-3.4.6*.deb

Thanks!

edit retag flag offensive close merge delete