0% found this document useful (0 votes)
94 views4 pages

An Improved Canny Edge Detection Algorithm Xuan2017

The document proposes an improved Canny edge detection algorithm. It uses median filtering instead of Gaussian filtering to reduce noise. It obtains adaptive double thresholds from the amplitude gradient histogram. Generalized chains of edge points are formed and filtered using criteria based on their mean value to remove false edges. Experimental results show the algorithm is more robust to noise and can better separate targets from background.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views4 pages

An Improved Canny Edge Detection Algorithm Xuan2017

The document proposes an improved Canny edge detection algorithm. It uses median filtering instead of Gaussian filtering to reduce noise. It obtains adaptive double thresholds from the amplitude gradient histogram. Generalized chains of edge points are formed and filtered using criteria based on their mean value to remove false edges. Experimental results show the algorithm is more robust to noise and can better separate targets from background.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

An Improved Canny Edge Detection Algorithm

Li Xuan, Zhang Hong


School of Electronic Information Engineering
Shenyang Aerospace University
Shenyang, China
[email protected]

Abstract—The traditional Canny algorithm has been applied to projection location algorithm. In order to improve the accuracy
image edge detection. However, this traditional algorithm can't of edge detection, a morphological filtering algorithm is
adaptively determine the filtering threshold value and it can't proposed to replace Gauss filtering, which can avoid manual
separate targets from background, when filtering the lower intervention. This algorithm effectively resists salt and pepper
contrast image. Therefore, in response to these problems, this noise[5-6]. In [7], it adopts the method of combining the global
paper proposed an improved method on Canny algorithm. Two and local edge detection to extract the edges. In this way, it can
adaptive thresholds were obtained by doing differential operation obtain the complete image edges. There also has a Canny
on amplitude gradient histogram. Then we connected edge points algorithm that is fused with the traditional motion objecting
to get some generalized chains. After that, it needed to calculate
detection algorithm. This algorithm can effectively extract the
their mean value to delete generalized chains, which are smaller
foreground area of the image [8].
than the mean value. Finally, the image edge detection results
were got by linear fitting method. Experimental results show that In this paper, we use median filter to smooth the image, and
the improved algorithm is more robust to noise and it can clearly adaptively get double thresholds. After that, we link edge
separate targets from background. points and get the generalized chains, and we put forward a
criterion on the generalized chains. In this way, it can eliminate
Keywords- edge detection; Canny algorithm; adaptive threshold; false edge points, which have the approximate gray value with
generalized chains; linear fitting method
real edge points. Finally, the results of image edge detection
are given by linear fitting method, and it makes the detection of
I. INTRODUCTION image more adaptive and accurate.
Digital image technology is widely used in image
processing by extracting the edge detection to get the feature II. THE TRADITIONAL CANNY ALGORITHM
attribute of image. At present, many edge detection algorithms
have been proposed, including Sobel, Robert operator, and A. Traditional Canny Algorithm Steps
Canny algorithm. Among these algorithms, Sobel and Robert Traditional Canny algorithm was divided into five steps:
operators are implemented through acquiring numerical
difference method. Later, some new algorithms have proposed, 1˅ Use Gauss function to smooth image.
such as ant colony optimization algorithm, ant colony
optimization algorithm that based on k mean value and neural 2 ˅ Obtains the amplitude gradient and direction by
network method. In these algorithms, because Canny operator differential operators.
has good SNR (Signal-to-Nose Ratio), accurate edge location 3˅ Choose non-maximal value suppression method to get
and unilateral response, so it is widely used in practice. candidate edge points.
In 2010, the globalPb algorithm was proposed, its threshold
4˅ Check these candidate edge points by double thresholds.
is generated adaptively by system, so it can improve the anti
noise ability of Canny algorithm. However, globalPb algorithm 5 ˅ Connect the rest candidate edge points, who are
not only needs multi-scale and multi-information to compute connected with edge points, and get the edge detection results
the gradient, but also requires the additional spectral clustering of image.
to exclude the false edge. If these information cannot be
provided, it will restrict the application in scene, which lacks B. Deficiencies of The Traditional Canny Algorithm
texture information [1]. After that, an improved algorithm was
proposed on it. This algorithm mainly wants to get the The Canny algorithm has widely used in image edge
optimum solution of the maximal variance method by using detection. However, it is still remaining three defects. The first
adaptive particle swarm optimization [2]. In [3], it proposed an one is that Gaussian filtering is sensitive to noise, and it is easy
adaptive Canny algorithm for color image, which converts the to produce isolated edge points. This leads to the generation of
RBG of color image into R-B chromatic aberration space graph, pseudo edge points. The second defect is that the value of the
it needs to do integral arithmetic after Gaussian filtering. This double thresholds are set fixed, so it cannot satisfy the
method can connect the entire image edge. In [4], it puts algorithm's adaptability. The last one is that it only find
forward an improved method based on Canny operator, it can whether there are edge points around them, when judging
achieve the positioning accuracy through the variance candidate edge points, this method will increase the number of

978-1-5-97-7/1$31.00 ©201 IEEE


pseudo edge points. For example, if there is a non edge point in First case:
the neighborhood of the candidate edge point, and it has the
same gray scale value with edge point, it will misjudge the G1 i, j ! ThH (5)
candidate edge points as edge points. This leads to an
increasing number of false edges, and it causes the prospecting it is defined that this pixel is strong edge point.
of the target to be submerged in the background image. In this Second cases:
paper, the median filter is used to replace the Gaussian filtering
method, when smoothing image. Check candidate edge points G1 i, j  ThH (6)
through two adaptive thresholds, then connect them to form
generalized chains. After that, we select generalized chains by it is defined that this pixel is not edge point.
rules to delete pseudo-edge points. Third cases

III. IMPROVED CANNY OPERATOR ThL  G1 i, j  ThH (7)

A. Median filter algorithm it is defined that this pixel is weak edge point. We take a
closer filtering for these weak targets.
In this paper, median filter algorithm is used to replace
Gaussian filtering method. The pixel value of a certain point C. Formation and Filtering Generalized Chains
in image is substituted by the median value in its
neighborhood, this method not only reduces the influence of After comparison we have got strong and weak edge
noise, but also can eliminate the isolated point [9]. points. The next steps are as following:

Suppose the gray value of each point of the input digital Firstly, it need to find edge starting point, which is the
maximum point and link it with weak edge points
image is f x, y , the filtering window is M ( M mn ) , two-
respectively. After that, the local maximum points are
dimensional of the median filter function is G x, y : removed, which cannot be connected. In this way, we get
edge chains. These chains are called generalized chains,
G x, y ^
Med f x  m, y  n M mn 1, x, y  N ` (1) which contains multiple lengths. The maximum length is set
to d max , the minimum length is set to d min , we need to get
B. Adaptive real - time dual threshold algorithm average modulus threshold of these chains, its rule are as
The adaptive real-time dual-threshold algorithm is following:
implemented by making a differential operation on the d max  d min
amplitude histogram of the image. First, we need to find the  d avrage  dtop (8)
maximum value of the central pixel in the same gradient 2
direction by the non-maximum value suppression method, then Remove the gradient value, which smaller than davrage .
the maximum value is processed by double threshold, if it is
not a maximum value, the amplitude of the pixel is set to zero, The distribution of pseudo-edge points are decentralized, it
can weaken the false strong edges through finding the mean
and generate the gradient amplitude histogram as G1 . So the of local maximum. And eliminate edge chains, which less
most important step is how to make the adaptive threshold. Its than the davrage . So we effectively suppress the pseudo-
steps are as following: doing difference operation on the
strong edge points. The remaining points are the real edge
adjacent gradient amplitude:
points of image. Finally, we take the linear fitting method to
G1 i  1  G1 i (2) get the result of the edge image.

Select the first zero of the amplitude as a high threshold, IV. THE IMPROVED CANNY ALGORITHM
and the low value take 0.4 times of this high threshold,
according to this rule, the adaptive threshold setting formulas This algorithm is programmed in MATLAB, steps are as
are defined as: follows:
a): Use the median filter on the image preprocessing to get
ThH Arg G1 i  1  G i 0 (3) the image, and it is written as G.
ThL 0.4ThH (4) b): Calculate the amplitude gradient. In order to obtain the
amplitude gradient of the pixel, we use the horizontal and
Where ThH and ThL stand for high threshold and low vertical templates to convolve the neighborhood of a pixel in
threshold. After determining the double threshold, the image is the image. In this paper, we use 3 u 3 template to calculate the
directly subjected to double threshold segmentation, when the image gradient, that is shown as follows:
non-maximum value is suppressed. G1 i, j stands for the
ª -1 0 1 º
center pixel, and compares it with ThH and ThL . The GX «-2 0 2 » (9)
« »
discussion is divided into the following three cases: «¬ -1 0 1 »¼


ª 1 2 1º
GY «0 0 0» (10)
« »
«¬ 1 2 1 »¼

ª a0 a3 a6 º
Gx , y «a a4 a7 »» (11)
« 1
«¬ a2 a5 a8 »¼
(c) Canny edge detection (d) improved edge detection
Where G X and GY are respectively stand for horizontal
Fig1. Saturn image segmentation comparison
pattern and vertical pattern. Gx , y is pixel value of image.
It can be seen that canny algorithm can get the edge of the
The gradient magnitude and gradient direction of the image clear than Sobel algorithm, and the picture also has a
central pixel are calculated as follows: sense of hierarchy for the canny algorithm from the Fig. 1(b)
and (c). Compared the canny algorithm with the improved
px a6  2a7  a8  a0  2a3  a6 (12) algorithm, we can see that the improved algorithm is more
clear and delicate. It also has strong anti-noise ability, because
py a6  2a7  a8  a0  a1  a2 (13) it is not like the canny algorithm to link the non-marginal
pixels, which are affected by the noise to misjudge as edge
The gradient direction is calculated as follows: points. The improved algorithm is mainly to limit the value of
the edge point, and filter them for second time.
G1 i, j px 2  p y 2 (14)
The spacecraft is selected as the original image, because the
§ · background information of the image is larger and the
T i, j arctan ¨ px p ¸ (15) background gray scale is same as the gray scale of the target.
© y ¹
We still use the same algorithm for simulation and compare the
c): We use non-maximum suppression to find the results of them.
maximum value. Use 2 , 3 , 4 to get double thresholds,
and compare them with maximum value of edge points to get
initial edge points.
d): Select strong edge points as the edge of the starting
point and link them with weak points to form edge chains, and
calculate the average of edge chains by 8 , then remove the
generalized edge chains, which are smaller than the average of
the gradient maximum of the image. (a) Original image (b) Sobel edge detection

e): The linear fitting method is used, and get detection


results of image.

V. EXPERIMENT AND ANALYSIS


Choose Saturn, and the spaceship two pictures as the
original image, in this paper, we respectively compare Sobel,
Canny, with proposed improved Canny algorithm.

Taking this Saturn picture as the original figure, because its (c)Canny edge detection (d) improved edge detection
target is mostly in the highlight and central area. We check the Fig2. Spacecraft image segmentation comparison
results of the improved method.
From Fig. 2(b), we can see that, it is not ideal to separate
image backgrounds from target images by using Sobel
algorithm. And the Canny algorithm is more poor in this
situation, it is mainly because in the canny algorithm, the edge
points are judged only by the neighborhood maximum. It is
easy to misjudge the weak point to strong edge point. This will
enlarge the background boundary and result in the foreground
target of the image is submerged, when target and background
have a similar gray value. The improved canny algorithm can
(a) Original image (b) Sobel edge detection
be clearly separated the target from background of image,
because it adopts the maximum point (including the strong
edge points and weak edge points) to form generalized chains,


then filter them by the mean value of these chains. This method
can improve the low threshold to delete the edge point, which
is smaller than the mean value.
Through above two sets of simulation experiments proved
that the improved algorithm is more adaptable and it also has
strong anti-noise ability.

VI. CONCLUSION
The mean filter was introduced in this paper to replace
Gaussian filtering method. This paper proposes an adaptive
double thresholds, and it defines generalized chains, after that it
need to calculate their mean value to filter themselves. The
improved algorithm not only has the advantages of the Canny
algorithm, but also improves the anti-noise ability, and keeps
the edge image more clearly.

ACKNOWLEDGMENT
This research was supported by Research on Massive
Interception Satellite Data Analysis Based on Depth Learning
(No.61501306) and Program for China Aviation Industry
Institute 601.

REFERENCES
[1] Xu Deming, and Lin Wan, “Anti noise using improved Canny edge
detection algorithm,” J. computer system, 2017 (01): 201-205.
[2] Yuan-Kai Huo, G. Wei, Y. D. Zhang and L. N. Wu, "An adaptive
threshold for the Canny Operator of edge detection,"2010 International
Conference on Image Analysis and Signal Processing, Zhejiang, 2010,
pp. 371-374.
[3] P. Hui, Z. Ruifang, L. Shanmei, W. Youxian and W. Lanlan, "Edge
Detection of Growing Citrus Based on Self-Adaptive Canny
Operator," 2011 International Conference on Computer Distributed
Control and Intelligent Environmental Monitoring, Changsha, 2011, pp.
342-345.
[4] Renjie Song and Xudong Gao, "The canny operator based on the study
of the method of image text location,"2011 International Conference on
Multimedia Technology, Hangzhou, 2011, pp. 5591-5593.
[5] Cai-Xia Deng, Gui-Bin Wang and Xin-Rui Yang,"Image edge detection
algorithm based on improved Canny operator," 2013 International
Conference on Wavelet Analysis and Pattern Recognition, Tianjin, 2013,
pp. 168-172.
[6] J. Y. Lu, H. P. Pan and Y. M. Xia, "The weld image edge-detection
algorithm combined with Canny operator and mathematical
morphology," Proceedings of the 32nd Chinese Control Conference,
Xi'an, 2013, pp. 4467-4470.
[7] L. Yuan and X. Xu, "Adaptive Image Edge Detection Algorithm Based
on Canny Operator," 2015 4th International Conference on Advanced
Information Technology and Sensor Application (AITS), Harbin, 2015,
pp. 28-31.
[8] D. Jin, S. Zhu, X. Sun, Z. Liang and G. Xu, "Fusing Canny operator
with vibe algorithm for target detection," 2016 Chinese Control and
Decision Conference (CCDC), Yinchuan, 2016, pp. 119-123.
[9] XU Hao-ming, WAN Chang-lin, “Canny improved edge detection
algorithm for anti-noise,” J. Journal of Computer Applications, 2017,
(01): 201-205.
[10] L. Yuan and X. Xu, "Adaptive Image Edge Detection Algorithm Based
on Canny Operator," 2015 4th International Conference on Advanced
Information Technology and Sensor Application (AITS), Harbin, 2015,
pp. 28-31.



You might also like