You are on page 1of 30

Image Transforms

Eigenvectors,
Transformation
Eigenvalues and Eigenvectors (E&E)
Definition: The eigenvalues of a real matrix M are the real numbers  for
which there is a nonzero vector e such that
Me = e.
The eigenvectors of M are the nonzero vectors e for which there is a real
number  such that Me = e.
If Me = e for e  0, then e is an eigenvector of M associated with
eigenvalue , and vice versa. The eigenvectors and corresponding
eigenvalues of M constitute the eigensystem of M.
Geometrically the eigenvectors represent the invariant directions of the
linear transformation M in space so that any vector v aligned in such
directions remains unaltered in direction upon multiplication by
multiplication of with M.
E&E: Example
Example: Consider the matrix

It is easy to verify that Me1 = 1e1 and Me2 = 2e2 with 1 = 1 and 1 = 2,
when we take

and

In other words, e1 is an eigenvector of M with associated


eigenvalue 1, and similarly for e2 and 2.
E&E: Properties – 1
• 1: If {1, 2,…, q, q  m, is a set of distinct eigenvalues of M, and ei is an
eigenvector of M with corresponding eigenvalue i, i = 1,2,…,q, then
{e1,e2,…,eq} is a linearly independent set of vectors. An important
implication of this property: If an m×m matrix M has m distinct
eigenvalues, its eigenvectors will constitute an orthogonal (orthonormal)
set, which means that any m-dimensional vector can be expressed as a
linear combination of the eigenvectors of M.
• 2: The numbers along the main diagonal of a diagonal matrix are equal to
its eigenvalues. It is not difficult to show using the definition Me = e
that the eigenvectors can be written by inspection when M is diagonal.
• 3: A real, symmetric m×m matrix M has a set of m linearly independent
eigenvectors that may be chosen to form an orthonormal set. This
property is of particular importance when dealing with covariance
matrices which are real and symmetric.
E&E: Properties – 2
• A corollary of Property 3 is that the eigenvalues of an m×m real
symmetric matrix are real, and the associated eigenvectors may be
chosen to form an orthonormal set of m vectors.
• Suppose that M is a real, symmetric m×m matrix, and that we form a
matrix A whose rows are the m orthonormal eigenvectors of M. Then, the
product AAT=I because the rows of A are orthonormal vectors. Thus, we
see that A1= AT when matrix A is formed in the manner just described.
• Consider matrices M and A in 5. The product D = AMA1 = AMAT is a
diagonal matrix whose elements along the main diagonal are the
eigenvalues of M. The eigenvectors of D are the same as the
eigenvectors of M.
E&E: Example
• Suppose that we have a random population of vectors, denoted by {x},
with covariance matrix:

• Suppose that we perform a transformation of the form y = Ax on each


vector x, where the rows of A are the orthonormal eigenvectors of Cx.
The covariance matrix of the population {y} is
E&E: Example – cont’d
• From Property 6, we know that Cy=ACxAT is a diagonal matrix with the
eigenvalues of Cx along its main diagonal. The elements along the main
diagonal of a covariance matrix are the variances of the components of
the vectors in the population. The off diagonal elements are the
covariances of the components of these vectors.
• The fact that Cy is diagonal means that the elements of the vectors in the
population {y} are uncorrelated (their covariances are 0). Thus, we see
that application of the linear transformation y = Ax involving the
eigenvectors of Cx decorrelates the data, and the elements of Cy along its
main diagonal give the variances of the components of the y's along the
eigenvectors.
• Basically, what has been accomplished here is a coordinate
transformation that aligns the data along the eigenvectors of the
covariance matrix of the population.
E&E: Example - Illustration

The preceding concepts


are illustrated in the
figure.
(a) shows a data
population {x} in two
dimensions, along with
the eigenvectors of Cx
(the black dot is the
mean).
(b) The result of
performing the
transformation y=A(x
 mx) on the x's.
E&E: Example – Interpretation
• The fact that we subtracted the mean from the x's caused the y's to have
zero mean, so the population is centered on the coordinate system of the
transformed data.
• It is important to note that all we have done here is make the
eigenvectors (the axes of) the new coordinate system (y1,y2).
• Because the covariance matrix of the y's is diagonal, this in fact also
decorrelated the data.
• The fact that the main data spread is along e1 is due to the fact that the
rows of the transformation matrix A were chosen according the order of
the eigenvalues, with the first row being the eigenvector corresponding to
the largest eigenvalue.
The Conventional View

A transform is traditionally considered a shortcut means to achieve a


convolution:

but this misses the real story. To understand the transform as a


mathematical entity, one needs to go back to looking at signals as points
in a vector space.
A Change of the Reference Frame
• In any vector space, a linear transformation applied upon the members of
the space maps each point in the space to some (other) point
• This map might be one-one or not, onto or not
• Transformations of full rank are both one-one and onto
• Such transformations effectively re-express the vector they operate upon
under a new system of coordinates
The New Reference Frame
• The new coordinate frame consists of the eigenvectors of the applied
transformation as its basis vectors.
• Thus for example, the DFT

reorients every signal vector expressed originally in the standard basis


under its own basis consisting of the complex exponentials
Magnitude and Phase Spectra
• Thus the signal’s magnitude and phase spectra are simply plots of the
magnitude and phase of the coordinate transformed representation of the
signal

• The reason the spectrum is complex (not real) is simply because the basis
vectors of the DFT are complex
Other Transforms
• The DFT is just one example of many possible transforms
• Other examples are The Discrete Sine and Discrete Cosine Transforms, the
Hadamard and the Haar transforms, the KL transform, etc.
• Each of these is essentially another alternative representation to the
conventional standard-basis representation that we use commonly and
term the ‘spatial domain’
• A recent innovation in representations is the Wavelet representation
The Uses of Transforms
• Transforms are primarily intended for three different uses:
– Filtering
– Compression
– Feature extraction
• Different transforms might excel in different situations:
– The DFT is usually used for filtering as its components are the
conceptual origin of frequency
– The DCT is best suited for compression
– The DHaT (Haar) is good for feature extraction
Common Desirable Features
• Orthogonality: this ensures the independence of the coefficients when
approximate representations are computed
• Separability: this allows the easy generalization of lower dimensional (1-
D) transforms to higher dimensions (2D and greater)
• Realness: this reduces the computational burden when one is concerned
with only real signals
• Block Structure: if a transform matrix has a block structure, it has the
capacity to present a fast formulation: this is considerable computational
value
• Energy Compaction: some transforms excel in compressing greyscale
images with smooth tones such as natural images, others in compressing
binary data such as documents
The Principle of Transform Domain
Compression
• A transform converts the pixel based original image description into an
equal number of transform coefficients
• The alteration or deletion of any one of the coefficients usually has a
global effect on every pixel of the image. Certain of such effects remain
unnoticed by the human observer
• This allows the deletion or coarse quantization of all such ‘perceptually
insignificant’ coefficients, resulting in a lot of saving of storage space or
transmission bandwidth.
• The process of elimination of insignificant coefficients is called ‘basis
restriction’, and the attendant recovery error is termed the Basis
Restriction Error (BRE)
• An approximation of the original image is constructed during recovery. A
good compressing transform keeps the BRE low even after many
coefficients have been deleted for a significantly large set of natural
images.
DFT Transform pair
• Complex Transform
• Possesses a fast variant, the FFT
• Transform representation components provide the conventional meaning
of frequency
DFT Salient Features

The FFT, which is a fast formulation of the DFT,


provides considerable comoutational savings
Discrete Cosine Transform (DCT)

8 x 8 DCT Basis
Images

• This is an orthogonal and real transform, hence the


inverse is simply the transpose.
DCT Salient Properties
Discrete Sine Transform (DST)

• The 2-D DST coefficients are given by


8 x 8 DST Basis
Images

• The transform is not the imaginary part of the DFT .


DST Salient Properties
Haar Transform

• A real orthogonal transform


• Of particular use as a feature extractor (face
8 x 8 DHaT Basis
recognition!)
Images
• The kth Haar function hk(x) for x in [0,1] and k = 0,
1, … , 2n-1 is defined as follows: first k is uniquely
decomposed as k = 2p + q – 1 for 0 ≤ p ≤ n-1 and
q = 0,1 for p = 0. Then hk(x) is given by
HaT Salient Properties
Hadamard Transform

The order N = 2n Hadamard transform matrix can be


8 x 8 DHT Basis computed recursively from the order 2 Hadamard
Images matrix and the recursion equation
HT Salient Properties
KLT /PCA / Hoteling Transform
• This is fundamentally different in nature from the other transforms
discussed.
• All the other transforms have a fixed set of basis functions: this one tailors
the basis to suit the particular data over which it is to be applied.
• The transform basis vectors are thus derived by certain statistical
computations upon the set of images of interest.
KLT Basis Computation
• The set of images of interest given is assumed to be a wide sense
stationary random field
• The first step is to compute the (sample) autocorrelation matrix of the
data: rij = E(xi xj)
• The eigenvalues and eigenvectors of the autocorrelation matrix are
evaluated
• Finally, the eigenvectors are orthonormalized are adopted as the basis
vectors of the transform.
• The matrix of these eigenvectors is the transform matrix that is applied
upon the data.
KLT Performance

• It is termed the optimum transform


• It provides the best energy compaction for a given data set as
compared to any other fixed-basis transform: clearly, this is the
consequence of choosing the basis most appropriately for the given
data
• The underside of this property is that it may perform quite poorly, even
in comparison with other, fixed-basis transforms for a different dataset
from the one it was designed for
• While it is true that better energy compaction implies higher
compression, one must also note that since the basis of the KLT is not
standard, the entire set of basis vectors has also to be
stored/transmitted in order to make decompression possible. This fact
adds to the overheads somewhat when the KLT is used as a tool for
image compression

You might also like