【opencv学习】关于Mat释放的问题

最近写了一个超简单的代码,但是总是有bug

int _tmain(int argc, _TCHAR* argv[])
{
	
	Mat img_mat=imread("6.jpg");
	
	cout<<"*****************"<

运行后提示:Unhandled exception at at 0x77194B32 in test.exe: Microsoft C++ exception: cv::Exception at memory location 0x0100F80C.


后来看了一下mat的源代码,把

cvReleaseData(&img_mat);

改为

img_mat.release();

就好了。

原因还不清楚,有机会再细细研究吧

你可能感兴趣的:(opencv基础)