Registration : 21mic7178 Name : Sai Sanjay K
Title : Image Restoration - Frequency Domain Filtering
Aim :
To perform frequency domain filtering on an image to achieve image restoration using pseudo- inverse filtering**.**
Theory :
Frequency domain filtering involves transforming an image from the spatial domain to the frequency domain using the Fourier Transform. In this domain, filtering operations like blurring or sharpening be applied more effectively. The process typically involves:
Fourier Transform: Converting the image into the frequency domain.
Filter Application: Applying a filter to modify the frequency components.
Inverse Fourier Transform: Converting the modified image back to the spatial domain.
For image restoration, a degraded image can be restored using pseudo-inverse filtering. This involves constructing an Optical Transfer Function (OTF) representing the degradation, computing its pseudo-inverse, and applying it to the degraded image’s Fourier Transform.
CODE :
% Read the degraded image
degradedImage = imread('/MATLAB Drive/blurred_newspaper (1).tiff');
% Convert to grayscale (if necessary) and double precision
degradedImage = im2double(im2gray(degradedImage));
% Display the degraded image
figure;
imshow(degradedImage);
title('Degraded Image');
% Get the size of the image
[M, N] = size(degradedImage);
% Define the Point Spread Function (PSF)
PSF = fspecial('motion', 15, 45); % Adjust length and angle as needed
% Convert PSF to Optical Transfer Function (OTF)
OTF = psf2otf(PSF, [M, N]);
% Compute the Fourier Transform of the degraded image
DegradedFFT = fft2(degradedImage);
% Compute the pseudo-inverse of the OTF
epsilon = 0.01; % Small constant to avoid division by zero
OTF_pseudo_inverse = conj(OTF) ./ (abs(OTF).^2 + epsilon);
% Apply the pseudo-inverse filter in the frequency domain
RestoredFFT = DegradedFFT .* OTF_pseudo_inverse;
% Compute the inverse Fourier Transform to get the restored image
restoredImage = real(ifft2(RestoredFFT));
% Normalize the restored image
restoredImage = mat2gray(restoredImage);
% Display the restored image
figure;
imshow(restoredImage);
title('Restored Image');
Sample Results :

Results :
In this experiment, we performed frequency domain filtering to restore a blurred image. The process involved pre-processing the image to center pixel values, computing its 2D Fourier Transform, and displaying the log amplitude spectrum to visualize frequency components. We modeled blurring filters and analyzed the Optical Transfer Function (OTF) to understand how different frequencies were affected. A pseudo-inverse filter was then applied to the image’s DFT to counteract the blurring, and the restored image was obtained through the inverse Fourier Transform and normalization. This method effectively demonstrated how frequency domain operations can reverse image degradation, highlighting their importance in digital image processing.
Conclusion :
This experiment highlights the power and effectiveness of frequency domain filtering for image restoration. By transforming the image into the frequency domain using the Fourier Transform, we can analyze and modify its frequency components more effectively. The Optical Transfer Function (OTF) plays a crucial role in understanding and modeling the blurring process, allowing for the construction of a pseudo-inverse filter to restore the original image. Despite challenges such as noise sensitivity, frequency domain filtering provides a robust method for counteracting specific types of image degradation, demonstrating its practical applications in digital image processing. The results underscore the importance of frequency domain operations in improving image quality and the potential for further applications in various imaging technologies.