matlab - Using a clear portion of the picture to recreate a PSF -
i'm trying unblur blurred segments of following picture.
the original psf not given, proceeded analyse blurred part , see whether there word make out. found out make out "of" in blurred section. cropped out both the blurred "of" , counterpart in clear section -> seen below.
i thought through lectures in fft divide blurred(frequency domain) particular blurring function(frequency domain) recreate original image.
i thought if unblurred(frequency domain)\blurred(frequency domain), original psf retrieved. please advise on how this.
this code.
img = im2double(imread('c:\users\adhil\desktop\matlab pics\image1.jpg')); blurred = imcrop(img,[205 541 13 12]); unblurred = imcrop(img,[39 140 13 12]); ub = fftshift(unblurred); ub = fft2(ub); ub = ifftshift(ub); f_1a = zeros(size(b)); idx = 1 : size(blurred, 3) b = fftshift(blurred(:,:,idx)); b = fft2(b); b = ifftshift(b); uba = ub(:,:,idx); tmp = uba ./ b; tmp = ifftshift(tmp); tmp = ifft2(tmp); tmp = fftshift(tmp); [j, p] = deconvblind(blurred,tmp); end subplot(1,3,1);imshow(blurred);title('blurred'); subplot(1,3,2);imshow(unblurred);title('original unblurred'); subplot(1,3,3);imshow(j);title('attempt @ unblurring');
this code, however, not work, , i'm getting following error.
error using deconvblind expected input number 2, initpsf, real. error in deconvblind>parse_inputs (line 258) validateattributes(p{1},{'uint8' 'uint16' 'double' 'int16' 'single'},... error in deconvblind (line 122) [j,p,numit,dampar,readout,weight,sizei,classi,sizepsf,funfcn,funarg] = ... error in test2 (line 20) [j, p] = deconvblind(blurred,tmp);
is way recreate original psf?
Comments
Post a Comment