Uploaded by Amrutha T D

DIGITAL IMAGE PROCESSING

advertisement
Module II(8 Hrs)
Review of matrix theory, row and column ordering- Toeplitz,
Circulant and block matrix,
2D transforms - DFT, its properties, Walsh transform, Hadamard
transform, Haar transform,
DCT, KL transform and Singular Value Decomposition.
Matrix theory
Vectors and matrices:
- Both 1 d and 2 D can be represented as vectors
and matrices
- U(n) = u(1)
u(2)
.
.
- The nth element of the vector u is denoted by
u(n)
- A column vector of size N is also called an Nx1
vector
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
-
a matrix A of size MxN has
M rows and N columns.
N
U
T
K
N
I
.
S
..... TaE
(1, N ) 
O
a (1,2)
 a(1,1)
A = a(m,n)= a(2,1) a(2,2) ...... a (2, N ) 

..
...
...
... 


a
(
M
,
1
)
a
(
M
,
2
)
.....
a
(
M
,
N
)


Downloaded from Ktunotes.in
Row and column ordering:
- xT
T
  x(1,1) x(1,2).....x(1, N ) x(2,1)....x(2, N ).....x( M ,1)....x( M , N )
-for 1 to 1 mapping this is called as a lexicographic or dictionary ordering
N
I
.
S
E
- X is row vector got by stacking each
row
one after another
T
O
N
U
T
K
- Column ordered vector is got by stacking column by column.
T
xT
  x(1,1) x(2,1).....x( M ,1) x(1,2)....x( M ,2)....x(1, M ).....x( M , N )
Downloaded from Ktunotes.in
T
Transposition and conjugate rules:
-
 
T *
A  A
*T
N
I
.
S
T
T T OTE
 AB KBTUAN
A   A 
T 1
1 T
 AB
*
AB
*
*
Downloaded from Ktunotes.in
Toeplitz and circulant matrix
- A Toeplitz matrix T is a matrix that has constant
elements along the diagonal and the sub
diagonals.
- A Toeplitz matrix is an n xn matrix Tn = [tk,j; k, j =
0, 1, . . . , n − 1]where tk,j = tk−j , i.e., a matrix of
the form
N
I
.
S
OTE
N
U
T
Kt0 t1
t1
t2
t n 1
t0
t1
t  2 ...............t ( n 1)
t 1
t0
t0
Downloaded from Ktunotes.in
- circulant matrix is a special kind of Toeplitz matrix where
each row vector is rotated one element to the right relative to
the preceding row vector.
-
Each of its rows is a circular shift of the previous row
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Show each of the following:
a. A circulant matrix is Toeplitz but the converse is not true
b. The product of 2 circulant matrices is a circulant matrix
c. The product of 2 Toeplitz matrices need not be Toeplitz.
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Orthognal and unitary matrix:
An orthognal matrix is such that its inverse is equal to its
transpose
A is orthognal if
A-1 =A T
N
U
T
K
N
I
.
S
OTE
Or
ATA=AAT=I
Downloaded from Ktunotes.in
• A matrix is called unitary matrix if ts inverse is equal to its
conjugate transpose
A-1= A*T
OR
AA*T-A*TA=I
N
U
T
K
N
I
.
S
OTE
A real orthognal matrix is also unitary but a unitary
matrix need not be orthognal
Downloaded from Ktunotes.in
Problem
1. consider matrices below and check for orthognality and unitary
1
1 1
A
[
]IN
S
1.
2 1OT
E
N
U
T
K2
j
B [
]
 j
2
j
1 1
c 
[
]
1
2 j
Downloaded from Ktunotes.in
Block matrix
-
A matrix whose elements are matrices are called block
matrix
 P11
P
 P21
 1 1
P11  

1
1


P12 
P22 
N
I
.
S
OTE
mxn
N
U
T
K P  2
12
pxq
2
 2 2


 3 3
P 21  

3
3


 4 4
P 22  

 4 4
Downloaded from Ktunotes.in
- Therefore P is a mxn block matrix with basic dimension pxq.
- If block structure is toeplitz or circulant it is called a block
toeplitz or block circulant.
- if each bolck itself is toeplitz or circulant then we have the
doubly block toeplitz or doubly block circulant.
Kronecker Product:
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Problem
A= 1 1
1 -1
B= 1 3
N
I
.
3 4
S
E
T
O
N
U
T
K product of A and B as well
Find kronecker
as B and A , Are they equal
Ans: They are not equal .A kronecker B is
not equal to B kronecker A
Downloaded from Ktunotes.in




Image Transforms
Image Transforms are used for image processing and image
analysis.
Transform is a mathematical tool for moving from one domain
to another for performing task in a easy manner.
Image transforms are useful for fast computation of
convolution and correlation.
By using transforms the signals are represented as a set of
basis function
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Need for transforms
 Mathematical convenience:
convolution in time domain is multiplication in frequency
domain
 To Extract more information:
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
• What does image transform do
– It represents a given image as a series
summation of a set of unitary matrices
N
I
– A matrix A is a unitary
matrix
if
.
A A
S
E
T
O
N
KTU
1
1
*T
A A
*T
– A* is the conjugate of A
Downloaded from Ktunotes.in
Walsh transform
• The basic kernel function of 1D walsh transform is given by
1 N 1
g (m, k )  ( )  (1) bi ( m )bn 1i ( k )
N i 0
IN
.
S
E
NOT
• WT[x(m)] =
KTU 1
X (K ) 
N 1
x(m) g (m, k )

N
m 0
• n represents no of bits to represent a number and bi(n) rep the i th
bit of the binary value(from LSB) and n=log 2N
Downloaded from Ktunotes.in
• Inverse walsh transform
N 1
WT-1[X(K)] =x(m)=
 X ( K )h(m, k )
K 0
2D walsh Transform
N
I
.
S
OTE
N
U
T
K N 1 N 1
1
X ( K , L) 
N
  x(m, n) g (m, k , n, l )
n 0
m 0
1 N 1
bi ( m ) bn 1 i ( k ) 
g (m, k , n, l )  ( )  (1)
N i 0
Downloaded from Ktunotes.in
bi ( n ) bn 1 i ( l )
Inverse 2D walsh Transform
N 1 N 1
x(m, n)   X ( K )Eh(Sm.I,Nn, k , l )
T
O
N
K  0K
LT
 0U
N 1
h(m, n, k , l )   (1)
bi ( m ) bn 1 i ( k )  bi ( n ) bn 1 i ( l )
i 0
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Hadamard matrix
• Hadamard matrices seem such simple matrix structures: they
are square, have entries +1 or −1 and have orthogonal row
vectors and orthogonal column vectors.
• A square matrix with elements ±1 and size h, whose distinct
row vectors are mutually orthogonal, is referred to as an
Hadamard matrix of order h.
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Hadamard Matrices
• The order N=2 hadamard matrix is
given by
1 1
H2  

1

1


N
I
.
S
OTE
N
U
T
K matrix of order 2N
• The Hadamard
can be generated by kronecker
product operation
 HN HN 
H 2N  

 HN  HN 
Downloaded from Ktunotes.in
• Substituting N=2
 H 2 H 2
H4  

H
2
H
2


N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Haar Transform
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
• Develop hadamard for f(x)={1,2,0,3}------1D
• HT for 1D : F=H.f
=
1 1 1 1
 1  1 1  1


 1 1  1  1


1

1

1
1


N
U
T
K
=
 1
 2
 
 0
N
I
.
S
OT E
 3
 6
  4


 0


 2
Downloaded from Ktunotes.in
• Develop Hadamard for 2D
 2
1

 2

1
1 2 1
2 3 2
N
I
3 4 3
.
S
E
T

O
N
U
2
3
2
T

K
• 2D HT : F=H.f.HT =H.f.H
Ans:
2  6  6
2 2
2 
 6 2 2
2



6
2
2
2


 34
 2

Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Discrete Cosine Transform
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Karhunen –Loeve Transform
 This transform also called as Hotelling Transform.
 KL transform is a reversible linear transform hat exploits statistical
properties of a vector representation
 The basic functions of KL transforms are orthogonal eigen vectors
of the covariance matrix of a data set
 After a KL transform , most of the energy of the transform
coefficients are concentrated within the first few components.
Drawbacks of KL transform:
 It is input dependent and the basic function has to be calculated for
each signal model in which it is operated.
 KL transform require O(m2) multiply / add operations .The DFT and
DCT require O(log2m) multiplications.
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Applications of KL transform:
 Clustering Analysis: to determine the new coordinates for the
sample data where largest covariance lies on the first axis and
next largest on the next axis and so on, and therefore used for
dimensionality reduction.
 Image compression
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Singular value decomposition(SVD)
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
N
U
T
K
N
I
.
S
OTE
Downloaded from Ktunotes.in
Download