cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.5.5/modules \
-DWITH_CUDA=ON \
-DWITH_CUDNN=ON \
-DOPENCV_DNN_CUDA=ON \
-DOPENCV_ENABLE_NONFREE=ON \
../opencv-4.5.5/
opencv_contrib-4.5.5/modules中的sfm模块安装会有问题,如果不用建议删掉opencv_contrib-4.5.5/modules/sfm,然后再编译