centos7安装opencv3.3

安装cmake
cd /usr/local/src/
wget http://www.cmake.org/files/v3.1/cmake-3.1.3.tar.gz
tar -zxvf cmake-3.1.3.tar.gz
cd cmake-3.1.3/
./configure ———-这步替换成 ./bootstrap –prefix=/usr
make && make install
cmake –version

安装numpy
cd ../
yum install python-devel
wget https://pypi.python.org/packages/source/n/numpy/numpy-1.9.1.tar.gz#md5=78842b73560ec378142665e712ae4ad9
tar -zxvf numpy-1.9.1.tar.gz
cd numpy-1.9.1/
python setup.py install

yum install -y gcc gcc-c++ gtk+-devel libjpeg-devel libtiff-devel jasper-devel libpng-devel zlib-devel cmake
yum install git gtk2-devel pkgconfig numpy python python-pip python-devel gstreamer-plugins-base-devel libv4l ffmpeg-devel mplayer mencoder flvtool2
yum install libdc1394
yum install gtk*

安装opencv3.3
wget https://codeload.github.com/opencv/opencv/zip/3.3.0
解压
新建文件夹:
mkdir build
编译与安装:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=./build ./opencv-3.3.0
make -j8
make install

检查:
cd lib/
ls
查看是否存在cv2.so

存在则:ln cv2.so /usr/lib/python2.7/site-packages
否则重新安装,查找错误
8.最后检查:
cd
python
import cv2
如果不报错 则成功!!!!

你可能感兴趣的:(opencv,opencv)