Vous êtes sur la page 1sur 58

Image

Transforms
Refers to a class of unitary matrices used for

representing images
Unitary Transforms
• Unitary Transformation for 1-Dim. Sequence
– Series representation of {u (n),0  n  N  1}
N 1
v  Au  v(k )   a(k , n)u (n), 0  k  N  1
n 0
N 1
u  A* v  u (n)   a* (k , n)v(k ), 0  n  N  1
n 0

where A1  A*T (unitary matrix)

– Basis vectors : a*k  {a * (k , n), 0  n  N  1}T


– Energy conservation :
v  Au  || v ||2 || u ||2 Here is the
proof

N 1 N 1
( || v ||   | v( k ) |  u A Au  u u   | u (n) |2 || u ||2 )
2 2 *T *T *T

k 0 n 0
• Unitary Transformation for 2-Dim. Sequence
– Separable Unitary Transforms
ak ,l (m, n)  ak (m)bl (n)
N 1 N 1
v(k , l )   ak (m)u (m, n)al (n)  V  AUAT
m 0 n 0
N 1 N 1
u (m, n)   ak* (m)v(k , l )al* (n)  U  A*T VA *
k 0 l 0
• separable transform reduces the number of multiplications and
additions from O( N 4 ) to O( N 3 )
– Energy conservation
N 1 N 1 N 1 N 1

 | u (
m 0 n 0
m, n ) | 2
  | v ( k ,
k 0 l 0
l ) | 2
Discrete Fourier Transform (DFT)

The DFT of  u( n) , n  0,1,2, ,N-1 is


N 1
v(k)   u (n) wN
kn
k  0,1, , N  1
n 0
 j 2N
New
where wN  e notation
 not scaled properly to be unitary transform
N 1
1
 u (n)wN ,
kn
v(k )  k  0,1, ,N  1
N n 0
N 1
1
 v(k )wN
 kn
u ( n)  , n  0,1, ,N  1
N k 0
For N  4
 v ( 0)  1 1 1 1  u (0) 
 v(1)  1 w1 w 2 w3   u (1) 
 1 4 4 4    v  Fu
v(2) 2 1 w42 w40 w42  u (2)
   3 2 1  
 v(3)  1 w4 w4 w4  u (3) 
 1 kn   1  j 2N kn 
F wN    e 
 N   N 
 easy to handle mathematically
2-D DFT
2  D unitary DFT is
 1 N 1 N 1


v ( k , l )  
N m 0 n 0
u ( m , n ) w km ln
N wN , 0  k, l  N 1
 N 1 N 1
u (m, n)  1
 
N k 0 l 0
v ( k , l ) w  km ln
N wN , 0  m, n  N  1

1.V  FUF since F  F t


U  F * VF*
vector  space notation
v  Fu and u  F* v
where F  F  F
2.separable  2 N 1 - D DFT  2 NO Nlog 2 N 
• 2-Dim. DFT (cont.)
– example

(a) Original Image (b) Magnitude (c) Phase

2  dim DFT of a 512  512 Lena image


• 2-Dim. DFT (cont.)
– Properties of 2D DFT
• Separability
1 N 1
 1 N 1

F (k , l ) 
N
 W
m0
km
N

 N

n0
f (m, n)W ,
ln
N

k , l  0,  , N  1

 km  1 
N 1 N 1
1
f (m, n)  
N k 0
WN 
 N
 F (k , l )W
l 0
 ln
N
,

m,n  0, , N  1
• 2-Dim. DFT (cont.)
– Properties of 2D DFT (cont.)
• Rotation

f (r ,   0 )  F ( ,    0 )

(a) a sample image (b) its spectrum (c) rotated image (d) resulting spectrum
• 2-Dim. DFT (cont.)
– Properties of 2D DFT
• Circular convolution and DFT
f (m, n)  g (m, n)   f ( p, q) g
p q
C ( m  p, n  q )

f (m, n) * g (m, n)  F (k , l )G (k , l )
f (m, n) g (m, n)  F (k , l ) * G (k , l )
• Correlation
R fg (m, n)  f (m, n)  g (m, n)  
p q
f * ( p, q ) g C ( m  p, n  q )

f (m, n)  g (m, n)  F * (k , l )G (k , l )
f * (m, n) g (m, n)  F (k , l )  G (k , l )
Category of transforms
Discrete Cosine Transform
(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 This is DCT
Discrete Cosine Transform
(DCT)

This is DCT
Discrete Cosine Transform
(DCT)

This is DCT
DCT is an orthogonal transformm so its
inverse kernel is the same as forward kernel

This is inverse
DCT
DCT can be obtained from DFT
orthogonal, energy-
compacting, eigenvector-based
Properties of the DCT
1.The DCT is real and orthogonal.
C  C   C 1  C t

2.excellent energy compaction  transform coding


JPEG, MPEG - 1, MEPG - 2

3.The basis vectors of the DCT are the eigen vectors of


the symmetric tridiagonal matrix Q c , given by
1    0  0 
  1    

Qc   0    0 
 
    1  
 0  0   1   
There are many DCT fast algorithms and hardware
designs. 57
4
3
2
1
()0x
6
yn
DCT fast algorithm
 x n  , 0  n  N  1
y n  
 x 2 N  1  n  , 0  n  2 N  1
Then 2 N  point DFT is
2 N 1
y k    y n e
 j 22N kn
, 0  k  2N 1
n 0
N 1 2 N 1
  x n  e  x 2 N  1  n  e
 j 22N kn  j 22 N kn

n 0 n N
N 1

 2 x n  cos  k  2n  1 ,
 j 22N k
e 2
2N 0  k  2N 1
n 0

 N - point DCT is obtained from y  k  by


w22 N Y  k  , 0  k  N  1
k

v k   
 0 , otherwise

Many fast DCT algorithms!


Discrete Sine
Transform(DST)
 ,
N 1
v k   2
N 2  u n  sin   k 1 n 1
N 1 0  k  N 1
n 0

 ,
N 1
u n  2
N 1  v k  sin   k 1 n 1
N 1 0  n  N 1
k 0

    k , n   2
N 1 sin   k N11n 1 ,  0  k, n  N 1
 S   S  S T  S 1
 fast algorithm
 DST is close to the KLT, provided that   0.5

Similar to DCT.
Walsh Transform
Here we calculate the matrix of Walsh coefficients
Here we calculate the matrix of Walsh coefficients
Here we calculate the matrix of Walsh coefficients
We have
done it
earlier in
different
ways

Here we calculate the matrix of Walsh coefficients


Symmetry of Walsh

Think about other


transforms that you
know, are they
Two-Dimensional Walsh Transform
Two-dimensional Walsh

Inverse Two-dimensional Walsh


Properties of Walsh Transforms
Here is the separable 2-Dim Inverse Walsh
Example for N=4
odd

even
Discuss the importance of this figure
Hadamard Transform

We will go quickly through this


material since it is very similar to
separable
Example of calculating Hadamard coefficients –
analogous to what was before
Standard Trivial Functions for Hadamard

One change

two changes
Discrete Walsh-Hadamard
transform
1) Hadamard transform
1 1 1
H1  1  1
2   Now we meet
 H n 1 H n 1  our old friend
1   in a new light
H n  H n 1  H1 
2 H  again!
 n 1  H n 1 
# of sign changes
 sequency
1 1 1 1 0
 
1 1  1 1  1 3
H2 
2 1 1  1  1 1
 
1  1  1 1 2
sequency
1 1 1 1 1 1 1 1 0
1  1 1 1 1 1 1  1 7

1 1  1 1 1 1 1  1 3
H H2   
H3 
1  2  1 1  1  1 1 1 1 1 1 4
8 H  H  8 1 1 1 1 1 1 1  1 1
 2 2  
1  1 1 1 1 1 1 1 6
1 1  1 1 1 1 1 1 2
 
1  1  1 1 1 1 1  1 5
 natural or Hadamard order
 also can be generated by sampling the Walsh function (1923, Walsh)
 Walsh - Hadamard transform
sequency
1 1 1 1 1 1 1 1 0
1 1 1 1 1 1 1  1 1

1 1 1 1 1 1 1 1 2
 
1 1 1 1 1 1 1 1  1 3
H3 
8 1  1 1 1 1 1 1 1 4
 
1  1 1 1 1 1 1  1 5
1  1 1 1 1 1 1 1 6
 
1  1 1 1 1 1 1  1 7
 sequency or Walsh order
1 N 1
v(k )  
N m 0
u (m)(1) b ( k ,m )

1 N 1
u ( m)  
N k 0
v ( k )( 1) b ( k ,m )

n 1
where b(k , m)   ki mi , n  log 2 N
i 0

and  ki  and  mi  are the binary representation of k and m


k  k0  2k1    2 n 1 k n 1
m  m0  2m1    2 n 1 mn 1

Properties
1. H  H   H t  H 1
2. no multiplication
3. fast algorithm
Relationship between Walsh-ordered
and Hadamard-ordered

i reverse gray decimal


(Walsh i(binary) (Hadamard
ordered) order code ordered)

0 000 000 000 0


1 001 100 111 7
2 010 010 011 3
3 011 110 100 4
4 100 001 001 1
5 101 101 110 6
6 110 011 010 2
7 111 111 101 5
Haar Transform
• Haar transform
– Haar function (1910, Haar) : periodic,
orthonormal, complete
1
haar(0,0, t )  , t  (0,1)
N
 2 2r m 1 m  12
 r
t  r
 r N 2 2
 2 m 2 1
m
haar(r , m, t )  2  t 
 N 2r 2r

 0 elsewhere for t  (0,1)
m
 Haar transform is obtained by letting t  , m  0,1, , N  1
N

Nonsinusoidal orthogonal function


 1 1 1 1 
 1 1 1  1 
1 
H4 
4 2  2 0 0 
 
 0 0 2  2

 1 1 1 1 1 1 1 1 
 1 1 1 1 1 1 1  1 

 2 2  2  2 0 0 0 0 
 
1  0 0 0 0 2 2  2  2
H8 
8 2 2 0 0 0 0 0 0 
 
 0 0 2 2 0 0 0 0 
 0 0 0 0 2 2 0 0 
 
 0 0 0 0 0 0 2  2 
Properties
1. H  H  , H 1  H t
2. fast algorithm, O( N ) operations
for N  1 vector
3. very poor energy compaction
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.
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
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

Vous aimerez peut-être aussi