$ git clone https://github.com/opencv/opencv.git
2.將電腦更新並且下載需要的套件:
# apt-get update
# apt-get install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff5-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
3.將 openCV 官網抓下來的 opencv-3.4.zip 解壓縮,進入 opencv-3.4裡面建立 release 資料夾,再 release 裡面執行一串cmake 程序:
3.將 openCV 官網抓下來的 opencv-3.4.zip 解壓縮,進入 opencv-3.4裡面建立 release 資料夾,再 release 裡面執行一串cmake 程序:
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
執行最後會顯示下列訊息:
...
-- Build files have been written to: /home/<username>/.../opencv-3.1.0/release
4.接著執行 make 和 make install 即可完成 openCV的環境建置:
$ make
# make install
5.參考網址:
沒有留言:
張貼留言