Frequency Filtering. Instructor: Juyong Zhang [email protected] http://staff.ustc.edu.cn/~juyong. Convolution Property of the Fourier Transform. * = convolution · = multiplication.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
* = convolution
· = multiplication
The Fourier Transform of a convolution equals the product of the Fourier Transforms. Similarly, the Fourier Transform of a convolution is the product of the Fourier Transforms
The mask is usually 1band
For color images you may need to do each step for each band separately.
Odd
Even
Odd
Image Origin
Image Origin
Weight Matrix Origin
Weight Matrix Origin
After FFT shift
After FFT shift
After IFFT shift
After IFFT shift
Coordinate Origin of the FFTCenter =
(floor(R/2)+1, floor(C/2)+1)
I(1,1) J ( R/2 +1, C/2 +1)
I = ifftshift(J):
J( R/2 +1, C/2 +1) I(1,1)
Matlab’s fftshift and ifftshiftwhere x = floor(x) = the largest integer smaller than x.
Blurring results from:
The values of the output image are all nonnegative.
Sharpening results from adding to the image, a copy of itself that has been:
The values of the output image positive & negative.
* = convolution
· = multiplication
The Fourier Transform of a convolution equals the product of the Fourier Transforms. Similarly, the Fourier Transform of a convolution is the product of the Fourier Transforms
Image size: 512x512
FD filter radius: 16
Multiply by this, or …
… convolve by this
Fourier Domain Rep.
Spatial Representation
Central Profile
Image size: 512x512
FD filter radius: 8
Multiply by this, or …
… convolve by this
Fourier Domain Rep.
Spatial Representation
Central Profile
Image size: 512x512
FD filter radius: 16
Ideal LPF in FD
Original Image
Power Spectrum
Image size: 512x512
FD filter radius: 16
Original Image
Filtered Power Spectrum
Filtered Image
Image size: 512x512
FD notch radius: 16
Multiply by this, or …
… convolve by this
Fourier Domain Rep.
Spatial Representation
Central Profile
Image size: 512x512
FD notch radius: 16
Power Spectrum
Original Image
Ideal HPF in FD
*signed image: 0 mapped to 128
Ideal Highpass FilterImage size: 512x512
FD notch radius: 16
Original Image
Filtered Power Spectrum
Filtered Image*
*signed image: 0 mapped to 128
Ideal Highpass FilterImage size: 512x512
FD notch radius: 16
Positive Pixels
Filtered Image*
Negative Pixels

=
FD LP mask with radius 1
FD LP mask with radius 2
FD BP mask 1 2
*signed image: 0 mapped to 128
Ideal Bandpass Filterimage LPF radius 1
image LPF radius 2
image BPF radii 1, 2*
*signed image: 0 mapped to 128
Ideal Bandpass Filteroriginal image*
filter power spectrum
filtered image
*signed image: 0 mapped to 128
A Different Ideal Bandpass Filteroriginal image
filter power spectrum
filtered image*
space
frequency
FT
space
frequency
FT
A small object in space has a large frequency extent and viceversa.
frequency
space
Recall: a symmetric pair of impulses in the frequency domain becomes a sinusoid in the spatial domain.
IFT
small extent
large extent
small extent
large extent
frequency
space
A symmetric pair of lines in the frequency domain becomes a sinusoidal line in the spatial domain.
IFT
small extent
large extent
small extent
large extent
IFT
A sharp cutoff in the frequency domain…
…causes ringing in the spatial domain.
Ideal LPF
Blurring the image above with an ideal lowpass filter…
…distorts the results with ringing or ghosting.
IFT
The Gaussian filter optimizes the uncertainty relation. It provides the sharpest cutoff with the least ringing.
R = 512, C = 512
c
r
= 257, s= 64
TwoDimensional GaussianIf and are different for r & c…
…or if and are the same for r & c.
Gaussian LPF
With a gaussian lowpass filter, the image above …
… is blurred without ringing or ghosting.
Ideal LPF
Blurring the image above with an ideal lowpass filter…
…distorts the results with ringing or ghosting.
Image size: 512x512
SD filter sigma = 8
Multiply by this, or …
… convolve by this
Fourier Domain Rep.
Spatial Representation
Central Profile
Image size: 512x512
SD filter sigma = 2
Multiply by this, or …
… convolve by this
Fourier Domain Rep.
Spatial Representation
Central Profile
Image size: 512x512
SD filter sigma = 8
Power Spectrum
Original Image
Gaussian LPF in FD
Image size: 512x512
SD filter sigma = 8
Original Image
Filtered Power Spectrum
Filtered Image
Image size: 512x512
FD notch sigma = 8
Multiply by this, or …
… convolve by this
Fourier Domain Rep.
Spatial Representation
Central Profile
Image size: 512x512
FD notch sigma = 8
Power Spectrum
Original Image
Gaussian HPF in FD
*signed image: 0 mapped to 128
Gaussian Highpass FilterImage size: 512x512
FD notch sigma = 8
Original Image
Filtered Power Spectrum
Filtered Image*
*signed image: 0 mapped to 128
Gaussian Highpass FilterImage size: 512x512
FD notch sigma = 8
Negative Pixels
Positive Pixels
Filtered Image*
*signed image: 0 mapped to 128
Another Gaussian Highpass Filteroriginal image
filter power spectrum
filtered image*

=
FD LP mask with radius 1
FD LP mask with radius 2
FD BP mask 1 2
*signed image: 0 mapped to 128
Ideal Bandpass Filteroriginal image
filter power spectrum
filtered image*
*signed image: 0 mapped to 128
Gaussian Bandpass Filterimage LPF radius 1
image LPF radius 2
image BPF radii 1, 2*
Image size: 512x512
sigma = 2  sigma = 8
Fourier Domain Rep.
Spatial Representation
Central Profile
Image size: 512x512
sigma = 2  sigma = 8
Power Spectrum
Original Image
Gaussian BPF in FD
*signed image: 0 mapped to 128
Gaussian Bandpass FilterImage size: 512x512
sigma = 2  sigma = 8
Filtered Image*
Filtered Power Spectrum
Original Image
*signed image: 0 mapped to 128
Gaussian Bandpass FilterImage size: 512x512
sigma = 2  sigma = 8
Negative Pixels
Positive Pixels
Filtered Image*
Filtered Image
*signed image: 0 mapped to 128
Ideal Lowpass and Highpass FiltersIdeal LPF
Original Image
Ideal HPF*
*signed image: 0 mapped to 128
Gaussian Lowpass and Highpass FiltersGaussian LPF
Original Image
Gaussian HPF*
*signed image: 0 mapped to 128
Ideal and Gaussian Bandpass FiltersIdeal BPF*
Original Image
Gaussian BPF*
*signed image: 0 mapped to 128
Gaussian and Ideal Bandpass FiltersGaussian BPF*
Original Image
Ideal BPF*