简体   繁体   中英

[make Error]Installing OpenCV 3 on Ubuntu16.04 Python

I am trying to install openCV 3.1.0 on Ubuntu16.04 with python. I get the following error after the below. I have recently updated to ubuntu16.04 from ubuntu14.04. on ubuntu 14.04, I had opencv 2.4.9.1 and that is still working on my ubuntu16.04.

the default python is 2.7.12

Can somebody tell me where I'm going wrong? Any clues would be appreciated. ※I'm a newbie

I have referred the below websites:

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


Command

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


Error

[ 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

I ran cmake with this option: -D WITH_FFMPEG=OFF and it solved my problem. You can also build ffmpeg lib from source code to solve this.

See here https://github.com/opencv/opencv/tree/master/3rdparty/ffmpeg

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM