Image Transforms
Module2
Definition
• Image transforms are mathematical techniques used to convert
images into different representations, making certain features more
accessible for analysis, compression, and enhancement. These
transformations are widely used in image filtering, compression, and
feature extraction.
Spatial Domain vs. Frequency Domain
• Spatial Domain: Direct manipulation of pixel values.
• Frequency Domain: Converts the image into frequency components,
analyzing patterns like edges and textures.
1-D Discrete Fourier Transform (DFT) in Digital
Image Processing
• What is DFT?
• The Discrete Fourier Transform (DFT) is used to convert a discrete-
time signal from the spatial (time) domain into the frequency
domain. It helps analyze the frequency components of a signal,
making it useful for filtering, compression, and feature extraction.
1-D DFT Formula
Inverse DFT (IDFT)
Example Calculation
Properties of 1-D DFT
Applications of 1-D DFT
Image Processing: Frequency-based filtering (low-pass, high-pass).
•Audio Processing: Noise reduction, sound equalization.
•Communication Systems: OFDM, signal modulation.
•Speech Recognition: Feature extraction.
Numericals
• Find the DFT coefficients for the signal x[n]={0,1,2,3} using the DFT
formula. Verify your result using matrix multiplication.
Solution
Compute DFT Coefficients Using Formula
Final DFT output
Verify Using Matrix Multiplication
Final Answer
2-D Discrete Fourier Transform (2D DFT)
• The 2-D Discrete Fourier Transform (2D DFT) is an extension of the
1D DFT for processing two-dimensional signals like digital images. It
converts an image from the spatial domain (pixel values) to the
frequency domain, making it useful for image filtering, compression,
and enhancement.
2D DFT Formula
Inverse 2D DFT (2D IDFT)
Example Calculation of 2D Discrete Fourier
Transform (2D DFT)
Compute DFT Values for
2. Compute F(0,1)
3. Compute F(1,0)
4. Compute F(1,1)
Final 2D DFT Result
Compute 2D Inverse DFT (IDFT)
Key Observations
Properties of 2D DFT
Applications of 2D DFT
Discrete Cosine Transform (DCT)
• The Discrete Cosine Transform (DCT) is a widely used mathematical
technique in digital image processing for transforming a signal or
image from the spatial domain to the frequency domain. It is similar
to the Fourier Transform but uses only real cosine functions, making it
more efficient for image compression applications.
Why Use DCT?
Mathematical Formulation
Derivation of the 2D Discrete Cosine Transform (2D DCT)
Inverse DCT (IDCT)
Properties of DCT
Applications of DCT
Discrete Cosine Transform (DCT) Numerical
Example
Let's compute the 2D DCT for a simple 2×2 grayscale image.
Numerical on DCT
Walsh-Hadamard Transform (WHT)
• The Walsh-Hadamard Transform (WHT) is a mathematical
transformation used in image and signal processing. Unlike the
Discrete Cosine Transform (DCT), which is based on sinusoidal
functions, the WHT is based on Walsh functions, which take only
binary values (+1 and -1). It is useful for applications in image
compression, pattern recognition, and error correction.
Properties of WHT
Walsh-Hadamard Matrix
How to Write the Hadamard Matrix?
Rules for Constructing Hadamard Matrix
Step-by-Step Construction of Hadamard Matrices
How to Write the Rows and Columns?
Observations
WHT
WHT Example Calculation (2×2 Matrix)
Haar Transform
• The Haar Transform is a simple and fast linear transform used in
signal and image processing. It is one of the earliest wavelet
transforms and serves as the basis for more advanced wavelet
transformations like Daubechies or Symlets. The Haar transform is
particularly useful for image compression and feature extraction due
to its computational simplicity.
Haar Wavelet Transform
• The Haar wavelet is a step function that is defined by simple
operations on the signal or image, involving averaging and
differencing operations. The Haar transform essentially represents
data by breaking it down into a sum of average and difference values
across various scales.
For a 1D signal, the Haar transform works as follows:
[Link] (A): The first step is to compute the average of two adjacent values.
[Link] (D): The second step is to compute the difference between the same two values.
The result is then represented as a sum of these average and difference values. In the case of
a 2D image, the process is applied separately to rows and columns.
Haar Transform - 1D Example
• Let’s first consider a simple 1D signal and apply the Haar transform to
it.
• Consider the signal:x=[4,6,10,12]
Step 1: Pairwise Averaging and Differencing
Haar Transform - 2D Example
Step 1: Apply Haar Transform on Rows
• We apply the Haar transform to each row, just like we did in the 1D
case.
After transforming all rows, we get the
following intermediate result:
Step 2: Apply Haar Transform on Columns
• Now we apply the Haar transform to each column of the intermediate
matrix.
After transforming all columns, we get the
final Haar-transformed image:
Haar Transform in Image Compression
• In image compression, the Haar transform is typically used to
represent the image in terms of low-frequency and high-frequency
components:
• Low-frequency coefficients (top-left corner of the matrix) represent
the overall structure or smooth transitions in the image.
• High-frequency coefficients (bottom-right corner) represent the
details or finer variations.
• By quantizing or discarding the high-frequency coefficients, we can
compress the image with minimal loss of quality.
Write the mathematical formula for 2-D DFT.
1
State any two properties of the 2-D DFT.
2
What is the inverse DFT, and why is it used?
3
Define the Walsh-Hadamard transform.
4
What is a Discrete Cosine Transform (DCT) used for?
5
State the difference between DFT and DCT.
6
What is the role of the Haar transform in image processing?
7
Given x[n] = [2, 3, 4], compute the 1-D DFT and interpret the result.
Find the 1-D DFT of the signal x[n] = [4, 2, 1, 3, 5]. Provide the magnitude and phase of each frequency component.
Given x[n] = [2, 3, 4], compute the 1-D DFT and interpret the result.
Given the matrix f = [[1, 2], [3, 4]], compute the 2-D Discrete Fourier Transform (DFT).
For a 2D matrix f = [[0, 1], [1, 0]], compute the 2-D DFT.
Compute the 2-D DFT of the matrix f = [[2, 3, 1], [4, 2, 1]].
Given x = [1, 2, 3, 4], compute the Walsh-Hadamard Transform (WHT) of the sequence.
Compute the Walsh-Hadamard transform of the sequence x = [3, 1, 2, 4]. Provide the result.
Apply the Walsh-Hadamard Transform to x = [5, 2, 8, 7]. Compute and interpret the result.
Compute the 1-D DCT of the sequence x = [1, 2, 3, 4].
Find the 1-D DCT for the sequence x = [3, 2, 4, 1].
Compute the 1-D DCT for the sequence x = [6, 8, 10, 12].
Apply the Haar transform on the sequence x = [8, 6, 4, 2].
Compute the Haar transform of x = [5, 9, 12, 15].
Find the Haar transform of the sequence x = [16, 12, 8, 4].
Explain the concept of 1-D Discrete Fourier Transform (DFT) and its mathematical representation.
What is the significance of the 2-D Discrete Fourier Transform in image processing?
Derive the inverse of the 2-D Discrete Fourier Transform and explain its practical importance.
Discuss some key properties of the 2-D DFT and explain how they are useful in image processing.
Compare the Walsh-Hadamard transform with the DFT in terms of computational efficiency and applications.
Explain the working principle of the Discrete Cosine Transform (DCT) and its role in image compression.
Calculate the 1-D DFT of a simple image and its inverse.
THANK YOU