diff --git "a/_posts/\345\267\245\344\275\234\346\227\245\345\277\227/OpenCV/2024-03-08-opencv-support-cuda.md" "b/_posts/\345\267\245\344\275\234\346\227\245\345\277\227/OpenCV/2024-03-08-opencv-support-cuda.md" new file mode 100644 index 0000000..19277be --- /dev/null +++ "b/_posts/\345\267\245\344\275\234\346\227\245\345\277\227/OpenCV/2024-03-08-opencv-support-cuda.md" @@ -0,0 +1,29 @@ +--- +layout: post +category: [工作日志, OpenCV] +tags: [OpenCV, 日志] +title: OpenCV 支持CUDA +--- + +> 从源码编译 opencv 和 opencv-contrib 并指支撑 cuda + + +```shell +git clone https://github.com/opencv/opencv.git +git clone https://github.com/opencv/opencv-contrib.git +``` + +```shell +mkdir build +cd build +cmake \ + -D OPENCV_DNN_CUDA=ON \ + -D WITH_CUDA=ON \ + -D WITH_CUDNN=ON \ + -D OPENCV_DNN_CUDA=ON \ + -D OPENCV_ENABLE_NONFREE=ON \ + -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \ + .. + + make +```