Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Image Transforms: DFT-Properties, Walsh, Hadamard, Discrete Cosine, Haar and Slant Transforms The Hotelling Transform

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 25

Image Transforms

DFT- Properties, Walsh, Hadamard,


Discrete cosine, Haar and Slant
transforms; The Hotelling Transform
What is a Transform and
Why Do we Need One ?
 Transform: A mathematical operation that takes a
function or sequence and maps it into another one.
 Transforms are useful because…
 The transform of a function may give additional /hidden
information about the original function, which may not
be available /obvious otherwise
 The transform of an equation may be easier to solve
than the original equation
 The transform of a function/sequence may require less
storage, hence provide data compression / reduction
 An operation may be easier to apply on the transformed
function, rather than the original function.
1-D Fourier Transform
The 1-D Fourier Transform is defined as


 i 2 u  x
F(u )   f( x)  e dx

Interpretation:
The input signal f (x) is multiplied with the basis function. For each value of
u, we get a value depending on the correlation between the two signals. Or in
other words what amount of the basis function is contained in f (x), the input
signal. If the two signals match we get a larger Fourier component or
coefficient and if not, we get a smaller component.
How FT Work
Cont.
 Or the other interpretation is we are representing the input signal as a
weighted sum of the basis functions


i 2 u  x
f ( x)  F (u )  e du


 In the Fourier representation we are representing the signals as a sum of


weighted sinusoids. So we are extracting the frequency components
present in the signal and the strength of each frequency component
present in the signal is given by the corresponding Fourier coefficients.
 Different transforms use different basis functions to extract different
features from the signal.
Basis Functions
 So how to choose the basis functions?
 Choose a set of basis functions which can
extract the features, which we are interested
in so that we can extract the features from
any signal of interest.
 But we cannot make a set of basis functions
as we want.
 Then what are the conditions that are to be
satisfied by the basis functions?
Basis Functions - Conditions
 The conditions to be satisfied by the set of basis is
that, the functions should

 Span the space

 Be linearly independent.
2-D Fourier Transform
 Two-Dimensional Fourier Transform:

 i 2 (ux  vy )
F(u , v)   f ( x , y )  e dxdy

 Two-Dimensional Inverse Fourier Transform:


 i 2 (ux  vy )
f ( x, y )   F(u , v )  e dudv

2-D DISCRETE FOURIER
TRANSFORM
1-D DFT
 The 1-D DFT equation is given by

N 1  j 2kn
X ( k )   x ( n) e N
k = 0, 1. . . . .N-1
n 0

 Where x (n) is the input signal and X (k) are the


DFT coefficients.
DFT in Matrix form
 Now we can represent the same equation in the
matrix form where the input and output
matrices can be represented as column matrices
and the transformation matrix will be an NxN
square matrix.
 x(0)   X (1) 
 x(1)   X (2) 
   
x(n)  .  X (k )  . 
   
 .   . 
 x( N  1)  X ( N  1)
DFT in Matrix form Cont.
 If we take
 WN = e -j2π/N

The transformation matrix can be written as

 1 1 . . 1 
 1 WN1 . . WNN 1 

WN   . . . . . 
 
 . . . . . 
 1 WNN 1 . . WN( N 1)( N 1) 
1-D DFT eg.
 Consider an input sequence having 4 samples x (n) = {x(0),
x(1), x(2), x(3)}
 After computation of DFT we will get 4 DFT coefficients.
 The transformation matrix is

1 1 1 1
1  j  1 j 
W4   
1  1 1  1 
 
1 j  1  j 
1-D DFT eg.
 Each row of the Transformation matrix
represents the 4 basis vectors and the
component along each of the basis vector is
calculated by finding the dot product. Or
projecting the input signal to each of the
basis functions.
 For eg. If x (n) = {1,2,2,1}
1-D DFT eg.
 X (k) = x (n) W4
= [ 1 2 2 1] 1 1 1 1
1  j  1 j 
 
1  1 1  1 
 
1 j  1  j 

=[6 -1-j 0 -1+j]


2-D DFT
 The 2-D DFT equation is given by

N1 1 N 2 1  j 2k1n1  j 2k 2 n2

X (k1 , k 2 )    x(n , n ) e
n1 0 n 2  0
1 2
N1
e N2

Where x (n1,n2) is an N1xN2 2-D function and X(k1,k2)


are the 2-D DFT coefficients.
Basis Images
 Now the basis vector for the input data will be
having the same dimensions and so the 2-D
basis functions will also be of the size N1xN2.
 If we consider the formation of basis functions
directly from the equations we can see that
each of the basis functions can be found by
taking the outer product of the rows and
columns of the 1-D DFT basis array.
2-D DFT eg.

 Consider a 4x4 input image. So after


transformation we will get a 4x4 coefficient
matrix. Each coefficient is formed by
projecting the input image to the 16 basis
images.
 The formation of the basis image can be
explained as follows.
2-D DFT eg.
 The 1-D DFT transformation matrix is given
by,
1 1 1 1
1  j  1 j 
 
1  1 1  1 
 
1 j  1  j 
2-D DFT eg.

1 1 1 1 1 1 1 1 1 1
1 1 1 1 1  j   j  j  j  j 
1 1 1 1     1 1 1 1     
1 1 1 1 1   1   1  1  1  1
      
1 1 1 1 1 j
   j j j j 
1 1 1 1 1 1 1 1 1 1
 1  1  1  1  1  j  j j j j 
1 1 1 1     1 1 1 1     
1 1 1 1 1   1   1  1  1  1
       
 1  1  1  1  1  j
    j  j  j  j 
2-D DFT eg
 Taking the other three row
basis vectors and doing the
same procedure as above 1 2 3 4
we get 12 (3x4) more basis 5 
6 7 8
images. 
 Now project the input to 1 2 3 4
these basis images to get the  
coefficients. 5 6 7 8
 Consider an input array
given by
2-D DFT eg.
1 1 1 1  1 1 1 1  1 1 1 1  1 1 1 1
1  j  1 j  1  j  1 j  1  j  1 j  1  j  1 j 
    [1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8]
 
1  1 1  1  1  1 1  1  1  1 1  1  1  1 1  1 
    
1 j  1  j  1 j  1  j  1 j  1  j  1 j  1  j 
1 1 1 1   j  j  j  j   1  1  1  1   j j j j
1  j  1 j   j  
 1 j 1   1 j 1  j   j 1  j  1 
 
 
1  1 1  1   j j  j j   1 1  1 1   j  j j  j 
    
1 j  1  j   j 1 j  1   1  j 1 j   j 1 1 1 
1 1 1 1  1  1  1  1 1 1
 1 1   1  1  1  1 
 1  j 1  j  1 j   1 j 1  j 

1  j  1 j  1 j
   
1  1 1  1 1 1  1 1 1  1 1  1   1 1  1 1 
  
  1 j 1 j 1 j  1  j   1  j 1 j
1 j  1  j   
1 1 1 1  j j j j   1  1  1  1   j  j  j  j 
  
1  j  1 j   j 1  j  1   1 j 1  j   j  1 j 1 
 
1  1 1  1   j  j j  j   1 1  1 1   j j  j j 
    
1 j  1  j   j  1  1 1   1  j 1 j   j 1 j  1
2-D DFT eg.
 Another way of getting the coefficients is
 Xkl = Σ x(n1,n2) Ө Wk WlT
Sum of all
Outer product
elements in
operation
the product
Point by point
multiplication of
corresponding
k,l th element
elements
or coefficient
2-D DFT cont.
 But since the basis functions are all separable
we can do successive row and column
operations using the 1-D DFT basis vectors.
Then the equation becomes,

N 11  N 21  j 2  k 2 n2
  j 2 k1 n1
X (k1, k 2)    x ( n1, n 2) e N2
 e N1

n1 0  n 20 
2-D DFT cont.
1 2 3 4 1 1 1 1  10  2  2 j  2  2  2 j
5 6 7 8  1  j  1 j  26  2  2 j  2  2  2 j 
  
1 2 3 4 1  1 1  1  10  2  2 j  2  2  2 j
     
5 6 7 8 1 j  1  j  26  2  2 j  2  2  2 j

1 1 1 1  10 22 j 2  2  2 j   72  8  8 j  8  8  8 j
1 j 1 j  26 22 j 2  2  2 j   0 0 0 0 
 
1 1 1  1 10 22 j 2  2  2 j   32 0 0 0 
    
1 j 1  j  26 22 j 2  2  2 j  0 0 0 0 

You might also like