Professional Documents
Culture Documents
Image transform
Definition: It is the operation to change the default
representation space of a digital image (spatial
domain -> another domain) so that:
Forward transform
real(A) imag(A)
u=0
Inverse transform
basis
u=7
n n
1-D DFT in matrix notations
real(A) imag(A)
u=0
N=8
u=7
n n
1-D DFT of different lengths
real(A) imag(A)
n
u
N=32
N=8
N=16 N=64
performing 1D DFT
real-valued input
Note: the coefficients in x and y on this slide are only meant for illustration purposes, which are not numerically accurate.
another illustration of 1D-DFT
real-valued input
DFT
IDFT
2-D Fourier basis
real imag
real( ) imag( )
2-D FT illustrated
real-valued
real
imag
Unitary Transform
2v ( k ) [R v ]k ,k [AR u A*T ]k ,k
W 1 N 1
v ( k ) v A A u u ( n)
2 *T *T *T 2
v u
k 0 n 0
N 1 N 1
k 0
2
v ( k ) Tr[AR u A ] Tr[R u ] 2u ( n )
*T
n 0
N 1 N 1
E v( k ) E u( n )
2 2
k 0 n 0
2-D orthogonal and unitary
transforms
Orthogonal series expansion for an NN image
u(m, n)
N 1 N 1
N 1 N 1
u(m, n) v(k,l)a
k 0 l0
*
k,l
(m, n) 0 m, n N 1
N 1 N 1
orthonormality : a
m0 n0
k ,l
(m,n)a k*,l (m, n) (k k ,l l)
N 1 N1
completeness :
k 0 l0
ak ,l (m,n)a k*,l (m , n ) (m m , n n )
5-2
Properties of Unitary Transform
transform
Consider v Au, then R v AR u (A* )t
Covariance
A 2 1 zero mean vector u is trasformed matrix
1 3 1 1 ρ
v u where Ru
2 1 3 ρ 1
1 3 ρ ρ
then R v 2 2
ρ 1 3 ρ
2 2
σ 2u (0) 1 σ 2u (1) ; total energy is equally distributed
but σ 2v (0) 1 3 ρ σ 2v (1) 1 3 ρ
2 2
if ρ 0.95 , then 91% energy in v(0)
and the correlation between v(0) and v(1) is
Ε[v(0)v(1)]
ρ v (0,1) 0.83
σ v (0) σ v (1)
energy compaction and decorrelation
Matrix representation of image
transform
N 1 N 1 N 1 N 1
v(k, l) u(m,n)a
m0 n0
k,l
(m, n) U v(k,l)A
k 0 l0
*
k,l
N 1 N 1
u(m, n)
k 0 l0
v(k, l)a k,l* (m, n) v(k,l) U, A*k ,l
N 1 N 1
5-4
2-D Separable image
transformation
{a (m, n)} is separable
k ,l
k 0 l 0
1.0 1.0
0.0 0.0
-1.0 -1.0
1.0 1.0
z(n) 0.0 0.0 Z(k)
-1.0 -1.0
n
k
1.0 1.0
Original signal
0.0 0.0 Transform coeff.
-1.0 -1.0
1.0 1.0
0.0 0.0
-1.0 -1.0
Basis vectors
DFT and DCT in Matrix Notations
Matrix notation for 1D transform
1D-DCT 1D-DFT
u=0
u=7
n=7
even
Discuss the importance of this figure
Hadamard Transform
separabl
Example of calculating Hadamard coefficients –
Standard Trivial Functions for Hadamard
One change
two changes
Discrete Walsh-Hadamard transform
1) Hadamard transform
1 1 1
H1 1 1
2
H H n 1
1 n 1
H n H n 1 H1
2 H
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 2 H2
1 1 1 1 1 1 1 1 1 1 4
H3
8 H 8 1 1 1 1 1 1 1 1 1
2 H2
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
Properties of Hadamard
transform
Real, symmetric, and orthogonal H H *
H T
H 1
DFT
• Fast transform; very useful in digital signal processing, convolution, filtering,
image analysis
• Good energy compaction; however – requires complex computations.
DCT
• Fast transform and requires only real number operations
• The optimal alternative to the KLT for highly correlated images
• Used in compression and coding
• Excellent energy compaction
Hadamard
• Faster than sinusoidal transforms since it only implies sums and subtractions
• Used for hardware implementation of some digital image processing algorithms
• Applied in image compression, filtering, coding
• Good energy compaction
KL transform of 1-D vector
For a real N×1 random vector u with autocorrelation matrix
R, KL transform of u is defined as
v Φ*T u u Φ v
where Rφ k k φk , 0 k N 1 , i.e., φ k’s are orthonormalized
eigenvectors of R and φ k is the k-th column of
reduces R to its diagonal form, i.e.,
Φ RΦΛ Diag{ }
*T
k
or Rψi ψ
i i i 0,..., N 2 1
ψ i is the N 1 vector representation of k ,l (m,n)
2
KL transform of 2-D image
(cont.)
If R matrix is separable, then Ψ {ψ } of N N is also
i
2 2
separable
Kronecker
R R1 R 2 Ψ Φ1 Φ2 operator
problems of R1, R2 ( N N )
Properties of the KL transform
Decorrelation
{v(k ),k 0,..., N 1}are uncorrelated and have zero mean
is not unique, not necessarily be the eigenmatrix of R
1 1
Tr[E{(u z)(u z)*T }]
N n0 N
Properties of the KL transform
(cont.)
Find A KL and B KL (KL transform) such that J m is minimized for
each value of m [1, N ] . (KL is effective in compacting the energy)
Select A Φ*T and B Φ , AB I , and columns of are sorted
according to their corresponding eigenvalues 0 1 2 ..... N 1
Minimum transmission rate at a given distortion
In a noisy channel, given a distortion specification,
1
D E[(u u. )*T (u u. )]
N
KL transform can, among all unitary transformation A (include A
= I ), achieve the minimum transmission rate
R(Φ*T ) R(A)
u A v v. u.
(unitary) channel A*T
An example of KL-transform
A 21 vector u, whose covariance matrix is
1
R , 1
1
The KL transform is
1 1 1
Φ Φ
*T
2 1 1
v Φ u E{[v(0)] 2
} 0 1 , E{[v(1)]2 } 1
1 1 1 ) max(0, 1 log 1
R(Φ) [max(0, log )]
2 2 2
comparing R(I) 1 [2log ], 0 1
4
CCU, Taiwan
R(Φ) R(I) Let be small, say 1
Wen-Nung Lie 5-26
Comparison of energy
distribution between transforms
For first-order stationary Markov process with
large , DCT is comparable to KL
With small , DST is comparable to KL
For any , we can find a faster sinusoidal
transform (DCT or DST) to substitute for the
optimal KL transform which needs covariance
matrix to compute transform basis vectors