Yolo 使用Webcam,修改Makefile文件 opencv=1 再次make的时候出错

下载YOLO的demo,单张图片测试没问题,按照教程使用webcam测试,修改Makefile中opencv = 1之后,re-make出错如下,opencv配置失败

gcc -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv`  -Wall -Wno-unknown-pragmas -Wfatal-```
errors -fPIC -Ofast -DOPENCV -c ./src/gemm.c -o obj/gemm.o
In file included from /usr/local/include/opencv2/core/types_c.h:59:0,
                 from /usr/local/include/opencv2/core/core_c.h:48,
                 from /usr/local/include/opencv2/highgui/highgui_c.h:45,
                 from include/darknet.h:25,
                 from ./src/utils.h:5,
                 from ./src/gemm.c:2:
/usr/local/include/opencv2/core/cvdef.h:485:1: error: unknown type name ‘namespace’
 namespace cv {
 ^~~~~~~~~
compilation terminated due to -Wfatal-errors.
Makefile:85: recipe for target 'obj/gemm.o' failed
make: *** [obj/gemm.o] Error 1

困扰许久最后在github找到解决方法,好像是opencv3内部存在对c编译的bug

解决办法卸载opencv3,安装opencv2.4,具体讨论详见:https://github.com/pjreddie/darknet/issues/485

ubuntu安装opencv2.4参考:https://www.cnblogs.com/eczhou/p/7860586.html

成功安装opencv2.4问题解决,结果cpu还是跑不动[笑哭][笑哭]

Yolo 使用Webcam,修改Makefile文件 opencv=1 再次make的时候出错_第1张图片

你可能感兴趣的:(pythonCV)