UNIT 2 - IMAGE TRANSFORMS
ID DFT, 2D transforms - DFT, DCT, Discrete Sine, Walsh,
Hadamard, Slant, Haar, KLT, SVD, Wavelet transform.
ONE-DIMENSIONAL DISCRETE FOURIER TRANSFORM (DFT)
Definition of DFT:
DFT transforms a sequence of values into its frequency components, revealing how
different frequencies are present in the sequence.
Formula:
Here: - v(k) is the transformed sequence (frequency domain). - u(n) is the input
sequence (time domain). - WN is the twiddle factor, defined as exp(−j2π/N).
Inverse Transform:
This process reconstructs the original sequence from its frequency components:
Unitary DFT:
Adjusted versions of the formulas ensure the transform is unitary, meaning it
preserves energy:
DFT Matrix Representation:
DFT can be represented using a matrix, FF, composed of the twiddle factors scaled by
Importance in Image Processing:
The DFT is particularly attractive for applications because it helps analyze periodic
structures and perform frequency-based filtering.
Properties of DFT:
Includes operations like circular shifts, which wrap the sequence around a circle
instead of shifting linearly.
• The Discrete Fourier Transform (DFT) and its properties, focusing on symmetry,
periodicity, and computational efficiency.
Symmetry of DFT and Unitary DFT Matrices:
•The DFT matrix F is symmetric, implying F-1= F^* (the conjugate transpose of
F).
Periodicity of DFT Extensions:
•Frequency-domain sequences derived from DFT are periodic with a period N.
For example, v(k)=v(k+N).
Spectrum Sampling:
DFT is effectively sampling the spectrum of a finite sequence extended with
zeros. This is mathematically represented as U~(ω), a Fourier transform of the
zero-extended sequence.
Computational Efficiency with FFT:
•Fast Fourier Transform (FFT) algorithms reduce the computational complexity of DFT
to O(N log N). These algorithms are widely used for large datasets and signals.
Conjugate Symmetry for Real Sequences:
•When the input sequence u(n) is real, its frequency-domain representation v(k)
exhibits conjugate symmetry about N/2.
The Circular Shift Illustrated:
Figure 5.3 shows the concept of a circular shift, which rearranges the sequence u(n) by
a specific amount (in this case, 2). Unlike linear shifts, circular shifts "wrap around" the
sequence, preserving periodicity.
1. Mathematical Symmetry Properties:
Equation (5.49) and Equation (5.50) discuss the symmetry properties of the DFT:
The values of the DFT exhibit a conjugate symmetry. Specifically:
•v^* denotes the complex conjugate of v.
•Similarly, the magnitudes of the symmetric components are equal:
Graphs (Figures 5.4 and 5.5):
Figure 5.4: This is a plot of a 256-sample scan line u(n)u(n) from an image, showing
pixel intensity values across a single row.
Figure 5.5: It visualizes the magnitude of the unitary DFT of the scan line, highlighting a
key property:
The graph is symmetric around the middle point (k=128), a result of the symmetry
in the DFT.
Insights:
The image emphasizes the periodic nature of the DFT. For example, it notes that:
v(−k)=v(N−k)
The practical implication of this is that DFT data is inherently repetitive, making it
efficient for signal reconstruction.
DFT Representation for Real Sequences:
Equation (5.51) illustrates how the DFT of a real sequence is entirely defined using NN
degrees of freedom:
This means the storage requirement for the DFT of a real sequence is identical to
that of the sequence itself.
Basis Vectors of Unitary DFT:
The basis vectors of the unitary DFT are orthonormal eigenvectors of any circulant
matrix H:
W represents the twiddle factor used in the DFT.
Eigenvalues of Circulant Matrices:
The eigenvalues λk of a circulant matrix H are determined by applying the DFT to the
first column of H. The formula is:
Circular Convolution Theorem:
A key property mentioned is that the DFT of the circular convolution of two sequences
equals the product of their DFTs.
Application Insights:
That circulant matrices and their relationship with DFT are foundational for efficient
computation, such as in signal processing and linear algebra.]
Circular Convolution:
Definition (Equation 5.58): Circular convolution is expressed as:
This involves wrapping the sequence boundaries (circular nature).
Efficient Calculation Using DFT (Equation 5.59):
The DFT simplifies convolution:
Using FFT, this reduces computational complexity to O(NlogN) compared to O(N^2).
Linear Convolution:
Linear convolution can be computed by embedding it into circular convolution, using
an FFT-based algorithm:
Extend sequences with zeros.
Perform element-wise multiplication in the frequency domain.
Use Inverse FFT to retrieve the result.
Circulant Matrices:
Diagonalization Property:
Circulant matrices H are diagonalized via the DFT:
FHF∗=Λ
F is the unitary DFT matrix, and Λ is a diagonal matrix containing eigenvalues.
Key Properties:
Circulant matrices commute (C1C2=C2C1).
The inverse of a circulant matrix is also circulant.
Arbitrary functions of circulant matrices (e.g., f(C)) preserve the circulant nature.
Practical Implications:
These techniques are widely used in signal processing for efficient computation and
filtering. Linear and circular convolutions are foundational in areas like audio and image
processing.
Two-dimensional Discrete Fourier Transform (DFT),
The two-dimensional Discrete Fourier Transform (DFT), which is an extension of the
DFT into two dimensions.
Mathematical Definition:
The formula for the two-dimensional DFT of an N×N image, {u(m,n)}, is given as:
Where:
v(k, l): Represents the transformed coefficients in the frequency domain.
u(m, n): Represents the image in the spatial domain (pixel values).
W N: The twiddle factor defined as W N=exp(−j2π/N).
k, l: Frequency indices.
m, n: Spatial indices.
Separability:
This formula highlights that the two-dimensional DFT is separable:
It can be computed as a series of one-dimensional DFTs applied along rows first, and
then columns (or vice versa).
This property is vital for computational efficiency, especially in image processing.
Applications in Image Processing:
The two-dimensional DFT is commonly used to analyze frequency patterns in images,
enabling:
Image filtering.
Compression techniques.
Edge detection and texture analysis.
Mathematical Definitions:
The two-dimensional unitary DFT pair is defined as:
Forward Transform:
Where:
v(k,l): Represents the frequency-domain coefficients.
u(m,n): Represents the spatial-domain values (e.g., pixel intensities in an image).
W N =exp(−j(2π/N)): The twiddle factor.
Inverse Transform:
Matrix Notation:
In matrix representation:
V=FUF
Where:
{F}: Represents the DFT matrix.
{U}: Represents the image or input matrix.
{V}: Represents the frequency-domain representation.
Implications for Image Processing:
The two-dimensional DFT is widely used for:
Filtering: Removing unwanted frequencies (e.g., noise).
Compression: Encoding frequency information efficiently.
Feature Detection: Highlighting periodic structures in images.
Fast Transform:
The image emphasizes that the two-dimensional DFT is separable, making it
computationally efficient via the Fast Fourier Transform (FFT). By applying 2N one-
dimensional unitary DFTs, the computational complexity is reduced to O(N 2log2N). This
efficiency is pivotal for large-scale image processing tasks.
Conjugate Symmetry:
The image discusses the symmetry properties of DFT for real images:
Conjugate symmetry is defined mathematically:
This symmetry implies that the frequency-domain coefficients contain only N 2
independent elements.
Figure 5.8 illustrates that the DFT coefficients in a shaded region can determine all other
coefficients due to this symmetry.
Circular Convolution
Circular convolution is the process of convolving two sequences, but instead of
moving linearly, the boundaries of the sequences "wrap around" periodically. In this
case, the concept is extended to two dimensions.
Mathematical Breakdown:
Circular Convolution Formula:
Two-dimensional circular convolution, u2(m,n) is defined as:
Here: - h(m−m′,n−n′)c: Periodic extension of the kernel h(m,n)-u1(m', n'): Input data or
image being convolved.
Fast Transform Property:
The circular convolution can be calculated efficiently using the DFT:
This reduces computational complexity from O(N^4) to O(N2log2N) by leveraging
the Fast Fourier Transform (FFT).
Use:
The ability to compute circular convolutions efficiently using FFT is especially useful for
applications like:
Image Filtering: Removing or enhancing certain frequency components.
Pattern Matching: Detecting repetitive patterns in images.
Signal Processing: Noise reduction and feature extraction.
Visual Representation (Figure 5.9):
Subfigure (a): Shows the kernel h(m,n) which acts as the filter.
Subfigure (b): Illustrates the result of the circular convolution applied to u1(m,n) over
an N×N region, demonstrating periodic wrapping.
Two-dimensional – DCT:
The Discrete Cosine Transform (DCT), a key mathematical technique used in image
compression and signal processing.
The DCT Matrix:
The Discrete Cosine Transform matrix C={c(k,n)} is defined for an N×N matrix. The
entries c(k,n) are calculated using:
This defines the rows of the DCT matrix, which transform a sequence into its
frequency components.
The DCT Formula:
The one-dimensional DCT for a sequence {u(n)} is given by:
Where:
v(k): The transformed frequency-domain value.
α(k): A scaling factor:
Graph: Cosine Transform of an Image Scan Line:
The graph illustrates the cosine transform of a single scan line taken from an image.
X-axis: Represents the frequency index k (ranging from 1 to 250).
Y-axis: Represents the DCT coefficients y(k), with values ranging from -503 to 822.
Observation: Most of the transform's energy is concentrated in just a few coefficients
(i.e., many y(k) values are small). This energy compaction makes DCT ideal for
compression.
Inverse DCT Formula:
The inverse DCT reconstructs the original data:
•u(n): Reconstructed value in the spatial domain (e.g., pixel intensity).
•α(k): Normalization factor.
•v(k): DCT coefficient.
Two-Dimensional DCT:
•The image mentions that extending DCT to two dimensions is possible by substituting
the cosine transform matrix into equations for multidimensional transforms.
•This allows efficient encoding of entire images rather than single scan lines.
Properties of the DCT:
•Real and Orthogonal:
•The transform preserves energy and can be easily inverted.
Relation to DFT:
While the DCT is not just the real part of the DFT, it is related to the DFT of a
symmetrically extended sequence.
Efficient Computation:
•The image discusses how a cosine transform of a vector with NN elements can be
computed in O(Nlog2N) operations using an N-point FFT. This reduction in complexity
makes the cosine transform highly efficient for large datasets.
Sequence Reordering:
•To optimize the process, the sequence u~(n) is introduced by reordering the even and odd
elements of the original sequence u(n):
This reordering simplifies the calculations, separating the even-indexed and odd-indexed
terms.
Transform Expression:
The summation term for v(k), the cosine transform output, is split into even and odd
terms:
Final Simplification:
Using a change in the summation index for the odd term, the cosine transform is
expressed compactly:
Inverse Discrete Cosine Transform (DCT), computational techniques using Fast Fourier
Transform (FFT), energy compaction properties, and its relation to the Karhunen-Loève
(KL) transform.
Inverse DCT Computation
The image provides the formula for computing the inverse DCT for even and odd data
points:
These equations show that the inverse DCT can be efficiently computed in
O(NlogN)operations using FFT techniques. Direct algorithms avoiding FFT also exist,
offering similar computational complexity.
2. Energy Compaction
The DCT exhibits excellent energy compaction for correlated data:
•This property makes it ideal for applications like image compression and denoising.
•A significant portion of the energy is concentrated in a few coefficients, preserving
the most relevant information.
3. Basis Vectors as Eigenvectors
The basis vectors of the cosine transform are the eigenvectors of the symmetric
tridiagonal matrix Qc, defined as:
The Hadamard transform, including its basis vectors, Walsh functions, and the
concept of sequency order.
Hadamard Matrix (H8H_8)
The matrix H8 shown in the image is an 8×8 Hadamard matrix, which is scaled by 1/
8 for normalization. It is:
This matrix forms the basis for the Hadamard transform, which is widely used in signal
processing and data analysis.
Transform Pair
The Hadamard transform is applied to an N×1 vector u:
v=Hu
The inverse transform reconstructs u:
u=Hv
Here:
H is the Hadamard matrix scaled by N-1/2
n=log2(N), indicating that N must be a power of 2.
Binary Representation
The binary representation used in the Hadamard transform is key to calculating b(k,m)
where:
k=k0+2k1+⋯+2n−1kn−1
m=m0+2m1+⋯+2n−1mn−1
5. Two-Dimensional Transform for Images
For N×N images, the two-dimensional Hadamard transform pair is obtained by applying
the same transform matrix H separately to rows and columns. The normalized matrix
ensures orthogonal basis vectors.
Properties of the Hadamard Transform
Real, Symmetric, and Orthogonal:
The Hadamard transform matrix, H, satisfies:
H= H* = HT = H-1
H∗: Complex conjugate.
HT: Transpose.
H−1: Inverse.
Fast Computation:
The Hadamard transform can be computed in O(Nlog2N) additions and subtractions.
Since the entries of H are only ±1, the transform requires no multiplications, making it
computationally efficient.
Definitions and Equations
Sine Transform
Additional properties and characteristics of the Sine Transform.
5. Fast KL Transform Algorithm:
The sine transform also serves as a basis for a fast KL transform algorithm when
boundary values are specified.
This makes it particularly useful in image processing and signal analysis tasks where
efficient transformations are required.
Haar Transform
PROPERTIES OF THE HAAR TRANSFORM
Slant Transform
Visual Examples in the Image
Figure 5.1:
Displays the basis vectors of an 8×8 Slant Transform, showing the gradual
transition from low-frequency to high-frequency patterns.
Figure 5.2:
Illustrates the basis images for the two-dimensional Slant Transform, which
demonstrate how energy is distributed spatially in an image.
Figure 5.15:
Presents the application of the Slant Transform to a 256×256 image, showing its
ability to capture essential features with high energy compaction.