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]
Related issue:
1. Follow the steps [5] to build for TX2 system.
(Edit buildOpenCV.sh : DOWNLOAD_OPENCV_EXTRAS=YES)
Reference:
[1] OpenCV-With-the-ODROID-XU4Q
[2] build and install on Ubuntu 16.04
[3] Build failure (2.4.4) : unsupported/Eigen/MatrixFunctions
[4] https://github.com/opencv/opencv/commit/c8ff7a486735f45f9dd4060111b71957c78142c6
[5] https://www.jetsonhacks.com/2018/05/28/build-opencv-3-4-with-cuda-on-nvidia-jetson-tx2/
$ 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
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]
Related issue:
1. Follow the steps [5] to build for TX2 system.
(Edit buildOpenCV.sh : DOWNLOAD_OPENCV_EXTRAS=YES)
Reference:
[1] OpenCV-With-the-ODROID-XU4Q
[2] build and install on Ubuntu 16.04
[3] Build failure (2.4.4) : unsupported/Eigen/MatrixFunctions
[4] https://github.com/opencv/opencv/commit/c8ff7a486735f45f9dd4060111b71957c78142c6
[5] https://www.jetsonhacks.com/2018/05/28/build-opencv-3-4-with-cuda-on-nvidia-jetson-tx2/
留言
張貼留言