2016 Joint International Conference on Artificial Intelligence and Computer Engineering (AICE 2016) and International Conference on Network and Communication Security (NCS 2016)
ISBN: 978-1-60595-362-5
Edge Detection Algorithm Based on the Top-hat Operator
Ying-Li WANG
a, Shan-Shan MU
bHarbin University of Science and Technology, China a[email protected], b[email protected]
Keywords: Mathematical Morphology, Structural Elements, Top-hat Operator, Edge Detection.
Abstract. This paper proposes an image edge detection method based on multi-directional, multi-scale Top-hat operators, and applies the method to the edge detection of OSAHS (Obstructive Sleep Apnea Hypopnea Syndrome) early pathological images. Firstly, construct multi-directional, multi-scale Top-hat operators, and they are used to detect the edge of image. Then the ideal image edge is obtained by combining the edges of the image detected by each operator according to a certain weight, so that we can calculate the actual area of the oral cavity accurately, and then achieve electronic medical diagnosis. The simulation results show that the operator proposed in this paper can filter out the noise better, preserve image detail more completely, so that the edge information of the image is more accurate and complete. Compared with conventional edge operator, it is more effective for image edge detection.
Introduction
Edge detection plays a vital role in image processing. It directly affects the results and accuracy of the image subsequent processing. In recent years, mathematical morphology widely applied in image processing, covering the edge detection, texture analysis, image restoration and
reconstruction and other fields. The basic idea of mathematical morphology is to use structural
elements with certain shapesto detect an image. Structural elements are similar to the probe with
orientation, size, color and other information. By moving to mark the locations which fit into the structural elements in the image; extract the structural characteristics of the image; achieve the purpose of analyzing and recognizing the image [1-3].
Traditional edge detection operators can be targeted to detect the image edge, but have some limitations. In order to improve the problems of traditional edge operators, in this paper, we applied the multi-directional, multi-scale Top-hat operator based on mathematical morphology to detect the
image edge. Compared withtraditional edge operators, this method canfilter out the noise better, so
that the edgeinformation of the imageis moreaccurate and morecomplete.
Algorithm Principle and Implementation The Basic Algorithm of Gray Morphology
Gray dilation and gray erosion [4] are two basicalgorithms of gray morphology. Let A
x,y istheinput image, B
x,y is thestructural element. If Dis the set ofrealinteger, belongs to, AandBarethe pixelgray valuefunctions correspondingcoordinates, then gray dilation is defined as:
A x x y y B x y x x y y DA x y DB
y x B
A )( , )min ( , ) ( , )( )( ) ,( , )
( ' ' ' ' ' ' ' '
(1)
Correspondingly, gray erosion is defined as:
A x x y y B x y x x y y DA x y DB
y x B
A )( , )max ( , ) ( , )( )( ) ,( , )
( ' ' ' ' ' ' ' '
(2)
Among them, x and y are the domains of inputimageand structuralelement.
Opening operation is firstly erosion and then dilation, denoted. Correspondingly, the closing
operationis firstlydilation and then erosion, denoted. They aredefined as:
B B A B
A ( ) (3)
B B A B
A ( ) (4)
Top-hat Operator
Top-hat operator divided into openingTop-hat operators and the closing Top-hat operator. They
are defined as:
B A A y x
OTHA,B( , ) (5)
A B A y x
CTHA,B( , ) (6)
Top-hatoperatorhas characteristicsofhigh-pass filter. Thehigh-frequencypartisthe edge of the
image. Edge detection is to detect the high-frequency component of the image[5]. Therefore
Top-hat operator has more advantages in the process of edge detection, It can effectively identify
thetarget invarious backgrounds; extracta reasonableand accurateedge [6].
Selectthe Structure Elements
Line, rectangle, octagon, disk, etc are the basic structural elements in the mathematical
morphology. According to the characteristics of the input image select structural elements in the
image processing. The input image is OSAHS early pathologicimages in this paper. The images
obtained from clinical medicine have various shapes and contain noise. We select multi-directional, multi-scale structural elements for edge detection, in order to filter out noise better; extract edge
information of different types more accurately. Use the large-scale operators to detect overall
changes; small-scale operators to detect slight changesof the image edge [7, 8]. In this paper, we
take the edge detection of oral images for example; apply disk and line structural elements in
different directions and scales.
Structure elements in different scalescan be obtained by using morphologicaldilation operation.
Namely, large-scale structural elementscan be obtained by using morphologicaldilation operation
of small-scale structural elements. Assume that Bm is a finite structure element, then multi-scale
structural elementscan be defined as:
m
m B B B B
B 1 1 1 1
(7)
Among them, m is the scale parameter, takes a positive integer. Suppose 1(a) is the minimum 3×3 disk structure element, then 1(b) and 1(c) are 5×5 and 7×7 disk structural elements, and so on, 1(c) is the disk structure element. As shown in Figure 1.
0 1 0 1 1 1 0 1 0
0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0
0 0 0 1 0 0 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 0 0 0
[image:2.612.167.441.604.672.2]
(a) Structural Element B1 (b) Structural Element B2 (c) Structural Element B3 Figure 1. Multi-scale Structural Elements.
Using simple symmetrical disk structural elements to detect image edge would reduce the
sensitivity todifferentdirectionsofthe edge, which would result intheloss of the direction details
detectcomplete and accurateedge [9], we constructthestructural element in four directions in this
paper. The structuralelement is shown in Figure2.
Figure 2. Multi-directional Structural Element b1.
Improve the Top-hatOperator
The traditional morphologicalTop-hatoperatorsuse the samestructural elements to complete the
opening and closingoperations, they have no effects on the suppression of noise,and they willlead
to the lack ofedge information. It is the most important to select the structural elements reasonably
in the edge detection processing. Small-scale structure elements can extract the edge details
accurately; large-scale structure elements can filter out the noise effectively; multi-directional
structure elements can improve the sensitivity ofthe edge information in different directions [10].
In order to fuse the advantages of the structural elements in different directions and scales, we proposed an integrated Top-hat operator based on structural elements in different directions and scales,
) , )( ) ( ( ) ,
(x y A A B B x y
OTHB i j (8)
) , )( ) ( ( ) ,
(x y A A b b x y
OTHb k l (9)
Among them, Bi, bk are small-scale structure elements, Bj, bl are large-scale structure
elements. Use each Top-hat operator to detect the edge of the image, then combine eachedge with
others which detected by operators according toa certain weight to get an ideal imageedges.
Experiment and Analysis
(a) Original Image (b) The Result of Roberts Operator (c) The Result of Prewitt Operator
[image:3.612.125.488.447.654.2]
(d) The Result of Log Operator (e) The Result of Canny Operator (f) The Result of this Paper’s Operator
Figure 3. Oral Image Processing Result.
Figure3 shows the results of edge detection by Robertsoperator, Prewitt operator, Log operator,
Canny operator and the Top-hat operator which proposed in this paper. 3(a) is the originalimage,
3(b) is the result of edge detection by Roberts operator, 3(c) is the result of edge detection by
detection by Canny operator. 3(f) is the result of edge detection by the Top-hat operator which
proposed in this paper. As we can see from the figure, Roberts operator and Prewitt operator
extracted the edge inaccurately; didn’t detect the complete edge information; Log operator and
Canny operator are sensitive to the noise, they extracted a lot of pseudo-edge information; The
algorithm which proposed in this paper can detect the edge information more accurately than other operators, and have a good Edge closure.
Figure 4 shows the results of edge detection by Roberts operator, Prewitt operator, Log operator,
Canny operator and the Top-hat operator which proposed in this paper after addingsalt and pepper
noisetothe original image. 4(a) is the original image, 4(b) is the result of edge detection by Roberts
operator, 4(c) is the result of edge detection by Prewitt operator. 4(d) is the result of edge detection by Log operator. 4(e) is the result of edge detection by Canny operator. 4(f) is the result of edge detection by the Top-hat operator which proposed in this paper. As we can see from the figure,
Roberts operator and Prewitt operator seemed that they were no use filtering out the noise, they
detected the portion of the edge; Logoperator could suppress the noiseobviously, at the same time,
it suppressed the original edge information, didn’t detect the complete edge information. Canny
operator could also suppress the noiseobviously, at the same time, it smoothedout some of theedge
information, leading tothe edge ofthe image was not clear. The algorithm which proposed in this
paper can filter out the noise better and detect the edge information more accurately than other operators, and have a good Edge closure.
(a) Original Image (b) The Result of Roberts Operator (c) The Result of Prewittoperator
[image:4.612.119.498.317.526.2]
(d) The Result of Log Operator (e) The Result of Canny Operator (f) The Result of this Paper’s Operator
Figure 4. Oral Image Added Noise Processing Result.
[image:4.612.112.508.636.678.2]Table 1 presents the performance comparison of these algorithms. As we can see from the Table, use this paper’s operator to detect the edge, the closure edge is better than the edges which detected by other operators.
Table 1. Performance Comparison of Several Operators. Roberts
operator operator Prewitt operator Log operator Canny This paper’s operator Edge closure 21.5% 38.3% 67.8% 85.5% 98.7%
Conclusions
This paper proposed a Top-hat operator based on the multi-directional, multi-scale structural
elements. After oral medical imagepreprocessing, the ideal image edge is obtained by combining
calculate the actual area of the oral cavity accurately, and then achieve electronic medical diagnosis. Compared with conventional edge operator, the operator proposed in this paper can filter out the noise better, preserve image detail more completely. It is very useful.
Scientific Research Fundation of the Education Department of Heilongjiang Province, 12541165, China.
References
[1]Huang HaiLong, Wang Hong, Ji Li. Order morphology edge detection algorithm based on partial fuzzy enhancement [J]. Chinese Journal of Scientific Instrument, 2012, 33(11): 2608-2615.
[2]Bai Xiangzhi, Zhou Fugen, Xue Bindang. Noise-suppressed image enhancement using multiscale Top-hat selection transform through region extraction. Applied Optics, 2012, 51(3): 338-347.
[3]Wu YiQuan, Song Yu, Zhou HuaiChun. Edge detection of combustion flame images based on anisotropic mathematical morphology [J]. Chinese Journal of Scientific Instrument, 2013, 34(8): 1818-1825.
[4]Gonzalez, R.C., R.E. Woods, and S.L. Eddins. Digital Image Processing Using MATLAB. Gatesmark Publishing, 2009.
[5]Zhang LiGuo, Yang Jin, Li Jing, et al. Image characteristic extraction method based on wavelet packet and mathematical morphology [J]. Chinese Journal of Scientific Instrument, 2010, 31(10): 2285-2290.
[6]Zeng Ming, Li JianXun. The small target detection in infrared image based on adaptive morphological Top-hat filter [J]. Journal of Shanghai Jiaotong University, 2006, 40(1): 90-97. [7]C. Dueottet, T. Fournel and C. Barat. Seale-adaPtive deteetion and local characterization of edges based on wavelet transform, Signal Proeessing, 2004, 84: 2115-2137.
[8]Felice Andrea Pellegrino, Wlater VanZella and Vincent Torre. Edge detection revisited, IEEE Trans. Systems, Man and Cybemetics-PartB: Cybernetics, 2004, 34(3): 1500-1518.
[9]Zhao Yuqian, Gui Weihua, Chen Zhencheng. Edge Detection Based on Multi-Structure Elemenets Morphology. The 6th Proceedings of the World Congress on Intelligent Control and Automation (WCICA), Dalina, China, 2006.