
Image Restoration 213
FIGURE 8.17: An attempt at inverse filtering
2. “Constrained division”: choose a threshold value d, and if |F (i, j)| < d, the original
value is returned instead of a division: Thus:
X(i, j) =
Y (i, j)
F (i, j)
if | F (i, j)| ≥ d,
Y (i, j) if |F (i, j)| < d.
The first method can be implemented by multiplying a Butterworth low pass filter to the
matrix
c1
above:
MATLAB/Octave
>> blf = fftshift(fft2(blur));
>> D = 40
>> bworth2 = 1./(1+(sqrt(2)-1)
*
((x.^2+y.^2)/D^2).^10);
>> blfb = blf./bworth.
*
bworth2;
>> ba = abs(ifft2(blfb));
>> imshow(mat2gray(ba))
or
Python
In : blf = fftshift(fft2(blur))
In : D = 40
In : bworth2 = 1/(1+(sqrt(2)-1)
*
((x
**