cv::cuda::getCudaEnabledDeviceCount() 一直返回0的情况;
opencv官方下载的库是不带gpu的;
需要用户根据电脑的显卡驱动和cuda版本,自行编译;然后opencv才能使用gpu;
编译过程中出现错误
报错:CUDA: OpenCV requires enabled ‘cudev‘ module from ‘opencv_contrib
cmake中给OPENCV_EXTRA_MODULES_PATH添加opencv_contrib-4.X.X/modules路径
opencv_contrib-4.X.X要与你的opencv版本一致;下载地址Tags · opencv/opencv_contrib · GitHub