0

I'm working to restore a blurred image without knowing the PSF value. I used blind deconvolution to estimate the PSF value and Lucy Richardson method to completely restore the image. The thing is, I used fspecial('gaussian') to blur the image and now I need to use imgaussfilt function to do that. But once I do that, the image does not restore as expected. With the first method, I got excellent results.

What is the difference between fspecial('gaussian') and imgaussfilt()? Is there a way I can restore an image blurred with the second function?

PS: All the images are iris pictures used in a biometric system.


First I tried the restoration process using this code:

function [J, P, V] = blindDeconv(image, qualityBlur, upTo)
lowerValue = 20;
for i = 3:15
    for j = 1:upTo
        P = fspecial('gaussian', i, j);
        [I PSF] = deconvblind(image,P);
        %[I PSF] = deblur(image, j);
        quality = blurMetric(I);
        if quality < lowerValue
            lowerValue = quality;
            P = PSF;
            J = I;
            V = j;
        end
    end
end

And this is the main script where I blur and deblur the image:

%----------------------
%  Blurring process
%----------------------
%PSF = fspecial('gaussian', 7, j);
%blur{i,j} = imfilter(im2double(image{i}), PSF, 'conv');
blur{i,j} = imgaussfilt(im2double(image{i}), j);
qualityBlur{i, j} = blurMetric(blur{i, j});
link = strcat(folder, '/', prefix, '_blur_', num2str(j), '.jpeg');
imwrite(blur{i, j}, link, 'jpeg');

%---------------------
% Deblurring process
%----------------------
[J, P, V] = blindDeconv(blur{i, j}, qualityBlur{i, j}, upTo);
deblurred{i, j} = deconvlucy(J, P, 20, V);
qualityDeblurred{i, j} = blurMetric(deblurred{i, j});
link = strcat(folder, '/', prefix, '_deblur_', num2str(j), '.jpeg');
imwrite(deblurred{i, j}, link, 'jpeg');

Image sample:

sample

Sardar Usama
  • 19,536
  • 9
  • 36
  • 58
  • Please provide us the code you tried including a sample image. In the meantime, you may have a look at [this post](https://stackoverflow.com/questions/42695132/image-deblurring-using-gaussian-filter-in-matlab-without-additive-noise/42706938#42706938). – m7913d Jun 10 '17 at 08:40
  • I added the code, and thanks I'll take a look !! – Franciscone Luiz Jun 10 '17 at 14:12

0 Answers0