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

Module 2 Image Transforms

Digital image processing notes
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Module 2 Image Transforms

Digital image processing notes
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

N 1

 v(k) =  a( k ,n )u( n ) , for 0  K  N 1 (1)


n0
T *T
where A1 = A* (unitary)
 T 
This implies , u = A* v
N 1
or, u(n) =  v( k )a* ( k,n ) , for 0n N 1 (2) Equation
k 0
(2) can be viewed as a series representation of sequence u(n) . The columns of
 

T T
A* i.e the vectors a*k  a* ( k ,n ) , 0  n  N  1  are called the “basis vectors” of
A.
The series coefficients v(k) give a representation of original sequence u(n) and are useful in
compression , filtering , feature extraction and other analysis.
Two dimensional Orthogonal and Unitary transforms:
As applied to image processing, a general orthogonal series expansion for an
N  N image is a pair of transformations of the form :
N 1
v(k,l) =   u( m,n )ak ,l ( m,n ) , 0  k ,l  N  1 (3)
m,n  0
N 1
u(m,n) =   v( k ,l )a*k ,l ( m,n ) , 0  m,n  N  1 (4)
k ,l  0
where ak ,l ( m,n ) is called an ” image transform.”
It is a set of complete orthogonal discrete basis functions satisfying the properties:-
N 1
1) Orthonormality:   ak ,l ( m,n )a* / / ( m,n )
k ,l
m,n  0
= δ( k  k ,l  l  )
N 1
k
2) Completeness :   ak ,l ( m,n )ak ,l ( m ,n  )
k ,l  0
= δ( m  m ,n  n  )
The elements v ( k ,l ) are transform coefficients and V  v( k ,l ) is the transformed
image.
The orthonomality property assures that any truncated series expansion of the form
P 1 Q 1
U P,Q ( m,n )   *
 v( k ,l )ak ,l ( m,n ) , for P  N ,
k 0 l 0
QN
will minimize the sum of squares error
N 1 2
σ e2    u( m,n )  U P,Q ( m,n )
m,n  0
where coefficients v( k ,l ) are given by (3).
The completeness property assures that this error will be zero for P  Q  N
Separable Unitary Transforms:
The number of multiplications and additions required to compute transform coefficients
v( k ,l ) in equation(3) is O( N 4 ) . This is too large for practical size images.
If the transform is restricted to be separable,
i.e ak ,l ( m,n )  ak ( m )bl ( n )
 a( k ,m )b( l ,n )
where ak ( m ),k  0( 1 )n  1 ,
and bl ( n ),l  0( 1 N  1 are 1D complete orthogonal sets of basis vectors.
On imposition of completeness and orthonormality properties we can show that A
 a( k ,m ) ,
and B  b( l,n ) are unitary matrices.
T T
i.e AA* = I = AT A* and BB* = I = BT B*
Often one chooses B same as A
N 1
 v( k ,l ) =   a( k ,m )u( m,n )a( l ,n )
m,n  0
T
 V = AU A (5)
N 1
And u( m,n ) =   a* ( k ,m )v( k ,l )a* ( l ,n )
k ,l  0
T
 U = A* V A* (6)
Eqn (5) can be written as V T = A( AU )T
 Eqn (5) can be performed by first transforming each column of U and then
transforming each row of the result to obtain rows of V .
 T
Basis Images : Let a*k denote k th column of A* .
 T
Let us define the matrices A*k ,l  a*k a*l and matrix inner product of two N  N matrices
F and G as
N 1
F ,G =   f ( m,n )g* ( m,n )
m,n  0
Then equ (6) and (5) give a series representation.
N 1
U =   v( k ,l ) A*k ,l
k ,l  0

and v( k ,l ) = u , A*k ,l

Any image U can be expressed as linear combination of N 2 matrices. A*k ,l called


“basis images”.
Therefore any N  N image can be expanded in a series using a complete set of N 2 basis
images.
1 1 1 
1 2 
Example: Let A = U = 
  ;
2 1 1
3 4 
 5 1
Transformed image V = A U AT =  
 2 0 
T
And Basis images are found as outer product of columns of A* i.e
1  1
A*0 ,0 =   (1 1)
2  1
1 1
A*0,1 =   (1 1)
2 1
1 1 1 *T
=   = A1,0
2 1 1
1  1 1  1
A*11
, =      (1 1)
2  1 1   1 
The inverse transformation
T 1 1 1   5 1  1 1 
A* V A* =    
2 1 1  2 0   1 1
1 2
=   =U
3 4

13. Explain the2-D DFT transformations


The two dimensional Discrete Fourier Transform (2-D DFT)
If f ( x , y ) is an M  N array, such as that obtained by sampling a continuous function of
two dimensions at dimensions M and N on a rectangular grid, then its two dimensional
Discrete Fourier transform (DFT) is the array given by
1 M 1 N 1
F (u , v)    f ( x, y )e  j 2 (ux / M  vy / N )
MN x 0 y 0
u  0, , M  1 , v  0, , N  1
and the inverse DFT (IDFT) is
M 1 N 1
f ( x , y )    F ( u, v )e j 2 ( ux / M  vy / N )
u 0 v  0
When images are sampled in a square array, M  N and
1 N 1 N 1  j 2 ( ux  vy )/ N
F ( u, v )    f ( x , y )e
N x 0 y 0
1 N 1 N 1 j 2 ( ux  vy )/ N
f ( x, y )    F ( u, v )e
N u 0 v  0
It is straightforward to prove that the two dimensional Discrete Fourier Transform is
separable, symmetric and unitary.
14. Explain in detail the discrete Cosine Transform (DCT) and also explain its
properties.
The N X N cosine transform matrix C = {c (K, n)}, also called the discrete cosine transform
(DCT), is defined as

 1 
 , k  0, 0  n  N  1 
 N 
C (k,n) =  
 2 (2n  1)k 
cos , 1  k  N  1,0  n  N  1
 N 2N 

The one dimensional DCT of a sequence {u (n), 0  n  N-1} is defined as

N1
 (2n  1)k 
 (k) = (k)  u (n) cos 
n 0 2N ,

0  k  N 1

Where
1 2
(0) ,  (k) for 1  k  N  1
N N
The inverse transformation is given by
N1
 (2n  1)k 
U (n) =  (k)(k) cos  , 0  n  N 1
k 0  2N 
The two-dimensional cosine transform pair is obtained by substituting A = A* = C
in (5.11) and (5.12). The basis images of the 8 x 8 two-dimensional cosine transform are
shown in figures shows examples of the cosine transform of different images.
Properties of the Cosine Transform
1. The cosine transform is real and orthogonal, that is, C = C*  C-1 = CT
2. The cosine transform is not the real part of the unitary DFT. This can be seen by
inspection of C and the DFT matrix F. (Also see Problem) However, the cosine transform
of a sequence is related to the DFT of its symmetric extension (see Problem)
3. The cosine transform is a fast transform. The cosine transform of a vector of N elements
can be calculated in O (N log2N) operations via an N-point FFT [19]. To show this we
define a new sequence u (n) by reordering the even and odd elements of u (n) as
- 
u (n)  u (2n)   N
 , 0  n    1
u (N  n  1)  u (2n 1)  2

Now, we split the summation term in into even and odd terms and use to obtain.

(N / 2)1  (4n  1)k  


  u (2n) cos  2N  
 n 0   
 (k) = (k)  (N / 2)1 
  (4n  3)k 
 
u(2n  1) cos  
n 0  2N 
(N / 2) 1   (4n  1)k  
  u (n) cos  2N   
 n 0  
(k)  (N / 2) 1 


 (4n  3)k 
 
u (N  n  1) cos  
n 0  2N 
Changing the index of summation in the second term to n’ = N –n – 1 and combining terms,
we obtain
N1 
 (4n  1)k 
 (k)   (k)  u (n) cos  
n 0  2N 
 N1

Re  (K)e  jk / 2N u(n)e  j2 kn / N   Re (k)W 2Nk / 2DFT{u(n)}N 
 n 0 
Which proves the previously stated result For inverse cosine transform we write for even
data points as
 N1 

u(2n)  u(2n) Re   (k)(k)e j / 2N  e j2 nk / N ,
 k 0 
 N
0  n    1
 2
The odd data points are obtained by nothing that
N
U (2n + 1) = u [2(n – 1 – n)], 0  n    - 1
2
Therefore, if we calculate the N-point inverse FFT of the sequence  (k)  (k) exp
(jk/2N), we can also obtain the inverse DCT in O (N log N) operations. Direct algorithms
that do not require FFT as an intermediate step, so that complex arithmetic is avoided, are
also possible [18]. The computational complexity of the direct as well as the FFT based
methods is about the same.
4. The cosine transform has excellent energy compaction for highly correlated data. This is
due to the following properties.
5. The basis vectors of the cosine transform (that is, rows of C) are the eigenvectors of the
symmetric tridiagonal matrix Qc, defined as
 1    0 
 
Qc    1 1  
 
 0  1  
6. The N X N cosine transform is very close to the KL transform of a first-order stationary
Markov sequence of length N whose covariance matrix is given by when the correlation
parameter  is close to 1. The reason is that R-1 is a symmetric tridiagonal matrix, which for
a scalar 2 (1  2 ) /(1  2 ) and   /(1  2 ) satisfies the relation
 1    0 
2 1
 
 R    1 1  
 
 0  1   
This gives the approximation 2 R-1  QC for   1
Hence the eigenvectors of R and the eigenvectors of Qc, that is, the cosine transform,
will be quite close. These aspects are considered in greater depth in Section on sinusoidal
transforms.
This property of the cosine transform together with the fact that it is a fast transform
has made it a useful substitute for the KL transform of highly correlated first order Markov
sequences.

You might also like