include/darknet.h:25:43: fatal error: opencv2/highgui/highgui_c.h: No such file or directory

yolo9000工程使用opencv进行编译时出现如下错误:
include/darknet.h:25:43: fatal error: opencv2/highgui/highgui_c.h: No such file or directory

解决办法:
需要安装opencv
sudo apt-get install libopencv-dev

参考:https://groups.google.com/forum/#!topic/darknet/m6hYE6eA05c

但之后编译时还会出现别的错误,具体什么错误忘记了

于是我使用源码进行opencv安装,官方教程:https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html

之后再编译时出现类似下面的错误:
/usr/bin/ld: cannot find -lippicv
collect2: error: ld returned 1 exit status
Makefile:76: recipe for target ‘darknet’ failed
make: * [darknet] Error 1

重新安装opencv,可以在cmake时加上”cmake -DINSTALL_CREATE_DISTRIB=ON” 这句。

sudo cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. -DWITH_IPP=ON -DINSTALL_CREATE_DISTRIB=ON

再编译darknet就成功了,可以检测摄像头视频和本地视屏。
参考:YOLO+yolo9000配置使用darknet

写的比较乱,见谅!

猜你喜欢

转载自blog.csdn.net/castle_cc/article/details/79636731
今日推荐