Yum install cmake python-devel numpy gcc gcc-c++yum install gtk2-devel libdc1394-devel libv4l-devel ffmpeg-devel gstreamer-plugins-base-devel# Optional Yum install libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-develwget github.com/itseez/opencv/archive/2.4.12.zipunzip 2.4.12.zipcd Opencv-2.4.12mkdir buildcd buildcmake -d cmake_build_type=release -d cmake_ INSTALL_PREFIX=/USR/LOCAL&NBSP, .... makemake install# The following error occurred while make : #collect2: ld returned 1 exit status#make[2] : *** [lib/cv2.so] error 1#make[1]: *** [modules/python/cmakefiles/opencv_ python.dir/all] error 2#make: *** [all] error 2# solution, Reload build python./configure --enable-shared# Setup Python is complete, start prompt error: #error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: no such file or directory# Workaround echo "/usr/local/lib" >>/etc/ld.so.conf && ldconfig# after the compilation is complete test:pthon>>> import cv2>>> cv2.__version__ ' 2.4.12 ' #如果在 import cv2 prompt error:#>> > import cv2#libdc1394 error: failed to initialize libdc1394# Workaround: Ln /dev/null /dev/raw1394
CentOS installation OpenCV