I want to use CUDA/GPU in OpenCV in Visual Studio. For example, `cuda::GpuMat`. I successfully build OpenCV with the extra modules with CUDA enabled
I tried the following code
#include
#include
#include
#include
#include
#include
using namespace std;
using namespace cv;
int main(){
string imageName("input.bmp");
//CPU version
Mat image = imread(imageName.c_str(), IMREAD_GRAYSCALE);
//CUDA version
cuda::GpuMat imageGPU;
cuda::GpuMat downloadGPU;
Mat buff;
imageGPU.upload(image);
cuda::fastNlMeansDenoising(imageGPU, downloadGPU, 2.5, 7, 31);
downloadGPU.download(buff);
imwrite("gpu.bmp", buff);
return 0;
}
But I get an `unhandled exception` error.
I originally downloaded OpenCV in `C:\Users\me\Downloads\opencv`
I then downloaded and installed the latest OpenCV extra modules with CUDA on in `C:\Users\me\Downloads\opencv-master1\opencv-master`
In `Property Pages->C/C++->General->Additional Include Directories`, I have:
C:\Users\me\Downloads\opencv\build\include\opencv
C:\Users\me\Downloads\opencv\build\include\opencv2
C:\Users\me\Downloads\opencv\build\include\
In `Property Pages->Linker->General->Additional Library Directories`, I have:
C:\Users\me\Downloads\opencv\build\x64\vc15\lib
and in `Property Pages->Linker->Input->Additional Dependencies`, I have:
opencv_world343d.lib
opencv_world343.lib
what else am I supposed to include so I can get `GpuMat` to work properly?
↧