我使用 cmake 和选项 WITH_CUDA=ON 安装了 opencv 2.4.6.1。我尝试了一些示例代码,效果很好。但有些麻烦在于 gpu 库。我在源文件中添加:
cv::gpu::printShortCudaDeviceInfo(cv::gpu::getDevice());
它返回:
OpenCV Error: No GPU support (The library is compiled without CUDA support) in getDevice, file /build/buildd/opencv-2.4.2+dfsg/modules/core/src/gpumat.cpp, line 182 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd/opencv-2.4.2+dfsg/modules/core/src/gpumat.cpp:182: error: (-216) The library is compiled without CUDA support in function getDevice
我该如何解决?