Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install opencv-contrib on jetson tx2 #22

Open
zhudaoruyi opened this issue Nov 23, 2018 · 7 comments
Open

How to install opencv-contrib on jetson tx2 #22

zhudaoruyi opened this issue Nov 23, 2018 · 7 comments

Comments

@zhudaoruyi
Copy link

How to install opencv-contrib on jetson tx2

@panpengjun
Copy link

I have the same question. I've already set DOWNLOAD_OPENCV_EXTRAS=YES and still when trying to get a build, I got this:

fatal error: opencv2/xfeatures2d.hpp: No such file or directory
#include "opencv2/xfeatures2d.hpp"
^
compilation terminated.

Looks like opencv_contrib was not installed. @jetsonhacks Please help! Thanks!

@panpengjun
Copy link

Looks like opencv_extra isn't opencv_contrib. That's why my build failed.

@zhudaoruyi
Copy link
Author

zhudaoruyi commented Dec 17, 2018

I have solved this problem.

change as bellow:

DOWNLOAD_OPENCV_EXTRAS=YES

and this,

if [ $DOWNLOAD_OPENCV_EXTRAS == "YES" ] ; then
 echo "Installing opencv_extras"
 # This is for opencv contrib
 cd $OPENCV_SOURCE_DIR
 git clone https://github.com/opencv/opencv_contrib.git
 cd opencv_contrib

 git checkout -b v${OPENCV_VERSION} ${OPENCV_VERSION}

and this,

time cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
      -D WITH_CUDA=ON \
      -D CUDA_ARCH_BIN=${ARCH_BIN} \
      -D CUDA_ARCH_PTX="" \
      -D ENABLE_FAST_MATH=ON \
      -D CUDA_FAST_MATH=ON \
      -D WITH_CUBLAS=ON \
      -D WITH_LIBV4L=ON \
      -D WITH_GSTREAMER=ON \
      -D WITH_GSTREAMER_0_10=OFF \
      -D WITH_QT=ON \
      -D WITH_OPENGL=ON \
      -D OPENCV_EXTRA_MODULES_PATH=/home/nvidia/opencv_contrib/modules \
      -D BUILD_opencv_legacy=OFF \
      ../

@zhudaoruyi
Copy link
Author

@thepaulm
Copy link

Hi - I just opened a PR for this: #24

@JadonZhou95
Copy link

https://github.com/zhudaoruyi/buildOpenCVTX2
@zhudaoruyi Thanks, the solution works. One thing is to remember to change the OPENCV_EXTRA_MODULES_PATH to the customized one.

@pdeman
Copy link

pdeman commented Oct 19, 2020

Hi, I have a problem with cudnn.
when I had with_cudnn = ON I get an error :
"found unsuitable version 7.3.1" but required is at least "7.5".
I am using the cuda and cudnn lib "coming" with the jetpack 4.2 and indeed it is libcudnn7_7.3.1.28-1+cuda10.0_arm64.deb which is included.
is there a way to solve this problem ?
(i am trying to do

net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)

in python3.6 opencv)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants