【问题标题】:Yolo object detection webcam opencv errorYolo对象检测网络摄像头opencv错误
【发布时间】:2018-05-15 15:02:34
【问题描述】:

我正在尝试使用 yolo 进行对象检测 后续教程https://pjreddie.com/darknet/yolo/

我想用网络摄像头做实时检测

所以我配置了 Makefile OPENCV = 1

又尝试制作

我收到以下错误

gcc -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv`  -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -c ./src/gemm.c -o obj/gemm.o
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
In file included from ./src/utils.h:5:0,
                 from ./src/gemm.c:2:
include/darknet.h:25:43: fatal error: opencv2/highgui/highgui_c.h: No such file or directory
compilation terminated.
Makefile:85: recipe for target 'obj/gemm.o' failed
make: *** [obj/gemm.o] Error 1

我在 Anaconda 上安装了 cv

Python 2.7.14 |Anaconda, Inc.| (default, Dec  7 2017, 17:05:42) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.__version__)
3.4.1
>>> 

【问题讨论】:

  • Perhaps you should add the directory containing opencv.pc to the PKG_CONFIG_PATH environment variable 所以就这样做PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/my/additional/config
  • 这是什么 my/addational/config ?你能详细解释一下我是opencv的新手吗
  • 可能相关问题:https://github.com/opencv/opencv/issues/10963, https://github.com/pjreddie/darknet/issues/518, ... 尝试降级到 OpenCV 3.4.0。
  • @SembeiNorimaki 我按照你的步骤操作,我收到一个很长的错误:ld:未找到架构 x86_64 的符号 clang:致命错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) make: *** [libdarknet.so] 错误 1
  • 你是如何构建opencv的?如果您正确构建它,您应该能够在安装后使用sudo ldconfig 将其正确添加到 pkg-config 路径。

标签: python opencv anaconda yolo


【解决方案1】:

我和你有同样的错误。 当我尝试按照本教程手动安装 opencv3.4 时,重新制作它就可以了。但是记住OpenCV的版本不能超过3.4.0,我试过4.0.0但是失败了。 https://docs.opencv.org/3.4.1/d2/de6/tutorial_py_setup_in_ubuntu.html

我的操作系统是Ubuntu16.04,希望对你有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多