红联Linux门户
Linux帮助

Ubuntu卸载opencv2.*,重新安装opencv3.*版本

发布时间:2017-02-24 10:04:28来源:linux网站作者:chengwei0019
一、卸载opencv2.4.9: Going to the "build" folder directory of opencv from terminal, and execute the following:
1.$ sudo make uninstall
2.$ cd ..
3.$ sudo rm -r build
4.$ sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
这一步可能有error
下面执行如下操作:
5.sudo apt-get –purge remove opencv-doc opencv-data python-opencv
 
二、安装opencv
1.安装依赖项(opencv网页打开太慢,自己搜吧)、opencv网站(http://opencv.org/)、docs about opencv(http://docs.opencv.org/3.2.0/)
sudo apt-get install build-essential
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
2.下载opencv对应版本,如opencv3.2.3
cd ~/opencv-3.2.0-rc1  
mkdir release  
cd release  
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..  
make  
sudo make install  
3.安装完成后,写入opencv路径:sudo sh -c 'echo "usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
4.更新电脑配准
sudo ldconfig

参考:
 
本文永久更新地址:http://www.linuxdiyf.com/linux/28655.html