2D Deconvolution using FFT in Matlab Problems

后端 未结 2 1114
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 07:50

I have convoluted an image I created in matlab with a 2D Gaussian function which I have also defined in matlab and now I am trying to deconvolve the resultant matrix to see

相关标签:
2条回答
  • 2020-12-06 08:27

    R = FC/Fimg needs to be R = FC./Fimg; You need to do division element-wise.

    0 讨论(0)
  • 2020-12-06 08:39

    Here are some Octave (version 3.6.2) plots of that deconvolved Gaussian.

    % deconvolve in frequency domain
    Fimg = fft2(img,599,599);
    FC = fft2(C);
    R = FC ./ Fimg;
    r = ifft2(R);
    
    % show deconvolved Gaussian
    figure(1);
    subplot(2,3,1), imshow(img), title('image');
    subplot(2,3,2), imshow(Z), title('Gaussian');
    subplot(2,3,3), imshow(C), title('image blurred by Gaussian');
    subplot(2,3,4), mesh(X,Y,Z), title('initial Gaussian');
    subplot(2,3,5), imagesc(real(r(1:300,1:300))), colormap gray, title('deconvolved Gaussian');
    subplot(2,3,6), mesh(X,Y,real(r(1:300,1:300))), title('deconvolved Gaussian');
    
    % show difference between Gaussian and deconvolved Gaussian
    figure(2);
    gdiff = Z - real(r(1:300,1:300));
    imagesc(gdiff), colorbar, colormap gray, title('difference between initial Gaussian and deconvolved Guassian');
    

    enter image description here enter image description here

    0 讨论(0)
提交回复
热议问题