Build OpenCV 3.3.1 with CUDA 9.0 support

Removing OpenCV installed by JetPack before performing this script installation:

$ sudo apt-get purge libopencv*

[Step by step commands]

$ cd ~
$ wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.3.1.zip
$ unzip opencv.zip
$ cd opencv
$ wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.3.1.zip
$ unzip opencv_contrib.zip
$ mkdir build
$ cd build

$ cmake -D CMAKE_BUILD_TYPE=RELEASE 

               -D CMAKE_INSTALL_PREFIX=/usr/local 
               -D WITH_CUDA=ON 
               -D ENABLE_FAST_MATH=1 
               -D CUDA_FAST_MATH=1 
               -D WITH_CUBLAS=1 
               -D INSTALL_PYTHON_EXAMPLES=OFF 
               -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.3.1/modules 
               -D BUILD_EXAMPLES=ON 
               -D CUDA_GENERATION=Auto 
               -D WITH_NVCUVID=1 
               -D WITH_EIGEN=ON 
               -D WITH_CUFFT=ON 
               -D WITH_IPP=ON ..

$ make -j8
$ sudo make install
$ sudo ldconfig


*Build error: unsupported/Eigen/MatrixFunctions: No such file or directory solution

Solution: open modules/contrib/src/rgbdodometry.cpp and add "eigen3/" to the include path. [3]

* Remember to edit the cmake file before cmake command mentioned above. [4]

[Library path after installing]

留言

這個網誌中的熱門文章

Tuing PID parameters in QGroundcontrol (2)

Useful PX4 Parameters

Burn linux image to eMMC storage on Banana Pi M3