Ask Your Question

denoise_TVL1 not working?

asked 2017-03-01 05:16:28 -0500

guidovitale gravatar image

I would like to denoise a grayscale image using the TV regularization, in order to prevent sharp edges being smoothed out. I'm working in win10 with Qt 5.4.1 and OpenCV 3.0. I tried the aforementioned algorithm but this gives me the following error:

OpenCV Error: Assertion failed ((flags & FIXED_TYPE) != 0) in type, file C:\opencv\sources\modules\core\src\matrix.cpp, line 1821

seems like a type error, but it looks strange to me since I'm just loading a grayscale image. please note that the function 'fastNlMeansDenoising' works flawlessly within the same framework.

For better clarity, here's the pseudo code:

String  imageName  = "imageName.jpg";
Mat I = imread(imageName, CV_LOAD_IMAGE_GRAYSCALE);
double lambda = 2;
int niters = 5;
Mat Denoised;
denoise_TVL1( I, Denoised,  lambda,  niters);       //  ! NOT WORKING !
fastNlMeansDenoising(I, Denoised, 8, 7, 25);        //  ! WORKING !

any hint? thank you, Guido.

edit retag flag offensive close merge delete


forget to say: my compiler is mingw...

guidovitale gravatar imageguidovitale ( 2017-03-01 08:18:12 -0500 )edit

any clue? I think variational denoising (especially using the L1 gradient norm) is quite important in the field of image treatment...

guidovitale gravatar imageguidovitale ( 2017-03-02 05:36:48 -0500 )edit

still could not believe no-one is giving any hint. is this question so trivial?

guidovitale gravatar imageguidovitale ( 2017-03-06 02:58:29 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-06-06 01:22:01 -0500

lohachan0108 gravatar image

Hello. It seems you are passing one image in I. But the first argument for denoise_TVL1 is a vector of images. Try passing vector of images rather than a single image. Hope it helps.

edit flag offensive delete link more

Question Tools



Asked: 2017-03-01 05:16:28 -0500

Seen: 673 times

Last updated: Jun 06 '17