我嘗試使用OpenCV的GpuMat但我發現了一個斷言錯誤,我的代碼如下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
如何任何想法解決這個問題?
它不應該只是被dst.upload(SRC); ? – 2013-12-03 19:45:55
是的,它應該是'dst.upload(src)'; – 2014-07-13 19:58:08