Image Transforms
Image Transforms
Image transforms are mathematical operations that convert an image from one
domain to another, typically from the spatial domain (where pixel values are
directly manipulated) to a frequency or another domain. These transforms are
fundamental in image processing and computer vision, allowing for various
operations like filtering, compression, enhancement, and feature extractionKey
steps
• Transform the image
• Carry the task(s) in the transformed domain.
• Apply inverse transform to return to the spatial domain.
Transformation Kernels:
A. Inverse Fourier Transform (IFT):
• Purpose: Converts the frequency domain representation of an image back
to the spatial domain.
• Description: The inverse Fourier transform reconstructs the original image
from its frequency components. This is crucial for applying filters in the
frequency domain and then converting the filtered image back to its
original form.
• Applications: Reconstruction of images after frequency domain
processing, image restoration.
M −1 N −1
f ( x, y ) = T (u, v)s( x, y, u, v)
u =0 v =0
x = 0,1,..., M − 1, y = 0,1,..., N − 1
•
B. Forward Transformation
In the context of image processing generally refers to the process of converting
an image from the spatial domain (where the image is represented by pixel
intensities) to another domain, such as the frequency domain or a different feature
space. This is usually the first step in various image processing tasks, like
filtering, compression, or analysis.
M −1 N −1
f ( x, y ) = T (u, v)s( x, y, u, v)
u =0 v =0
x = 0,1,..., M − 1, y = 0,1,..., N − 1
• where f(x,y) is the original image, and F(u,v) is the frequency domain
representation.
Kernel Properties:
Here:
• a0 is the average value (or the DC component) of the function over one
period.
• an and bn are the Fourier coefficients for the cosine and sine terms,
respectively.
• n is an integer representing the harmonic number.
E. Exponential Fourier Series
The exponential Fourier series is an alternative form of the Fourier series that
uses complex exponentials (Euler's formula) to represent a periodic function. This
formulation is particularly elegant and compact, and it is widely used in signal
processing and electrical engineering because of its ability to handle complex
signals and its symmetry properties.
Given a periodic function f(x) with period T, the exponential Fourier series is
expressed as:
Jean Baptiste Joseph Fourier: Jean Baptiste Joseph Fourier was a French
mathematician and physicist best known for initiating the study of Fourier series
and their applications to problems of heat transfer and vibrations. His work laid
the groundwork for Fourier analysis, which is fundamental to many areas of
mathematics, physics, and engineering.
Fourier Series & Fourier Transform
• Fourier Series: A Fourier series is a way to represent a function as the sum
of simple sine waves. Fourier developed this concept to solve the heat
equation. The idea is that any periodic function can be broken down into a
series of sine and cosine functions, each with specific amplitudes and
frequencies.
• Fourier Transform: The Fourier transform is a generalization of the
Fourier series. It transforms a function from its original domain (often time
or space) into the frequency domain. This tool is crucial in signal
processing, image analysis, and solving partial differential equations.
Image Processing in the Frequency Domain
Image processing in the frequency domain involves transforming an image into
its frequency components using the Fourier transform. This method can reveal
patterns and details not easily visible in the spatial domain. It is useful for
filtering, enhancing, and analyzing images.
• Image Smoothing: This process involves reducing noise and details in an
image to produce a smoother appearance. In the frequency domain, this is
done by attenuating high-frequency components, which often represent
noise and fine details, while preserving low-frequency components, which
represent the broader, smoother regions of the image.
• Image Sharpening: Conversely, image sharpening involves enhancing the
edges and fine details in an image. This is done by amplifying the high-
frequency components in the frequency domain.
The Discrete Fourier Transform (DFT):
The Discrete Fourier Transform of f(x, y), for x = 0, 1, 2…M-1 and y = 0,1,2…N-
1, denoted by F(u, v), is given by the equation:
The transfer function for the ideal low pass filter can be given as:
− D 2 ( u ,v ) / 2 D0 2
H (u , v) = e
Sharpening in the Frequency Domain:
Sharpening in the frequency domain is a technique used to enhance the edges and
fine details of an image by amplifying its high-frequency components. This
process is the opposite of smoothing (or blurring), which reduces high-frequency
components to soften an image. In the frequency domain, sharpening is achieved
by emphasizing these high-frequency components, which correspond to rapid
changes in intensity, such as edges.
• Edges and fine detail in images are associated with high frequency
components
• High pass filters – only pass the high frequencies, drop the low ones
• High pass frequencies are precisely the reverse of low pass filters, so:
o Hhp(u, v) = 1 – Hlp(u, v)
•
g ( x, y ) = f ( x, y ) + ( x, y )
• where f(x, y) is the original image pixel, η(x, y) is the noise term and g(x,
y) is the resulting noisy pixel
• If we can estimate the noise model we can figure out how to restore the
image
A. Gaussian Noise:
• Gaussian noise follows a normal distribution and is characterized by its
mean (usually zero) and standard deviation. It causes pixel values to vary
randomly around the true value, with variations more likely to be smaller
than larger.
• Mathematical Model: If I(x,y) is the true pixel value and N(x,y) is the
noise, then the observed pixel value O(x,y) is given by:
• O(x,y)=I(x,y)+N(x,y), where N(x,y)∼N(0,σ^2) is Gaussian noise with
mean 0 and variance σ^2
B. Salt-and-Pepper Noise:
• This type of noise appears as randomly scattered black and white pixels
(salt and pepper). It typically occurs due to sudden disturbances in the
image capturing process.
• Mathematical Model: Pixel values are either set to 0 (pepper) or 255 (salt)
with certain probabilities.
C. Poisson Noise:
• Poisson noise is associated with the statistical variation in the number of
photons detected by the image sensor. It is often encountered in low-light
conditions and follows a Poisson distribution.
• Mathematical Model: The observed pixel value O(x,y) follows a Poisson
distribution with a mean I(x,y): O(x,y)∼Poisson(I(x,y))
D. Speckle Noise:
• Speckle noise is caused by interference or random variations in the image
sensor. It appears as granular noise and is often modeled as multiplicative
noise.
• Mathematical Model: The observed pixel value O(x,y) can be modeled
as: O(x,y)=I(x,y)⋅(1+N(x,y)) where N(x,y) is additive noise with zero
mean and variance.
I. Noise Removal Using Spatial Domain Filtering
Spatial domain filtering involves processing the image directly in the pixel
domain to reduce noise. Common spatial domain filters include:
A. Mean Filter: Averages the pixel values in a neighborhood to reduce noise. It
is simple but may blur edges. Implementation: Convolve the image with a kernel
(e.g., a box filter) where each pixel is replaced by the average of its neighboring
pixels.
B. Median Filter: Replaces each pixel value with the median value of its
neighborhood. Effective at removing salt-and-pepper noise while preserving
edges. Implementation: Sort the pixel values in a neighborhood and replace the
central pixel with the median value.
C. Gaussian Filter: A weighted average filter where pixel values are averaged
with weights following a Gaussian distribution. Reduces noise while preserving
image details better than a mean filter. Implementation: Convolve the image
with a Gaussian kernel, which assigns more weight to pixels closer to the center
of the kernel.
D. Wiener Filter: An adaptive filter that takes into account local image variance
to reduce noise while preserving edges. It adjusts based on local statistics.
Implementation: Uses local mean and variance to compute the filter response
for each pixel, aiming to minimize mean squared error.
II. Noise Removal Using Frequency Domain Filtering
Frequency domain filtering involves transforming the image into the frequency
domain, applying filters, and then transforming it back to the spatial domain. This
approach is useful for removing periodic noise and can be more effective than
spatial domain filtering for certain types of noise.
A. Low-Pass Filtering: Removes high-frequency components, which are often
associated with noise, while preserving low-frequency components, which
represent the main features of the image. Implementation: Apply a low-pass
filter (e.g., Gaussian filter) in the frequency domain. Transform the image to the
frequency domain using the Fourier Transform, multiply by the low-pass filter,
and transform back to the spatial domain.
B. High-Pass Filtering: Enhances high-frequency components to sharpen the
image and reduce blurring caused by noise or distortions. Implementation:
Apply a high-pass filter in the frequency domain to enhance edges and details,
followed by an inverse Fourier Transform to return to the spatial domain.
C. Band-Pass Filtering: Filters out both low and high-frequency components,
allowing only a specific range of frequencies to pass. Useful for removing noise
in a particular frequency range. Implementation: Apply a band-pass filter in the
frequency domain, which allows only frequencies within a certain range to pass
through while attenuating others.
D. Notch Filtering: Specifically targets and removes periodic noise or
interference at certain frequencies. Implementation: Apply a notch filter in the
frequency domain to remove specific frequency components associated with the
noise, such as periodic interference.