linux平臺編譯opencv
阿新 • • 發佈:2018-10-26
all home 2.4 2.4.1 docs com mpi mage lease
參考博客:
https://www.pyimagesearch.com/2016/07/11/compiling-opencv-with-cuda-support//
https://docs.opencv.org/3.4.0/d7/d9f/tutorial_linux_install.html
https://askubuntu.com/questions/631720/opencv-2-4-9-make-error
http://www.itboth.com/d/eyY3ma/linux-cuda-opencv
1、在官網上下載opencv源碼(我安裝的是2.4.10版本)
https://opencv.org/releases.html
2、解壓後建立一個build文件,然後在opencv目錄下輸入如下指令進行cmake(註意如果有錯誤的話就將DWITH_CUDA的值改為OFF)
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/home/users/qing.you/opencv/opencv-2.4.10 -DWITH_CUDA=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 -DINSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON
然後輸入如下指令
cd build
cmake -DCUDA_GENERATION=Kepler ..
3、然後返回opencv主目錄,執行如下指令
make -j64
4、然後再執行
make install
有問題的話參考這個博客:https://www.codetd.com/article/2686117
linux平臺編譯opencv