DIP Image Transforms
description
Transcript of DIP Image Transforms
![Page 1: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/1.jpg)
Image Transforms
Refers to a class of unitary matrices used for representing images
![Page 2: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/2.jpg)
Unitary TransformsUnitary Transforms• Unitary Transformation for 1-Dim. Sequence
– Series representation of
– Basis vectors :
– Energy conservation :
}10),({ Nnnu
1
0
10),(),()(N
n
NknunkakvAuv
) ( *1 matrixunitaryAAwhere T
1
0
** 10),(),()(N
n
NnkvnkanuA vu
TNnnka }10),,({ * *ka
22 |||||||| uvuv A
)|||||)(||)(||||| ( 21
0
2*1
0
22 uuuuuv T*T*
N
n
TN
k
nuAAkv
Here is the proof
![Page 3: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/3.jpg)
• Unitary Transformation for 2-Dim. SequenceUnitary Transformation for 2-Dim. Sequence– Separable Unitary Transforms
• separable transform reduces the number of multiplications and additions from to
– Energy conservation
)()(),(, nbmanma lklk
Tl
N
m
N
nk AUAVnanmumalkv
)(),()(),(1
0
1
0
***1
0
1
0
* )(),()(),( VAAUnalkvmanmu Tl
N
k
N
lk
)( 4NO )( 3NO
1
0
1
0
21
0
1
0
2 |),(||),(|N
k
N
l
N
m
N
n
lkvnmu
![Page 4: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/4.jpg)
1,N0,1,nwkvN
nu
1,N0,1,kwnuN
kv
ew
Nkwnuv(k)
,N-10,1,2,nn
N
k
knN
N
n
knN
jN
N
n
knN
N
,)(1
)(
,)(1
)(
ansformunitary tr be oproperly t scalednot
where
1,,1,0)(
is , of DFT The
1
0
1
0
1
0
2
)u(
Discrete Fourier Transform (DFT)Discrete Fourier Transform (DFT)
New notation
![Page 5: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/5.jpg)
allymathematic handle easy to
11
)3(
)2(
)1(
)0(
1
1
1
1111
2
1
)3(
)2(
)1(
)0(
For
2
14
24
34
24
04
24
34
24
14
knjknN
NeN
wN
u
u
u
u
www
www
www
v
v
v
v
4N
F
uFv
![Page 6: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/6.jpg)
NNNN
and
NnmwwlkvN
nmu
NlkwwnmuN
lkv
N
k
N
l
lnN
kmN
N
m
N
n
lnN
kmN
2
*
1
0
1
0
1
0
1
0
log2 DFT D-1 2separable.2
where
notation spacevector
since.1
1,0,),(1
),(
1,0,),(1
),(
is DFTunitary D2
O
FF
vuuv
VFFU
FFFUFV**
t
F
FF
2-D DFT2-D DFT
![Page 7: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/7.jpg)
• 2-Dim. DFT (cont.)– example
image Lena 512512 a of DFT dim2
(a) Original Image (b) Magnitude (c) Phase
![Page 8: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/8.jpg)
• 2-Dim. DFT (cont.) – Properties of 2D DFT
• SeparabilitySeparability
1,,0, ,),(11
),(1
0
1
0
NlkWnmfN
WN
lkFN
m
N
n
lnN
kmN
1,,0 ,),(11
),(1
0
1
0
Nm,nWlkFN
WN
nmfN
k
N
l
lnN
kmN
![Page 9: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/9.jpg)
• 2-Dim. DFT (cont.) – Properties of 2D DFT (cont.)
• RotationRotation
),(),( 00 Frf
(a) a sample image (b) its spectrum (c) rotated image (d) resulting spectrum
![Page 10: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/10.jpg)
• 2-Dim. DFT (cont.) – Properties of 2D DFT
• Circular convolution and DFTCircular convolution and DFT
• CorrelationCorrelation
p q
C qnpmgqpfnmgnmf ),(),(),(),(
),(*),(),(),(
),(),(),(*),(
lkGlkFnmgnmf
lkGlkFnmgnmf
p q
Cfg qnpmgqpfnmgnmfnmR ),(),(),(),(),( *
),(),(),(),(
),(),(),(),(*
*
lkGlkFnmgnmf
lkGlkFnmgnmf
![Page 11: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/11.jpg)
Category of transformsCategory of transforms
![Page 12: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/12.jpg)
Discrete Discrete Cosine Transform Cosine Transform (DCT)(DCT)
This is DCT
The N point DFT X(k) of a real sequence x(n) is a complex sequence satisfying the symmetry condition X(k)=X*(-K))N For N even ,DFT samples X(0) and X(N-2)/2) are real and distinct.Remaining N-2 samples are complex ,and only half of these samples are distinct and remaining are the complex conjugate of these samples .For N odd,DFT samples X(0) is real,and remaining N-1 samples are comples of which only half of these samples are distinct>There is a redundancy in DFT based frequency domain representation
![Page 13: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/13.jpg)
Discrete Discrete Cosine Transform Cosine Transform (DCT)(DCT)
This is DCT
![Page 14: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/14.jpg)
Discrete Discrete Cosine Transform Cosine Transform (DCT)(DCT)
This is DCT
![Page 15: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/15.jpg)
DCT is an orthogonal transformm so its DCT is an orthogonal transformm so its inverse kernel is the same as forward kernelinverse kernel is the same as forward kernel
This is inverse DCT
![Page 16: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/16.jpg)
![Page 17: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/17.jpg)
DCT can be obtained from DFTDCT can be obtained from DFT
![Page 18: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/18.jpg)
100
1
00
1
001
bygiven ,matrix al tridiagonsymmetric the
of orseigen vect theare DCT theof vectorsbasis 3.The
2-MEPG 1,-MPEG JPEG,
coding transformcompactionenergy excellent .2
.orthogonal and real is DCT 1.The
DCT theof Properties
1
c
c
Q
Q
tCCCC
Properties of DCT: real, Properties of DCT: real, orthogonal, energy-orthogonal, energy-
compacting, compacting, eigenvector-eigenvector-basedbased
![Page 19: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/19.jpg)
120,12
10,
algorithmfast DCT
NnnNx
Nnnxny
!algorithms DCTfast Many
otherwise,0
10,
by from obtained is DCTpoint -N
120,12cos2
12
120,
is DFTpoint 2Then
2
222
22
22
22
2
1
02
121
0
12
0
NkkYwkv
ky
Nknknxe
enNxenx
Nkenyky
N
k
kN
NN
N
N
N
nN
j
knjN
Nn
knjN
n
knjN
n
0 1 2 3 4 5 76 x n( )
y n( )
There are many DCT fast algorithms and hardware There are many DCT fast algorithms and hardware designs.designs.
![Page 20: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/20.jpg)
5.0 that provided KLT, the toclose is DST
algorithmfast
1,0,sin,
10,sin
10,sin
1
111
12
1
01
111
2
1
01
112
2
SSSS
Nnknk
Nnkvnu
Nknukv
T
Nnk
N
N
kN
nkN
N
nN
nkN
Discrete Sine Discrete Sine Transform(DST)Transform(DST)
Similar to DCT.
![Page 21: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/21.jpg)
Walsh TransformWalsh Transform
![Page 22: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/22.jpg)
Here we calculate the matrix of Walsh coefficients
![Page 23: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/23.jpg)
Here we calculate the matrix of Walsh coefficients
![Page 24: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/24.jpg)
Here we calculate the matrix of Walsh coefficients
![Page 25: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/25.jpg)
Here we calculate the matrix of Walsh coefficients
We have We have done it done it earlier in earlier in different different waysways
![Page 26: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/26.jpg)
Symmetry of WalshSymmetry of Walsh
Think about other transforms that you know, are they symmetric?
![Page 27: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/27.jpg)
Two-Dimensional Walsh TransformTwo-Dimensional Walsh Transform
![Page 28: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/28.jpg)
Two-dimensional Walsh
Inverse Two-dimensional Walsh
![Page 29: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/29.jpg)
Properties of Walsh TransformsProperties of Walsh Transforms
![Page 30: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/30.jpg)
Here is the separable 2-Dim Inverse Walsh
![Page 31: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/31.jpg)
Example for N=4
![Page 32: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/32.jpg)
even
odd
![Page 33: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/33.jpg)
Discuss the importance of this figure
![Page 34: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/34.jpg)
HadamardHadamard TransformTransform
We will go quickly through this material since it is very similar to Walsh
![Page 35: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/35.jpg)
![Page 36: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/36.jpg)
separable
![Page 37: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/37.jpg)
Example of calculating Hadamard coefficients – analogous to what was before
![Page 38: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/38.jpg)
![Page 39: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/39.jpg)
![Page 40: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/40.jpg)
![Page 41: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/41.jpg)
![Page 42: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/42.jpg)
![Page 43: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/43.jpg)
![Page 44: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/44.jpg)
![Page 45: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/45.jpg)
Standard Trivial Functions for HadamardStandard Trivial Functions for Hadamard
One change
two changes
![Page 46: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/46.jpg)
![Page 47: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/47.jpg)
2
1
3
0
1111
1111
1111
1111
2
1
sequency
changessignof#
2
1
11
11
2
1
m transforHadamard1)
2
11
11
11
1
H
HH
HHHHH
H
nn
nn
nn
Discrete Walsh-Hadamard Discrete Walsh-Hadamard transformtransform
Now we meet our old friend in a new light again!
![Page 48: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/48.jpg)
Walsh)(1923,function Walsh thesamplingby generated becan also
order Hadamardor natural
5
2
6
1
4
3
7
0
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
8
1
8
1
22
22
3
HH
HHH
sequency
![Page 49: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/49.jpg)
order or Walsh sequency
7
6
5
4
3
2
1
0
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
8
1
sequency
m transforHadamard - Walsh
3
H
![Page 50: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/50.jpg)
![Page 51: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/51.jpg)
algorithmfast3.
tionmultiplicano2.
.1
Properties
22
22
andoftionrepresentabinarytheareandand
log,),(where
)1)((1
)(
)1)((1
)(
1
11
10
11
10
2
1
0
1
0
),(
1
0
),(
HHHH
mmmm
kkkk
mkmk
Nnmkmkb
kvN
mu
muN
kv
t
nn
nn
ii
n
iii
N
k
mkb
N
m
mkb
![Page 52: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/52.jpg)
i(Walshordered)
i(binary)reverseorder
graycode
decimal(Hadamardordered)
01234567
000001010011100101110111
000100010110001101011111
000111011100001110010101
07341625
Relationship between Walsh-ordered Relationship between Walsh-ordered and Hadamard-orderedand Hadamard-ordered
![Page 53: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/53.jpg)
1,,1,0, lettingby obtained is transformHaar
)1,0(forelsewhere 0
222
22
12
),,(
)1,0(,1
),0,0(
21
21
2
2
NmN
mt
t
mt
mN
mt
mN
tmrhaar
tN
thaar
rr
rr
r
r
Nonsinusoidal orthogonal functionNonsinusoidal orthogonal function
• Haar transform– Haar function (1910, Haar) : periodic,
orthonormal, complete
Haar TransformHaar Transform
![Page 54: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/54.jpg)
22000000
00220000
00002200
00000022
22220000
00002222
11111111
11111111
8
1
2200
0022
1111
1111
4
1
8
4
H
H
![Page 55: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/55.jpg)
compactionenergypoorvery3.
vector1for
operations)(algorithm,fast.2
,.1
Properties1
N
NO
HHHH t
![Page 56: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/56.jpg)
Fourier Transform
• ‘Fourier Transform’ transforms one function into another domain , which is called the frequency domain representation of the original function
• The original function is often a function in the Time domain
• In image Processing the original function is in the Spatial Domain
• The term Fourier transform can refer to either the Frequency domain representation of a function or to the process/formula that "transforms" one function into the other.
![Page 57: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/57.jpg)
Our Interest in Fourier Transform
• We will be dealing only with functions (images) of finite duration so we will be interested only in Fourier Transform
![Page 58: DIP Image Transforms](https://reader033.fdocuments.net/reader033/viewer/2022061123/5474e203b4af9f3a118b4593/html5/thumbnails/58.jpg)
Applications of Fourier Transforms
1-D Fourier transforms are used in Signal Processing 2-D Fourier transforms are used in Image Processing 3-D Fourier transforms are used in Computer Vision Applications of Fourier transforms in Image processing: –
– Image enhancement,
– Image restoration,
– Image encoding / decoding,
– Image description