I’m trying to use OpenCV GpuMat but I’m getting an assert error, my code is as follows
#include "opencv2/opencv.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/gpu/gpu.hpp"
// ...
using namespace cv;
using namespace cv::gpu;
int main()
{
string baboon = "baboon.jpg";
try
{
DeviceInfo info = getDevice();
cout << info.name() << endl;
GpuMat src;
src = cv::imread(baboon, 1);
}
catch (const cv::Exception* ex)
{
cout << "Error: " << ex->what() << endl;
}
}
The output is:
GeForce GTX 550 Ti
OpenCV Error: Assertion failed (!m.empty()) in unknown function, file ($PATH_TO_OPENCV)\opencv\modules\gpu\src\gpumat.cpp, line 411
Any ideas on how to solve this problem?
The solution is: