Journal of Systems Engineering and Electronics Vol. 18, No. 2, 2007, pp.199-204
Circular object recognition based on shape parameters Chen Aijun, Li Jinzong & Zhu Bing Inst. of Image Information Technology and Engineering, Harbin Inst. of Technology, Harbin 150001, P. R. China (Received November 29, 2005)
Abstract: To recognize circular objects rapidly in satellite remote sensing imagery, an approach using their geometry properties is presented. The original image is segmented to be a binary one by one dimension maximum entropy threshold algorithm and the binary image is labeled with an algorithm based on recursion technique. Then, shape parameters of all labeled regions are calculated and those regions with shape parameters satisfying certain conditions are recognized as circular objects. The algorithm is described in detail, and comparison experiments with the randomized Hough transformation (RHT) are also provided. The experimental results on synthetic images and real images show that the proposed method has the merits of fast recognition rate, high recognition efficiency and the ability of anti-noise and anti-jamming. In addition, the method performs well when some circular objects are little deformed and partly misshapen.
Keywords: Circular object, Pattern recognition, Shape parameter, Region labeling, Image segmentation.
1. Introduction In everyday experience, many objects that we see are in circular form. It is an essential task for us to recognize and localize them reliably and efficiently in image analysis applications. One of the commonly used methods for circular object recognition is the Hough transform (HT), which is robust to random noise, and can withstand certain degree of occlusion and boundary defects. So the HT is recognized as the best unique technique for the recognition of geometry shaped in images[1]. The technique can handle noise-corrupted images and can be successfully used when data are partially occluded. However, the HT has some disadvantages when it works on a discrete image. The large amount of storage and computing power required by the HT are the major disadvantages, which render it difficult to be used in realtime applications. To alleviate these problems, Xu et al.[2] presented a randomized Hough transform (RHT) which can significantly reduce the storage requirement and the computing time needed. A lot of invalid cells will arise because of random sampling when the RHT is used in complex images, which produces a mass of
useless accumulation. Many studies have been performed to recognize circular objects in digital images. In Refs. [3−4], the geometric symmetry is used as a feature to recognize imperfect circular objects, but it is invalid if circular objects are somewhat distorted, i.e. incompletely symmetric. The fuzzy recognition methods [5−6] overcome the above mentioned shortage, but they need prior knowledge regarding the number of circular objects to be recognized in digital images. In this article, a method for circular object recognition with a group of shape parameters is presented. The proposed method does not require prior knowledge regarding the number of circular objects,furthermore, both perfect circular objects and circular targets with partial distortion and little imperfection can be recognized well.
2. Recognition algorithm The presented algorithm in this article is described as follows. The original image is segmented into a binary image in which all pixels whose gray value is 255 are labeled into regions in view of 4-connected relation between pixels. Then the shape parameters of all labeled
200
Chen Aijun, Li Jinzong & Zhu Bing
regions are calculated, and those regions whose shape parameters satisfy some conditions are recognized as a
Fig. 1
2.1
The framework of the circular object recognition algorithm
Image segmentation
As a basic computer vision technique, image segmentation plays an important role in image analysis and pattern recognition and it even decides whether the features of an object can be successfully extracted. There are many methods of image segmentation, among which, thresholding is the most commonly used tool. In this article, a kind of thresholding method based on the onedimension entropy presented by Kapur et al[7] is adopted to segment the original images. The algorithm is concretely described as follows. Let L be the number of gray levels in the original image, Ni the occurrence number of pixels, whose gray value is i (i ∈{0,1,· · · ,L-1}) and pi the occurrence probability of gray level i. Now we have pi =
Ni N
(1)
where N denotes the total number of pixels in the original image. Suppose t is the segmenting threshold, and we have the probability distributions of object O and background B. p0 p1 pt O: , ,··· , Pt Pt Pt pt+1 pt+2 pL−1 B: , ,··· , 1 − Pt 1 − Pt 1 − Pt The entropies associated with the above two probability distributions are defined as H(O) = ln Pt + H(B) = ln(1 − Pt ) +
Ht Pt
(2)
HL−1 − Ht 1 − Pt
(3)
where Pt =
t i=0
pi , Ht = −
t i=0
circular object and located. The detailed recognition progress is illustrated in Fig. 1.
(pi ln pi ), HL−1 = −
L−1
(pi ln pi )
i=0
Kapur definition rule function ψ(t) is expressed as
ψ(t) = H(O) + H(B) = (4) Ht HL−1 − Ht + ln[Pt (1 − Pt )] + Pt 1 − Pt L−1 On account of HL−1 − Ht = − (pi ln pi ), Eq. i=t+1
(4) can be written as L−1 t pi pi pi pi ψ(t) = − ln ln − Pt Pt 1 − Pt 1 − Pt i=0 i=t+1 (5) The gray level t is selected as the optimal threshold t* that maximizes ψ(t), i.e. t∗ = arg max ψ(t) t∈G
(6)
A binary image can be obtained if the gray value of pixels, which is bigger than that of the optimal threshold acquired with the above-mentioned method, is set to 255 and that of other pixels to 0 in the original image. In the next context, pixels with gray value 255 are called white pixels. 2.2
Region labeling
A region labeling algorithm[8] based on recursion technique is used to label white 4-connected pixels in the binary image. At the same time, the number and the coordinates of the white pixels in each labeled region are stored in the following link-list data structure. Struct RegionList { int Num; //the number of white pixels int *x; //row coordinates int *y; //column coordinates struct RegionList * next ; //the pointer to //the next connected region }; The detailed algorithm is as follows. Step 1 Scan the binary image in the order of left to right and up to down. If a white pixel is found go to Step 2. Otherwise, stop.
Circular object recognition based on shape parameters
201
Step 2 Erect a new link-list node and initialize the number variable num in the node to be 0. Then set the gray value of the current white pixel to be 0 and store the row and the column coordinates of the current pixel into x and y in the node, respectively.
where W and L denote the width and the length of the minimum external rectangle of a labeled region, respectively. The width and the length can be obtained from the number variables, *x and *y, of structure data, which come into being when regions are labeled. Another shape parameter is rectangle degree, by which, the extent by which an object is held by its minimum external rectangle can be obtained. The value of rectangle degree is limited in the range [0,1], and it is maximal, 1.0 for rectangle objects, about 0.79 for circular objects and it becomes smaller for slender objects and curving objects. The rectangle degree of an object can be calculated by
Step 3 Scan the four 4-connected neighborhood points of the current pixel in the order of the numbers showed in Fig. 2. If a white pixel is found, set its gray value to 0 and store its coordinates in x and y. Then scan the four neighboring pixels of the four neighboring white pixels in the above-mentioned order again. If another white pixel is found, set its gray value to 0 and store its coordinates in x and y. The process is iterative and when there is a white one among the neighboring pixels, go ahead by one step. Come back step by step after all the white pixels undergo such a process. Step 4 If the recursion process comes to an end, a 4-connected region labeling is accomplished. Then go to Step 1.
c2 = A0 /AR
(8)
where A0 denotes the area of the labeled region, whose value is equal to the number of pixels in the region, i.e. the value of number num in the data structure and AR denotes the area of the minimum external rectangle of the labeled region, whose value can be calculated by W × L. Replace A0 and AR with num and W × L respectively, then Eq. (8) can be rewritten as c2 = num/(W × L)
Fig. 2
For each labeled region, if its posture ratio and rectangle degree satisfy inequality (10), it will be recognized as a circular object.
The order of recursive processing to neighborhood points
2.3
c1l c1 c1h and c2l c2 c2h
Shape identification
Circular objects can be identified in view of geometry properties of each labeled region after all regions are labeled. There are some common geometry properties, such as area, perimeter, denseness degree, posture ratio and rectangle degree, etc [9−10] . In this article, two shape parameters, posture ratio and rectangle degree, are selected to identify circular objects. Slender objects can be distinguished from quadrate objects and circular objects in terms of posture ratio. For four square objects and circular objects, their posture ratio value is equal to 1. The posture ratio of an object can be calculated by c1 = W/L
(9)
(7)
(10)
where c1l and c1h are the low threshold and the high threshold of c1 , and c2l and c2h are the low threshold and the high threshold of c2 , respectively. We use its centroid to locate when a labeled region is recognized as a circular object and the centroid can be calculated by num
xC =
i=1
num
xi ,
yC =
i=1
yi
(11) num num where xC and yC are the centroid row coordinate and column coordinate of the circular object respectively, x and y denote the row coordinate and the column coordinate of each pixel in the labeled region respectively and num is the number of pixels in the labeled region.
202
Chen Aijun, Li Jinzong & Zhu Bing
3. Experimental results and analysis The experiments are performed on a Pentium 1.60 GHz computer with Windows XP operating system using Visual C++6.0 program language. The images to be processed, which are of size 256×256 and of gray level 256, are divided into two groups: one consists of synthetic images and another real images. In this experiments, the value of c1 is in the range [0.8, 1.0] and c2 [0.64, 0.86]. For the purpose of comparison, we apply the proposed approach and the RHT method to each image individually. In this article, the performances of the two methods are evaluated by running the programs 50 times, because running results with RHT method may be different due to random sampling. The first experiment is tested on the synthetic images. The original image is shown in Fig. 3(a). It consists of two circular objects with different radii, two circular objects with different flaws and one circular object with little deformation similar to an ellipse object. The recognition and location result on using the proposed method is shown in Fig. 3(b). The recognition and location result on using the proposed method is shown in Fig. 3(c), after the edge is detected with Canny operator in the original image. In order to test
Fig. 3
the robustness of the proposed method, we add 10% salt and pepper noise to the original synthetic image, and the resulting noise image is shown in Fig. 3(d). The recognition and location results to Fig. 3(d) using the proposed method and the RHT method are shown in Fig. 3(e) and Fig. 3(f), respectively. Both methods can correctly recognize the five circular objects because the edge of the synthetic images is simple. At the same time, we can see that both methods are not sensitive to noise, edge distortion and imperfection. The second experiment is carried out on real images, as shown in Fig. 4(a), Fig. 4(f) and Fig. 4(k). There are 4 circular objects in Fig. 4(a), 1 in Fig. 4(f) and 10 in Fig. 4(k). The segmenting results to Fig. 4(a), Fig. 4(f) and Fig. 4(k) using the one-dimension entropy method are shown in Fig. 4(b), Fig. 4(g) and Fig. 4(l), respectively. The sets of edge pixels of the original images are shown in Fig. 4(c), Fig. 4(h) and Fig. 4(m) respectively, where some edges are spurious and some edges are missing. Here, the edge detection operator used is the Canny operator. The recognition and location results using the proposed method are shown in Fig. 4(d), Fig. 4(i) and Fig. 4(n) respectively and those using the RHT method are shown in Fig. 4(e), Fig. 4(j) and Fig. 4(o) respectively. From
The synthetic images and their recognition results
Circular object recognition based on shape parameters
Fig. 4
The real images and their recognition results
the results it is found that as to real images, when their edges become more complicated, the recognition efficient using the RHT method will be lower, whereas that using the proposed method still retains a higher value. The execution time required for each method is measured in terms of seconds and it is obtained from an average of 50 simulations in spite of the fact that the recognition result may be incorrect. The performance comparison between the RHT method and the proposed method is shown in Table 1. Table 1 Image
RHT/s
Fig. 3(a) 6.707
203
Time performance comparison The proposed (RHT−the proposed method) method/s
/ the proposed method
1.278
4.2
Fig. 3(d) 6.723
1.191
4.6
Fig. 4(a) 41.139
0.233
175.5
Fig. 4(f) 40.261
0.135
297.2
Fig. 4(k) 53.991
0.080
673.8
In Table 1, the first column denotes the used synthetic and real images. The execution time required in the RHT is listed in the second column. The execution time of the proposed method is displayed in the third column. Furthermore, the three columns are followed
by a column, which lists the corresponding improvement ratios. The improved ratio is measured by (RHT method-the proposed method)/the proposed method. Table 1 reveals that the proposed method is at least 4 times and 175 times faster than the RHT for the synthetic images shown in Fig.3 and the real images shown in Fig. 4, respectively. According to the experimental results in Table 1, Fig.3 and Fig. 4, the proposed method is faster than the RHT and it can resist noise and interfere to certain extent. In addition, on using the proposed method, multiple circular objects with different size can be simultaneously recognized, moreover, the results have no reliance to one another. The proposed method performs well when it is used to recognize those circular objects with little distortion and imperfection.
4. Conclusions In this article, we present a method based on geometry properties for recognizing circular objects. We obtain a binary image by segmenting the original image with a one dimension maximum entropy threshold algorithm. All white 4-connected pixels are labeled with a region labeling method based on recursion and the geometry properties of posture ratio and rectangle
204 degree of each labeled region are calculated. If its geometry properties are satisfied with some constraints, a labeled region is recognized as one circular object and located by its centroid. Experimental results on synthetic images and real images demonstrate that the proposed method is faster and more efficient, and robust in recognizing circular objects and can be used in real world. The images have to be segmented before the circular objects are recognized, so the recognition and localization will be affected by segmenting error. In addition, it is useless to recognize circular objects overlapped with the proposed method. How to adopt a better method to segment original images and improvement on the proposed method are the future research issues.
References [1] Illingworth J, Kittler J. A survey of the hough transform. Computer Vision, Graphics, and Image Processing, 1988, 44 (1): 87-116. [2] Xu L, Oja E, Kultanan P. A new curve detection method: randomized hough transform (RHT). Pattern Recognition Letters, 1990, 11(5): 331-338. [3] Ducottet C, Daniere J, Moine M, et al. Localization of objects with circular symmetry in a noisy image using wavelet transforms and adapted correlation. Pattern Recognition, 1994, 27 (3): 351-364. [4] Ho ChunTa , Chen Linghwei. A fast ellipse /circle detector using geometric symmetry. Pattern Recognition, 1995, 28 (1): 117-124. [5] Rajesh N Dave. Generalized fuzzy c-shells clustering and detection of circular and elliptical boundaries. Pattern
Chen Aijun, Li Jinzong & Zhu Bing Recognition, 1992, 25 (7): 713-721. [6] Man Y, Gath I. Detection and separation of ring-shaped clusters using fuzzy clustering. IEEE Trans. on Pattern Analysis and Machine Intelligence, 1994, 16 (8): 855-861. [7] Kapur J N, Sahoo P K, Wong A K C. A new method for gray-level picture thresholding using the entropy of the histogram. Computer Vision, Graphics, and Image Processing, 1985, 29(3): 273-285. [8] YU Jie, XU Huaxi. An achievable algorithm suitable to cell image connected area. Journal of Jiangsu University (Medicine), 2005, 15(2): 152-153,155. [9] LI Jinzong. Introduction to pattern recognition. Beijing: Higher Education Press, 1994: 378-380. [10] Castleman K R. Digital image processing. Beijing: Publishing House of Electronics Industry, 2002: 412-414.
Chen Aijun was born in 1976. He is a Ph. D. candidate in Harbin Institute of Technology. His research interests include image processing and pattern recognition. E-mail:
[email protected] Li Jinzong was born in 1940. He is a professor and a doctoral supervisor in Harbin Institute of Technology. His research interests include image processing, serial image analysis, pattern recognition, precision guidance and homing tracking. Zhu Bing was born in 1976. He is a Ph. D. candidate in Harbin Institute of Technology. His research interests include image processing, pattern recognition and signal processing.