1. 程式人生 > >03_Ubuntu安裝opencv2.4.10(zip)

03_Ubuntu安裝opencv2.4.10(zip)

pan tor nump led dev napt cmak 2.0 optional

0、安裝官方說明英文

https://docs.opencv.org/2.4.10/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation

1、下載opencv2.4.10.zip

https://opencv.org/releases.html

技術分享圖片

2、上傳解壓zip文件

技術分享圖片

redhat@ubuntu:~/Desktop$ sudo unzip opencv-2.4.10.zip 

  

3. 進入源碼目錄,創建release目錄

cd opencv-2.4.10

mkdir release  

  

4、安裝依賴包

依賴包說明

  • GCC 4.4.x or later
  • CMake 2.6 or higher
  • Git
  • GTK+2.x or higher, including headers (libgtk2.0-dev)
  • pkg-config
  • Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)
  • ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev
  • [optional] libtbb2 libtbb-dev
  • [optional] libdc1394 2.x
  • [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev, libdc1394-22-dev

依賴包命令

The packages can be installed using a terminal and the following commands or by using Synaptic Manager:

[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

  

5. 進入release目錄

安裝OpenCV時,所有的文件都會被放到這個release目錄下

cd release

  

6. cmake編譯OpenCV源碼

安裝所有的lib文件都會被安裝到/usr/local/opencv2.4.10目錄下

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv2.4.10 .. 

 

7.安裝

make
sudo make install -j4 

 j4代表4個進程一起

 

03_Ubuntu安裝opencv2.4.10(zip)