安装OPENCV过程
参考网页:
http://blog.csdn.net/a1429331875/article/details/31539129
http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html
http://tutewall.com/package-mysql-server-5-5-is-not-configured-yet/
安装环境 ubuntu 14.04
opencv版本 2.4.9
步骤
1 在http://opencv.org/downloads.html 中找所需opencv版本下载
2 、
安装GCC:
sudo apt-get install build-essential
安装GTK开发版
sudo apt-get install libgtk2.0-dev
3、
安装这些
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
4、
进行步骤3的时候,我这边报错,
报错信息
error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
原因为:以前安装mysql的时候 没有配置好
5、
解决方法为:
见该网页:http://tutewall.com/package-mysql-server-5-5-is-not-configured-yet/
即
sudo apt-get purge mysql*
再 sudo apt-get dist-upgrade
然后再 sudo apt-get install mysql-server mysql-common
此时安装mysql的时候没有报错
6、
重复1-3,基本上很多都还在的,就几个要安装
7、
解压缩opencv
unzip opencv-2.4.9
cd opencv-2.4.9/
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local ..
(cmake这步我花了20分钟)
make
sudo make install
8、
将文件/etc/ld.so.conf中末尾添加一行代码/usr/local/lib
sudo nano /etc/ld.so.conf
sudo /sbin/ldconfig -v
sudo gedit /etc/bash.bashrc也是在最后一行添加
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
9、
此时已经安装并配置完毕
10、
测试opencv
http://docs.opencv.org/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html
如果能显示网页中的图片,则验证成功