1、搭建C/C++编译环境:
sudo apt-get install build-essential
2、安装依赖库:
$ sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
$ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
3、下载OpenCV3.0 :
a、第一种方式(alpha版本):
$ mkdir ~/opencv
$ cd ~/opencv
$ wget https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip -O opencv-3.0.0-alpha.zip
$ unzip opencv-3.0.0-alpha.zip
b、第二种方式(beta版本):
密码: 3n52:http://pan.baidu.com/s/1hqtThPE
4、安装opencv:
$ cmake . # cmake+空格+"."
$ sudo make
$ sudo make install
$ sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
$ sudo ldconfig
注:如果cmake过程中提示:ippicv_linux_20141027.tgz的hash码不对,则将在3->b中下载的ippicv_linux_20141027.tgz手动复制到
opencv-3.0.0-beta/3rdparty/ippicv/downloads/linux-8b449a536a2157bcad08a2b9f266828b文件夹中,重新cmake即可
5、编译samples程序:
$ cd ~/opencv/samples
$ sudo cmake .
$ sudo make -j $(nproc)
6、运行测试程序:
# 第一种方式(alpha版本):
# 注:使用alpha版本,images在opencv/cpp文件夹下
$ cd cpp/
$ ./cpp-example-facedetect lena.jpg
# 第二种方式(beta版本):
# 注:使用beta版本,images在opencv/data文件夹下
$ cd cpp/
$ ./cpp-example-facedetect ../data/lena.jpg
备注:如果发现依赖库版本不对,推荐使用命令:
sudo aptitude install XXX
Ubuntu14.04下安装OpenCV 3.0.RC1:http://www.linuxdiyf.com/linux/13355.html
Ubuntu 14.04下OpenCV 3.0+Python 2.7安装测试:http://www.linuxdiyf.com/linux/11903.html
Ubuntu 12.04下安装OpenCV 2.3.1,图像二值化:http://www.linuxdiyf.com/linux/8615.html
Ubuntu中安装OpenCv2.1九步曲:http://www.linuxdiyf.com/linux/9848.html
在Fedora22中安装OpenCV3.0.0:http://www.linuxdiyf.com/linux/12610.html