I am trying to learn about inverse filtering of images and am trying it out on a test image in MATLAB.
The test image is an 8x8 checkerboard, with 64x64 pixels, generated by the MATLAB code:
g = checkerboard(8);
I am using a 3x3 averaging filter, h, and convolving it with the test image.
I am not adding noise and I want to see the results of direct inverse filtering the distorted image.
I am applying the deconvolution function in the frequency domain by:
1) Padding the 3x3 averaging mask h to generate a 64x64 mask hp.
2) Centering the coefficients (0.111...) of hp to maintain symmetry.
3) Multiplying hp by (-1)^x+y (since I want the fft of the mask to give me a centered Fourier transform, hpc.
4) Taking the FFt of the padded, centered mask and multiplying (-1)^(u+v) (since I centered the mask in the spatial domain in step 2) to give me H.
5) Taking the distorted, and frequency shifted test image and dividing it by H, (ie. Y = G./H). (Note: I am not padding the image since the mask was padded, and wraparound is not a huge concern here)
6) Obtaining the inverse filtered image inv = (-1)^x+y * real(ifft2(Y))
My question: Why can't I obtain the original (or something very close to it)?