首頁 > 軟體

Linux下OpenCV的安裝設定

2020-06-16 17:42:02

Linux下OpenCV的安裝設定

1 安裝cmake及一些依賴庫

sudo apt-get install cmake
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev

CentOSRedHat

yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devellibavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig Python libtool nasm

2 安裝opencv

從官網下載opencv並解壓,cd命令進入opencv的目錄

下載地址:http://opencv.org/downloads.html

cmake .
(cmake時間較長,約半小時)

sudo make

sudo makeinstall

3 設定

將opencv的庫加入到路徑,從而讓系統可以找到,沒第一個就加第二個

sudo gedit /etc/ld.so.conf.d/opencv.conf

sudo gedit /etc/ld.so.conf

末尾加入/usr/local/lib,儲存退出

sudo ldconfig #使設定生效

sudo gedit /etc/bash.bashrc

末尾加入
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

儲存退出
sudo source /etc/bash.bashrc #使設定生效

OpenCV官方教學中文版(For Python) PDF  http://www.linuxidc.com/Linux/2015-08/121400.htm

Ubuntu Linux下安裝OpenCV2.4.1所需包 http://www.linuxidc.com/Linux/2012-08/68184.htm

Ubuntu 12.04 安裝 OpenCV2.4.2 http://www.linuxidc.com/Linux/2012-09/70158.htm

CentOS下OpenCV無法讀取視訊檔 http://www.linuxidc.com/Linux/2011-07/39295.htm

Ubuntu 12.04下安裝OpenCV 2.4.5總結 http://www.linuxidc.com/Linux/2013-06/86704.htm

Ubuntu 10.04中安裝OpenCv2.1九步曲 http://www.linuxidc.com/Linux/2010-09/28678.htm

基於QT和OpenCV的臉部辨識系統 http://www.linuxidc.com/Linux/2011-11/47806.htm


IT145.com E-mail:sddin#qq.com