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.