Académique Documents
Professionnel Documents
Culture Documents
Bachelor of Technology
in
Electronics and Instrumentation Engineering
By
SAURABH KUMAR SAHOO (111EI0258)
1| P a g e
Bachelor of Technology
in
Electronics and Instrumentation Engineering
By
SAURABH KUMAR SAHOO (111EI0258)
Under the guidance of
2| P a g e
We hereby declare that the project work entitled Study and Development of Handwritten
Character Recognition is a record of our original work done under Prof. Sukadev Meher,
National Institute of Technology, Rourkela. Throughout this documentation wherever
contributions of others are involved, every endeavour was made to acknowledge this clearly
with due reference to literature. This work is being submitted in the partial fulfilment of the
requirements for the degree of Bachelor of Technology in Electronics and Instrumentation
Engineering at National Institute of Technology, Rourkela for the academic session 2011
2015.
The results embodied in the thesis are our own and not copied from other sources, wherever
materials from other sources are put, due reference and recognition is given to original
publication.
3| P a g e
CERTIFICATE
Date:
SUKADEV MEHER
Prof.
Department of Electronics and
Communication
4| P a g e
Engineering
National Institute of
Technology, Rourkela-769008
ACKNOWLEDGEMENT
We would like to thank all my friends, faculty members and staff of the
Department of Electronics and Communication Engineering, N.I.T Rourkela
for their extreme help throughout my course of study at this institute.
SAURABH KUMAR
SAHOO (111EI0258)
5| P a g e
6| P a g e
ABSTRACT
7| P a g e
CONTENTS
Declaration
.3
Certificate
4
Acknowledgement.
.............................5
Abstract
6
List of
Figures...............
....................9
Chapter 1:
INTRODUCTION
.10
1.1 Declaration and Brief
Review..11
1.2 Classification
Process.
12
Chapter 2: IMAGE PREPROCESSING...............................................................14
2.1 Introduction
.15
2.2 Morphological Image
Processing15
2.2.1 Fundamental principles of morphological image
processing..17
2.3 Medial Axis
Transform
19
8| P a g e
9| P a g e
Chapter 6: REFERENCES
....43
LIST OF FIGURES
2.2 Examples
of
simple
structuring
elements.16
2.3
Fitting
and
hitting
with
structuring
s2..17
elements
2.4 Erosion
with
a
3*3
square
element...18
2.5
Dilation
with
a
3*3
square
..18
2.5 Skeleton
images
of
sample
characters.20
s1
structuring
structuring
images
element
of
numeric
2.7
Skew
correction
of
a
word.....21
2.8 Normalization
of
a
sample
image
image.22
w.r.t
2.9
Fitting
of
a
set
of
lines
in
a
points.23
and
given
sample
reference
no.
of
2.10
Examples
of
sobel
operators..24
filter
2.11 Image
after
slant
correction
....25
filter
by
using
sobel
2.12 Separation
of
lines
and
characters.....26
3.1
Chain
code
and
Freeman
29
code
representation
3.2 Example
of
freeman
code
30
3.3 Chain code for different numeric characters in a given image
....30
11| P a g e
4.1
Fourier
approximation
of
numbers....37
two
Chapter 1
Introd
uction
12| P a g e
13| P a g e
Image processing is grouped into two wide regions as, computer graphics
and computer vision. In computer graphics, the inputs are typically
synthetic from different protests and lighting. Whereas in computer vision,
the inputs are generally extracted from video, a PC, cam or a product. It
incorporates different systems for securing, processing and analysing
pictures. The different undertakings it incorporates are, recognition,
motion analysis, scene reconstruction and image restoration, and on
account of recognition it incorporates object recognition, identification and
detection. In this examination work, another neural system technique is
proposed to perceive transcribed numerals. Scanned pictures of manually
written numerals are data for recognition.
The aim of optical character recognition is to classify the optical patterns
corresponding to numerical or alphabetical characters. The process of
recognition includes different steps which involves segmentation, feature
extraction and classification. Each of these steps is a field unto itself, and
is described here in the context of a Matlab implementation of character
recognition.
15| P a g e
1.1
BLOCK DIAGRAM OF OPTICAL CHARACTER
RECOGNITION
1. Training
a. Pre-processing - This stage transforms and processes the data so that it
is converted suitable form for feature extraction.
b. Feature extraction Decreases the amount of data by extracting only
the important
information from the pre-processed data.
c. Model Estimation this stage estimates a model from the finite set of
feature vectors
(Usually statistical) for each class of the training data.
2. Testing
a. Pre-processing - This stage transforms and processes the data so that it
is converted suitable form for feature extraction.
b. Feature extraction Decreases the amount of data by extracting only
the important
information from the pre-processed data.
16| P a g e
CHAPTER 2
IMAGE- PREPROCESSING
17| P a g e
2.1
INTRODUCTION
2.2
19| P a g e
20| P a g e
21| P a g e
IMAGE DILATION
The hit and miss operation preserves the pixels whose neighbourhood
match the shape of SE1 (structuring element) and dont match the shape
of SE2(structuring element). SE1 and SE2 are structuring element objects
created by strel function or neighbourhood array.
Syntax: BW2 = bwhitmiss(BW1,SE1,SE2)
It is equivalent to
f
{s1, s2} = (f
s1) (f c
s2)
2.3
MEDIAL AXIS
TRANSFORM/SKELETONIZATION
Skeletonization is a procedure for lessening foreground regions in a
binary picture to a skeletal remainder that to a great extent protects
the degree and integration of the first district while discarding the
greater part of the first forefront pixels. To perceive how this
functions, envision that the frontal areas in the input binary picture
are made of some uniform moderate blazing material. Light flames
at the same time at all focuses along the limit of this district and
watch the flame move into the inside. At points where the flame
going from two distinct limits meets itself, the flame will smother
itself and the points at which this happens form the alleged `quench
line'. This line is the skeleton. Under this definition it is clear that
thinning produces a sort of skeleton.
Algorithm used:
Finding the contour of an image.
For each pixel, select 5 upper pixels and 5 down pixels.
Find the angle of all the pixels with respect to the selected pixel
along the horizontal line
Find the median of all the angles found.
Use geometry to find the coordinates of opposite pixel.
Find the mid-point between the selected pixel and its opposite pixel.
Remove all the isolated points.
The median of the local orientations in the neighbourhood of
selected and opposite pixel should at most differ by 10degrees.
23| P a g e
Skeletonization:
2.4
SKEW-CORRECTION OF WORD
The correction of handwritten word skew is an arduous task that
must be independent of due to style and writing conditions
variations. A least square method is proposed to detect and correct
handwritten word skew in the treatment of dates written on bank
check. Our aim is to limit the number of parameters and heuristic
features necessary for a good skew correction. Our approach is
based on the morphological pseudo-convex hull. We illustrate the
accuracy of this new method with real examples of dates
handwritten on bank checks.
Algorithm used:
Find the contour of the image.
Find the minimum points of all the contours.
Using least square method try to fit the minimum points along a
straight line i.e. y=ax+b.
Find out the slope a and intercept b of the straight line.
24| P a g e
Skew-correction of a word
2.5
NORMALIZATION OF AN IMAGE
In image processing, normalization is a process that changes
the size of the image. In this process the size of the sample images
is adjusted according to a reference image.
Algorithm used:
Normalization of an image
X cos + Y sin = r
Where r is the length of normal from origin to the line, theta is the
orientation of r with respect to x axis. For every point (x,y) on the line, r is
constant.
In hough Space, The points that are collinear in the Cartesian space gives
rise to curves which intersect at a common (r,theta) point.
SOBEL FILTER
28| P a g e
2.8 SEGMENTATION
We have taken a binary image. This binary picture comprises of a
considerable bunch of items that are differentiated from every other.
Pixels that has a place with an object are marked as 1/true while others
are marked as 0/false.
Suppose a binary image that looks like
00000111
01010011
01110000
00000001
00000011
00111011
We can see that there are 4 objects in the above image. The definition of
an object in the picture are those pixels that are 1, that are associated in a
chain by taking a look at nearby neighbourhood.
29| P a g e
Our output will be given as an integer map where every object is assigned
an unique id. The yield would look something like this
00000333
01010033
01110000
00000004
00000044
00222044
30| P a g e
CHAPTER 3
FEATURE
EXTRACTION
3.1 INTRODUCTION
31| P a g e
1. Boundary Detection
The IPT function bwboundaries traces region boundaries in binary image.
It can trace the exterior boundaries of objects, as well as boundaries of
holes inside these objects. It can also trace the boundaries of children of
parent objects in an image. The bwboundaries function returns a cell array
(B) in which each cell contains the row and column coordinates of a
boundary pixel.
2. Chain code
Chain codes are alternative methods for tracing and describing a contour.
A chain code is a boundary representation technique by which a contour is
represented as a sequence of straight line segments of specified length
(usually 1) and direction. The simplest chain code mechanism, also known
32| P a g e
chain code
b. freeman code
33| P a g e
34| P a g e
CHAPTER 4
TRAINING AND
RECOGNITION
4.1 INTRODUCTION
35| P a g e
V = a1 a2 a3 a4 a5.
36| P a g e
An example of a chaincode ,
V1=0005676644422123
Is shown in fig., using the method of deriving a chain code from an area
quantized image .The fourier coefficients of a chain encoded contour
developed in this section is for a particular starting point on the contour.
The fourier series representation is approximate for the chain code
because the code repeats on successive traversals of the contour.
Elementary properties of the chain code are easily described. Assuming
that the chain code is followed at constant speed, the time needed to
traverse a particular link ai is
The time required to traverse the first p links of the chain are, respectively
And the basic period of the chain code is T=tk. The changes in the x , y
projections of the chain as the link ai is traversed are
And arbitrarily locating the starting point of the chain code at the origin,
the projections on x and y of the first p links of the chain are respectively
37| P a g e
The fourier series expansion for the x projection of the chain code of the
complete contour is defined as
38| P a g e
Where
39| P a g e
The fourier series expansion for the y projection of the chain code of the
complete
40| P a g e
41| P a g e
There are different kinds of learning rules. The one we used here is
back propagation technique. In back propagation technique learning is a
supervised process which occurs with each epoch through a forward flow
42| P a g e
of the outputs and then back propagation of the errors for adjusting the
weights. We have used different activation function for different hidden
layers and we have also defined a minimum gradient.
No of hidden layers: 3
No of epoch: 1500
43| P a g e
CHAPTER 5
RESULTS
AND CONCLUSION
44| P a g e
5.1 RESULTS
The program was rigorously tested on approximately sample images, hand
written on Microsoft Paint. Since the samples were hand written the
experimental results provide a good estimate of the performance of the
program.
An analysis of the results have been tabulated as below. Each of the
characters were tested for 40 samples.
TYPE
OF
TRAINING
RECOGNITION
ALGORITHM
AND
CO-EFFICIENTS
TRANSFORM
OF CHAIN CODE
OF
FOURIER
ACCURACY OBTAINED
85.3333%
93.07862%
5.2 CONCLUSION
In this paper, we have described a system for OCR of printed numeral
character material. The recognition accuracy of the prototype
implementation is promising, but more work needs to be done. In
particular, no fine-tuning of the system has been done so far. Our
character segmentation method also needs to be improved so that it can
handle a larger variety of touching characters, which occur fairly often in
45| P a g e
46| P a g e
CHAPTER
5
REFERENCES
47| P a g e
REFERENCES
February 2002.
49| P a g e