Dip Mod 2
Dip Mod 2
IMAGE TRANSFORMATIONS
Introduction
Two dimensional unitary transforms play an important role in image processing. The
term
image transform refers to a class of unitary matrices used for representation of
images.
Amatrix is called unitary if its inverse is equal to its conjugate transpose (A=A")
In analogy with I-D signals that can be represented by an orthogonal series of
basis functions,
For example 1D signals can be represented in frequency domain using sines and
cosines as
basis function in Fourier Representation.
we can similarly represent an image in terms of a discrete set of basis arrays
called "basis
images". These are generated by unitary matrices.
Alternatively an (N×N) image can be represented as (N'x 1) vector. An image
transform
----(2.1)
I1=0
Or,
u(n) =
k=0
---(2.2)
Image Process
A i.c., the vectors ak=
ak (a (k, n), 0SnsN-I}" arecalled
the
"basis vcctors" of A
The serics coefficients v(k) give arepresentation of original sequence u(n) and arc
uscful
Ni%
N-1
(m,n),3isN
r(k, =u(m,n)a,
)
m,n =0
N-I.
1. Orthonormality:
mn =0
a,(m,n)ak,(m,n)
= S(k-k,-)
N-1
2. Completeness:
-()
k,l =)
= S(m-m', n-n')
Uo,(m,n) A
will minimize the sum of
P-10-1
k=0 =0
squares erTOr
N
EXúmn)-Usgm.n)
Mn=0
0=N
Image Transformations
35
v(k.) in equation (2.3) is 0(N"). This is too large for practical size images.
If the transform is restricted to be separable,
where
and
-o-- (2.8)
AA{a(k, m)}.
and B A {bl, n)} are unitary matrices.
1.e.,
v(k, I) =
m,n =0)
ak,m)u(m,n)al, n)
V= AUA'
---- (2.9)
---- (2.10)
N-1
And
u (m, n) =
kl =0\
U = A" VA
---- (2.11)
---- (2.12)
Equation (2.9) can be written as y' = A(AU)"
’ Equation (2.9) can be performed by first transforming each column of Uand then
transforming each row of the result to obtain rows of V.
Basis Images : Let a, denote kth columnof A
Let us define the matrices
F and G as
36
N-I
(E.G) =
)fm,n)g (m,n)
mn =)
---- (2.1
U= Lv(k.)4,
---- (2.1
kl=)
and
---- (2.1
images.
Example Prob<ems
1. Let A =
Transformed image
-2
-)
A0
A VA
Image Transformations
37
-)-u
2. For the given othogonalmatrix Aand image U. Obtain the transformed image V.
Compare the
energy in U
and Vand give your inference.
A =
V= AUAT
V =
-2-4)
V= AUAT
V=
V=
V=
7.5
|-45
751
-2.s|
38
Image Proces
A-a-9-)
4. For the given orthogonal matrix Aand the image Uobtain
V=AUAT
5
v
AT VA*= UU=
U=
(4
aUATJC)
V= Ai
09/Jan 10 3 (c).
Image Transformations
39
--.(2.16)
is called separable if
-.. (2.17)
A = A, X A,
This is because equation 2.16 can be reduced to the separable two-dimensional
transformations
y = A, XA,'
---- (2.18)
wherex and y are matrices that map into vectors x andy,respectively, by'row
ordering. IfA is
NxN and A,, A,are NxN, then the number of operationsrequired for implementing
equation
(2.18) reduces from N to about 2N?. The number of operations can be reduced further
ifA, and A,
are also separable. Image transforms such as discrete Fourier sine, cosine,
Hadamard, Haar and
Slant can be factored as knocker products of several smaller - sized matrices,
which leads to fast
A= 0e)Ap)
----(2.19)
where A,a =i=1,2 ... p (p<<N) are matrices with just a fewnon zero entries. Thus, a
multiplication of the type y = Ax is accomplished in rpN operations. For Fourier,
sine, cosine
Hadamard, slant and several other transforms, P= log,N, and the operations reduce
to the actual
transform.
Transform Frequency
For aone-dimensional signal f(), frequency is defined by the Fourier domain
variable ,. It
is related to the number of zero crossing of the real or imaginary part of the
basis function
exp{j2 x}. Let the rows of a unitary matrix Abe arranged so that the number of zero
crossings
increases with the row number then in the transformation
y= Ax
the elements y(k) are ordered according to increasing wave number or transform
frequency.
Compression of images based on the mean square criterion. The (KL T) is known to be
optimum
with respect to this criterion.
Image Proces
40
Proof
----(2)
A Au
k=0
are projections of
N-I
mn=)
kl=0
..- (2.2
and
A =
sin
-sin
cos
This
’
Transformation
--
cos
= A can be written as
cos
sin 9
|-sin9 cos
-x sin
+x, sin
+x, cos)
Image Transformations
41
image into relatively few transform coefficients. Since total energy is preserved
this implies that
many transform coefficients will contain very little energy. If H, and Rdenote the
mean and
covariance of vector uthen corresponding quantities for vare
---- (2.22)
And
----(2.23)
R, =
---- (2.24)
= AR,
--- (2.25)
R.], =o,()
---- (2.26)
---- (2.27)
k=0
Image Proces
N
N-I
---(2
and
k=0
N-I
=
n=0
---- (2)
n=0
For a2D random field u(m,n), with meanu, (m, n) and covariance r(m, n; m, n'), its
transfor
N-1
4. (k)=Xalk,m)a(l,n)4, (m,n)
min=0
---- (2.3#
N=I
,(6) =
2a(k,m)a(U.n) E|u(m,n)]
m,n=()
and
---- (2.3
---- (2.3
--.(2.3
--.-(2.3
where
--..(2.37
Image Transformations
43
3. Decorrelation
When input vector clements are highly correlatcd, the transform coefficients ternl
to be
uncorrelated. That is, the off-diagonal terms of covariance matrix R,tend to be
small compared
todiagonal elements.
4. Other properties
(a) The determinant and eigenvalues of a unitary matrix have unity magnitude.
Example: 2.2 Given the entropy of an N × 1Gaussian random vector i with mean and
R, covariance as;
log,
To show
Let
= Au
log, (2reR,')
Use the definition ofR, we have
44
\mage Po
Now
B, = AR,A"
Also
.AA = AA'= I
7
AR,A = A AR, A A
V(k. =u(m,n)
i)
W" WN 0sk,isN -1
m=0 =)
N-IN
u (m, n) =
k=0 I=0
-2
1 N-IN-I
lu
N >u(m,n) Wy WN 0sk,lSN-1
m=0 )=)
N-IN-I
u(m, n) = N
V= FUF
U= F VF
If U
and Vare mapped into
row-ordered vectors uand v respectively, then
f=.F
-... (2
symmetric, unitary
=..=.f'=F
-..(24
Image Transformations
45
Periodic extensions
N) = u (m,n), Vn, n
---- (2.47)
Otherwisethen ,
NN
(m, n) = 0
---- (2.48)
Conjugate Symmetry
The DFT and unitary DFT of real images exhibit conjugate symmetry that is
N
---- (2.49)
---- (2.50)
From this it can be shown that v(k,I) has only N independent real elements.
Basis images
The basis images are given by definition
1
u(m, n) =
where
=0 n=)
----(2.53)
46
Image Procs
n'
U, (m, n)
N-1
h(m, n) = 0
u, (rn,
h(m, n)
M-1
(m, n)
m'
N-1
M-1
Fig. 2.1:
Fig. 2.1 shows the meaning of circular convolution. It is the same when a periodic
exten
of h (m, n) is convolved over an N x N region with u, (m, n). The two dimensional
DET
N-IN-1
j=n
m=0n=0
N-IN-I
Wm'k+n') Xh(m,n) W(mk+nl)
m=0n=0
---(2.
where we have used equation 2.53 taking the DFT of both sides of equation 2.52 and
us
DFT {u, (m, n)},, = DFT {h (m, n)} DFT {u, (m, n)
From this and the fast transform property it follows that an N x
convolution c
performed in 0 (N² log, N) operation. This property is also useful inNcircular
calculating two dimes
convolution such as
X, (m, n) =
M-IM-1
m'=0n'=0
,(m-m',n-n') x.(om',n)
[0,
---(2.
support for the result x, (m, n) is {0< m, ns 2 M-2}.Let N 2M-1 and define NxNara"
Image Transformations
47
h (m, n) A
(m, n) A
O< m,nM-1
0,
---- (2.57)
otherwise
(m,n), 0s m,nsM -1
0,
---- (2.58)
otherwise
---- (2.59)
----(2.60)
FOF.N= D(FO F)
where
0sk, IsN-I
---- (2.61)
---- (2.62)
that is a doubly block circulant matrix is diagonalize by the two -dimensional
unitary DFT.
From equation 2.61 and the fast transform property, we conclude that a doubly
circulant matrix
can be diagonalized in 0(N log, N)operation. The eigen values of :/given by the two
dimensional
DFT of h(m, n) are the same as operating NFof the first column of : . This is
because the
elements of the firstcolumn of :/' are the clements h(m, n) mapped by laxicographic
ordering .
Block Toeplitz operations
Any doubly Toeplitz matrix operationcan be imbedded intoadouble block circulant
operation
which can be implemented using the two dimensional unitary DFT.
Define two -dimensional unitary transform. Check whether the unitary DFT matrix is
unitary
or not for N=4consider NxNimage u(m, n) and two dimensional unitary matrix A.
N-1
0sk, lsN-1
mJn=0
N-I
0Sm, nsN-1
Image Transformations
49
Fig 2.2 : Applying the Fourier transform to the image ofa Baby face
Figure 2.2(a) shows thec image of a face and Figure 2.2(b) shows its transform. The
transform
reveals that much of the information is carried in the lower frequencies since this
is where most of
the spectral components concentrate. This isbecause the face image has many regions
where the
brightness does not change a lot, such as the cheeks and forehead, The high
frequency components
AFourier-Transformed image can be used for frequency filtering refer the image
enhancement
chapter for frequency domain filtering.
The Fourier Transform is usedfor theremoval of additive noise. Refer the inverse
and wiener
filtering in the image restoration chapter.
2.4 The cosine Transform
The NXN cosine transform matrix C = {c (k. n) }, also called the discrete cosine
transform
(DCT) 0s defined as
k=0,0<nsN-1
N
C(k,n) =
COS
T(2n+1)k
2N
1sks N-1,0<nsN-1
--- (2.63)
50
Image Pron
V
(0) = o. (k)
I1=0
k|
(n) cos (2n+1)
2N
|0sksN
Where
2
a (0)
k=0
2N
--- (2:
2. The cosine transform is not the real part of the unitary DFT. The cosine
transform o
sequence is related to the DFT of its symmetric extension.
u(n)=u(2n)
--- (26
k(N-n-1)=u(2n +1)]|
Split the summation term in equation 2 into even and odd terms and use equation 2.6
obtain.
V (k) = a (k)
u(2n) cos
Tr(4n+ 1)k|
n=0
= a. (k)
u(n) cos
n=)
2N
n(4n+1)k
2N
u (2n+1) cos
+
n=0
(½
n=0
u(N-n-1) cos
T (4n +3)k
-(20
2N
n(4N +3)k
2.N
-(26
Image Transformations
51
Changing the index of summation in the second term to n'= N-n-l and combining term,
we obtain
N-I
v(k) = a (k)
u(n) cos
n=)
(4n+1)k
2N
--- (2.72)
N-I
-j2 rkn/N
= Re
--- (2.73)
H=)
--- (2.74)
Which proves the previously stated result. For inverse cosine transform we write
equation
2.65 for even data points
FN-I
u(2n) = A(2n)
0sns
Re Lk=0
-
--- (2.75)
4. The cosine transform has excellent energy compaction for highly correlated data.
This is due
. =
--- (2.77)
I
m
age
P
r
o
C
a first.
52
order stl
The re
A(|-p')!+p'
||- pa - .
B² R-! =
-C.
1- pa
This gives the approximation
B² RQ, for p=l
()
Hence the eigenvectors of Rand the eigen vectors of , that is, the cosine transform
wi
quite close. This property of the cosine transform together with the fact that it
is a fast trans
has made it a useful substitute for the KL ransform of highly correlated first -
order Me
sequences.
k=0,0<nsN-I
C(K,n) =
n(2n +1)k
-cos
-, 1sksN-1,0SnsN-I
N
2N
2
k n
k n
kn
k n
00
01
02
03
1,0
1,1
1.2
1,3
1
COS
V2
C(k, n) =
2,0
COS
2,1
COS
3,1
COS
2,2
COS
3,0
CoS
2,3
COS
COS
3,2
3,3
3Tt
8
cos
COS
157t
(26
COS