an edge detection algorithm for online image · pdf filean edge detection algorithm for online...
TRANSCRIPT
An Edge Detection Algorithm for Online Image Analysis
Azzam Sleit, Abdel latif Abu Dalhoum, Ibraheem Al-Dhamari, Afaf Tareef
Department of Computer Science, King Abdulla II School for Information Technology
University of Jordan, Amman, Jordan
[email protected], [email protected], [email protected], [email protected]
Abstract: - Online image analysis is used in a wide variety of applications. Edge detection is a fundamental tool used
to obtain features of objects as a prerequisite step to object segmentation. This paper presents a simple and relatively
fast online edge detection algorithm based on second derivative. The proposed edge detector is less sensitive to noise
and may be applied on color, gray and binary images without preprocessing requirements. The merits of the algorithm
are demonstrated by comparison with Canny’s and Sobel’s edge detectors.
Keywords: Edge detection, Canny’s edge detector, Sobel’s edge detector, Wavelet transforms, Derivative operators.
1. Introduction
Several real life applications related to medical
imaging, Geographical Information Systems (GIS) and
Object Character recognition (OCR) depend on the
discovery of edges surrounding objects since they hold
desired features for the objects which appear in the
images. Applying an edge detector to an image may
significantly reduce the amount of data to be processed
and may therefore filter out information that may be
regarded as less relevant, while preserving the
important structural properties of an image. An edge is
a set of connected pixels that lie on the boundary
between two regions reflecting discontinuities in the
brightness of the image due to surface, depth, color, or
illumination [1].
Sobel edge operator is one of the simplest operators
known since 1968. It is a discrete differentiation
operator which computes the approximated gradient of
the image intensity. For each pixel of the image Sobel
operator produces either the corresponding gradient
vector or the norm of the corresponding gradient
vector. The gradient approximation which Sobel
operator produces is crude for high frequency
variations in the image [2].
The Canny edge detector and its variations are
considered the state-of-the-art edge detectors. Canny
showed that the optimal filter is a sum of four
exponential terms. He also showed that this filter can
be well approximated by first-order derivatives of
Gaussians. Canny edge detector is relatively complex
and typically requires noise smoothing, edge
enhancement, and edge localization [3].
There are many other edge detection algorithms which
utilize more complex techniques such as k-means,
neural networks and wavelet transform [4, 5, 6]. Such
techniques have massive run-time requirements which
make them inappropriate for online analysis of video
steams or applications with large sets of images.
Section 2 of this article proposes a fast and simple
edge detection algorithm. Section 3 demonstrates
experimental runs for the proposed algorithm
including comparisons with Sobel and Canny. Section
4 concludes this article.
2. Proposed Edge Detector
Real-time video and image processing is used in a
wide variety of applications from video surveillance
and traffic management to medical imaging
applications. Edge detection is a fundamental tool used
in most image processing applications to obtain
information from the frames as a prerequisite step to
feature extraction and object segmentation. This
section presents a simple and relatively fast online
edge detection approach based on the second
derivative operator. The difference of the neighbor
pixels is a good indicator of an edge in digital images.
Second-order derivative operators such as Laplacian
are sensitive to noise. However, we address this issue
by the following steps:
RECENT ADVANCES in APPLIED MATHEMATICS
ISSN: 1790-2769 250 ISBN: 978-960-474-150-2
1. Get the negative value of the second
of the current pixel.
2. Remove the center pixel value.
3. Subtract the four diagonal pixels values.
Now we can write the operator equation
f(x, y) = - 2∇ f(x, y) – 4f(x, y) – f(x-1, y
– f(x-1, y+1) – f(x+1, y-1) – f(x+1, y+1)
The value of f(x, y) is the color value of the current
pixel with coordination (x, y), and 2
∇ f(x, y)
second derivate of the value f(x, y).
The following operator mask represents the
equation:
-1 1 -1
1 0 1
-1 1 -1
Adding the diagonal values and remove the center
value gives us the necessary balancing for edge
detection and removes undesired noise.
employs the differences between neighbor
with respect to the current pixel to become
value of the current center pixel. The operator
undesired data (colors and noise) and only
edges.
The following algorithm implements the proposed
operator for an image hxw, where, h is the number of
rows and w is the number of columns. The algorithm
has a runtime complexity of ( )hwΘ , where d is
constant.
Input: A =an image with size [height x width
Output: B=the edges image of the image A.
[h w d]=size(A);// the dimensions of the image
for k=1 to d
for x=1 to h
for y=1 to w
B(x,y,k)=-A(x-1,y-1)+A(x-1,y)-A(x-
+A(x,y-1) -A(x,y+1) -A(x+1,y-
-A(x+1,y+1);
Get the negative value of the second derivative
diagonal pixels values.
operator equation as follow:
1, y-1)
f(x+1, y+1)
the color value of the current
f(x, y) is the
the above
Adding the diagonal values and remove the center
value gives us the necessary balancing for edge
undesired noise. The operator
between neighboring pixels
come the new
The operator removes
only holds the
algorithm implements the proposed
operator for an image hxw, where, h is the number of
columns. The algorithm
, where d is
height x width] .
mage A.
d]=size(A);// the dimensions of the image
-1,y+1)
-1)+A(x+1,y)
The simplicity of the algorithm
be implemented by hardware which
resolution and large size
frames.
3. Experiments and Sample Runs
We have implemented the proposed operator along
with Sobel and Canny using M
the outcome of the proposed operator with Sobel and
Canny for the leaf image.
in figures 2-7. It is clear that the proposed operator is
less sensitive to noise than both Sobel and Canny. The
fact that our operator detects edges with exactly one
pass over the image with simple mathematical
operations applied on each pixel makes it appropriate
for online image analysis.
(c)
(a)
Fig 1. (a) Leaf image
Sobel (c) Edge-detection using Canny
detection using proposed
the algorithm makes it possible to
hardware which is suitable for high
large size images such as satellite
and Sample Runs
the proposed operator along
using Matlab. Fig 1 compares
the outcome of the proposed operator with Sobel and
More runs are demonstrated
It is clear that the proposed operator is
less sensitive to noise than both Sobel and Canny. The
fact that our operator detects edges with exactly one
pass over the image with simple mathematical
operations applied on each pixel makes it appropriate
(b)
(d)
(b) Edge-detection using
etection using Canny (d) Edge-
etection using proposed algorithm.
RECENT ADVANCES in APPLIED MATHEMATICS
ISSN: 1790-2769 251 ISBN: 978-960-474-150-2
4. The Original Image
Sobel Edges
Canny Edges
Proposed Algorithm
Fig 2. Chalks image
The Original Image
Sobel Edges
Canny Edges
Proposed Algorithm
Fig 3. LKMagenta image Fig
The Original Image
Sobel Edges
Canny Edges
Proposed Algorithm
Fig 4. Random image
RECENT ADVANCES in APPLIED MATHEMATICS
ISSN: 1790-2769 252 ISBN: 978-960-474-150-2
The Original Image
Sobel Edges
Canny Edges
Proposed Algorithm
Fig 5. Sample image
The Original Image
Sobel Edges
Canny Edges
Proposed Algorithm
Fig 6. Rose image
The Original Image
Sobel Edges
Canny Edges
Proposed Algorithm
Fig 7. Washington image
RECENT ADVANCES in APPLIED MATHEMATICS
ISSN: 1790-2769 253 ISBN: 978-960-474-150-2
Conclusion
This paper introduces a fast edge detection algorithm
which runs in ( )hwΘ , where h and w are the height
and width of the source image. The algorithm utilizes
8 operations per pixel in the source image which
makes it appropriate for large size images and image
streams. Experiments demonstrate the merits of the
proposed operator as it is less sensitive to noise than
Sobel’s and Canny’s edge detectors.
As future work, we will investigate the merits of the
operator for optical character recognition.
References
[1] Rafael C. Gonzalez and Richard E. Woods, 2008,
Digital Image Processing, 3rd edition.
[2] Sobel, I., Feldman,G., A 3x3 Isotropic Gradient
Operator for Image Processing", presented at a talk at
the Stanford Artificial Project in 1968, unpublished.
[3] Canny, J., 1986, A Computational Approach to
Edge Detection, IEEE Trans. Pattern Analysis and
Machine Intelligence, Vol. 8, Issue 6, pp. 679 - 698.
[4] Suzuki, K., Horiba, I., and Sugie, N., 2003, Neural
Edge Enhancer for Supervised Edge Enhancement
from Noisy Image, IEEE Trans. Pattern Analysis and
Machine Intelligence, Vol. 25 , Issue 12, pp. 1582 –
1596.
[5] Guowei T., Xiaoqing Z., Fangzhou Z., Zhenying J.,
2009, X-Ray Image Edge Detection Based on
Wavelet Transform and Lipschitz Exponent, Second
International Symposium on Intelligent Information
Technology and Security Informatics, pp. 56-66.
[6] Ganguly, D., Mukherjee, S., Mitra, K., Mukherjee,
P., 2009, A Novel Approach for Edge Detection of
Images, International Conference on Computer
and Automation Engineering, pp. 49-53.
RECENT ADVANCES in APPLIED MATHEMATICS
ISSN: 1790-2769 254 ISBN: 978-960-474-150-2