You are on page 1of 40

EEE F435 (2023-24-I)

Digital Image Processing


(Image Enhancement : Frequency Domain)
BITS Pilani
K K Birla Goa Campus
Ashish Chittora
Utility of Frequency Domain Processing
• Some of similar (possible) operations in spatial
domain require more computational effort
• Frequency domain provides many useful
information apart from spatial domain
Continuous Fourier transform
• One dimensional Fourier transform

• Two dimensional Fourier transform


Discrete Fourier Transform
• Discretization in time domain results in periodicity in
frequency domain

•Inverse DFT

f ( x, y)  (1 / MN )
Some facts
• The value of transform at (u , v) = (0 , 0)

• If f(x , y) is real,

• Space-frequency relationships
Sampling and Aliasing

Aliasing No aliasing
DFT Periodicity
Displaying Fourier transform
Displaying Fourier transform
• Logarithm : range of values of Fourier coefficients is very
high. So logarithm transformation is used to compress the
range non-uniformly.
log (1+|F(u,v)|)
Understanding Fourier Transform image
• Frequency Granularity
Periodic pattern Fourier transform
Frequency Granularity : Periodic or nearly periodic pattern has FT with
repetitive peaks (harmonics)
Understanding Fourier Transform image
• Frequency Orientation
• If DFT is brighter along a certain direction then image
contains highly oriented components along that
direction
Frequency domain representation
Frequency domain representation
Frequency domain representation

Effect of frequency components


Frequency domain representation

Effect of rotation
Frequency domain representation

Effect of rotation
Frequency domain representation
Sinusoidal patterns and their Fourier
transforms

Sum of all three


Frequency domain filtering
Ideal low pass Filtering of image

Ideal low pass filter


Ideal low pass filter
Gaussian Low pass filter
Gaussian Low pass filter

Input image GLPF Filtered image


Butterworth Low pass filter
Butterworth Low pass filters
High pass filters
Ideal high pass filter
Gaussian high pass filter
Butterworth high pass filter
Homo-morphic filtering
• Poor illumination causes a uniform region to
appear brighter and darker in some area
• May causes misclassification of pixels during
segmentation.
Homomorphic filtering
Homomorphic filtering
Homomorphic filtering
• Difference of Gaussian (DoG) filter function

• c = constant to control the steepness of slope


• , = high and low frequency gain
• Cross section of a circularly symmetric filter
function
Notch Filtering

Noisy image Filtered Fourier transform Filtered image


Class notes
• Laplacian filter
• Unsharp masking and High boost filter
• High frequency emphasis filter
• Band-reject and Band-pass filter
• Notch filter
Thank you!
io=imread('onion.png');
i=rgb2gray(io);
[r,c]=size(i);

%fourier transform
i1=fft2(i);
if1=log(1+abs(i1)); % for displaying fourier transform
i2=fftshift(i1); % for shifting fourier transform
if2=log(1+abs(i2)); % for displaying shifted symmetric fourier transform

%inverse fourier transform


ifim=abs(ifft2(i2));

subplot(221), imshow(io);
subplot(222), imshow(mat2gray(if1));
subplot(223), imshow(mat2gray(if2));
subplot(224), imshow(mat2gray(ifim));
• i=imread('peppers.png');
• i=rgb2gray(i);
• [r,c]=size(i);
• filt1=zeros(r,c);
• %Ideal low pass filter
• for j=1:r
• for k=1:c
• dist1=sqrt((j-(r/2))^2 + (k-(c/2))^2);
• if dist1<=40
• filt1(j,k)=1;
• end
• end
• end
• i1=fft2(i);
• i2=fftshift(i1);
• i3=log(1+abs(i2));
• filtd1=i2.*filt1; % actual filtering
• filtd2=i3.*filt1; %filtering for display
• ifim=abs(ifft2(filtd1)); %inverse filtering
• subplot(221), imshow(i);
• subplot(222), imshow(mat2gray(i3));
• subplot(223), imshow(mat2gray(abs(filtd2)));
• subplot(224), imshow(mat2gray(ifim));

You might also like