You are on page 1of 66

CII4F3 / Digital Image Processing

Image Transform
Dr. Eng. Ir. Wikky Fawwaz Al Maki, S.T., M.Eng.

Intelligent Computing and Multimedia (ICM)

1 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Overview

Mathematical Preliminaries
2-D Orthogonal and Unitary Transform
Karhunen Loeve Transform
Discrete Cosine Transform
Discrete Sine Transform
Welsh Hadamard Transform
Haar Transform
Slant Transform

2 11/02/2020 CIG4E3 / Pengolahan Citra Digital


MATHEMATICAL PRELIMINARIES

3 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Mathematical Preliminaries
Review of matrix and vector
Conjugate and conjugate transpose
Singular matrix
Trace and norm of a matrix
Orthogonal and unitary
Inner product and outer product
Kronecker product
Probability and Statistics
Expected value

4 11/02/2020 CIG4E3 / Pengolahan Citra Digital


2-D ORTHOGONAL AND UNITARY
TRANSFORM

5 11/02/2020 CIG4E3 / Pengolahan Citra Digital


2D Orthogonal
Orthogonal
  series expansion for an image

  s are the transform coefficients, represents the transformed image

is a set of orthonormal functions, representing the image transform

6 11/02/2020 CIG4E3 / Pengolahan Citra Digital


2D Orthogonal

 must satisfies

7 11/02/2020 CIG4E3 / Pengolahan Citra Digital


2D Orthogonal
 
The elements are transform coefficients and is the transformed image. The
orthonormality assures the any truncated series of expansion of the form

will minimize the sum squares error

where coefficients are given by the previous equation.

The completeness property assures that this error will be zero for P= Q= N

8 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Separable Unitary Transform
Computational Complexity of former: O(N4)
With  Separable Transform: O(N3)

Orthonormality and Completeness:
A={a(k,m)}and B={b(l,n)}are unitary:

Usually B is selected same as A(A=B):

Unitary  Transform!
9 11/02/2020 CIG4E3 / Pengolahan Citra Digital
Matrix Representation of Image Transform

 is the matrix inner product


Image can be described as linear combination of matrix ,

are called the basis images

can be considered as the projection of on the -th basis image

10 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Basis Images

Example of basis images

11 11/02/2020 CIG4E3 / Pengolahan Citra Digital


2D Separable Image Transformation

  separable
is

are unitary matrices

Consider the above as the transforming columns of by , then transforming rows


of the results by

12 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Example of Image Transform
 
Given

Compute transform =

Basis images

13 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Properties of Unitary Transform
Given
  ( is a unitary transform)

, i.e. energy-conserved

A unitary transformation is a rotation of the basis coordinates , or a


rotation of the vector u in N-Dimensional vector space

Unitary transform tends to concentrate most of the signal energy on


a small set of transform coefficients

14 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Properties of Unitary Transform (cont’d)

 
The transform coefficients tends to be decorrelated, i.e., the off-
diagonal elements of are approaching zero

The entropy of a random vector is preserved under a unitary


transformation (i.e., information preserved)

15 11/02/2020 CIG4E3 / Pengolahan Citra Digital


KARHUNEN LOEVE TRANSFORM

16 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Introduction to KLT

Known as Hotelling transform or PCA

The KLT analyzes a set of vectors or images, into basis functions or


images where the choice of the basis set depends on the statistics
of the image set - depends on image covariance matrix.

17 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Introduction to KLT: Eigenvalues and Eigenvector

The
  concepts of eigenvalues and eigenvectors are important for
understanding the KL transform.

If is a matrix of dimension , then a scalar is called an eigenvalue of if


there is a nonzero vector in such that

  The vector is called an eigenvector of the matrix C corresponding to the


eigenvalues

18 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Introduction to KLT: Vector Population
 Consider a population of a random vectors of the following form:

The quantity may represent the gray values of the image

The population may arise from the formation of the above vectors
for different image pixels

19 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Introduction to KLT: Eigenvalues and Eigenvector
(Cont’d)
Example: x vectors could be pixel values in several spectral bands
(channels)

Formation of a vector from corresponding pixels in 6 images


20 11/02/2020 CIG4E3 / Pengolahan Citra Digital
Introduction to KLT: Mean and Covariance Matrix

 The mean vector of the population is defines as:

The covariance matrix of the population is defines as:

For M vectors of a random population, where M is large enough

21 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Introduction to KLT: How to compute covariance
matrix?
 Compute the covariance matrix of a set of 4 vectors

then and so

22 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Introduction to KLT: How to compute covariance
matrix?
  calculate alsos need to know , the mean of the outer products of
To
each vector with itself

then

23 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Introduction to KLT: How to compute covariance
matrix?

 It follows that equals

24 11/02/2020 CIG4E3 / Pengolahan Citra Digital


KLT
 Let A be a matrix whose rows are formed from the eigenvectors of the
covariance matrix C of the population

They are ordered so that the first row of A is the eigenvector corresponding
to the largest eigenvalue, and the last row the eigenvector corresponding
to the smallest eigenvalue

We define the following transform :

It is called the Karhunen-Loeve Transform

25 11/02/2020 CIG4E3 / Pengolahan Citra Digital


KLT

26 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Inverse Karhunen Loeve Transform
 To reconstruct the original vectors from its corresponding

We form a matrix from the eigenvectors which correspond to the


largest eigenvalues, yielding a transformation matrix of size
The vectors would then be dimensional
The reconstruction of the original vector is

27 11/02/2020 CIG4E3 / Pengolahan Citra Digital


KLT (Karhunen Loeve Transform) of 1-D Vector
For
  a real random vector u with autocorrelation matrix R, KL transform of u is
defined as

where , i.e., ’s are orthonormalized eigenvectors of R

and is the k-th column of

reduces R to its diagonal form, i.e.,

If we replace R with then eigen matrix of is the KL transform of u-µ

KL transform is independent of the image data themselves, but related to its 2nd-
order statistics

28 11/02/2020 CIG4E3 / Pengolahan Citra Digital


KLT (Karhunen Loeve Transform) of 2-D Vector
 FFT, DCT, DST all are special cases of KL transform

For an image of pixels, its autocorrelation function denoted as (or


an N2 x N2 R matrix), the basis images of the KL transform are :

or
where is the N2 x 1 vector representation of

29 11/02/2020 CIG4E3 / Pengolahan Citra Digital


KLT (Karhunen Loeve Transform) of 2-D Vector

 If R matrix is separable, then of is also separable

where

 KL transform : or

Advantages of this separability: reduce the eigenvalue problem of R


matrix () into two eigenvalue problems of R1, R2 ()

30 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Properties of the KL Transform
 Decorrelation
are uncorrelated and have zero mean
is not unique, not necessarily be the eigen matrix of R

Minimum basis restriction error

Signal u is transformed via A to be v, clip the first m values by Im to


form w, and transformed back to z via B. The basis restriction error
is defined as

31 11/02/2020 CIG4E3 / Pengolahan Citra Digital


KLT Example Images
6 spectral images from
an airborne Scanner

Channel Wavelength band


(microns)
1 0.40 – 0.44
2 0.62 – 0.66
3 0.66 – 0.72
4 0.80 – 1.00
5 1.00 – 1.40
6 2.00 – 2.60

32 11/02/2020 CIG4E3 / Pengolahan Citra Digital


KLT Example Images

Original images (channels) and the principal components after KLT


33 11/02/2020 CIG4E3 / Pengolahan Citra Digital
DISCRETE COSINE TRANSFORM

34 11/02/2020 CIG4E3 / Pengolahan Citra Digital


DCT (Discrete Cosine Transform)
1D cases:

35 11/02/2020 CIG4E3 / Pengolahan Citra Digital


DCT (Discrete Cosine Transform)

 2D cases:

36 11/02/2020 CIG4E3 / Pengolahan Citra Digital


DCT Basis

37 11/02/2020 CIG4E3 / Pengolahan Citra Digital


DCT Basis (Cont’d)

38 11/02/2020 CIG4E3 / Pengolahan Citra Digital


DCT Basis (Cont’d)

39 11/02/2020 CIG4E3 / Pengolahan Citra Digital


DCT (Discrete Cosine Transform)
8 x 8 2-D DCT

40 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Properties of DCT
DCT
  is real and orthogonal  and

DCT ≠Real {DFT}

DCT can be calculated via FFT

For highly correlated data, DCT has good energy compaction. That is, for first-
order stationary Markov sequence with correlation ρ≅1, DCT is approximate to KL
transform

41 11/02/2020 CIG4E3 / Pengolahan Citra Digital


DISCRETE SINE TRANSFORM

42 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Discrete Sine Transform (DST)
1D Cases :

2D Cases : A=A*=AT=Ψ

43 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Discrete Sine Transform (DST)

44 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Discrete Sine Transform (DST)
 
Properties

DST is real, symmetric and orthogonal 

DST and DST-1 are the same in the form (forward and Inverse are identical)

DST ≠ Imagery {DFT}

Fast transform

For first-order stationary Markov sequence with correlation , the energy


compaction of DST is approximate to KL transform

45 11/02/2020 CIG4E3 / Pengolahan Citra Digital


WELSH HADAMARD TRANSFORM
(WHT)

46 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Welsh Hadamard Transform
 
Welsh Hadamard Transform  N=2n

1D Case:

Components of HT vector contain only 1 and -1

The number of transitions from 1 to -1 is called sequency (like ω in the continuous case)

47 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Welsh Hadamard Transform
Welsh Hadamard transform pair:

H= Hn, N= 2n

Notice the disordering effect in the sequency in HT spectrum when


filtering will be performed
48 11/02/2020 CIG4E3 / Pengolahan Citra Digital
Welsh Hadamard Transform
2D  Cases: 

A=A*=AT=H

49 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Properties of Welsh Hadamard Transform
 
Real, symmetric, and orthogonal 

Fast computation (only addition is needed)

Can be decomposed into product of sparse matrix

For highly correlated images, Hadamard transform also has good energy
compaction

50 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Welsh Hadamard Basis

51 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Welsh Hadamard Basis (Cont’d)

Welsh Hadamard Transform basis function


N=16

52 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Welsh Hadamard Basis (Cont’d)

Welsh Hadamard Transform basis image

53 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Plot Hadamard Transform

54 11/02/2020 CIG4E3 / Pengolahan Citra Digital


HAAR TRANSFORM

55 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Haar Transform
1D Case:

56 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Haar Transform
Haar Transform  N=2n

1D Case:

57 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Haar Transform
Haar Transform  N=2n

2D Case:  Hr*A*HrT

58 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Haar Transform

Haar Transform Basis Function


N=16

59 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Haar Transform Properties

Real  and Orthogonal: Hr = Hr*, Hr-1=HrT

Fast  Transform

Poor energy compactness

60 11/02/2020 CIG4E3 / Pengolahan Citra Digital


SLANT TRANSFORM

61 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Slant Transform

N=2n

62 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Slant Transform
N=2n

63 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Slant Transform
Slant Transform Basis Function N=16

64 11/02/2020 CIG4E3 / Pengolahan Citra Digital


Slant Transform

Slant Transform Properties:

Real  and Orthogonal S=S*S-1=ST

Fast

Very  Good Compactness

65 11/02/2020 CIG4E3 / Pengolahan Citra Digital


THANK YOU
66 11/02/2020 CIG4E3 / Pengolahan Citra Digital

You might also like