ubuntu16.04 安裝opencv3.4.3以及opencv_contrib(命令列形式)
阿新 • • 發佈:2018-12-28
通過命令列下載opencv檔案: git clone https://github.com/Itseez/opencv.git git clone https://github.com/Itseez/opencv_contrib.git
安裝依賴項:
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
將opencv_contrib移到opencv資料夾,並在opencv資料夾建立build:mkdir build
進入build資料夾進行編譯:
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
然後是更加漫長的編譯過程:
make -j8
sudo make install
至此安裝結束
測試opencv:
進入samples:
編譯:cmake .
make
./opencv_example