用OpenCV的Mat载入图像可是一直错误,代码如下
int main()
{
Mat image;
std::string str;
str = "D:\\IMG_0284.jpg";
image = imread(str);
return 0;
}
我试过只要一加Mat image;声明,str的声明,赋值就会出现异常。也就是str实际并没有成功赋值为D:\IMG_0284.jpg
求这是什么原因?
用的是VS2010 和 opencv2.3.1