1. Trang chủ
  2. » Giáo án - Bài giảng

double row cascade labeling algorithm for hyper scale issue

5 8 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Nội dung

Available online at www.sciencedirect.com Available online at www.sciencedirect.com Procedia Engineering ProcediaProcedia Engineering 00 (2011) Engineering 15000–000 (2011) 4047 – 4051 www.elsevier.com/locate/procedia Double-Row Cascade Labeling Algorithm for Hyper-Scale Issue Yebin Fana, Hualong Zhaob* a b Department of Computer Science, Huazhong University of Science and Technology; National Key Laboratory of Science and Technology on Multi-Spectral Information Processing, Institute for Pattern Recognition and Artificial Intelligence, Huazhong University of Science and Technology Abstract An efficient algorithm is presented to label the connected components in the case that the primary memory is smaller than the image data Our algorithm uses only the memory of two image rows to label the huge image or any image larger than the available memory The search path compression is a applied for improving the performance further An extensive comparison with the state-of-art algorithms is proposed, both on random and real datasets Our algorithm shows an impressive speedup, while the auxiliary memory is not required at all comparing with all competitors Keywords: Connected components labeling, page fault, hyper-scalar, union-find Introduction Connected components labeling is one of the most fundamental tasks in image processing and pattern recognition In recent years, the researches on labeling algorithm are mainly focused on improving performance for the normal size images In most of famous algorithms, the whole image will be loaded into primary memory for processing and the extra auxiliary memory is adopted for storing the equivalence table used for merging the equivalent connected components However, if the size of image is larger than the available memory (such as remote sensing and astronomical images or any images larger than the memory of embedded systems), the whole image is impossible to be loaded, not to mention the required auxiliary memory space Many page faults will occur and the algorithm performance will dramatically decline, even leads to a failure In this paper, this situation is named the hyper-scale issue * Corresponding author Tel.: +86-27-61341385 E-mail address: Charles.zhao1112@gmail.com 1877-7058 © 2011 Published by Elsevier Ltd doi:10.1016/j.proeng.2011.08.759 4048 Yebin Fan and Hualong / Procedia Engineering 15 (2011) 4047 – 4051 Y.B Fan et al / Zhao Procedia Engineering 00 (2011) 000–000 Many excellent algorithms have been proposed in the past For improving the program efficiency, Chang et al [1] proposed a fast algorithm based on contour tracing in 2004, which was the fastest algorithm in that time In 2010, Grana et al [2] introduced a new 2x2 block scanning technique and applied OR-decision tables to increase the labeling performance Their work provided an impressive speedup over the state-of-art algorithms Two months later, a new stripe-based scanning and local pixel extraction technique was introduced by Zhao et al [3] Their proposal reached a better performance in real images test and don’t requires any auxiliary memory For improving the memory usage efficiency, Samet et al [4] successfully compressed the size of equivalence table to 2/3N for NxN image by reusing the temporary labels In 2002, Khanna et al [5] makes the bound to �N/2� � � by aggressive reuse of labels In this paper, we called the last two approaches cascade-like scheme, because the common feature of them is the label assigned to the pixel in the current row are only involved with the labels in the previous row or the previous part of the current row before this pixel In this paper, we proposed a novel Double-Row Cascade Labeling Algorithm (DCLA) with no memory requirement but only two rows of image data Two techniques are also applied for improving performance further: compress the search path of Union-Find-tree for increasing the merge speed of the equivalent connected components; if the memory space is larger than rows, prefetch more data into memory for reducing the access number of hard disk which enhances performance An extensive comparison with the state-of-art approaches is proposed, both on random and real datasets DCLA shows an impressive speedup over the state of the art algorithms in hyper-scale situation, while the auxiliary memory is not required at all comparing with all competitors Double-Row Cascade Labeling Algorithm 2.1 Preliminary For a � � � binary image, we assume that the object value of image is 1, and the background value is ������ is used to denote the 1-D position value of pixel ���� �� in the image, which is ������ � � � � � � ��������� is used to represent the pixel P value stored at its position For convenience, in this Letter, we consider only the eight-connectivity issue Our algorithm can be easily modified for the fourconnectivity 2.2 Algorithm Description DCLA is a 2-pass algorithm based on Union-Find method The workspace required by DCLA is only the size of two neighbor image rows; and no extra auxiliary memory is needed For the first pass, the upper row of the two neighbor rows in the workspace is called the fixing row, while the lower row is called the working row The transfer style of the image data being processed between the primary memory and the hard disk is as follows: when the current fixing row has been fixed, it will be written to the hard disk; the current working row is taken as the new fixing row, while the row next to the current working row is fetched from the hard disk and is taken as the new working row The image process direction for the first pass is from top to bottom, while the direction for the second pass is from bottom to top The first pass is detailed as follows: firstly, examine each pixel in the new fetched row, i.e the new working row, in raster order until a non-zero pixel P� is encountered; secondly, compute the global position of this pixel ������ � (i.e called Position Computation), and take it as the new value of P� (i.e ���� � � ������ �, called Position Assignment); in the same time, record the x-coordinate of this pixel X� ; Yebin Fan and Hualong Zhao / Procedia Engineering 15 (2011) 4047 – 4051 Y.B Fan et al./ Procedia Engineering 00 (2011) 000–000 4049 thirdly, assign ������ � to the following contiguous non-zero pixels until a zero pixel is encountered (i.e called Position Propagation), and record the x-coordinate of the last non-zero pixel X� ; fourthly, examine all pixels in the region ��� � �� �� � ��of the new fixing row (currently, the last working row becomes the new fixing row) If pixel A is the first encountered non-zero pixel in this region, the ����������� operation (which is detailed in the following) for finding the root ������� � of the connected component including pixel A, then make ��������� �� � ������ � to merge the equivalent connected components(The whole procedure in this step is called Equivalent Connected Components Hook-up); finally, go back to the first step for looping these steps until the new fetched row is exhausted If the new fetched row is the first row of image, then only the Position Computation, Position Assignment and Position Propagation have to be done The FindRoot Operation is listed as follows:  position = Yi*N+Xi  while (ImgData[position] != position)  position = ImgData[position]  return ImgData[position]First point According to the steps mentioned above, traverse the whole image for the first pass.Fig give a example for there steps Fig Illustration for DCLA in part of a 16*16 image example Based on the Position Computation, Position Assignment and Position Propagation parts mentioned in the above steps, the connected pixels in workspace will be abstracted into Local Connected Components (LCCs) which can be represented as the rooted trees [6] of which the roots are at the down-side Each LCC �� should have only one root, which is stored at the first non-zero pixel �� , and can be represented as follows: �� �� � ��� ���������� � ������� �� � ��� ��� � � � �� � ��� ���������� � ������� (1) 44050 Yebin Hualong ZhaoEngineering / Procedia Engineering 15 (2011) 4047 – 4051 Y.B.Fan Fanand et al / Procedia 00 (2011) 000–000 If the LCCs in the fixing row and the working row are equivalent and are merged in the rooted tree form, then the merged connected components in two rows can also be represented in this manner Take a 16  16 image for example, part of which is shown in Fig.1(a) The two LCCs shown in the first two rows in Fig.1 can be merged into one connected component by simply assigning the root value in the working row to the root in the fixing row The merge process called Equivalent Connected Components Hook-up has been detailed in the steps mentioned above and, in fact, can be considered as the merge process of the disjoint-set problem So by extending this manner, the merged connected component Si can be represented by a Union-Find-tree and can be described as: ��� � � �� �� � ��� ���������� � ������� ��� � ��� ��� ���������� � � � ������� �� In the above formula, the iterative process ��� ���������� � � is referred as ������������ operation In the second pass, the final label values are allocated and assigned to pixels The mainly process is described as follows: firstly, examine each pixel in the new fetched row, i.e the new upper row, in raster order until a non-zero pixel A is encountered; secondly, execute �������������������� to find the corresponding connected component and get A’s label value; thirdly, propagate this label value to the following contiguous non-zero pixels until a zero pixel is encountered; fourthly, go back to the first step for looping these steps until the new upper row is exhausted The FindRoot&GetLabel operation is presented as follows:  position = Yi*N + Xi  while(ImgData[position] != position && ImgData[position]>0)  position = ImgData[position]  if(ImgData[position]>0)  ImgData[position] = ( LabelNum)  return ImgData[position] In order to distinguish the label value with the pixel value, every label value is negative and the initial LabelNum value is The absolute value of label depends on the encounter order According to the steps mentioned above, traverse the whole image for the second pass Algorithm Improvement The Union-Find-tree generated by the original DCLA has the feature that the new discovered node is always taken as the new root to be added to the tree The benefit of this feature is the current root will only appear in the same local region with the new discovered node, thereby constraining the search range of the root However, purely doing this leads to low efficiency of algorithm, because the new discovered node is probably to traverse the search path from the leaf nodes to the root node repeatedly The improvement is listed below: in the first pass, FindRoot operation will not only find and modify the current root, but also assign the new discovered root to the every node in the search path; in the second pass, when FindRoot&GetLabel operation finished, assign the obtained label to the every node in the search path, which reduces the search cost of these nodes to O(1) Tests and Comparison Tests and comparisons are performed between DCLA, BBDT [2] and Khanna [5] in this section BBDT is one of the fastest labeling algorithms in the literature Khanna is the fastest algorithm for hyperscale issue in the literatures we have found The test environment is E5300 2.60GHz CPU, 7200 RPM ���� 4051 Yebin FanY.B andFan Hualong / Procedia Engineering 15 (2011) 4047 – 4051 et al./Zhao Procedia Engineering 00 (2011) 000–000 hard disk, WindowsXP sp3 The performance tests are based on random images which can generally represents all possible connectivities in images Fig.2(a) shows and Fig.2(b) the performance and page faults comparison for random noise image, of which the size is 12288*12288, with different memory capacities The values in Fig.2 are the average test results of 20 random noise 12288*12288 images with different densities from 5% to 95% 700 Page Fault Performance 280K (Sec) DCLA 230 600 230K 500 BBDT 180K 130K 400 Khann 80K 300 30K 30 a 200 200 100 128 256 384 512 640 Memory Capacity(MB) 150 100 50 768 128 256 384 512 640 768 Fig 2.(a) Performance results in different memory (b)Page fault number comparison in different memory Conclusion In this paper, a novel labeling algorithm (DCLA) is proposed for solving the hyper-scale issue of connected component labeling With theoretical analysis and test results comparison, the significant performance advantage of DCLA is demonstrated Our algorithm achieves more than 10X and 1.5X speedup relative to BBDT and Khanna DCLA is very suitable for labeling the very high resolution images or being used in memory-insufficient embedded platforms References [1] [2] [3] [4] [5] [6] F Chang, C.J Chen, and C.J Lu, A linear-time component-labeling algorithm using contour tracing technique, Comput Vis Image Unders., 2004, 93(2), pp 206–220 C Grana, D Borghesani, R Cucchiara, Optimized block-based connected components labeling with decision trees, IEEE Trans Image Process., 2010, 19(6), pp 1596-1609 H.L Zhao, Y.B Fan, T.X Zhang, H.S Sang, Stripe-based connected components Labelling, Electron Lett., 2010, 46(21), pp 1434 - 1436 M.B Dillencourt, H Samet, and M Tamminen, A general approach to connected-component labeling for arbitrary image representations, J ACM, 1992,39(2), pp 253-280 V Khanna, P Gupta, C.J Hwang, “Finding connected components in digital images by aggressive reuse of labels,” Image Vis Comput., 2002, 20(8), pp 557-568 T.H Corman, and C.E Leiserson, Introduction to algorithms, 2nd ed, Boston, MIT Press; 2001 ... of the art algorithms in hyper- scale situation, while the auxiliary memory is not required at all comparing with all competitors Double- Row Cascade Labeling Algorithm 2.1 Preliminary For a � �... previous part of the current row before this pixel In this paper, we proposed a novel Double- Row Cascade Labeling Algorithm (DCLA) with no memory requirement but only two rows of image data Two techniques... comparisons are performed between DCLA, BBDT [2] and Khanna [5] in this section BBDT is one of the fastest labeling algorithms in the literature Khanna is the fastest algorithm for hyperscale issue in

Ngày đăng: 01/11/2022, 10:17

w