My task was to deblur a image. I used Weiner Filter and got this kind of image. Is it possible to improve it further?
Here is my code:
I = im2double(imread('Demo4_b.jpg'));
imshow(I);
title('Original Image');
LEN = 21;
THETA = 11;
PSF = fspecial('motion', LEN, THETA);
estimated_nsr = 0;
wnr2 = deconvwnr(I, PSF, estimated_nsr);
figure, imshow(wnr2)
title('Restoration of Blurred, Noisy Image Using NSR = 0')
estimated_nsr = noise_var / var(I(:));
wnr3 = deconvwnr(I, PSF, estimated_nsr);
figure, imshow(wnr3)
title('Restoration of Blurred, Noisy Image Using Estimated NSR');
I am getting same output in both with NSR and without NSR cases. Here is my original image:
You use the motion kernel from the matlab example. The image, however, looks more like it was smoothed with a gaussian kernel. That is the reason you're getting the wobbly lines.
Try this:
I = im2double(imread('a.jpg'));
imshow(I);
title('Original Image');
PSF = fspecial('gaussian', [51 51], 5);
wnr2 = deconvwnr(blurred, PSF, 0.0003 / var(I(:)));
figure, imshow(wnr2)
title('Restoration of Blurred, Noisy Image Using NSR = 0')
You can still tune it with the two parameters (5 and 0.0003)