0% found this document useful (0 votes)
7 views

Image Transformations

The document outlines fundamental steps in image processing, including image acquisition, enhancement, restoration, segmentation, and recognition. It discusses geometric transformations such as translation, scaling, and rotation, along with interpolation techniques like B-Spline functions. Additionally, the document covers image transforms and their applications, emphasizing the role of unitary and orthogonal matrices in representing images.

Uploaded by

aajawaleb22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Image Transformations

The document outlines fundamental steps in image processing, including image acquisition, enhancement, restoration, segmentation, and recognition. It discusses geometric transformations such as translation, scaling, and rotation, along with interpolation techniques like B-Spline functions. Additionally, the document covers image transforms and their applications, emphasizing the role of unitary and orthogonal matrices in representing images.

Uploaded by

aajawaleb22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Fundamental Steps in image processing

2 FUNDAMENTAL STEPS IN IMAGE PROCESSING


3 IMAGE ACQUISITION
4 IMAGE ENHANCEMENT
5 IMAGE RESTORATION
6 MORPHOLOGICAL OPERATIONS
7 IMAGE SEGMENTATION
8 OBJECT RECOGNITION
9 IMAGE REPRESENTATION AND DESCRIPTION
10 IMAGE COMPRESSION
11 COLOR IMAGE PROCESSING
Geometric Transformation
13 SPATIAL / GEOMETRIC TRANSFORMATION
➢ It means changing geometry of an image.

➢ It permits the elimination of geometric


distortion that occurs when an image is
captured.

➢ It is geometric transformation of the image


co ordinate system.

➢ In spatial transformation each pixel located


at point (x,y) of an image is mapped to a
new location located at (u,v)
14 AFFINE TRANSFORMATION
➢ The following affine transformation relationship can be used
to perform different geometric transformations on image

𝑥′ 𝑎 𝑏 𝑥 𝛼
= +
𝑦′ 𝑐 𝑑 𝑦 𝛽

➢ Where (x,y) is original pixel location and (x’,y’) is transformed


pixel location. [a,b,c,d,α and β] are transforming parameters
15 TRANSLATION
➢ The translation operation is performed using the equation
below:

𝑥′ 1 0 𝑥 𝛼
= +
𝑦′ 0 1 𝑦 𝛽

𝑥 =𝑥+𝛼

𝑦 =𝑦+𝛽
16 SCALING
➢ The translation operation is performed
using the equation below:
𝑥′ 𝑠𝑥 0 𝑥 0
= 0 𝑠𝑦 𝑦 +
𝑦′ 0

𝑥 = 𝑠𝑥 . 𝑥

𝑦 = 𝑠𝑦 . 𝑦
17 ROTATION

➢ The Rotation operation is performed


using the equation below:
𝑥′ 𝑐𝑜𝑠𝜃 𝑠𝑖𝑛𝜃 𝑥 0
= +
𝑦′ −𝑠𝑖𝑛𝜃 𝑐𝑜𝑠𝜃 𝑦 0

𝑥 = 𝑥. 𝑐𝑜𝑠𝜃 + 𝑦. 𝑠𝑖𝑛𝜃
𝑦 ′ = −𝑥. 𝑠𝑖𝑛𝜃 + 𝑦. 𝑐𝑜𝑠𝜃
18 PROBLEM
➢ Perform Translation, Scaling and Rotation operation on the image
given below and show the translated, scaled and rotated image

(2,3) (3,3)

(2,2) (3,2)
19 INTERPOLATION AND RESAMPLING
➢ Basic requirement of a interpolation function

▪ It should have a finite support region


▪ It should be able to do a smooth interpolation
▪ It should be shift invariant
20 INTERPOLATION
➢ The B-Spline function is represented as:
𝑛

𝑥 𝑡 = ෍ 𝑃𝑖 𝐵𝑖,𝑘 (𝑡)
𝑖=0
Where, 𝑃𝑖 -Control Points
And 𝐵𝑖,𝑘 (𝑡)- normalized B-spline function of order 𝑘
21 INTERPOLATION
Now, 𝐵𝑖,𝑘 (𝑡) is defined as:

1 𝑡𝑖 ≤ 𝑡 < 1
𝐵𝑖,1 𝑡 =
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

𝑡 − 𝑡𝑖 . 𝐵𝑖,𝑘−1 𝑡 𝑡𝑖+1 − 1 . 𝐵𝑖+1,𝑘−1 𝑡


𝐵𝑖,𝑘 𝑡 = +
(𝑡𝑖+𝑘−1 − 𝑡𝑖 ) (𝑡𝑖+𝑘 − 𝑡𝑖+1 )
Also,
𝐵𝑖,𝑘 𝑡 = 𝐵0,𝑘 (𝑡 − 𝑖)
22 INTERPOLATION
➢ The B-Spline function of order ➢ The B-Spline function of order
1 is represented as: 2 is represented as:
𝑡 0≤𝑡<1
1 0≤𝑡<1
𝐵0,1 𝑡 = 𝐵0,2 𝑡 =2−𝑡 1≤𝑡<2
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Interpolation done using above Interpolation done using above
function is known as constant function is known as linear
interpolation interpolation
23 INTERPOLATION
➢ The B-Spline function of order 3 is represented as:

𝑡2
0≤𝑡<1
2
−𝑡 2 + 3𝑡 − 1.5 1 ≤ 𝑡 < 2
𝐵0,3 𝑡 =
(3 − 𝑡)2
2≤𝑡<3
2
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Interpolation done using above function is known as
quadratic interpolation
24 INTERPOLATION
➢ The B-Spline function of order 4 is represented as:
𝑡3
0≤𝑡<1
6 Interpolation done
−3𝑡 3 + 12𝑡 2 − 12𝑡 + 4 using above function
1≤𝑡<2
6 is known as cubic
𝐵0,4 𝑡 = 3𝑡 3 − 24𝑡 2 + 60𝑡 − 44 interpolation
2≤𝑡<3
6
(4 − 𝑡)3
3≤𝑡<4
6
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
25 INTERPOLATION
𝐵𝑖,1 𝑡 constant interpolation 𝐵𝑖,2 𝑡 linear interpolation

𝑡𝑖 𝑡𝑖+1 𝑡𝑖 𝑡𝑖+1 𝑡𝑖+2


𝐵𝑖,3 𝑡 𝐵𝑖,4 𝑡
quadratic interpolation cubic interpolation

𝑡𝑖 𝑡𝑖+1 𝑡𝑖+2 𝑡𝑖+3 𝑡𝑖 𝑡𝑖+1 𝑡𝑖+2 𝑡𝑖+3 𝑡𝑖+4


26 PROBLEM
Q. For the function 𝑓 sample values are given as, 𝑓 0 = 0.5, 𝑓 1 = 1.0, 𝑓 2 = 0.6, 𝑓 3 = 1.1,
𝑓 4 = 0.9, 𝑓 5 = 0.7. Find the value of function 𝑓(2.1) using modified interpolation formula
for
1. Constant interpolation
2. Linear interpolation
3. Cubic interpolation
Q. For the function 𝑓 sample values are given as, 𝑓 1 = 1.5, 𝑓 2 = 2.5, 𝑓 3 = 3, 𝑓 4 = 2.5,
𝑓 5 = 3, 𝑓 6 = 2.4, 𝑓 7 = 1, 𝑓 8 = 2.5. Find the value of function 𝑓(4.3) using modified
interpolation formula for
1. Constant interpolation
2. Linear interpolation
3. Cubic interpolation
27 1D VS 2D INTERPOLATION
28 2D NEAREST NEIGHBOR INTERPOLATION
29 BILINEAR INTERPOLATION
30 BICUBIC INTERPOLATION
Image Transformations
32 IMAGE TRANSFORM AND IT’S APPLICATIONS

Transform

Transformed
Image
Image
NXN
NXN
Inverse
Transform
33 IMAGE TRANSFORM
➢ What does the image transformation do?
It represents a given image as a series summation of a set of
unitary matrices
➢ What is unitary matrix?
A matrix ‘𝐴’ is a unitary matrix if
𝑇
𝐴−1 = 𝐴∗

Where, 𝐴∗ is conjugate of 𝐴
Unitary matrices basis images
34 IMAGE TRANSFORM
➢ In case of one dimensional continuous signal, the signal can be
represented as series summation of a set of orthogonal basis functions.
➢ What does orthogonal function mean here?
Consider a set of real valued continuous function
𝑎𝑛 𝑡 = 𝑎0 𝑡 , 𝑎1 𝑡 , 𝑎2 𝑡 , …
This set of real valued function is said to be orthogonal over period t,
when

𝑘 𝑖𝑓 𝑚 = 𝑛
‫𝑚𝑎 ׬‬ 𝑡 . 𝑎𝑛 𝑡 =
0 𝑖𝑓 𝑚 ≠ 𝑛
If k=1, it is called orthonormal.
35 IMAGE TRANSFORM
If we have a series of discrete samples The inverse is given as:
𝑇
𝑢 𝑛 :0 ≤ 𝑛 ≤ 𝑁 −1 𝑢 = 𝑣. 𝐴−1 = 𝑣. 𝐴∗
The transformation can be given as:
𝑁−1
𝑣 = 𝑢. 𝐴
𝑢 𝑛 = ෍ 𝑣 𝑘 . 𝑎∗ 𝑘, 𝑛
Where, 𝑣 is transformed vector and 𝐴 is 𝑘=0
transformation matrix
𝑁−1 𝑛 = 0,1,2, … , 𝑁 − 1
𝑣 𝑘 = ෍ 𝑢 𝑛 . 𝑎 𝑘, 𝑛
𝑛=0
𝑘 = 0,1,2, … , 𝑁 − 1
36 IMAGE TRANSFORM

For a given image 𝑢 𝑚, 𝑛 for 0 ≤ 𝑚, 𝑛 ≤ 𝑁 − 1 The inverse transformation is given as:


the transformation is given as:

𝑁−1 𝑁−1
𝑁−1 𝑁−1 𝑢 𝑚, 𝑛 = ෍ ෍ 𝑣 𝑘, 𝑙 . 𝑎∗ 𝑘,𝑙 𝑚, 𝑛
𝑣 𝑘, 𝑙 = ෍ ෍ 𝑢 𝑚, 𝑛 . 𝑎𝑘,𝑙 𝑚, 𝑛 𝑘=0 𝑙=0
𝑚=0 𝑛=0

Where, 0 ≤ 𝑚, 𝑛 ≤ 𝑁 − 1
Where, 0 ≤ 𝑘, 𝑙 ≤ 𝑁 − 1
37 IMAGE TRANSFORM
Condition for orthogonal matrices is:
𝑁−1 𝑁−1

෍ ෍ 𝑎𝑘,𝑙 𝑚, 𝑛 . 𝑎∗ 𝑘 ′,𝑙′ 𝑚, 𝑛 = 𝛿(𝑘 − 𝑘 ′ , 𝑙 − 𝑙′ )


𝑚=0 𝑛=0

And
𝑁−1 𝑁−1

෍ ෍ 𝑎𝑘,𝑙 𝑚, 𝑛 . 𝑎∗ 𝑘,𝑙 𝑚′ , 𝑛′ = 𝛿(𝑚 − 𝑚′ , 𝑛 − 𝑛′ )


𝑚=0 𝑛=0
38 IMAGE TRANSFORM
If a given matrix 𝑎𝑘,𝑙 𝑚, 𝑛 can be represented as Generally we take matrices A and B same, so the
separable transform is given as:
𝑎𝑘,𝑙 𝑚, 𝑛 = 𝑎𝑘 𝑚 . 𝑏𝑙 𝑛 ≈ 𝑎 𝑘, 𝑚 . 𝑏(𝑙, 𝑛) 𝑁−1 𝑁−1

𝑣 𝑘, 𝑙 = ෍ ෍ 𝑎 𝑘, 𝑚 . 𝑢 𝑚, 𝑛 . 𝑎 𝑙, 𝑛
Then the matrix is known as a separable matrix.
𝑚=0 𝑛=0
So, This can also be represented as: v = 𝐴 𝑈 𝐴𝑇
𝑎𝑘 𝑚 : 𝑘 = 0,1, … , 𝑁 − 1
𝑏𝑙 𝑛 : 𝑙 = 0,1, … , 𝑁 − 1
The inverse separable transformation is given as:
Are 1-D complete orthonormal basis vectors 𝑁−1 𝑁−1

𝑢 𝑚, 𝑛 = ෍ ෍ 𝑎∗ 𝑘, 𝑚 . 𝑣 𝑘, 𝑙 . 𝑎∗ 𝑙, 𝑛
So, if we assume 𝐴 ≈ {𝑎 𝑘, 𝑚 } and B ≈ {𝑏 𝑙, 𝑛 }
𝑘=0 𝑙=0
Then A and B are both unitary matrices. This can also be represented as: 𝑈 = 𝐴∗ 𝑇 𝑉𝐴∗
39 BASIS IMAGES

➢ How to compute the basis images: ➢ Problem: for the given orthogonal matrix a
and image u find the transformed image
using separable transform and obtain all the
𝑎∗ 𝑘 → 𝑘 𝑡ℎ 𝑐𝑜𝑙𝑢𝑚𝑛 𝑜𝑓 𝐴∗ 𝑇 possible basis functions.
𝑎∗ 𝑙 → 𝑙𝑡ℎ 𝑟𝑜𝑤 𝑜𝑓 𝐴∗ 𝑇
1 1 1 1 2
𝐴= ,𝑈 =
So the basis image is: 2 1 −1 3 4
𝐴∗ 𝑘,𝑙 = 𝑎∗ 𝑘 . 𝑎∗ 𝑙
Find the inverse transform also
40 IMAGE TRANSFORM
➢A general transform of a two dimensional square ➢Here if transformation kernel can be
represented as:
digital image 𝑓(𝑥, 𝑦) of size 𝑁 × 𝑁 can be represented
as: 𝑔 𝑥, 𝑦, 𝑢, 𝑣 = 𝑔1 𝑥, 𝑢 . 𝑔2 (𝑦, 𝑣)
𝑁−1 𝑁−1

𝑇 𝑢, 𝑣 = ෍ ෍ 𝑓 𝑥, 𝑦 . 𝑔(𝑥, 𝑦, 𝑢, 𝑣) Then it is a separable transform. Now, if


function 𝑔1 and 𝑔2 are considered functionally
𝑥=0 𝑦=0
same then function 𝑔 becomes symmetric and
➢A general inverse transform can be represented as: can be represented as:
𝑁−1 𝑁−1
𝑔 𝑥, 𝑦, 𝑢, 𝑣 = 𝑔1 𝑥, 𝑢 . 𝑔1 (𝑦, 𝑣)
𝑓 𝑥, 𝑦 = ෍ ෍ 𝑇 𝑢, 𝑣 . ℎ(𝑥, 𝑦, 𝑢, 𝑣)
𝑥=0 𝑦=0
Hence this transformation is separable as well
as symmetric. Similarly we can do for inverse
kernel ℎ.
41 IMAGE TRANSFORM APPLICATIONS
Applications:

➢ Preprocessing: ➢ Data Compression:


• Filtering • reducing storage requirements
• Enhancement • effective bandwidth utilization
• Augmentation etc. during data transmission etc.

➢ Feature Extraction:
• Edge Detection
• Corner Detection etc.
42 2-D FOURIER TRANSFORM
➢Fourier transform of a two dimensional signal ➢The Fourier spectrum can be given as:
1
𝑓(𝑥, 𝑦) can be represented as: 2 2
𝐹(𝑢, 𝑣) = 𝑅𝑒 𝑢, 𝑣 + 𝐼𝑚 𝑢, 𝑣 2


➢The Phase can be given as:
𝐹 𝑢, 𝑣 = ඵ 𝑓(𝑥, 𝑦)𝑒 −𝑗2𝜋(𝑢𝑥+𝑣𝑦) 𝑑𝑥𝑑𝑦 𝐼𝑚 (𝑢, 𝑣)
𝜑 𝑢, 𝑣 = 𝑡𝑎𝑛−1
−∞ 𝑅𝑒 (𝑢, 𝑣)
➢Inverse fourier transform can be represented
➢The Power Spectrum can be computed
as: by:
∞ 𝑃 𝑢, 𝑣 = 𝐹(𝑢, 𝑣) 2

𝑓 𝑥, 𝑦 = ඵ 𝐹(𝑢, 𝑣)𝑒 −𝑗2𝜋(𝑢𝑥+𝑣𝑦) 𝑑𝑢𝑑𝑣


−∞
43 2-D FOURIER TRANSFORM
* Example*
𝑓(𝑥, 𝑦)
Fourier spectrum is:

𝐴
sin(𝜋𝑢𝑋) sin(𝜋𝑣𝑌)
𝐹(𝑢, 𝑣) = 𝐴𝑋𝑌
𝜋𝑢𝑋 𝜋𝑣𝑌
𝑌 𝑦
𝑋

𝑥
44 2-D DISCRETE FOURIER TRANSFORM
➢ Fourier transform of a two dimensional digital ➢Inverse Fourier Transform can be
image 𝑓(𝑥, 𝑦) of size 𝑀 × 𝑁 can be represented represented as
as: 𝑀−1 𝑁−1
𝑢𝑥 𝑣𝑦
𝑗2𝜋( 𝑀 + 𝑁 )
𝑓 𝑥, 𝑦 = ෍ ෍ 𝐹 𝑢, 𝑣 𝑒
𝑢=0 𝑣=0
𝑀−1 𝑁−1
1 𝑢𝑥 𝑣𝑦
−𝑗2𝜋( 𝑀 + 𝑁 )
𝐹 𝑢, 𝑣 = ෍ ෍ 𝑓(𝑥, 𝑦)𝑒 Here, x= 0,1, … , 𝑀 − 1
𝑀𝑁
𝑥=0 𝑦=0 And y = 0,1, … , 𝑁 − 1

HERE, 𝑢 = 0,1, … , 𝑀 − 1
AND V = 0,1, … , 𝑁 − 1
45 2-D DFT RESULT
Original Image Magnitude spectrum Phase spectrum

Reconstructed Magnitude Only Reconstructed Phase Only Reconstructed


46 PROPERTIES OF DFT
➢SEPARABILITY: ➢SEPARABILITY:
THE FORWARD TRANSFORM INVERSE TRANSFORM
𝐹 𝑢, 𝑣 𝑁−1 𝑁−1
𝑢𝑥 𝑣𝑦
𝑗2𝜋 𝑁 + 𝑁
𝑁−1 𝑁−1 𝑓(𝑥, 𝑦) = ෍ ෍ 𝐹 𝑢, 𝑣 𝑒
1 −𝑗2𝜋
𝑢𝑥 𝑣𝑦
= 2 ෍ ෍ 𝑓(𝑥, 𝑦)𝑒 𝑁+𝑁 𝑢=0 𝑣=0
𝑁 𝑁−1 𝑁−1
𝑥=0 𝑦=0
2𝜋 2𝜋
𝑗 𝑢𝑥 𝑗 𝑣𝑦
𝑁−1 𝑁−1 =෍ 𝑒 𝑁 . ෍ 𝐹 𝑢, 𝑣 𝑒 𝑁
1 2𝜋
−𝑗 𝑁 𝑢𝑥 1 2𝜋
−𝑗 𝑁 𝑣𝑦 𝑢=0 𝑣=0
= ෍ 𝑒 . ෍ 𝑓(𝑥, 𝑦)𝑒
𝑁 𝑁 𝑁−1
𝑥=0 𝑦=0 2𝜋
−𝑗 𝑢𝑥
𝑁−1 = ෍𝑒 𝑁 . 𝑓 𝑢, 𝑦
1 2𝜋
−𝑗 𝑢𝑥 𝑢=0
= ෍ 𝑒 𝑁 . 𝐹 𝑥, 𝑣
𝑁 = 𝑓 𝑥, 𝑦
𝑥=0
= 𝐹 𝑢, 𝑣
47 PROPERTIES OF DFT ➢Periodicity:
➢TRANSLATION:
The Periodicity property says that both DFT and IDFT are
IF 𝑓 𝑥, 𝑦 𝑖𝑠 𝑡𝑟𝑎𝑛𝑠𝑙𝑎𝑡𝑒𝑑 𝑏𝑦 𝑥0 , 𝑦0 𝑎𝑛𝑑 𝑏𝑒𝑐𝑜𝑚𝑒𝑠
periodic with a period capital N. i.e.
𝑓(𝑥 − 𝑥0 , 𝑦 − 𝑦0 )
THEN 𝐹 𝑢, 𝑣 = 𝐹 𝑢 + 𝑁, 𝑣 = 𝐹 𝑢, 𝑣 + 𝑁 = 𝐹(𝑢 + 𝑁, 𝑣 + 𝑁)
𝐹 𝑓(𝑥 − 𝑥0 , 𝑦 − 𝑦0 ) = 𝐹𝑡 𝑢, 𝑣
2𝜋
−𝑗 (𝑢𝑥0 +𝑣𝑦0 )
= 𝐹 𝑢, 𝑣 . 𝑒 𝑁
➢Conjugate:
THE FOURIER SPECTRUM REMAINS THE SAME I.E.
𝐹𝑡 (𝑢, 𝑣) = 𝐹(𝑢, 𝑣) If 𝑓 𝑥, 𝑦 𝑖𝑠 a real valued function Then
𝐹 𝑢, 𝑣 = 𝐹 ∗ −𝑢, −𝑣
SIMILARLY FOR INVERSE TRANSFORM
2𝜋
−1 𝑗 (𝑢 𝑥+𝑣0 𝑦) And the Fourier Spectrum is
𝐹 𝐹 𝑢 − 𝑢0 , 𝑣 − 𝑣0 = 𝑓 𝑥, 𝑦 . 𝑒 𝑁 0
𝐹(𝑢, 𝑣) = 𝐹(−𝑢, −𝑣)
48 PROPERTIES OF DFT ➢Distributivity:

➢Rotation:
𝐹 𝑓1 𝑥, 𝑦 + 𝑓2 𝑥, 𝑦 = 𝐹 𝑓1 𝑥, 𝑦 + 𝐹 𝑓2 𝑥, 𝑦
To explain rotation property we consider the polar But
coordinate system i.e. 𝐹 𝑓1 𝑥, 𝑦 . 𝑓2 𝑥, 𝑦 ≠ 𝐹 𝑓1 𝑥, 𝑦 . 𝐹 𝑓2 𝑥, 𝑦
So, the distributivity property says that both DFT and IDFT
𝑥 = 𝑟𝑐𝑜𝑠𝜃 𝑎𝑛𝑑 𝑦 = 𝑟𝑠𝑖𝑛𝜃
are distributive over addition operation but not distributive
𝑢 = ω𝑐𝑜𝑠∅ 𝑎𝑛𝑑 𝑣 = ω𝑠𝑖𝑛∅
over multiplication operation.
So, 𝑓 𝑥, 𝑦 → 𝑓 𝑟, 𝜃 𝑎𝑛𝑑 𝐹(𝑢, 𝑣) → 𝐹(𝜔, ∅) ➢Scaling:
If the Fourier transform is given as If there are scalar quantities 𝑎, 𝑏

𝑓 𝑟, 𝜃 = 𝐹 𝜔, ∅ Then as per scaling property,


A. 𝑓 𝑥, 𝑦 = 𝑎. 𝐹(𝑢, 𝑣)
Then by rotation property And
1 𝑢 𝑣
𝑓 𝑟, 𝜃 + 𝜃0 = 𝐹(𝜔, ∅ + 𝜃0 ) 𝑓 𝑎𝑥, 𝑏𝑦 = 𝐹( , )
𝑎𝑏 𝑎 𝑏
49 PROPERTIES OF DFT
➢Convolution: ➢Average:
The average is given as:
𝑓1 𝑥, 𝑦 . 𝑓2 𝑥, 𝑦 ↔ 𝐹1 𝑢, 𝑣 ∗ 𝐹2 𝑢, 𝑣 𝑁−1 𝑁−1
1
ҧ
𝑓 𝑥, 𝑦 = 2 ෍ ෍ 𝑓(𝑥, 𝑦)
and 𝑁
𝑥=0 𝑦=0
𝑓1 𝑥, 𝑦 ∗ 𝑓2 𝑥, 𝑦 ↔ 𝐹1 𝑢, 𝑣 . 𝐹2 𝑢, 𝑣
We know that,
𝑁−1 𝑁−1
1
➢Correlation: 𝐹 0,0 = ෍ ෍ 𝑓(𝑥, 𝑦)
𝑁
𝑥=0 𝑦=0
𝑓1 𝑥, 𝑦 𝜊 𝑓2 𝑥, 𝑦 ↔ 𝐹 ∗1 𝑢, 𝑣 . 𝐹2 𝑢, 𝑣
So, the average can be given as:
and 1
𝑓 ∗1 𝑥, 𝑦 . 𝑓2 𝑥, 𝑦 ↔ 𝐹1 𝑢, 𝑣 𝜊 𝐹2 𝑢, 𝑣 𝑓 ҧ 𝑥, 𝑦 = 𝐹(0,0)
𝑁
50 DISCRETE COSINE TRANSFORM
➢A cosine transform of a two dimensional square ➢Hence DCT is separable as well as symmetric.
digital image 𝑓(𝑥, 𝑦) of size 𝑁 × 𝑁 can be Here
represented as:
𝑁−1 𝑁−1
1
𝐶 𝑢, 𝑣 = ෍ ෍ 𝑓 𝑥, 𝑦 . 𝑔(𝑥, 𝑦, 𝑢, 𝑣) 𝑢, 𝑣 = 0
𝑥=0 𝑦=0 𝑁
Here
𝛼 𝑢 =𝛼 𝑣 =
2
𝑢, 𝑣 = 1,2, … , 𝑁 − 1
𝑔 𝑥, 𝑦, 𝑢, 𝑣 = ℎ 𝑥, 𝑦, 𝑢, 𝑣 𝑁
2𝑥 + 1 𝑢𝜋 2𝑦 + 1 𝑣𝜋
= 𝛼 𝑢 . 𝛼 𝑣 . 𝑐𝑜𝑠 . 𝑐𝑜𝑠
2𝑁 2𝑁
51 DISCRETE COSINE TRANSFORM

➢A discrete cosine transform of a two dimensional square digital image 𝑓(𝑥, 𝑦) of size 𝑁 × 𝑁 can
be represented as:
𝑁−1 𝑁−1
2𝑥 + 1 𝑢𝜋 2𝑦 + 1 𝑣𝜋
𝐶 𝑢, 𝑣 = 𝛼 𝑢 . 𝛼 𝑣 ෍ ෍ 𝑓 𝑥, 𝑦 . 𝑐𝑜𝑠 . 𝑐𝑜𝑠
2𝑁 2𝑁
𝑥=0 𝑦=0

Here, 𝑢, 𝑣 = 0,1, … , 𝑁 − 1
➢And inverse DCT can be given as:

𝑁−1 𝑁−1
2𝑥 + 1 𝑢𝜋 2𝑦 + 1 𝑣𝜋
𝑓 𝑥, 𝑦 = ෍ ෍ 𝛼 𝑢 . 𝛼 𝑣 𝐶 𝑢, 𝑣 . 𝑐𝑜𝑠 . 𝑐𝑜𝑠
2𝑁 2𝑁
𝑢=0 𝑣=0

Here, x, y = 0,1, … , 𝑁 − 1
52 OUTPUT OF DCT
Original Image Transformed Image

DCT BASIS IMAGES


➢1-D inverse walsh transform kernel can be
53 WALSH TRANSFORM represented as:
➢1-D walsh transform kernel can be represented as: 𝑛−1

𝑛−1 ℎ 𝑥, 𝑢 = ෑ(−1)𝑏𝑖 (𝑥)𝑏𝑛−1−𝑖 (𝑢)


1 𝑖=0
𝑔 𝑥, 𝑢 = ෑ(−1)𝑏𝑖 (𝑥)𝑏𝑛−1−𝑖 (𝑢)
𝑁
𝑖=0 Here
Here 𝑁 = 𝑛𝑜. 𝑜𝑓 𝑠𝑎𝑚𝑝𝑙𝑒𝑠
𝑁 = 𝑛𝑜. 𝑜𝑓 𝑠𝑎𝑚𝑝𝑙𝑒𝑠 𝑛 = 𝑛𝑜. 𝑜𝑓 𝑏𝑖𝑡𝑠 𝑛𝑒𝑒𝑑𝑒𝑑 𝑡𝑜 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡 𝑥 𝑎𝑠 𝑤𝑒𝑙𝑙 𝑎𝑠 𝑢
𝑛 = 𝑛𝑜. 𝑜𝑓 𝑏𝑖𝑡𝑠 𝑛𝑒𝑒𝑑𝑒𝑑 𝑡𝑜 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡 𝑥 𝑎𝑠 𝑤𝑒𝑙𝑙 𝑎𝑠 𝑢 And 𝑏𝑘 𝑧 = 𝑘 𝑡ℎ 𝑏𝑖𝑡 𝑖𝑛 𝑏𝑖𝑛𝑎𝑟𝑦 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑧
And 𝑏𝑘 𝑧 = 𝑘 𝑡ℎ 𝑏𝑖𝑡 𝑖𝑛 𝑏𝑖𝑛𝑎𝑟𝑦 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑧 ➢So the 1-D inverse walsh transform can be
➢So the 1-d walsh transform can be determined by: determined by:
𝑁−1 𝑛−1 𝑁−1 𝑛−1
1
𝑊 𝑢 = ෍ 𝑓 𝑥 . ෑ(−1)𝑏𝑖 (𝑥)𝑏𝑛−1−𝑖 (𝑢) 𝑓 𝑥 = ෍ 𝑊 𝑢 . ෑ(−1)𝑏𝑖 (𝑥)𝑏𝑛−1−𝑖 (𝑢)
𝑁 𝑢=0 𝑖=0
𝑥=0 𝑖=0
54 WALSH TRANSFORM
➢Similarly 2-D walsh transform kernel can be represented as:
𝑁−1 𝑁−1 𝑛−1
1
𝑊 𝑢, 𝑣 = ෍ ෍ 𝑓(𝑥, 𝑦) ෑ(−1) 𝑏𝑖 𝑥 𝑏𝑛−1−𝑖 𝑢 +𝑏𝑖 𝑦 𝑏𝑛−1−𝑖 𝑣
𝑁
𝑥=0 𝑦=0 𝑖=0

➢2-D inverse walsh transform can be determined by:


𝑁−1 𝑁−1 𝑛−1

𝑓 𝑥, 𝑦 = ෍ ෍ 𝑊(𝑢, 𝑣) ෑ(−1) 𝑏𝑖 𝑥 𝑏𝑛−1−𝑖 𝑢 +𝑏𝑖 𝑦 𝑏𝑛−1−𝑖 𝑣

𝑢=0 𝑣=0 𝑖=0


55 WALSH TRANSFORM Original Image Transformed Image
56 APPLICATIONS OF WALSH TRANSFORM

➢Power spectrum analysis


➢Filtering
➢Speech processing
➢Medical signals
➢Multiplexing and coding in communication
➢Logical design and analysis
➢Solving non linear differential equations
57 HADAMARD TRANSFORM ➢1-D inverse hadamard transform kernel can be
➢1-D hadamard transform kernel can be represented represented as:
as: 𝑛−1
ℎ 𝑥, 𝑢 = (−1)σ𝑖−0 𝑏𝑖 (𝑥)𝑏𝑖 (𝑢)
1 𝑛−1
𝑔 𝑥, 𝑢 = (−1)σ𝑖−0 𝑏𝑖 (𝑥)𝑏𝑖 (𝑢) Here
𝑁
𝑁 = 2𝑛
Here
𝑛 = 𝑛𝑜. 𝑜𝑓 𝑏𝑖𝑡𝑠 𝑛𝑒𝑒𝑑𝑒𝑑 𝑡𝑜 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡 𝑥 𝑎𝑠 𝑤𝑒𝑙𝑙 𝑎𝑠 𝑢
𝑁 = 2𝑛
𝑡ℎ
𝑛 = 𝑛𝑜. 𝑜𝑓 𝑏𝑖𝑡𝑠 𝑛𝑒𝑒𝑑𝑒𝑑 𝑡𝑜 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡 𝑥 𝑎𝑠 𝑤𝑒𝑙𝑙 𝑎𝑠 𝑢 And 𝑏𝑘 𝑧 = 𝑘 𝑏𝑖𝑡 𝑖𝑛 𝑏𝑖𝑛𝑎𝑟𝑦 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑧
And 𝑏𝑘 𝑧 = 𝑘 𝑡ℎ 𝑏𝑖𝑡 𝑖𝑛 𝑏𝑖𝑛𝑎𝑟𝑦 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑧 ➢So the 1-D inverse hadamard transform can be
determined by:
➢So the 1-D hadamard transform can be determined
𝑁−1
by: 𝑛−1
𝑓 𝑥 = ෍ 𝐻 𝑢 . (−1)σ𝑖−0 𝑏𝑖 (𝑥)𝑏𝑖 (𝑢)
𝑁−1
1 σ𝑛−1
𝑢=0
𝐻 𝑢 = ෍ 𝑓 𝑥 . (−1) 𝑖−0 𝑏𝑖 (𝑥)𝑏𝑖 (𝑢)
𝑁
𝑥=0
58 HADAMARD TRANSFORM
➢Similarly 2-D hadamard transform kernel can be represented as:
𝑁−1 𝑁−1
1 σ𝑛−1
𝐻 𝑢, 𝑣 = ෍ ෍ 𝑓 𝑥, 𝑦 . (−1) 𝑖=0 𝑏𝑖 𝑥 𝑏𝑖 𝑢 +𝑏𝑖 𝑦 𝑏𝑖 𝑣
𝑁
𝑥=0 𝑦=0

➢2-D inverse hadamard transform can be determined by:


𝑁−1 𝑁−1
σ𝑛−1
𝑓 𝑥, 𝑦 = ෍ ෍ 𝐻(𝑢, 𝑣) . (−1) 𝑖=0 𝑏𝑖 𝑥 𝑏𝑖 𝑢 +𝑏𝑖 𝑦 𝑏𝑖 𝑣
𝑢=0 𝑣=0
59 HADAMARD TRANSFORM
Hadamard Matrix: Applications:
➢Basic hadamard matrix is given as: ➢Signal processing
➢Data compression
1 1 ➢Data encryption
𝐻2 =
1 −1
➢In many scientific methods like mass
And higher hadamard matrix is given as:
spectroscopy, crystallography etc
𝐻2 𝐻2
𝐻4 =
𝐻2 −𝐻2

Generalised hadamard matrix is given as:


𝐻𝑁 𝐻𝑁
𝐻2𝑁 =
𝐻𝑁 −𝐻𝑁
60 STUDY MATERIAL
Textbooks:
➢ Gonzalez, Rafael C, “Digital image processing”, Pearson
Education India, 2009.
➢ Schalkoff, Robert J, “Digital image processing and
computer vision”, WileyNew York, 1989.
➢ Jain, Anil K, “Fundamentals of digital image processing”,
Prentice-Hall, Inc., 1989.

NPTEL Video Lecture link:


➢ https://archive.nptel.ac.in/courses/117/105/117105079/
THANK YOU !

You might also like