[make Error]在Ubuntu16.04 Python上安装OpenCV 3

时间:2016-11-03 02:46:30

标签: python c++ linux opencv ubuntu

我正在尝试使用python在Ubuntu16.04上安装openCV 3.1.0。我在下面的后面得到以下错误。我最近从ubuntu14.04更新到ubuntu16.04。在ubuntu 14.04上,我有opencv 2.4.9.1,那仍然在我的ubuntu16.04上运行。

默认python是2.7.12

有人可以告诉我哪里出错了吗? 任何线索将不胜感激。 ※我是新手

我推荐了以下网站:

http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/ http://embedonix.com/articles/image-processing/installing-opencv-3-1-0-on-ubuntu/#comment-697

命令

snoopy@snoopy-HP-ProBook-6560b:~/opencv-3.1.0/build$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules -D PYTHON_EXECUTABLE=/usr/bin/python -D BUILD_EXAMPLES=ON /home/snoopy/opencv-3.1.0/
snoopy@snoopy-HP-ProBook-6560b:~/opencv-3.1.0/build$ make

错误

[ 6%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/dnn.cpp.o [ 6%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/opencl_kernels_dnn.cpp.o make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libprotobuf.so', needed by 'lib/libopencv_dnn.so.3.1.0'. Stop. CMakeFiles/Makefile2:6741: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/all' failed make[1]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/all] Error 2 Makefile:160: recipe for target 'all' failed make: *** [all] Error 2

1 个答案:

答案 0 :(得分:0)

我用这个选项运行cmake:-D WITH_FFMPEG = OFF它解决了我的问题。 您还可以从源代码构建ffmpeg lib来解决此问题。

请参阅此处https://github.com/opencv/opencv/tree/master/3rdparty/ffmpeg