Rao
Rao

Reputation: 13

I'm trying to denoise a colored image using 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;

I'm getting the following assert:

assertion failed in cv::imshow

Can someone tell me what is wrong?

Upvotes: 0

Views: 4911

Answers (1)

berak
berak

Reputation: 39806

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;

Upvotes: 2

Related Questions