The image to be deblurred was captured with the PSF u1. Now on deconvolution in both Fourier and Spatial domains, I do not get the deblurred Image. Followed Raskar's paper on coded exposure photography. Kindly help

1 view (last 30 days)
grayImage = (imread('car.jpg'));
[rows columns numberOfColorBands] = size(grayImage);
if numberOfColorBands > 1
oldimg = rgb2gray(grayImage);
end
figure,imshow(oldimg, []);
[x,y]=size(oldimg);
k=[150];
u=double('1010000111000001010000110011110111010111001001100111')-'0';
u1=zeros(1,length(u));
for count=1:length(u)
u1(count)=u(count)/26;
end
m=length(u);
oldimg1 = im2double(imresize(oldimg,[x ceil((y*m)/k)],'bicubic'));
[height width]=size(oldimg1);
F=zeros(size(oldimg1));
PQ=paddedsize(size(oldimg));
figure,plot(abs(fftshift(fft(u1,250))));
otf=psf2otf(u1,size(oldimg));
F = real(ifft2(fft2(oldimg1,PQ(1)/2,PQ(2)/2)./otf));
F=F(1:size(oldimg1,1),1:size(oldimg1,2));
F=uint8(255*mat2gray(F));
newimg= imresize(F,[width floor((width*k)/m)],'bicubic');
J=deconvreg(oldimg,u1);
figure,imshow(J,[0 255]);
figure,imshow(newimg,[0 255]);
figure,imshow(deconvblind(oldimg,u1));

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!