Category Archives: machine vision

Linux计算机视觉库opencv的编译安装

opencv是一个计算机视觉库,有c,c++,python多种接口,是学习计算机视觉的必备工具。

编译安装opencv3.0

yum groups install "Development Tools"
wget https://github.com/opencv/opencv/archive/3.0.0.tar.gz
tar -xvf 3.0.0.tar.gz
mv opencv-3.0.0 opencv
cd opencv && mkdir build -p 
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make && make install

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install opencv-python numpy

参考文档:
https://docs.opencv.org/3.0.0/d7/d9f/tutorial_linux_install.html

安装扩展模块opencv_contrib

wget https://github.com/opencv/opencv_contrib/archive/3.0.0.tar.gz
tar -xvf 3.0.0.tar.gz
mv opencv_contrib-3.0.0/ opencv_contrib
mv opencv_contrib/ opencv
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/ ~/opencv/
make && make install