【发布时间】:2012-02-16 20:13:33
【问题描述】:
我正在尝试使用 OpenCV GpuMat 但我收到断言错误,我的代码如下
#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;
}
}
输出是:
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
关于如何解决这个问题的任何想法?
【问题讨论】: