我试图使用OpenCV对彩色图像进行去噪处理

时间:2014-06-20 09:23:48

标签: c++ opencv

 Mat dimg=imread("mata.jpg");
 Mat result;

 void fastNlMeansDenoisingColored(InputArray dimg, OutputArray result, float h=3, float
 hColor=3, int templateWindowSize=7, int searchWindowSize=21 );     

 namedWindow("denoised Image",1);
 imshow("denoised Image",result);

 /// Wait until user press some key
 waitKey();
 return 0;

我得到以下断言:

  

cv :: imshow

中的断言失败

有人可以告诉我出了什么问题吗?

1 个答案:

答案 0 :(得分:2)

Mat dimg=imread("mata.jpg");
Mat result;

if ( dimg.empty() ) // only fools don't check !
{
   cerr << "could not load image !";
}

// you have to call the actual function, not copy/paste the declaration !
fastNlMeansDenoisingColored( dimg, result, 3, 3, 7, 21 );     

namedWindow("denoised Image",1);
imshow("denoised Image",result);

/// Wait until user press some key
waitKey();
return 0;