Академический Документы
Профессиональный Документы
Культура Документы
1. Introduction
Mathematical Morphology mainly serves for getting object topological figure and result information. It reaches the essential configured shape of an object by some operation on interaction between object and structure element. The application of Mathematical Morphology can simplify the data of images, meanwhile remains their fundamental figure features and delete the unconcerned structure [1,2]. The application of Mathematical Morphology in graphics processing include: Uses morphological fundamental operation to observe and process graphics on purpose of ameliorating the quality of images. Describes and defines various geometrical parameter and characteristics, such as area, perimeter, connectivity, granule, skeleton and direction etc. Computer text identification, Computer
978-0-7695-3570-8/09 $25.00 2009 IEEE DOI 10.1109/WCSE.2009.367 185
rectangle structure elements, merely 6 times of pixel value comparing is required. Erosion (dilation) with van Herk can boost the speed of process to a great extent in the condition of long-length structure element operation [6]. Formulas of van Herk algorithm are below. The following notions are showed: f(x), g(x) and h(x) represent discrete images or structuring elements, x is image index and k is the kernel size. The image indices run from 1 to N, where N is the image size.
f ( x ) x = 1, k + 1, 2 k + 1 g ( x ) = min[ g ( x 1), f ( x )] x = 2,....k ; k + 2,....2k ; 2 k + 2......, 3k ;.......
move of g(x) and k/2 units rightward horizontal move of h(x) are needed., and + is used to fill the parts moved out. Apparently, such calculation may increase the time cost of erosion (dilation). On the other hand, we have noticed that the horizontal move mentioned above are not necessary for the reason that min (+, g(x)) =g(x) or min (+, h(x)) =h(x). If we stagger the comparison position of the two rows of pixels, then Formula (5) can be generated from Formula (4). With Formula (5) we can avoid the time spending on adding + to the end of rows (columns), thus erosion efficiency will be improved.
g ( x + k / 2) x [0, ( k 1) / 2) min( g ( x + k / 2), h( x ( k 1) / 2)) result ( x ) = x [( k 1) / 2, width 1 k / 2] h( x ( k 1) / 2) x [ width k / 2, width 1]
(1)
f ( x ) x = N , N k 1, N 2 k 1,... h ( x ) = min[ h ( x + 1), f ( x )] x = N 1,....N k ; N k 2,.... N 2 k 1;
result (x) = min[g(x+(k-1)/2) , h(x-(k-1)/2)] x=1&N
(2)
(3) From the three formulas above [7], we can easily know that by taking k/2 units leftward horizontal move of g(x) and k/2 units rightward horizontal move of h(x), the combination of these two operations constitute all the pixel values of an eroded image.
(5) Now we assume that the rows length of one image is integral multiple to that of structure element, which means Width=N k. Then the calculation uses van Herk algorithm required two extra auxiliary spaces whose lengths equals their widths. If the images size is relatively large, such as 1024*1024, then 2k extra space is required, which cost considerable space. In van Herk algorithm, each row of the image will be divided into N segments, and N extra spaces of structure elements length are synchronically allocated. But only in case that g(x) needs to be compared with h(x) will those spaces for comparison be necessary, which means other spaces can be save temporarily. Conducted by this method, we just need to insert those parts of pixels which need to be compared with into g(x) and h(x). When comparison of this part is done, the next pixel part will be operated in the exactly same way. Therefore, we can obtain the final expected eroded image when comparisons of all pixels are finished. In this way the purpose of saving space cost will be completed. Assumes length=k n n=1, 2, , N. When n=N, the space cost of new algorithm is just the same as that of van Herk algorithm. Now we divide each row into M parts, then the length of new allocated extra auxiliary spaces will be length .Every time we get n segment pixels of k length from f(x) and put them into g(x), h(x):
186
values of g1(x) and h1(x) and let result (index) = g1(x+ k/2); x [0, (k-1)/2. Because part of value of g1(x) has been assigned to result (index), the pixels comparing position in two extra auxiliary spaces will be staggered for a certain distance. Now we have Formula (7):
result (index ) = min[ g 1( x + ( k -1) / 2) , h1( x )] x [0, length - k ] (7) After all pixels of g1(x) have been compared, g2(x) is followed to be compared. However, comparison of h1(x) hasnt finished, so h2(x) is not permitted to be compared at this moment. Thus the pixels comparing position in two extra auxiliary spaces remain being staggered for a certain distance. Naturally, we will have Formula (8):
Process time(ms)
(10) In Formula (10), the value of length should be calculated again when these two steps min [gM(x+k-1), hi(x)], x [0length-k] and hM(x+length-k+1) x [0, k/2-1] are on operation in condition that width% length0. Thats to say, length=width% length. Using this new method we need neither horizontal move of g(x) and h(x) nor extra spaces as the same row (line)s length of image. Consequently, erosion
Normal algorithm, as its structure elements size is m*n, will disassemble the structure element to m*1 and 1*n and then erosion (dilation) with them separately. In this way the times of comparison of each pixel is only m+n. Also it doesnt need any image expansion or extra auxiliary spaces because it doesnt require the image to have the length of row (column) being integral multiple to that of structure element. So it cost no extra space, which means it may be the best algorithm in case the structure element is relatively small. Nonetheless, the running time of normal algorithm varies according to the size of structure element. It doesnt suit for the operation with large structure element for its running time will increase as well as the structure elements length. For improved algorithm with condition N=Width/K, its space cost renders the same as van Herk algorithm. But from the chart above we can see it has less running time, for it doesnt require any horizontal move of g(x) or h(x). For improved algorithms with condition N=1 and N=5, their running time are related to the size of their structure elements. In details, the running time decreases in a small range as the length of structure element increases. According to the introduction of the new algorithm above, the times g(x) and h(x) being called are Width/Length, so when Length gets bigger, the called times decreases. Consequently the time
187
spend on functions calling becomes less. Besides, we can find out an interesting phenomenon from the chart that when it has long structure element, no matter in condition N=1 or N=5, its running time is very close to that of the condition N=Width/K. Therefore, we suggest set N=1~5 in practical use whiles the value N=Width/K is totally unnecessary.
5. Conclusions
This paper introduces a new fast algorithm based on van Herk algorithm for erosion (dilation), and successfully proved its validity and availability by establishing emulator program. The new method can reduce both the time spend on erosion (dilation) process and the required extra auxiliary spaces. As a result the efficiency of erosion (dilation) has been improved. Using the new algorithm to deal with large structure elements can reach its best performance.
6. Acknowledgment
This work is supported by Foshan Special Fund Project of Production, Academy and Research (grant No.2007B1038).
7. References
[1] C.L. Luengo Hendriks, and L.J. van Vliet, Discrete Morphology with Line Structuring Elements, Computer Analysis of Images and Patterns, Springer, Berlin, Volume 2756, 2003, pp. 722-729. [2] P. Soille, and H. Talbot, Directional morphological filtering, IEEE Transactions on Pattern Analysis and Machine Intelligence, Volume 23, No.11, Nov.2001, pp. 1313-1329. [3] A.Katartzis V.Pizurica, and H.Sahli, Applications of mathematical morphology and Markov random field theory to the automatic extraction of linear features in airborne images, Mathematical Morphology and its Applications to Image and Signal Processing, Springer US, Volume 18, 2000, pp.405-414. [4] C.L. Luengo Hendriks and L.J. van Vliet, A rotationinvariant morphology for shape analysis of anisotropic objects and structures, Visual Form 2001, Springer, Berlin, Volume 2059, 2001, pp.378-387. [5] Chris Houser, Cheryl Hapke, and Stuart Hamilton, Controls on coastal dune morphology, shoreline erosion and barrier island response to extreme storms, Geomorphology, Volume 100, August 2008, pp.223-240 . [6] P. Soille, and H. Talbot, Image structure orientation using mathematical morphology, 14th International Conference on Pattern Recognition (ICPR'98), Volume 2, 1998 , pp.1467-1469. [7] Van Herk, M. , A fast algorithm for local minimum and maximum filters on rectangular and octagonal kernels, Pattern Recognition Letters Volume 13 , July 1992, pp.517521.
188