Image Features Using Wavelets and Applications To Document Image Processing
Image Features Using Wavelets and Applications To Document Image Processing
Dr. S A Angadi
Professor
Department of Computer Science and Engineering
PG Centre,
Visvesvaraya Technological University, Belgaum
Contents
Document Image Processing : An Introduction
Wavelets : An Overview
Discrete Wavelet Transform and Images
Image Features using Wavelets
Applications
Document Image Processing: An Introduction
Digital
ender’s Address Endorsem Post Mark
ent
In Case of Undeliverable as Addressed Return to Sender
Linear
Code
Delivery Address
Document Image
Examples-Graphics
Document Image Processing
Document Image
Analysis
Document
Data Capture
All these features can be subjected to transforms to obtain more meaningful information
Wavelet Transform: An Overview
What are Transforms
Transforms are applied to raw signal/data to obtain
further information from signal/ data which is not
readily available from raw data.
Fourier Transform gives frequency content of time
domain signal.
It will also give point value representation of a
polynomial
Why do we need frequency content of a signal/ ECG
Wavelet Transform: An Overview
FT provides a signal which contains only the frequency
domain information
It does not give any information of the signal in the
time domain
When time localization of the frequency components is
needed we require a transform giving time frequency
representation
STFT, Wigner Distributions and Wavelet Transforms
provide time frequency representation
Both FT and WT are reversible transforms- one can go
from raw data to processed data and back
Wavelet Transform: An Overview
“The wavelet transform is a tool that cuts up data,
functions or operators into different frequency
components, and then studies each component with
a resolution matched to its scale”
Wavelet Transform: An Overview
tau and s are translation and scale parameters
psi(t) is the transforming function and is called the
mother wavelet
there are two main differences between the STFT and
the CWT
1. The Fourier transforms of the windowed signals are not taken,
and therefore single peak will be seen corresponding to a
sinusoid, i.e., negative frequencies are not computed
2. The width of the window is changed as the transform is
computed for every single spectral component, which is probably
the most significant characteristic of the wavelet transform
Wavelet Transform: An Overview
the CWT can be thought of as the inner product of
the test signal with the basis functions psi_(tau ,s)
(t):
Where
Wavelet Transform: An Overview
Wavelet transform is referred to as “Fourier Transform of 20th Century”
Wavelets are wavelike oscillatory signals of finite bandwidth both in Time
and in Frequency
Wavelets are basis functions of spaces with certain properties
Wavelets provide time scale(frequency) representation of non stationary
signals
Based on multiresolution approximation (MRA)
• Approximate a function at various resolutions using a scaling function,
(t)
• Keep track of details lost using wavelet functions, (t)
• Reconstruct the original signal by adding approximation and detail
coeff
Implemented by using a series of lowpass and highpass filters
• Lowpass filters are associated with the scaling function and provide approximation
• Highpass filters are associated with the wavelet function and provide detail lost in approximating the signal
Discrete Wavelet Transform
The foundations of the DWT go back to 1976 when Croiser, Esteban,
and Galand devised a technique to decompose discrete time signals.
Crochiere, Weber, and Flanagan did a similar work on coding of speech
signals in the same year, they named their analysis scheme as subband
coding
A Discrete Wavelet Transform is any Transform for which
wavelets are discretely sampled
It transforms a discrete time signal to a discrete wavelet
representation
It converts an input series x0, x1, ..xm, into one high-pass
wavelet coefficient series and one low-pass wavelet coefficient
series (of length n/2 each)
Discrete Wavelet Transform
signal
lowpass highpass
filters
Approximation Details
(a) (d)
Discrete Wavelet Transform
The procedure starts with passing this signal
(sequence) through a half band digital lowpass
filter with impulse response h[n]
Filtering a signal corresponds to the mathematical
operation of convolution of the signal with the
impulse response of the filter.
Discrete Wavelet Transform
The DWT analyzes the signal at different frequency
bands with different resolutions by decomposing the
signal into a coarse approximation and detail information
DWT employs two sets of functions, called scaling
functions and wavelet functions, which are associated
with low pass and highpass filters, respectively.
The decomposition of the signal into different frequency
bands is simply obtained by successive highpass and
lowpass filtering of the time domain signal
The original signal x[n] is first passed through a
halfband highpass filter g[n] and a lowpass filter h[n]
Discrete Wavelet Transform
After the filtering, half of the samples can be
eliminated according to the Nyquist’s rule, since
the signal now has a highest frequency of p/2
radians instead of p
The signal can therefore be subsampled by 2,
simply by discarding every other sample. This
constitutes one level of decomposition and can
mathematically be expressed as follows:
Discrete Wavelet Transform
This decomposition halves the time resolution since
only half the number of samples now characterizes the
entire signal. However, this operation doubles the
frequency resolution, since the frequency band of the
signal now spans only half the previous frequency
band, effectively reducing the uncertainty in the
frequency by half
At every level, the filtering and subsampling will
result in half the number of samples (and hence half
the time resolution) and half the frequency band
spanned (and hence double the frequency resolution)
Discrete Wavelet Transform
Discrete Wavelet Transform
In practice, such transformation will be applied
recursively on the low-pass series until the desired
number of iterations is reached
The frequencies that are most prominent in the original signal
will appear as high amplitudes in that region of the DWT
signal that includes those particular frequencies
The difference of this transform from the Fourier transform is
that the time localization of these frequencies will not be lost
However, the time localization will have a resolution that
depends on which level they appear
This procedure in effect offers a good time resolution at high
frequencies, and good frequency resolution at low frequencies
Most practical signals encountered are of this type
Discrete Wavelet Transform
One important property of the discrete wavelet
transform is the relationship between the impulse
responses of the highpass and lowpass filters. The
highpass and lowpass filters are not independent of
each other, and they are related by
where g[n] is the highpass, h[n] is the lowpass filter, and L is the
filter length (in number of points).
Discrete Wavelet Transform
Note that the two filters are odd index alternated
reversed versions of each other. Lowpass to
highpass conversion is provided by the (-1)n term.
Filters satisfying this condition are commonly used
in signal processing, and they are known as the
Quadrature Mirror Filters (QMF). The two filtering
and subsampling operations can be expressed by
Discrete Wavelet Transform
The reconstruction in this case is very easy since half band
filters form orthonormal bases
The procedure is followed in reverse order for the
reconstruction
The signals at every level are upsampled by two, passed
through the synthesis filters g’[n], and h’[n] (highpass and
lowpass, respectively), and then added
The interesting point here is that the analysis and synthesis
filters are identical to each other, except for a time reversal
Therefore, the reconstruction formula becomes (for each layer)
Discrete Wavelet Transform
However, if the filters are not ideal halfband, then
perfect reconstruction cannot be achieved.
Although it is not possible to realize ideal filters,
under certain conditions it is possible to find filters
that provide perfect reconstruction
The most famous ones are the ones developed by
Ingrid Daubechies, and they are known as
Daubechies’ wavelets
2D- Discrete Wavelet Transform
2D-DWT of an image
We start by defining a two-dimensional scaling and
wavelet functions
s ( x, y ) ( x) ( y ) s ( x, y ) ( x) ( y )
INPUT COLUMNS
……
IMAGE ~
H 1 2 HL Dk(v)1
~ 2 1
G
ROWS
~ (d)
G 1 2 D
HH k 1
COLUMNS
Downsample columns along the rows: For each row, keep the
2 1 even indexed columns, discard the odd indexed columns
Upsample columns along the rows: For each row, insert zeros at
2 1 between every other sample (column)
Upsample rows along the columns: For each column, insert zeros
1 2 at between every other sample (row)
DWT on Images
LL Ak 1 1 2 H
2 1 H
LH (h)
Dk 1 1 2 G
ORIGINAL
IMAGE
Dk(v)1
HL
1 2 H
2 1 G
HH D(d) 1 2 G
k 1
We perform the 2-D wavelet transform by applying 1-D wavelet
transform first on rows and then on columns.
Rows Columns
H 2
H 2 LL
G 2
f(m, n) LH
H 2
G 2
HL
G 2
HH
Integer based Wavelets
By using a so-called lifting scheme, integer-
based wavelets can be created.
Using the integer-based wavelet, one can
City Block Distance Measure for Script Identification using Wavelet Features
Preprocessing and Feature Extraction
55
The three horizontal zones namely top zone, middle zone and
bottom zone covers 30%, 40% and 30% of the region of band
and all vertical zones are divided to have equal size.
Feature Extraction
56 Zone Wise Wavelet Energy Features
Then, the wavelet energy feature is computed from the detailed coefficient
Dj3 (Diagonal Energy Band) at every level j.
Hence, totally 10 wavelet energy features are obtained at each level j.
These features (10 at each level) are stored into feature vector X.
u1 N
Ej1h1 ( (D ( m, n )) /( MxN )
j1
m 1 n 1
u2 N
E j1h 2 ( (D
m u 1 1 n 1
( m , n )) /( MxN )
j1
M N
E j 1h 3 ( (D
m u 2 1 n 1
j1 ( m, n )) /( MxN )
Feature Extraction
58 Wavelet Log Mean Deviation Features
•The method computes totally 3j wavelet log mean deviation features at every
resolution level j, which are stored into feature vector X.
M N |Djp (m ,n )| 1)
log(
m 1n 1 Sj
LMDjp
MN
•In the current work, the value of ∂ = 0.001 is experimented
• During experiments it is observed that, the obtained values gives better representation of
texture.
•Further, 2 more additional features that model relation between detailed energy bands are
determined as stated in equations below.
•Hence, this step records 10 features (5 at each level) into feature vector X.
LMDj4 = LMDj1 - LMDj2;
LMDj5 = LMDj2 - LMDj3;
Feature Extraction
59 Wavelet Vertical Run Features
•These statistical features are obtained from vertical detailed coefficient Dj2
halved into four equal sized vertical regions/zones leading to a dimension of
8 features at both decomposition levels (4 features for every level j), which
are further recorded into feature vector X.
Feature Extraction
60 Wavelet Vertical Run Features
X = [Ej1h1 Ej1h2 Ej1h3 Ej1h4 Ej1h5 Ej1v1 Ej1v2 Ej1v3 Ej1v4 Ej3 LMDj1 LMDj2 LMDj3 LMDj4 LMDj5
WRFj1 WRFj2 WRFj3 WRFj4, j=1,2 ]
Knowledge Base Construction
61
•For the purpose of knowledge base construction,
the images were captured from display boards of
government offices in India. The image database
consists of 1450 Kannada, 1200 English, 900
Malyalam, 900 Tamil and 900 Devanagari script
word images of varying resolutions
63
64
66
The smallest distance between test word image and knowledge base is
used to identify the script class.
Results and Analysis
67
It is also found that, if the knowledge bases are trained for all
variations and degradations, better performance can be obtained.
69
THANK YOU
Useful Link
Matlab wavelet tool using guide
http://www.wavelet.org
http://www.multires.caltech.edu/teaching/
http://www-dsp.rice.edu/software/RWT/
www.multires.caltech.edu/teaching/courses/
waveletcourse/sig95.course.pdf
http://www.amara.com/current/wavelet.html