You are on page 1of 51

Comparison of Edge Detection Techniques on

Alphanumeric Characters
A Thesis Submitted
in Partial Fulllment of the Requirements
for the Degree of
Master of Technology
in
Software Engineering
by
Rajesh Kumar
2008ptsw06
Under the Guidance of
Prof. Suneeta Agarwal
COMPUTER SCIENCE AND ENGINEERING DEPARTMENT
MOTILAL NEHRU NATIONAL INSTITUTE OF TECHNOLOGY
ALLAHABAD 211004, INDIA
October, 2011
UNDERTAKING
I declare that the work presented in this thesis titled Comparison of
Edge Detection Techniques on Alphanumeric Characters , submit-
ted to the Computer Science and Engineering Department, Motilal
Nehru National Institute of Technology, Allahabad, for the award of
the Master of Technology degree in Software Engineering, is my
original work. I have not plagiarized or submitted the same work for
the award of any other degree. In case this undertaking is found in-
correct, I accept that my degree may be unconditionally withdrawn.
October, 2011
Allahabad
(Rajesh Kumar)
ii
CERTIFICATE
Certied that the work contained in the thesis titled Comparison
of Edge Detection Techniques on Alphanumeric Characters , by
Rajesh Kumar, Registration Number 2008ptsw06 has been carried
out under my supervision and that this work has not been submitted
elsewhere for a degree.
October, 2011
(Dr. Suneeta Agarwal)
Computer Science and Engineering Dept.
M.N.N.I.T, Allahabad
iii
Acknowledgment
I would like to take this opportunity to express my deep sense of gratitude to all who
helped me directly or indirectly during this thesis work.
Firstly, I would like to thank my supervisor, Prof. Suneeta Agarawal, for being a
great mentor and the best adviser I could ever have. Her advise, encouragement and crit-
ics are source of innovative ideas, inspiration and causes behind the successful completion
of this dissertation. The condence shown on me by her was the biggest source of inspi-
ration for me. It has been a privilege working with her from last one year.
I am highly obliged to all the faculty members of Computer Science and Engineer-
ing Department for their support and encouragement. I express my sincere thanks to the
Prof. B. D. Chaudhary, Head of the Department Prof. M. M. Gore, Prof. A. K. Misra,
Prof. Krishna Kant, DPGC Convener, Prof. R. S. Yadav and Mr. Manoj Waria, MNNIT,
Allahabad, for providing continuous support, encouragement and advice. I express my
sincere thanks to all the Professors, Deans, ofce staff, supporting staff and students of
MNNIT, Allahabad. I express my gratitude to all Vice-Chancellors, Registrars, Deans,
Heads, Student Alumni of the respondent universities and its allied institutes.I owe my
sincere gratitude to the Chairman BOG-LDCITS, Mr. Sanjay Gupta, , Secretary, Mr.
Vivek Gupta, Director, Dr. A. L. Kundu, Dean Academics, Dr. S. N. Tewari, Registrar,
iv
Mr. Iqbal Ahmad, Heads of the Department and all my colleagues of LDCITS, Allahabad
for giving me all the necessary support and cooperation that enabled me to fulll this
academic endeavor. Special thanks to Mr. Chintan Mandal ,Mr. Shivendra Shiwani, Mr.
Anoop Patel Allahabad, Research Scholars from MNNIT: Mr.Nagendra Pratap Singh ,Mr.
Brajesh Umarao,Mr. Karunesh Kumar,Mr.R. R. Yadav who helped a lot precisely in mak-
ing this dissertation. My wife, Smt. Vandana Bharati, gave me power and brain to work
out on this research and her help at every level made me to see this success. I extend my
thanks to her and also to my loving Daughter Aditi Bharati, who are my parts in respira-
tion. Words are insufcient to express my profound sense of gratitude to my dear parents
whose encourage- ment and blessings gave me physical and moral strength throughout
my career as well in the present investigation. I also express my deepest gratitude to my
brothers and sisters for their unfailing emotional support and encouragement during this
research work. However, I alone assume the complete responsibility for any error that
might have crept in or omissions that are committed unconsciously. Finally, I would like
to wind up by paying my heartfelt thanks and prayers to the Almighty for his unbound
love and grace. Finally, I am grateful to my parents for their support. It was impossible
for me to complete this thesis work without their love, blessing and encouragement.
- Rajesh Kumar
v
Biographical Sketch
Rajesh Kumar
Vill- Hetimpur ,Post-Shikarganj Dist- Chandauli, PIN-232103, E-Mail:
rajeshkumargis@gmail.com, Contact. No. 09451644196
Education
Pursuing M.Tech. in Software Engineering branch from M.N.N.I.T. Allahabad with
CPI of 7.5/10/00.
B.Tech. in Computer Science and Engineering branch from G.B. Pant Engineering
College ,Pauri , 71.50% in 2003.
Intermediate from .G.I.C Chakia Chandauli,From U.P. Board in 1998.
High School from R.K Inter College Tiari,Chandauli, From U.P.Board in 1996.
M.Tech Thesis Research Orientation
Publications
Edge detection of vehilce lisence Plates Nubber
vi
Dedicated to
To My wife Mrs. Vandana Bharati and baby Aditi for their kind love & support.
To my parrents , for their encouragement & blessings that provide me condence all
the time.
vii
cYou cant teach people everything they need to know. The best you
can do is position them where they can nd what they need to know when
they need to know it.d
-Seymour Papert (MIT Mathematician)
viii
Synopsis
Edge detection is one of the most commonly used operations in image analysis, and there
are probably more algorithms in the literature for enhancing and detecting edges than any
other single subject. The reason for this is that edges form the outline of an object. An
edge is the boundary between an object and the background, and indicates the boundary
between overlapping objects. This means that if the edges in an image can be identied
accurately, all of the objects can be located and basic properties such as area, perimeter,
and shape can be measured. Since computer vision involves the identication and clas-
sication of objects in an image, edge detections is an essential tool. In this thesis, we
have compared ve Edge Detection techniques like Sobel,Roberts, Prewitt ,Laplasian of
Gaussian and Canny. We have taken different fonts and letters for detecting the edges.The
Goodness of edge detection techniques can be measured with the help of two criteria.
First by visual observations and second by Mean Square Error (MSE).nally we calculate
average mean square error for several edge detectors.
ix
Contents
Acknowledgment iv
Biographical Sketch vi
Dedicated to vii
Synopsis ix
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Edges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 Mean Square Error . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Contribution of the Dissertation . . . . . . . . . . . . . . . . . . . . . . 3
2 Related Work 4
2.1 Classication of Edge Detector . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1 Gradient Edge detector . . . . . . . . . . . . . . . . . . . . . . 4
2.2 IMPLEMENTATION AND COMPARISON . . . . . . . . . . . . . . . . 12
x
2.3 Method for Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3 EXPERIMENTAL ANALYSIS 14
3.1 Sobel operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Prewitt Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Roberts Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4 Laplacian of Gaussian Operators . . . . . . . . . . . . . . . . . . . . . . 15
3.5 Canny Operaotrs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 PERFORMANCE EVALUATION 17
4.1 Visual observation of Edges . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Edges of Digits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.3 Edges of Alphabets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.4 Edges of Vehicle License Plates . . . . . . . . . . . . . . . . . . . . . . 18
4.5 MSE OF ALPHABETS . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.6 MSE OF License Plates . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Conclusion and Future work 36
References 37
xi
List of Figures
1 Type of Edges Present in Image . . . . . . . . . . . . . . . . . . . . . . 2
2 Edges of Digit 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3 Edges of Digit 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 Edges of digit 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5 Edges of digit 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6 Edges of digit 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7 Edges of Letter F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8 Edges of Letter T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
9 Edges of Letter U . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
10 Edges of Letter V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
11 Edges of Letter W . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
12 Edges of Letter Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
13 Edges of Letter Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
14 Edges of License Plate 1st . . . . . . . . . . . . . . . . . . . . . . . . . 30
15 Edges of License Plate 2nd . . . . . . . . . . . . . . . . . . . . . . . . . 31
16 Edges of License Plate 3rd . . . . . . . . . . . . . . . . . . . . . . . . . 32
17 Edges of License Plate 4th . . . . . . . . . . . . . . . . . . . . . . . . . 33
18 Edges of License Plate 5th . . . . . . . . . . . . . . . . . . . . . . . . . 34
19 Edges of License Plate 5th . . . . . . . . . . . . . . . . . . . . . . . . . 35
xv
List of Tables
1 Gx : Sobel Opeartor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Gy : Sobel Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Gx : Robert Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 Gy : Robert Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5 Gx : Prewitt Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6 Gy : Prewitt Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
7 I: Laplacian Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
8 II: Laplacian Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
9 III: Laplacian Opeartor . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
10 G
x
: Canny Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
11 G
y
: Canny Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
12 four possible Direction for a . . . . . . . . . . . . . . . . . . . . . . . . 11
xvi
Chapter 1
Introduction
An edge in an image is a contour across which the brightness of the image changes
abruptly. In image processing, an edge is often interpreted as one class of singularities.
In a function, singularities can be characterized easily as discontinuities where the gradi-
ent approaches innity. However, image data is discrete, so edges in an image often are
dened as the local maxima of the gradient. This is the denition we will use here. Edge
detection is an important task in image processing. It is a main tool in pattern recognition,
image segmentation, and scene analysis. An edge detector is basically a high- pass lter
that can be applied to extract the edge points in an image. This topic has attracted many
researchers and many achievements have been made [14]-[20]. In this paper, we will ex-
plain the mechanism of edge detectors from the point of view of wavelets and develop a
way to construct edge detection lters using wavelet transforms.
1.1 Motivation
When I rst started writing this thesis, I was quite in doubt whether such a topic was
too applied to be of any value in Mtech research. However, with further study of Edge
1
analysis and Computer Vission , I realized that this particular eld of Image processing
would not have been developing so quickly were it not for the vast applications that re-
quired such a mathematical tool. In St. Louis, Victor Wickerhauser was using this same
mathematics to help the FBI store ngerprints more economically; while at Yale, Ronald
Coifman used it to coax a battered recording of Brahms playing the piano into yielding its
secrets. In France, Yves Meyer of the University of Paris-Dauphina found himself talking
to astronomers about how these new techniques could be used to study the large-scale
structure of the universe. The technique of edge detection has long been studied by re-
searchers in electrical engineering and in mathematics. It was not until the work of Mallat
and his colleagues that wavelet was introduced into such studies. Mallat and his col-
leagues put their emphasis on decomposing and reconstructing digital signals from their
edge information. Here, we make improvements based on some of the previous results,
and develop a wavelet approach Thus this work is totally motivated by the requirement of
the Edge Detection Techniques and Computer vission .
1.2 Terminology
1.2.1 Edges
Edges are boubdary between an object and its background , and indicates the boundary
between overlapping objects . If the edges in an images can be identied accurately
all the basic property of objects such as shape, area ,size and perimeter are measured
As mentioned, different edge detectors use different denitions of edges. There- fore, a
precise denition of how the term edge is used in this thesis is as follows.type of edges
that are present in image are shown bellow
Figure 1: Type of Edges Present in Image
2
1.2.2 Mean Square Error
The mean Square error is numerical error measurement used in this work for the compar-
ing the results of edge detection operators .
1.3 Goal
The main goal of this thesis work is to nd out the correct algorithm for detecting the
edge of alphanumeric character present in an image . for this purpose I have taken more
than 40 images including character A-Z and digits 0-9 and Some special characters like
,@,&.
1.4 Contribution of the Dissertation
I have taken more th 40 digital Images and apply ve edge detection algorithms over it
. I use some metrics by which it can be decided that which edge detectors are good for
detecting edges in alphanumeric character in images . I have used all the algorithms,
some of which are using rst derivatives and some using second derivatives like Robert
, sobel ,prewitt,laplacin and canny. For this purpose I calculated Mean Square Error(M
S E ) for each and every images for different algorithms comparison with canny edge
detector.. After that Average Mean Square Error is calculated by above ve methods
. if the Average Mean Square Error for any method is Less of closer to Canny Edge
detector we can conclude that this particular Method . Then We Apply this method to
Detect edge of Alphanumeric character in Digital Images . I had implemented these
above algorithms in MATLAB and Calculating the Edges for every method and Mean
Square Error is calculated for each and every case .
3
Chapter 2
Related Work
Edge detection is a useful low-level form of image processing for obtaining a simplied
image .Edges have most of the information of an object like Shape , size ,perimeter ,area
,etc. [? ] therefore, accurate edge detection techniques are important for many imaging
systems. For example, edge detection has played a great role in medical imaging, Vehicle
license plate recognition and identication ,Global positioning systems etc
2.1 Classication of Edge Detector
The edge detector can be classied in to following categories
2.1.1 Gradient Edge detector
It contains the classical operators and uses rst directional derivatives operators. It include
the Algorithms such as Sobel(1970),Prewitt(1970),and Robert Operator
4
Table 1: Gx : Sobel Opeartor
-1 0 1
-2 0 2
-1 0 1
Table 2: Gy : Sobel Operator
1 2 1
0 0 0
-1 -2 -1
Sobel Operator
The operator consists of 3 3 convolution Kernels as shown in table bellow:
These Kernels are design to represent maximally to edge running vertically and hori-
zontal relative to the pixel grid . One kernel for each of the two perpendicular orientation
the gradient magnitude is given by
|G| =

G
x
2
+ G
y
2
(1)
Typically the maximum magnitude is computed using
|G| = |G
x
| + |G
y
| (2)
This is much faster to compute . The angle of orientation of edge (relative to the pixel
grid)giving rise to the spatial gradient is given by
= arctan

G
y
G
x

(3)
Roberts Cross operator
The roberts cross operator performs a simple and quick method to compute 2-D spatial
gradient measurement on an image . The operator consists of a pair of 3 3 convolution
5
Table 3: Gx : Robert Operator
0 0 0
1 0 0
0 -1 0
Table 4: Gy : Robert Operator
0 0 0
0 1 0
-1 0 0
kernel as shown in table bellow:
These kernals are design to responds maximally to edge running at 45

C to the pixel
grid the one kernel for each of the two perpendicular orientation .The kernel can be applied
separately to produce separate measurement of gradient component in each orientationG
x
and G
y
.The gradient magnitude is given by :
|G| =

G
x
2
+ G
y
2
The angle of orientation of the edge giving rise to the spatial
gradient relative to the pixel grid and the orientation is given by
= arctan

G
y
G
x

4
Prewitt Operator
Prewitt operator is similar to the Sobel operator and is used for detecting vertical and
horizontal edges in images.The prewitt operator is slightly simpler to implemented com-
putationally than sobel operator .
6
Table 5: Gx : Prewitt Operator
-1 0 1
-1 0 1
-1 0 1
Table 6: Gy : Prewitt Operator
1 1 1
0 0 0
-1 -1 -1
Laplacian of Gaussian
The Laplacian is a 2-D isotropic measure of the 2nd spatial derivative of an image. The
Laplacian of an image highlights regions of rapid intensity change and is therefore often
used for edge detection. The Laplacian is often applied to an image that has rst been
smoothed with something approximating a Gaussian Smoothing lter in order to reduce
its sensitivity to noise. The operator normally takes a single gray level image as input and
produces another gray level image as output. The Laplacian L(x,y) of an image with pixel
intensity values I(x,y) is given by:
L(x, y) =

2
I
x
2
+

2
I
y
2
Since the input image is represented as a set of discrete pixels, we have to nd a discrete
convolution kernel that can approximate the second derivatives in the denition of the
Laplacian. Three commonly used small kernels are shown in table bellow: Because
Table 7: I: Laplacian Operator
1 1 1
1 8 1
1 1 1
7
Table 8: II: Laplacian Operator
-1 2 -1
2 4 2
-1 2 -1
these kernels are approximating a second derivative measurement on the image, they are
very sensitive to noise. To counter this, the image is often Gaussian Smoothed before
applying the Laplacian lter. This pre-processing step reduces the high frequency noise
components prior to the differentiation step. In fact, since the convolution operation is
associative, we can convolve the Gaussian smoothing lter with the Laplacian lter rst
of all, and then convolve this hybrid lter with the image to achieve the required result.
Doing things this way has two advantages: Since both the Gaussian and the Laplacian
kernels are usually much smaller than the image, this method usually requires far fewer
arithmetic operations. The LoG (Laplacian of Gaussian) kernel can be pre-calculated in
advance so only one convolution needs to be performed at run-time on the image. The
2-D LoG function centered on zero and with Gaussian standard deviation has the form
LoG(x, y) =
1

x
2
+ y
2
2
2

x
2
+ y
2
2
2
(4)
Note that as the Gaussian is made increasingly narrow, the LoG kernel becomes the
same as the simple Laplacian kernels shown in gure 4. This is because smoothing with
a very narrow Gaussian ( < 0.5pixels) on a discrete grid has no effect. Hence on a
discrete grid, the simple Laplacian can be seen as a limiting case of the LoG for narrow
Gaussians.
Because these kernels are approximating a second derivative measurement on the image,
they are very sensitive to noise. To counter this, the image is often Gaussian Smoothed
before applying the Laplacian lter.
8
Table 9: III: Laplacian Opeartor
0 1 0
1 -4 1
0 1 0
Canny Edge Operator
The Canny edge detection algorithm is known to many as the optimal edge detector.
Cannys intentions were to enhance the many edge detectors already out at the time he
started his work. He was very successful in achieving his goal and his ideas and methods
can be found in his paper, A Computational Approach to Edge Detection. In his paper,
he followed a list of criteria to improve current methods of edge detection. The rst and
most obvious is low error rate. It is important that edges occurring in images should not
be missed and that there be no responses to non-edges. The second criterion is that the
edge points be well localized. In other words, the distance between the edge pixels as
found by the detector and the actual edge is to be at a minimum. A third criterion is to
have only one response to a single edge. This was implemented because the rst two
were not substantial enough to completely eliminate the possibility of multiple responses
to an edge. Based on these criteria, the canny edge detector rst smooths the image to
eliminate and noise. It then nds the image gradient to highlight regions with high spatial
derivatives. The algorithm then tracks along these regions and suppresses any pixel that
is not at the maximum (non maximum suppression). The gradient array is now further
reduced by hysteresis. Hysteresis is used to track along the remaining pixels that have not
been suppressed. Hysteresis uses two thresholds and if the magnitude is below the rst
threshold, it is set to zero (made a non edge). If the magnitude is above the high threshold,
it is made an edge. And if the magnitude is between the 2 thresholds, then it is set to zero
unless there is a path from this pixel to a pixel with a gradient above T2.
In order to implement the canny edge detector algorithm, a series of steps must be fol-
lowed:
The rst step is to lter out any noise in the original image before trying to locate and
detect any edges. And because the Gaussian lter can be computed using a simple mask,
9
Table 10: G
x
: Canny Operator
-1 0 1
-2 0 2
-1 0 1
Table 11: G
y
: Canny Operator
1 2 1
0 0 0
-1 2 -1
it is used exclusively in the Canny algorithm. Once a suitable mask has been calculated,
the Gaussian smoothing can be performed using standard convolution methods. A con-
volution mask is usually much smaller than the actual image. As a result, the mask is
slid over the image, manipulating a square of pixels at a time. The larger the width of the
Gaussian mask, the lower is the detectors sensitivity to noise. The localization error in
the detected edges also increases slightly as the Gaussian width is increased.
After smoothing the image and eliminating the noise, the Second step is to nd the edge
strength by taking the gradient of the image. The Sobel operator performs a 2-D spatial
gradient measurement on an image. Then, the approximate absolute gradient magnitude
(edge strength) at each point can be found. The Sobel operator uses a pair of 3 3 con-
volution masks, one estimating the gradient in the x-direction (columns) and the other
estimating the gradient in the y-direction (rows). They are shown Table 10 -11.: The
magnitude, or edge strength, of the gradient is then approximated using the formula:
|G| = |G
x
| + |G
y
| (5)
In the third step direction of the edge is computed using the gradient in the x and y
directions. However, an error will be generated when sum X is equal to zero. So in the
code there has to be a restriction set whenever this takes place. Whenever the gradient in
the x direction is equal to zero, the edge direction has to be equal to 90

or 0

, depending
on what the value of the gradient in the y-direction is equal to. If GY has a value of zero,
10
Table 12: four possible Direction for a


a


the edge direction will equal 0

. Otherwise the edge direction will equal90

. The formula
for nding the edge direction is just:
= tan
1

G
y
G
x

The fourth step is to relate the edge direction to a direction that can be traced in an
image. So if the pixels of a 5 5 image are aligned as table 12:
Then, it can be seen by looking at pixel a, there are only four possible directions when
describing the surrounding pixels -0

(in the horizontal direction), 45

(along the positive


diagonal), 90

(in the vertical direction), or 135

(along the negative diagonal). So now


the edge orientation has to be resolved into one of these four directions depending on
which direction it is closest to (e.g. if the orientation angle is found to be 3

, make it zero
degrees). Think of this as taking a semicircle and dividing it into 5 regions.
Finally, hysteresis is used as a means of eliminating streaking. Streaking is the breaking
up of an edge contour caused by the operator output uctuating above and below the
threshold. If a single threshold, T1 is applied to an image, and an edge has an average
strength equal to T1, then due to noise, there will be instances where the edge dips below
the threshold. Equally it will also extend above the threshold making an edge look like a
dashed line. To avoid this, hysteresis uses 2 thresholds, a high and a low. Any pixel in the
image that has a value greater than T1 is presumed to be an edge pixel, and is marked as
such immediately. Then, any pixels that are connected to this edge pixel and that have a
value greater than T2 are also selected as edge pixels. If you think of following an edge,
you need a gradient of T2 to start but you dont stop till you hit a gradient below T1.
11
2.2 IMPLEMENTATION AND COMPARISON
All edge detectors were implemented using MATLAB. For the LOG edge detector, it was
possible to set the slope threshold, the sigma of the Gaussian, and the size of the Gaussian.
For the Canny edge detector and Color Canny edge detector, it was possible to set the high
threshold and low threshold, the sigma for the Gaussian, and size of the Gaussian. For
the Boolean Function Based edge detector, it was possible to set the local threshold and
the global threshold. For the Euclidean Distance and Vector Angle Color edge detector, it
was possible to set the slope and offset, and to set the nal threshold. For the Multi-Flash
edge detector, it was possible to set the threshold of the negative edge step.
2.3 Method for Comparison
There are ve different criteria that are typically used for testing the quality of an edge
detector:
The probability of a false positive (marking something as an edge which isnt an e
dge)
The probability of a false negative (failing to mark an edge which actually exists)
The error in estimating the edge angle
The mean square distance of the edge estimate from the true edge
The algorithms tolerance to distorted edges and features such as corners and junc-
tions
(Criteria taken from [? ] However, in order to determine the third and fourth criteria, an
exact map of the edges in an image must be known, and in general this is not available.
It is also not plausible to assume that some exact map of all the edges can even be
constructed. Therefore, the third and fourth criteria are not very useful. Additionally,
corners and junctions simply are not handled well by any edge detector and must be
considered separately. Therefore the fth criterion is not very useful either. The most
important criteria are the rst two, as it is much more important to have the proper features
12
labeled as edges than having each edge exactly follow what would be considered the
ideal edge or being able to handle special features such as corners and junctions. So for
our evaluation, we only considered the rst two criteria.
13
Chapter 3
EXPERIMENTAL ANALYSIS
Edges are detected using the Sobel, Prewitt and Roberts methods by thresholding the
gradient function. For the Laplacian of Gaussian method, thresholding is computed for
the slope of the zero crossings after ltering the image with the LoG lter. For the Canny
method, a threshold is applied to the gradient using the derivative of a Gaussian lter.
3.1 Sobel operator
Detection using Sobel lter As mentioned before, the Sobel method nds edges using
the Sobel approximation to the derivative. It returns edges at those points where the
gradient of the image is maximum. It very simple operator and detecting the edge and
their orientation clearly.It is less sensitive to the noise and comparatively have higher
accuracy than other edge detection operators.
14
3.2 Prewitt Operator
The Prewitt method nds edges using the Prewitt approximation to the derivative. It
returns edges at those points where the gradient of the image is maximum. The edges
obtained by prewitt operaor is not better that Sobel in some cases and some cases it is
about to sobel.
3.3 Roberts Operators
The Roberts method nds edges using the Roberts approximation to the derivative. It
returns edges at those points where the gradient of the image is maximum. The Roberts
Cross operator performs a simple, quick to compute, 2-D spatial gradient measurement
on an image. Pixel values at each point in the output represent the estimated absolute
magnitude of the spatial gradient of the input image at that point.
3.4 Laplacian of Gaussian Operators
The Laplacian of Gaussian method nds edges by looking for zero crossings after ltering
the image with the Laplacian of Gaussian lter. The Laplacian is a 2-D isotropic measure
of the 2nd spatial derivative of an image. The Laplacian of an image highlights regions
of rapid intensity change and is therefore often used for edge detection. The Laplacian
isoften applied to an image that has rst been smoothed with something approximating
a Gaussian Smoothing lter in order to reduce its sensitivity to noise. The operator nor-
mally takes a single gray level image as input and produces another gray level image as
output. It nding correct places of edges testing wider area around the pixel but it per-
forms Malfunctioning at the corners.orientations of edges are not found accurate because
of using laplasian edge detector .
15
3.5 Canny Operaotrs
The Canny method nds edges by looking for local maxima of the gradient of the image.
The gradient is calculated using the derivative of the Gaussian lter. The method uses two
thresholds to detect strong and weak edges, and includes the weak edges in the output
only if they are connected to strong edges. This method is therefore less likely than the
others to be fooled by noise, and more likely to detect true weak edges. Canny selects
larger widths of gaussian mask so dectector sensitivity to the noise is lower. some time
it removes the actual edges due to larger gaussian mask.The performance of canny edge
detector depends heavily on adjustment paramert
16
Chapter 4
PERFORMANCE EVALUATION
The performance of edge detectors are measured with the help of following two criteria
.First by visual observations of Edge results obtained by these ve edge detectors and ,
second one by using Mean Square Error (MSE). MSE is obtained by comparing the edge
results of edge detectors with standard canny operator . The visual observation of these
edge detectors are illustrated in following section.
4.1 Visual observation of Edges
we have taken three different kind of JPEG images for detecting the edges of Alphanu-
meric characters . First Digits , Second Alphabets and third Vehicle License Plates.
17
Figure 2: Edges of Digit 1
4.2 Edges of Digits
4.3 Edges of Alphabets
4.4 Edges of Vehicle License Plates
4.5 MSE OF ALPHABETS
4.6 MSE OF License Plates
18
Figure 3: Edges of Digit 2
19
Figure 4: Edges of digit 3
20
Figure 5: Edges of digit 8
21
Figure 6: Edges of digit 9
22
Figure 7: Edges of Letter F
23
Figure 8: Edges of Letter T
24
Figure 9: Edges of Letter U
25
Figure 10: Edges of Letter V
26
Figure 11: Edges of Letter W
27
Figure 12: Edges of Letter Y
28
Figure 13: Edges of Letter Z
29
Figure 14: Edges of License Plate 1st
30
Figure 15: Edges of License Plate 2nd
31
Figure 16: Edges of License Plate 3rd
32
Figure 17: Edges of License Plate 4th
33
Figure 18: Edges of License Plate 5th
34
Figure 19: Edges of License Plate 5th
35
Conclusion and Future work
The Edge detection operators are very important tools for detecting edges of alphanumeric
characters.Different edge detection operator has own advantages and disadvantages. But
from both of the criteria visual observations and MSE, we are in position to conclude
that the sobel edge detection operator is well suited for detecting edges of alphanumeric
characters. The results of the edges can be further improved using Morphological op-
erations and Articial Neural Networks. Improved edge detection Operator can be used
for Recognition and identication of Vehicle License Plates, which is useful in intelligent
Trafc Management the Public Security Systems.
36
References
[1] J.Parker Algorithims for image processing and Computer Vission . In New York Wiley
, 1996.
[2] S.S. Agaian, K.A. Panetta, S.C Narcessian. Boolean Derivatives with Application to
Edge detection for Image System. In IEEE Transaction on System ,Man and Syber-
neticsn, volume: 40 NO-2 pages 371382, APRIL 2010.
[3] Rafael C. Gonzalez,Rechard E. Woods . Digital Imege Processing . Published by
Pearson EducationThird Edition , 2008.
[4] S.Price. Edges:The Canny Edge detector. http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL-
COPIES/MARBLE/low/edges/canny.htm
[5] M.B. Ahmad and T.S. Choi , Local Threshold and Boolean Function Based Edge
Detection, IEEE Transactions on Consumer Electronics, Vol. 45, No 3. August 1999.
[6] R. Owens, Lecture 6, Computer Vision IT412, 10/29/1997.
http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL
C
OPIES/OWENS/LECT6/node2.html.
[7] S. Wesolkowski and E. Jernigan, Color Edge Detection in RGB Using Jointly Eu-
clidean Distance and Vector Angle, Vision Interface 99, Trois-Rivieres, Canada, 19-21
May,1099.
37
[8] E. Danahy, S. Agaian, and K. Panetta, Detecting edges in noisy multi-media environ-
ments, in Proc. IEEE Int. Symp. Multimedia, 2006, pp. 696 700.
38

You might also like