DIP_UNIT_2
DIP_UNIT_2
IMAGE TRANSFORMATIONS
Introduction
Transformation in this context means change in representation of data without changing the
information. This newform of data can be processed easily to meet the requirement.
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
provides aset of coordinates or basis vectors for the vector space.
-D-Transforms
This implies,
N-I
Or, u(n) =
k=0
v(k)a (k,n), for 0snsN-I ---(2.2)
Equation (2.2) can be viewed as a series representation of sequence u(n). The columns of
34
Image Process
the
ak (a (k, n), 0SnsN-I}" arecalled
A i.c., the vectors ak= "basis vcctors" of A
The serics coefficients v(k) give a representation of original sequence u(n) and
compression, filtering, feature extraction and other analysis.
arc uscful
2.1 Two Dimensional Orthogonal and Unitary Transforms
As applied to image processing, a general orthogonal series expansion for an
N× Ni%
u(m, n) is a pair of transformations of the form:
N-1
r(k, =u(m,n)a,
) (m,n),3isN
m,n =0
N-I.
u(m, n) = Xk,)ak(m,n) , 0Sm, nSN-I
kl=)
where {a,, (m, n)} is called an "image transform".
It is a set of complete orthogonal discrete basis functions satisfying the properties
N-1
1. Orthonormality: a,(m,n)ak,(m,n)
mn =0
= S(k-k,-)
N-1
2. Completeness: -()
k,l =)
= S(m-m', n-n')
The elemnents v (k, ) are transform coefficients and V A
{v (k. I)} is the transformed ima
The orthonomality property assures that any
truncated series expansion of the form
P-10-1
Uo,(m,n) A v(k,ha, (m,n),for PSN, QsN
k=0 =0
will minimize the sum of
squares erTOr
N
given by (2.3).
assures that this error will be zero for
P= 0=N
Image Transformations 35
N-I
v(k, I) =
m,n =0)
ak,m)u(m,n)al, n) ---- (2.9)
Let us define the matrices A,=aka' and matrix inner product of two Nx Nmatrices
F and G as
36 Image Processi
N-I
U= Lv(k.)4,
kl=)
---- (2.1
1. Let A =
5
Transformed image -2 0
-)
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)
The average energy E [1V(K)1'] of the transform coefficients V(K) tends to be unevenly
distributed although it may be evenly distributed for the input sequence u (n).
Few components of the transform co efficeints packa large fraction of the average energy of
the image.
So many of the transform co efficients will contain very little energy.
3. For the 2 x 2 transfer Aand the image U.
A =
-
V= AUAT
V=
7.5 751
V= |-45 -2.s|
V=
A-a-9-)
4. For the given orthogonal matrix Aand the image Uobtain
() the transformed image
(i) the original image from transformed image
V=AUAT
v
AT VA*= UU=
A= (4 1
U=
2
V= Ai
aUATJC)
Basis images - refer Dec
09/Jan 10 3 (c).
Image Transformations 39
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.
The Optimum Transform
Important consideration in selecting a transform is its performance in filtering and data
Compression of images based on the mean square criterion. The (KL T) is known to be optimum
with respect to this criterion.
40 Image Proces
2.2 Properties of Unitary Transforms
1. Encrgy conservation
’
Proof
A Au ----(2)
k=0
Ndimensional vector space. That is, every unitary transformation is simply a rotation of
N- dimensionalvector space.Alternatively, aunitary transform is arotation of basis coordinat
and components of are projections of on the new basis. Similarly, for 2D unitar
transformations, it can be proved that
N-1 N-I
..- (2.2
mn=) kl=0
cos sin
A = -sin cos
T 7
This ’ ’ ’
---- (2.22)
And R, = ----(2.23)
---- (2.24)
A --- (2.25)
= AR, A
Variances of the transform coefficients are given by the diagonal elements of R. i.e
R.], =o,()
---- (2.26)
N-I
and ---(2
k=0
N-I
n=0
---- (2)
n=0
N=I
and
---- (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.
(b) Entropy of arandom vector is observed under unitary transfornmation average information
of the random vector is preserved.
Example: 2.2 Given the entropy of an N × 1Gaussian random vector i with mean and
R, covariance as;
log,
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
N-IN
u (m, n) = SSvk,) w,w"oSm, nsN-l
k=0 I=0 -2
The two dimensional unitary DFT pair is defined as
1 N-IN-I lu
N >u(m,n) Wy WN
v (k, l) =
m=0 )=) 0sk,lSN-1
N-IN-I
u(m, n) = N S>vk,)
k=0 /=0
w, W0sm,nSN-I ---2:
In matrix notation this becomes
V= FUF
U= F VF
If U
and Vare mapped into row-ordered
vectors uand v respectively, then
f=.F -... (2
The N² x N matrix.F represents NxN
two-dinmensional unitary DFT.
Properties of the Two -Dimensional DFT
The properties of the two
dimensional unitary DFT are
symmetric, unitary =..=.f'=F F -..(24
Image Transformations 45
Periodic extensions
v(k+N, I + N) =v(k, ), Vk, l
u(m + N, n+ N) = u (m,n), Vn, n ---- (2.47)
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
A = , 0= {W-(km+ln), 0< m, nsN-1},0<k, I<N-I
N
---- (2.51)
Twodimensional circular convolution theorem
The DFT of the two dimensional circular convolution of two arrays is the product of their
DFTs.
Twodimensional circular convolution of twoN xNarrays h (m, n) and u, (m, n) is defined as
N-1N-1
u(m, n) =
=0 n=)
h(m-m',n -n'), u,(m',n'), 0sm, nsN-l--- (2.52)
where h (m, n), =h (n modulo N, n modulo N) ----(2.53)
46
Image Procs
n n'
N-1 U, (m, n)
m m'
M-1 N-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
h(m-m', nn') for fixed m', n' is given by.
N-IN-1 N-I-m N--n
N-IN-I
= N
Wm'k+n') Xh(m,n) W(mk+nl)
m=0n=0
O< m,nM-1
h (m, n) A ---- (2.57)
0, otherwise
(m,n), 0s m,nsM -1
(m, n) A 0, otherwise ---- (2.58)
Evaluating the circular convolution of h(m, n) and (m, n) according to cquation 2.52. If
can be seen that in Fig. 2.1that
x, (m, n) =u, (m, n) 0Sm, ns 2, M-2 ---- (2.59)
N-I
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
reflect change in intensity.Accordingly, the higher frequency components arise from the hair (and
that feather!) and from the borders of features of the human face, such as the nose and eyes.
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.
k=0,0<nsN-1
C(k,n) =
N
T(2n+1)k
COS 1sks N-1,0<nsN-1
2N
--- (2.63)
50
2
a (0) N for 1< ksN-1
The inverse transformation is given by
Changing the index of summation in the second term to n'= N-n-l and combining term,
we obtain
N-I
(4n+1)k
v(k) = a (k) u(n) cos 2N
--- (2.72)
n=)
N-I
-j2 rkn/N
= Re --- (2.73)
H=)
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) Re Lk=0
0sns -
--- (2.75)
a first.
Image ProC
6. The NXN cosine transform is very close to the KL transform of
Markow sequence of length N, when the correlation paramcter Pis close to
1 order stl
The re
that R- isasymmetric tridiagonal matrix, whichfor a scalar ß²
Ap/(1tp') satisfies the relation A(|-p')!+p'
||- pa - .
-C.
B² R-! =
1- pa
This gives the approximation
B² R- Q, 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.
a) Compute the DCT matrix for N=4.
Ans TheNxN DCT matrix C= (K, n) is defined as
k=0,0<nsN-I
C(K,n) = 2 n(2n +1)k
N
-cos 2N
-, 1sksN-1,0SnsN-I
k n k n kn k n
00 01 02 03
3,0 3,1
3,2 3,3
COS
3Tt
157t
(26
8
COS COS