Sei sulla pagina 1di 5

2011 Ninth International Conference on ICT and Knowledge Engineering

Compact Scan mask for 3-D Connected Components Labeling


Wichian Premchaiswadi1, Phaisarn Sutheebanjard2
Graduate School of Information Technology Siam University Bangkok 10160, Thailand wichian@siam.edu1, mr.phaisarn@gmail.com2
AbstractConnected component labeling is the underlying technique that is typically used in todays digital image processing for both 2-dimensional and 3-dimensional images. This research analyzes the scan mask for connected components labeling and proposes a new scan mask for 3-dimensional connected components labeling operation (26-connectivity), in which the number of pixels to be inspected is reduced from 14 pixels to 8 pixels. Keywordsconnected components, image processing, labeling algorithm, pattern recognition, scan mask

The equivalences resolution: This is an operation that creates an equivalence table containing the information needed to assign unique labels to each connected component. In the first image scan, all those labels that belong to one component are declared equivalent. In the second image scan, one label from an equivalent class is selected to be assigned to all pixels of a component.

I.

INTRODUCTION
(a) Pixels coordinate (b) Identifiers of the single pixels

A connected component is a set of pixels in which all pixels are connected to each other. Connected component labeling is a methodology to group all connected pixels into components based on pixel connectivity and mark each component with a different label. In a connected component, all pixels have similar values and are, in some manner, connected to each other. There are many algorithms that have been proposed in order to address the connected components labeling operation in 2-dimension. Generally, these algorithms are categorized into four classes as follows: (i) one-scan [1-2], (ii) two-scan [311], (iii) multi-scan [12] and (iv) contour tracing [13] algorithms. Accordingly to Grana et al. [3], two-scan is the fastest algorithm for labeling the 2-dimension connected components. Two-scan is a simple and efficient algorithm in computation time that was previously introduced by Rosenfeld and Pfaltz in 1966 [4]. It consists of three classical operations: 1. 2. 3. First image scan: (provisional label assignment and collection of label equivalences) Equivalences resolution: (equivalence classes creation) Second image scan: (final label assignment)

Figure 1. 2-D scan mask [5] (8-connectivity)

a:P(x-1,y-1,z-1) d:P(x-1,y,z-1) g:P(x-1,y+1,z-1) p:P(x-1,y-1,z) s:P(x-1,y,z)

b:P(x,y-1,z-1) e:P(x,y,z-1) h:P(x,y+1,z-1) q:P(x,y-1,z) x:P(x,y,z)

c:P(x+1,y-1,z-1) f:P(x+1,y,z-1) i:P(x+1,y+1,z-1) r:P(x+1,y-1,z)

(a) Pixels coordinate

(b) Identifiers of the single pixels


Figure 2. 3-D scan mask (26-connectivity)

First image scan: This is an operation in the classical twoscan labeling algorithm which accesses the pixels sequentially in raster scan order to find the 8-connectivity in 2-D binary image by using the scan mask as shown in Fig. 1 [5], and find the 26-connectivity in 3-D binary image by using the scan mask as shown in Fig 2. 978-1-4577-2162-5/11/$26.00 2011 IEEE 145

This paper presents a new, more efficient 3-D scan mask for connected components labeling (26-connectivity) in 3-D binary images for the two-scan connected components labeling process.

II.

TWO-SCAN ALGORITHM

The two-scan algorithm is a method used for labeling the connected components in a binary image. There are three classical operations in the two-scan algorithm: first image scan, equivalences resolution and second image scan. This section presents the literature related to first image scan operations. A. 2-dimension This operation accesses the pixels sequentially in raster scan order for finding the 8-connectivity by using the pixelbased scan mask as shown in Fig. 1. The conditions outcomes are given by all possible combinations of five Boolean variables (p, q, r, s, x). The actions belong to four classes: no action, new label, assign, and merge [3]. 1. 2. 3. No action: is performed if the current pixel belongs to the background. New label: is created when the neighborhood is only composed of background pixels. Assign action: current pixel can take on any existing provisional label in the mask without the need for consideration of label equivalences (either only one pixel is foreground or all pixels share the same label). Merge action: is performed to solve equivalence between two or more classes and a representative is assigned to the current pixel.

Instead of using the decision tree, He et al. [7], in 2009, analyzed the mask for 8-connectivity containing 16 possible cases (not including x, which is the background), as shown in Fig. 4. Case 1 is the new label action, cases 2-9 and 13-16 are the assign action and cases 10-12 are the merge action. Based on these cases, they proposed the algorithm as shown in Fig. 5.

Figure 4. Sixteen possible cases for the current object pixel in the

4.

mask for eight-connectivity proposed by He et al. [7]

In 2005, Wu et al. [6] proposed a decision tree as shown in Fig. 3 to examine the neighbors of the connected components. A decision tree is a binary tree whose non-terminal nodes are conditional variables and whose terminal nodes are actions to be performed. A decision tree will be defined as being optimal if it has a minimal number of non-terminal nodes and terminal nodes. Wu et al. [6] suggested the idea that every pixel in the scan mask is always the neighbor of q (see Fig. 1). If there is enough equivalence information to access the correct label of q, there is no need to examine the rest of the neighbors. Therefore, their decision tree minimizes the number of scanned neighbors.

1: If (x==Foreground) 2: If (q==Foreground) 3: x=q 4: else if (s==Foreground) 5: x=s 6: if (r==Foreground) 7: x=r+s 8: else if (p==Foreground) 9: x=p 10: if (r==Foreground) 11: x=p+r 12: else if (r==Foreground) 13: x=r 14: else 15: x=new label 16: else 17: no action
Figure 5. He et al. [7] first-scan algorithm

In 2010, Grana et al. [3] analyzed the 8-connectivity scan mask using a decision table. They defined the OR-decision table in which any of the actions in the set of actions may be performed in order to satisfy the corresponding condition. Their OR-decision table is different from the classical decision table in that all actions in a classical decision table have to be performed. The following describes the algorithm they used to convert the OR-decision table into a single action decision table for obtaining the optimal decision tree. In OR-decision tables, only one of the different alternatives provided must be selected. While an arbitrary selection does not change the result of the algorithm, the optimal tree derived from a decision table 146

Figure 3. The decision tree used in scanning for 8-connectivity.

implementing these arbitrary choices may be different. They used a greedy approach: the number of occurrences of each action entry is counted; iteratively the most common one is selected and for each rule where this entry is present all the other entries are removed until no more changes are required. If two actions have the same number of entries, they arbitrarily choose the one with a lower index. The resulting table, after applying this process, is shown in Table I with boldfaces 1s. We added the Mask column to Grana et al. [3]s OR-decision table in order to map the sixteen possible cases proposed by He et al. [7] (Fig. 4) to the corresponding rule in the OR-decision table. The algorithm in which only two actions are chosen arbitrarily leads to four possible equivalent decision trees. All of these trees have the same number of nodes and are optimal.
TABLE I. OR-DECISION TABLE FOR LABELING. BOLD 1S ARE SELECTED. Condition new label no action Mask Action Assign x=p x=q x=s x=r Merge x=p+r x=r+s

background or foreground) as shown in Fig. 8. The action entries are obtained by applying the following considerations: 1. 2. 3. No action: for cases 1-3 and cases 5-8, take no action. New label: for case 9, assign the new provisional labels to pixel x. Assign: for cases 10-11 and cases 13-16, assign the provisional labels of its neighbor to pixel x (its entire foreground neighbors have the same provisional label). Merge: for case 12, merge two provisional labels into the same class and a representative is assigned to pixel x (using the proposed scan mask, s and q are not connected to each other yet, s and q might belong to different provisional labels). Merge only: for case 4, merge two provisional labels of s and q into the same class and do not assign provisional labels to pixel x.

4.

5.

x
1 3 5 9 2 7 11 4 13 6 10 15 8 12 14 16 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

p
0 1 0 0 0 1 1 1 0 0 0 1 1 1 0 1

q
0 0 1 0 0 1 0 0 1 1 0 1 1 0 1 1

r
0 0 0 1 0 0 1 0 1 0 1 1 0 1 1 1

s
0 0 0 0 1 0 0 1 0 1 1 0 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

(a) Pixels coordinate

(b) Identifiers of the single pixels

Figure 6. Sutheebanjard and Premchaiswadi scan mask or P-Mask

In 2011, Sutheebanjard and Premchaiswadi [14] proposed scan mask for finding 8-connectivity. The scan mask ignores pixel r and uses only four pixels as shown in Fig. 6. It is used to scan pixels in raster scan order; from top to bottom, left to right and pixel by pixel. For the first scan at the top-left position of an image at time t, their scan mask checks positions p, q, s, x (see Fig. 7 (a)). After that, it is shifted to the right 1 pixel at time t+1 as shown in Fig. 7 (b). Then, it continues checking at the new positions p, q, s, x as shown in the Fig. 7 (b). Now the new position of q at time t+1 was previously the position of r at time t, and the new position of s at time t+1 was previously the position of x at time t. So, the positions of x and r at time t can be checked later while performing the checks at positions s and q at time t+1. Therefore, checking at positions s and q are always performed no matter whether the position of x is a foreground or background pixel. So, they suggest that the scan mask has only p, q, s, x. Sutheebanjard and Premchaiswadi also reanalyzed the actions in the scan mask. They added merge only as a new class of action. They analyzed the new pixel-based scan mask for 8-connectivity. There are 16 possible cases (whether x is

(a) Time t

(b) Time t+1

Figure 7. Example of using P-Mask at time t and time t+1

Figure 8. Sixteen possible cases

147

Sutheebanjard and Premchaiswadi also analyzed the above sixteen possible cases into the OR-decision table as shown in Table II. They converted the OR-decision table into a decision tree directly, without converting the OR-decision table into a single action decision table, by using the algorithm proposed by [15].
TABLE II. OR-DECISION TABLE.

a:P(x-1,y-1,z-1) d:P(x-1,y,z-1) p:P(x-1,y-1,z) s:P(x-1,y,z)

b:P(x,y-1,z-1) e:P(x,y,z-1) q:P(x,y-1,z) x:P(x,y,z)

Condition new label no action Mask

Action Assign x=p x=q x=s

Merge x=q+s

Merge Only q+s

(a) Pixels coordinate

(b) Identifiers of the single pixels

Figure 9. Proposed 3-D scan mask (26-connectivity)

x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

p
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

q
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

s
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1

TABLE IV. THE POSITION TO IMPLICIT CHECK VOWELS AND ITS ACTION ON MERGE AND MERGE ONLY ACTIONS
1

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

x r c f g h i r,f,h

Merge 1 x=q+s x=s+b x=s+e x=q+d x=q+e x=p+e x=q+s+e

Merge only 0 q+s s+b s+e q+d q+e p+e q+s+e

B. 3-dimension Labeling of connected components in 3-D binary images has been studied from the Lumia et al. in 1983 [16] and Shirai in 1987 [17]. Recently, He et al. in 2010 [18] present an efficient method of deciding the order for checking voxels in the mask. They analyze number of the neighbor voxels that need to be checked. The number of the neighbor voxels of each voxel in the mask is shown in table III.
TABLE III. THE NUMBER OF NEIGHBORING VOXELS TO A VOXEL IN THE
SCAN MASK.

In order to using the proposed 3-D scan mask. First create the OR-decision table from that have 28=256 case (in the same manner of Table II). Second convert OR-decision table into decision tree by Sutheebanjard and Premchaiswadi method [15]. The result will be the decision tree with 8 levels for the depth of the tree. IV. CONCLUSION The main contribution of this paper is to improve the performance of the existing connected components labeling in 3-dimension for binary image. In this paper, we presented a new scan mask of 26-connectivity in conjunction with a new class of action. The proposed 3-D scan mask have only 8 positions, so when convert to decision tree it has only 8 level for the depth of a tree. REFERENCES
[1] A. AbuBaker, R. Qahwaji, S. Ipson, and M. Saleh, One scan connected component labeling technique, IEEE International Conference on Signal Processing and Communications (ICSPC 2007), Dubai, United Arab Emirates, 2007, pp. 1283-1286. J. Trein, A. T. Schwarzbacher, and B. Hoppe, FPGA implementation of a single pass real-time blob analysis using run length encoding, MPCWorkshop, Ravensburg-Weingarten, Germany, 2008, pp. 71-77. C. Grana, D. Borghesani and R. Cucchiara, Optimized block-based connected components labeling with decision trees, IEEE Transactions on Image Processing, vol. 19, issue 6, 2010. A. Rosenfeld and J. L. Pfaltz, Sequential operations in digital picture processing, J. ACM, vol. 13, no. 4, pp. 471494, 1966 A. Rosenfeld, A.C. Kak, Digital Picture Processing, Academic Press, second ed., vol. 2, San Diego, CA, 1982.

a 6

b 9

c 5

d 8

e 12

f 7

g 4

h 6

i 3

p 6

q 9

r 5

s 8

They can reduce number of voxel to be check, but in the worst case, their algorithm working on all neighbors. III. PROPOSED 3-D SCAN MASK This paper proposes a new scan mask for 3-D connected components labeling to find 26-connectivity. Instead of classical scan mask that having 14 pixels, the proposed scan mask has only 8 pixels (ignore voxels c, f, g, h, i, and r) as shown in Fig. 9. The proposed scan mask ignores voxels c, f, g, h, i, and r at time t and implicit check voxels c, f, g, h, i, and r at time t+1. The position to implicit check vowels is shown in Table IV.

[2]

[3]

[4] [5]

148

[6]

[7] [8]

[9]

[10]

[11]

[12]

[13]

[14]

[15] [16]

[17] [18]

K. Wu, E. Otoo and A. Shoshani, Optimizing Connected Component Labeling Algorithms, Proceedings of the SPIE, vol. 5747, pp. 19651976, 2005. L. He, Y. Chao, K. Suzuki, and K. Wu, Fast connected-component labeling, Pattern Recog, vol. 42, no. 9, Sep. 2009. L. He, Y. Chao, and K. Suzuki, An Efficient First-Scan Method for Label-Equivalence-Based Labeling Algorithms, Pattern Recognition Letters, vol. 31, 2010, pp. 28-35 L. He, Y. Chao, and K. Suzuki, A Run-based Two-Scan Labeling Algorithm, IEEE Transactions on Image Processing, vol.17, No. 5, pp. 749-756, 2008 L. He, Y. Chao, and K. Suzuki, A Run-Based One-and-a-Half-Scan Connected-Component Labeling Algorithm, International Journal of Pattern Recognition and Artificial Intelligence, vol. 24, No. 4, 2010, pp. 557-579. L. He, Y. Chao, and K. Suzuki, A linear-time two-scan labeling algorithm, 2007 IEEE International Conference on Image Processing (ICIP), San Antonio, Texas, USA, September 2007, pp. V-241-V-244. K. Suzuki, I. Horiba, and N. Sugie, Linear-time connected-component labeling based on sequential local operations, Comput Vision Image Understand, vol. 89, pp. 123, 2003. F. Chang, C.J. Chen and C.J. Lu, A linear-time component-labeling algorithm using contour tracing technique, Computer Vision and Image Understanding, vol. 93, 2004. P. Sutheebanjard and W. Premchaiswadi Efficient Scan Mask Techniques for Connected Components Labeling Algorithm, EURASIP Journal on Image and Video Processing, 2011:14. P. Sutheebanjard and W. Premchaiswadi, Fast Convert OR-Decision Table to Decision Tree, IEEE ICT&KE2010, 2010. R. Lumia, L. Shapiro, and O. Zungia, A new connected components algorithm for virtual memory computers, Comput. Vis., Graph., Image Process., vol. 22, no. 2, pp. 287300, 1983. Y. Shirai, Labeling connected regions, in Three-Dimensional Computer Vision. New York: Springer-Verlag, pp. 8689, 1987. He, L. Chao, Y. Suzuki, K. Two Efficient Label-Equivalence-Based Connected-Component Labeling Algorithms for 3-D Binary Images, IEEE Transactions on Image Processing, Vol. 20 No. 8. August, 2011.

149

Potrebbero piacerti anche