efficient technique for circle detection using hypothesis filtering and hough transform

9
W.C.Y. Lam S .Y. Yu en Indexing terms: Hough transforms, Image processing, Circle detection, Parameter hypothesis Abstract: A fast circle detection method using a variant of Hough-like technique is reported. The proposed technique is simple in implementation, efficient in computation and robust to noise. In general, to evaluate circle parameters for all possible point triplets in an edge image containing n points, .C3 enumerations of the points have to be examined. However, if specific relations of the circle points are sought, the required number of enumerations can be reduced. The authors propose one such scheme of detection with point triplets possessing right angle property and the required enumerations can be reduced to .C, Moreover, a novel processing strategy known as hypothesis filtering is introduced. The strategy includes two hypothesis constraints termed as consistency checking with gradient angles and neighbouring points validation. Experimental results are demonstrated to reveal the performance of the method on detecting circles in both synthetic and real images. Since the proposed method adopts a right angle criterion for hypothesis, circles occluded or broken by more than one half may not be detected. Test results show that the limitation of the proposed method appears to be acceptable. When compared with established Hough transform techniques, the main strengths of the proposed detection method are its attractively low computational and memory complexities and good accuracy of detection. In everyday experience, many objects that we perceive are in circular form. The detection of their presence in an image reliably and efficiently is therefore an essen- tial task in image analysis. One frequently adopted technique is the standard Hough transform (SHT) method [2], which is robust to noise and can withstand certain degree of occlusion and boundary defects. Moreover, the technique can also be extended to detect 0 IEE, 1996 IEE Proceedings online no. 19960794 Paper first received 26th January and in revised form 29th July 1996 The authors are with the Department of Electronic Engineering, City University of Hong Kong, 83, Tat Chee Avenue, Kowloon Tong, Hong Kong arbitrary shapes [3, 41. Unfortunately, the major short- comings of the technique which inhibit its application to higher-order analytic shape detection are its massive storage requirement and high cost of computation. To tackle these problems, many improvements have been suggested [5, 61. Kimme et al. [3] and Ballard [4] used gradient information to reduce computation cost. Davies [7] used a two-pass algorithm to locate a circle centre in two l-D arrays. Yuen et al. [8] compared four modified HT methods for circle detection with the SHT. These were the Gerig Hough transform (GHT) [9], the Gerig Hough transform with gradient (GHTG) [XI, the two-stage Hough transform (21HT) [lo, 111 and the modified fast Hough transform (MFHT) [8, 121. These methods employ one edge point for each accu- mulation in their Hough space (HS). Their strengths and shortcomings are also discussed in the same refer- ences. Variants of the Hough technique using more than one edge point for evidence accumulation have also been adopted recently. Among these reported multipoint transform approaches, Leavers [l, 131 detected circles by a dynamic generalised Hough trans- form (DGHT) method which is probabilistic in nature. First, it picks a seed point which must be part of a con- nected curve. Then, a region of interest corresponding to the seed point is hypothesised. Subsets of edge points sampled within the region, together with the seed point, are used for parameter estimation and accu- mulations in the projection subspaces formed by l-D arrays. Since the criteria of selecting the seed points are quite simple and the selection of the region of interest requires prior information of the range of dimensions of the shapes under detection, the efficiency of the method may easily be affected by an invalid hypothesis of the seed point or region of interest. Yip et al. [14] suggested the use of parallel tangents and accumulation of the four vertices (referred to by the authors as the end points of the circle diameters parallel to the co- ordinate axes) in a 2-D accumulator array. Subse- quently, peaks formed by the four vertices are detected to recover the circle parameters. However, as reported by the authors, difficulties may occur when detecting circles with more than one quarter missing or being occluded by more than one quarter. Lam et al. [15] pre- sented a Hough prediction/correction (HPC) method which can detect nearly half the occluded circles with- out using gradient information. In the method, circle parameters are evaluated with two of the points enu- merated combinatorially from the image and the third point searched along a path perpendicular to the line joining the point doublet. The number of enumerations IEE Proc -Vis Image Signal Process, Vol 143, No 5, October 1996 292

Upload: sy

Post on 19-Sep-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Efficient technique for circle detection using hypothesis filtering and Hough transform

W.C.Y. Lam S .Y. Yu en

Indexing terms: Hough transforms, Image processing, Circle detection, Parameter hypothesis

Abstract: A fast circle detection method using a variant of Hough-like technique is reported. The proposed technique is simple in implementation, efficient in computation and robust to noise. In general, to evaluate circle parameters for all possible point triplets in an edge image containing n points, .C3 enumerations of the points have to be examined. However, if specific relations of the circle points are sought, the required number of enumerations can be reduced. The authors propose one such scheme of detection with point triplets possessing right angle property and the required enumerations can be reduced to .C, Moreover, a novel processing strategy known as hypothesis filtering is introduced. The strategy includes two hypothesis constraints termed as consistency checking with gradient angles and neighbouring points validation. Experimental results are demonstrated to reveal the performance of the method on detecting circles in both synthetic and real images. Since the proposed method adopts a right angle criterion for hypothesis, circles occluded or broken by more than one half may not be detected. Test results show that the limitation of the proposed method appears to be acceptable. When compared with established Hough transform techniques, the main strengths of the proposed detection method are its attractively low computational and memory complexities and good accuracy of detection.

In everyday experience, many objects that we perceive are in circular form. The detection of their presence in an image reliably and efficiently is therefore an essen- tial task in image analysis. One frequently adopted technique i s the standard Hough transform (SHT) method [2], which is robust to noise and can withstand certain degree of occlusion and boundary defects. Moreover, the technique can also be extended to detect 0 IEE, 1996 IEE Proceedings online no. 19960794 Paper first received 26th January and in revised form 29th July 1996 The authors are with the Department of Electronic Engineering, City University of Hong Kong, 83, Tat Chee Avenue, Kowloon Tong, Hong Kong

arbitrary shapes [3, 41. Unfortunately, the major short- comings of the technique which inhibit its application to higher-order analytic shape detection are its massive storage requirement and high cost of computation.

To tackle these problems, many improvements have been suggested [5, 61. Kimme et al. [3] and Ballard [4] used gradient information to reduce computation cost. Davies [7] used a two-pass algorithm to locate a circle centre in two l-D arrays. Yuen et al. [8] compared four modified HT methods for circle detection with the SHT. These were the Gerig Hough transform (GHT) [9], the Gerig Hough transform with gradient (GHTG) [XI, the two-stage Hough transform (21HT) [lo, 111 and the modified fast Hough transform (MFHT) [8, 121. These methods employ one edge point for each accu- mulation in their Hough space (HS). Their strengths and shortcomings are also discussed in the same refer- ences.

Variants of the Hough technique using more than one edge point for evidence accumulation have also been adopted recently. Among these reported multipoint transform approaches, Leavers [l, 131 detected circles by a dynamic generalised Hough trans- form (DGHT) method which is probabilistic in nature. First, it picks a seed point which must be part of a con- nected curve. Then, a region of interest corresponding to the seed point is hypothesised. Subsets of edge points sampled within the region, together with the seed point, are used for parameter estimation and accu- mulations in the projection subspaces formed by l-D arrays. Since the criteria of selecting the seed points are quite simple and the selection of the region of interest requires prior information of the range of dimensions of the shapes under detection, the efficiency of the method may easily be affected by an invalid hypothesis of the seed point or region of interest. Yip et al. [14] suggested the use of parallel tangents and accumulation of the four vertices (referred to by the authors as the end points of the circle diameters parallel to the co- ordinate axes) in a 2-D accumulator array. Subse- quently, peaks formed by the four vertices are detected to recover the circle parameters. However, as reported by the authors, difficulties may occur when detecting circles with more than one quarter missing or being occluded by more than one quarter. Lam et al. [15] pre- sented a Hough prediction/correction (HPC) method which can detect nearly half the occluded circles with- out using gradient information. In the method, circle parameters are evaluated with two of the points enu- merated combinatorially from the image and the third point searched along a path perpendicular to the line joining the point doublet. The number of enumerations

IEE Proc -Vis Image Signal Process, Vol 143, No 5, October 1996 292

Page 2: Efficient technique for circle detection using hypothesis filtering and Hough transform

required by the method is ,C2N, where N is the dimen- sion of a square image. A major merit of this category of multipoint transform techniques is a significant reduction of memory storage. However, due to the combinatorial enumeration of points required, the computational complexity of these methods is usually higher than the conventional single point approach. Therefore, to find a way to reduce the number of enu- merations is a main concern for these methods.

This paper presents an approach for circle detection. The proposed scheme also belongs to the multipoint transform category. Theoretically, to evaluate circle parameters for point triplets in an edge image contain- ing n points, ,C3 enumerations of the edge points have to be examined. However, if specific relations of the circle points are sought, the required number of enu- merations can be reduced enormously. The idea of the proposed technique comes from a property of a circle that any three points lying on it and with two of these points being the diameter, the third point forms a right angle triangle with the remaining two points. Using such a criterion to form specific sets of a feature point triplet, the number of enumerations can be reduced to .C2 only. The performance of the proposed technique is promising in that it is both fast and memory saving as compared with conventional Hough transform meth- ods.

- X

I I

Fig. 1 0 edge point 0 searched edge point location

Co-ordinates ofPJa and Pjb determinedfrom P, and Pz

2 implementation details

Consider any two end points Pl(x l , yl) and P2(x2, y2) of a diameter Dl of a circle as shown in Fig. 1. We can locate simply another two points P 3 a ( ~ 1 , y2) and P3b(x2, y l ) which form a second diameter D2 of the same circle such that P1, P3a, P2 and P3, constitute the four cor- ners of a rectangle circumscribed by the circle. In such a configuration, the sides of the rectangle are parallel to the co-ordinate axes. Since both the angles LP1P3,P2 and LP2P3bP1 are right angles, the existence of either points P3, or P3, in the image, together with Pl and P2 forming a feature point triplet, can be used to hypothe- sise the same circle. Therefore, without losing general- ity, we use P3 to refer to P3a or P3b when the third point need not be distinguished explicitly.

With the feature point triplet formed, we can deter- mine the parameters (ahp, b,, rhp) of a hypothetical cir- cle by the following simple equations:

Proposed scheme for circle detection and its

and

Since the hypothesis of a circle depends on its diameter formed by Pl and P2, circles which are occluded or broken by more than half may not be determined. This constitutes a limitation of using the technique. How- ever, the limitation is less severe than Yip’s method [14] where the imperfect boundary cannot be more than a quarter. The DGHT method [I] does not have this lim- itation for circle detection. However, as tested by the author for good quality image data where the degree of connectivity for edge boundaries are high, minimum data requirements are of the order of a half circle. A quarter arc is insufficient and leads to ambiguity in the results. In this regard, the limitation of the proposed technique appears to be acceptable.

Another issue to be considered here is that the HT technique used in [1, 141 obviously requires a large number of feature point triplets for valid accumula- tions in the HS. This is not easily accomplished here when few point triplets satisfy the right angle criterion. To get rid of this requirement, a hypothesis-verification paradigm is introduced in our detection scheme. The paradigm employed here is essentially based on a single occurrence of a point triplet satisfying the right angle criterion for hypothesis. Basically, the hypothetical cir- cle can be initiated by two points PI and Pz which is adequate to determine the circle parameters. However, the additional point P3 located can provide greater evi- dence to screen out unlikely hypotheses. Therefore, the location of P3 can be considered as a simple but useful strategy for preliminary hypothesis filtering. ]Moreover, since the right angle condition for any point triplet is not a unique property of a circle, invalid hypotheses can still be generated when the image contains noncir- cular objects. To eliminate these invalid hypotheses, we impose two more hypothesis constraints. These con- straints will be elaborated further in the following sub- section.

With the additional constraints introduced, the pro- posed detection scheme can be performed in the follow- ing manner:

For any point triplet in an image satisfying the required right angle criterion and hypothesis con- straints, we hypothesise a circle passing through them. The corresponding circle parameters (ahp, bhp, Yhp) are evaluated with eqns. 1 and 2. Subsequently, edge points that exist within a region of interest (i.e. an associated rectangular template to be described in Section 2.2) corresponding to the hypothetical circle are located. Their distances from the hypothetical circle centre are evaluated and accumulated in a 1-D accumulator array (i.e. the radius array). A circle is regarded as existing when a prominent peak is detected in the array. Once the circle is detected, its parameters are recorded in a parameter list. As revealed from the experiments in Section 3, we shall see that the detected parameters are sufficiently accurate for general requirements. How- ever, the parameter values can be further improved when better subpixel accuracy is desired. This can be done by an optional procedure for refinement as elabo- rated in Section 2.4. Subsequently, edge points corre- sponding to the detected circle are removed from the image. The scenario is repeated until all of the enumer- ations are completed.

Based on the above scheme of detection, a complete detection algorithm is presented as shown in Section 7.1.

IEE Proc.-Vis. Image Signal Process., Vol. 143, No. 5, October 1996 293

Page 3: Efficient technique for circle detection using hypothesis filtering and Hough transform

2.1 Filtering with hypothesis constraints The hypothesis constraints adopted in the detection scheme are mainly composed of two categories. The first category tests the compatibility of gradient angles in a point triplet before a hypothetical circle is verified. The gradient angles used are obtained from a 3 x 3 Sobel edge detector. In the second category of con- straints, the neighbouring points of the point triplet are verified. The reason is that if the hypothesis is valid, it is equally likely that the proximal points of the triplet should also satisfy the same set of circle parameters. The following explains the details of the constraints employed:

2. I. I Consistency checking with gradient angles: The consistency checking with gradient angles of a point triplet is divided into two cases: Case 1: For points P I and P2, their respective gradient angles and @2 differ by n, i.e. - - n. Case 2: For the gradient angle 4, of point P,, its con- sistency can be tested via the comparison of b,, with b,, i.e. bp , = bh,. The parameter bp, is the the vertical co-ordinate of the circle centre determined using P3(x3, y3 ) and ah, and they are related by the following equa- tion:

This equation can be obtained simply by differentiating b ~ , = (ahp - 2 3 ) tan43 + y3 (3)

the circle equation

with respect to x. T ; ~ = (x - ahp)’ + (y - bhp)2 (4)

x

Fig.2 (i) search location (ii) pixel location

Validation of neighbouring points within a 5 x 5 window

2.1.2 Neighbouring points validation: Consider a 5 x 5 window corresponding to PI as shown in Fig. 2. Edge points are located from the shaded region within the window. An edge point Q that exists in the region is considered as a feature point of the hypothet- ical circle when the following two criteria are satisfied: (a) The separation of Q from the hypothetical circle centre rQ is approximately the same as rhp, i.e. Y Q - Yh,.

(b) The gradient angle of Q is consistent. The consist- ency is verified by using a procedure similar to case 2 of Section 2.1.1. The same test is also performed for P2 and P3. The val- idation of neighbouring points is satisfied when for each point Pi in the triplet, the following condition is met:

(5) m, - > r; where i = 1,. . . , 3 M% -

In the above equation, M L is the number of neighbour- ing edge points that exist in the shaded region of P,; m,

294

is the number of these edge points satisfying criteria (a) and (b); and z is a threshold value set experimentally as 0.5.

Fig. 3 (i) rectangular template (ii) circular template (iii) hypothetical circle

Rectangular template enclosing the hypothetical circle C,,

2.2 Design of rectangular template To verify the existence of the hypothetical circle, a rec- tangular template can be designed and edge points within the template region are located for evidence accumulation using a 1-D array. An example of the template designed with the parameters of a hypotheti- cal circle CHyp is shown in Fig. 3. The template is com- posed of two rectangular boundaries Rect, and Recto which are defined by

and Recto { ( a h p - ( T t ) m a z , b h p - ( T t ) m a ~ ) ,

( a h p + ( T t l m a z , b h p + ( T t ) m u z ) > (7) The parameters ( Y ~ ) ~ , ~ and (rJmax are the bounds of the hypothetical circle radius rhp. An analysis of these bounds due to discretisation errors in the sensing device is shown in Section 1.2. We assume that the images containing the circular features are taken with sufficient care of lighting and that the camera used is well calibrated such that the effect of perspective pro- jection and optical anomalies can be corrected. If the projection distortion is dominant, an ellipse detector will be more appropriate for detection. These assump- tions are usually valid and achievable in indoor envi- ronments or industrial applications.

For each point P(x, y ) located in the template, a ver- ification radius rv is evaluated using

rv = d ( x - a h p ) 2 + (y - bh,)2 (8) and the value is accumulated in a small 1-D radius array. A prominent peak formed in the array can imply the existence of a hypothetical circle.

2.3 Using an interleaved scanning heuristic The processing of pixel points in an image is dependent on the scanning sequence applied to the image, and conventionally pixel points are scanned from left to right and top to bottom. In the proposed detection scheme, once a circle is detected, edge points belonging to the circle can be removed from the image and they will not be used in subsequent hypotheses and verifica- tions. Therefore, the earlier the shape can be detected,

IEE Pioc -Vis Image Signal Process, Vol 143, No 5, October 1996

Page 4: Efficient technique for circle detection using hypothesis filtering and Hough transform

the fewer the remaining points will be used for hypoth- esis and verification. Since points scanned from succes- sive columns (or rows) are usually neighbouring points, they usually correspond to similar local information of the same shape which are of little use to aid the earlier detection of other shapes. To facilitate the detection, we can reorder the scanning sequence in an interleaved manner. For example, with an image of N columns, if we let the scanning direction be column by column, the conventional scanning sequence will be { C ~ : i = 1, ..., N } , where c, represents the ith column of the image. With the heuristic of interleaved scanning applied, the new scanning sequence will become { cI, c $ + ~ - ~ ) , c2s+0-l), ..., c , , + ~ - ~ ) : j = 1, ..., s-I}, where s is an interleaved factor and K = N DIV s. The symbol DIV denotes an integer division operation and scanning is not per- formed when KS + 0'- 1) > N .

2.4 Refinement of the circle parameters When a hypothetical circle is verified as existing, its parameters (ahp, bhp, rhp) are considered as the detected parameters. However, when desired, their accuracy can be further improved by an optional refinement process. The process is composed of three SHT modules which refine the circle parameters independently. For exam- ple, if the parameter rhp is to be refined, the sampling parameters, which are the centre parameters a and b used in one of the SHT modules, can be set with small

a b I I

C d Fig. 4 Experiment 1. Synthetic drawing of circles

a b

d Fig. 5 Experiment 2. Synthetic drawing of concentric circles

IEE Proc.-Vis. Image Signal Process., Vol. 143, No. 5, October 1996

sampling ranges and across the detected values ahp and bhp, respectively. The same technique is applied to refine ah, and bhp in another two SHT modules. Again, in each SHT module, only edge points in the template region are used for accumulation in the 1-D arrays. To cope with a noise corrupted circle where the boundaries may not be exactly circular, the size of the template

a b

C d

a b

Fig. 6 Experiment 3. Synthetic drawing of occluded circles

C d

a b

Fig. 7 Experiment 4. Discrimination of circular and rectangular objects

C d Fig. 8 Experiment 5. Detection of chess pieces in clutter environment

295

Page 5: Efficient technique for circle detection using hypothesis filtering and Hough transform

region can be tolerated further by several pixels accord- ing to eqns. 17 and 18 derived in Section 7.2. To achieve better subpixel accuracy of the refined parame- ters, the co-ordinates of the edge points and the resolu- tion of the sampling parameters in the SHT modules can be oversampled to reduce their discretisation errors.

Table 1: Execution time for experiments 1-5

Experiment n (pixels) T, (s) T,,, ( s ) TA,, ( s ) 1 1248 0.9 1.4 5.1

2 1755 1 .o 1.6 7.5

3 1614 1.2 2.0 6.7

4 1162 1.8 2.2 4.9

5 4843 1.9 22.8 26.6

n = number of edge points in thinned edge image T, = execution time for Sobel edge detection and thinning T,,, = execution time of the proposed method T;,, = execution t ime of the proposed method with refinement

3 Experimental results

The algorithm presented in Section 7.1 has been imple- mented in C language on an IBM-PC compatible DX- 2/66MHz computer. A total of five images (Figs. 4-8), each with size 256 x 256 pixels, have been tested. In the experiments, the size of each 1-D array used for accu- mulation was 15, the angular tolerance for consistency checking was 7", the interleaved scanning factor was set experimentally as 5, and the existence ratio for local peak detection was 0.54. The results for the five experi- ments arc also shown in the corresponding subfigures in Figs. 4-8. The execution times of the experiments were tabulated in Table 1. As shown in the last two columns of Table 1, the first four experiments were completed within 3 s when no refinement is performed. But for the fifth experiment where the edge points processed arc about three times the other edge images, the time taken was reasonably longer and is about 23 s. With the detected parameters refined, the additional time required is fairly constant for all the experiments and is within 6s. Moreover, as revealed from the first four experiments, the yield of better subpixel accuracy was achieved at a higher cost of processing efforts. For these cases where the refinement is performed sequen- tially and constitutes the main proportion of the overall computation, it appears that benefits have to be weighed against accuracy and additional effort paid

Table 2: Number of enumerations and hypothesis counts required

Experiment n(pixels) .C, NEnum NRgrAng NGrad " g b d NDet

1 1248 778128 59661 211 7 7 6

2 1755 1539135 4507 50 19 19 5

3 1614 1301691 102655 320 33 32 8

4 1162 674541 51147 145 32 21 5

5 4843 11724903 7603724 38477 654 207 6

n = number of edge points in thinned edge image .C, = theoretical number of enumerations required NEnom = actual number of enumerations required NRgrAns = counts passing the right angle condition N,,, = counts passing the consistency checking using gradient

N,,,,, = counts passing the neighbouring points validation N,,, = number of detected circles

angles

for. Another possible alternative that can be considered for implementation is to perform the refinement in a parallel manner.

To investigate the effectiveness of the hypothesis con- straints employed, hypothesis counts passing the imposed constraints were recorded in Table 2. Since the feature points of the detected circles were removed, the actual number of eiiumerations required NEFTUnZ is less than ,,C,. As revealed from NRgtAng, NGrad and NNgbd, most of the invalid hypotheses are effectively screened out by the constraints imposed. Moreover as compared to NEnUm, "gbd (i.e. the number of point tri- plets actually verified) constitutes a very small fraction only. Therefore, the main core of processing, i.e. the verification and refinement process which require the heaviest computation effort, is limited to a small amount of confident hypotheses only.

The first three experiments shown in Figs. 4-6 reveal the performance of the proposed algorithm to locate synthetic circles with different sizes and positions and its capability to handle concentric and occluded circles. In the first experiment, six circles were synthesised as shown in Fig. 4a and its edge detected image is shown in Fig. 4b. The circles detected by the algorithm are superimposed on the edge image and reconstructed as shown in Fig. 4c. In the same Figure, the crosses drawn on each reconstructed circle denote the corresponding triplet of edge points that initiates the hypothesis. Moreover, the rectangles embracing the detected circles are their associated templates for verification. In practi- cal implementation, each rectangular template is com- posed of two pairs of equal area regions. The search of points in the same pair of regions is performed simulta- neously by simple translation of the region co-ordinates. Fig. 4d shows the refined results superimposed on the original intensity image. The detected and refined circle parameters obtained in this experiment were recorded in Table 3 and compared with the actual parameters of the synthetic circles. As seen from the third column of the Table, the errors of the detected parameters without refinement are within 1 pixel. When refinement was per- formed, an appreciable improvement on the overall detection accuracy can be observed as shown in the fourth column. The cases for the second and third experiments are depicted in Figs. 5 and 6, respectively. For the third experiment, it should be noted that differ- ent parts of the circles are purposefully occluded aiid two of the circles are occluded by more than a quarter by another circle located at the lower right corner. Despite these missing portions, all of the circles arc still detectable and the reconstructed circles approximate the missing portions quite well.

Table 3: Absolute errors for detected and refined circle parameters in experiment 1

Items Actual parameters Errors without Errors with (a, b, r ) refinement refinement

(16a1, 1661, 164) (16al, 1661, 164) 1 (38.2,46.7,25.5) (0.2,0.3,0.0) (0.1 ,o. 1 ,O.O)

2 (60.6,180.9,50.2) (0.1 ,0.6,0.0) (0.2,0.1,0.0)

4 (1 20.4,12 1.6,30.9) (0.6,O. 1 ,O. 1) (0.1,0.2,0.1)

3 (1 12.3,40.0,33.5) (0.3,0.5,0.2) (0.2,0.5,0.6)

5 (190.3,80.5,43.7) (0.2,0.5,0.2) (0.2,0.3,0.0)

6 (170.1,180.5,38.3) (0.1,0.5,0.1) (0.2,0.3,0.1) The co-ordinates are in Cartesian form and the origin is at the bottom left corners of the images

IEE Proc -Vis Image Signal Piocess , Vol 143 No 5, October 1996 296

Page 6: Efficient technique for circle detection using hypothesis filtering and Hough transform

The last two experiments were performed on real intensity images as shown in Figs. 7 and 8. In the fourth experiment, a match box with right-angled cor- ners was placed together with three coins and a circular roll of adhesive tape. No false detection due to the right-angled corners was observed. Another point that is worth mentioning here is that the edge boundaries of the coins shown in Fig. 76 are not exactly circular. The anomalies arising from these boundaries did not affect their detection as circles. A similar performance of detection was observed in the fifth experiment. This time the test image contains several Chinese chess pieces which are in a cluttered environment arisen from the shadows of chess pieces and patterns of the chess-

r (for verification)

Fig.9 Accumulation scores for one of the detected circles in experiment I : verlfication radius

3000

ZJ 2000

1000

0 55 60

.b4

C

8

65

a Fig.10 Accumulation scores for one of the detected circles in experiment I : parameter a

40001 1

b Fig.11 Accumulation scores for one of the detected circles in experiment I : parameter b

5 0 0 0 1 1

r Fig.12 Accumulation scores for one of the detected circles in experiment 1: parameter r

IEE Proc.-Vis. Image Signal Process., Vol. 143, No. 5, October 1996

board. Fig. 8c and d show the corresponding detected and refined results. The complicated patterns of char- acters present in the iniage do not make the results deteriorate too much. Since less than half of the chess pieces are located at both the left and right top corners, they are undetectable. The outer boundaries of other chess pieces are imperfect and severely distorted and they cannot be detected as circles either. From this last experiment, the strength (i.e. the computational effi- ciency, accuracy of detection and robustness to clutter noise) and the weakness (i.e. the amount of the circle to be detected should be more than haIQ of the method are simultaneously observed.

r (for verification)

Fig. 13 experiment 5: ver$cation radius

Accumulation scores fo r one of the detected chess pieces in

1000 c C J 2

500

0 72 73 7L 75 76

a Fig.14 experiment 5: parameter a

Accumulation scores jbr one of the detected chess pieces in

1 5 0 0 7

1000 I

C

0 U

500

0 208 209 210 211 212

b Fig.15 Accumulation score.y for one of the detected chess pieces in experiment 5: parameter b

2ooo7 15001

c C

U 2 1000

500

0 30

1 I

3; 34

r Fig. 16 Accumulation scores for one of the detected chess pieces in experiment 5: parameter r

297

Page 7: Efficient technique for circle detection using hypothesis filtering and Hough transform

In Figs. 9-12 and Figs. 13-16, two sets of detected circle parameters, one obtained from experiment 1 and another from experiment 5 , were plotted, respectively. In each set of Figures, the first Figure is the accumula- tion score of the verification radius Y , as described in Section 2.2. The remaining three Figures in each set correspond to the refined parameters obtained from the three SHT modules described in Section 2.4. As men- tioned previously, to reduce the discretisation errors for refinement, the co-ordinates of the edge points in the template region and the resolution of the sampling parameters in the SHT modules were oversampled. This results in higher accumulation scores obtained for the refined circle parameters as compared to the score for the verification radius 7,. Therefore, in the two sets of Figures, the vertical scales are different. From these subplots, distinguishable peaks are observed.

count 500 \

-100

a

Fig. 17 Projected accumulation scores obtained by SHT method

count

200

100

0

-100

Fig. 18 Accumulation scores obtained by GHTG method

Finally, using the image of the fifth experiment, a comparison of the proposed method with the SHT and the GHTG methods were made. The accumulation scores of the SHT and GHTG methods, together with their contour plots, are shown in Figs. 17 and 18. Since the complete HS of the SHT method is three-dimen- sional, the visualisation of peak formation is difficult. Alternatively, Fig. 11 shows the accumulation scores projected to a 2-D subspace of centre parameters. Moreover, gradient information has been used for fil- tering invalid accumulations. However, to be fair for

298

the comparison of the execution time, the unmodified SHT algorithm was used. The execution time and memory storage required by the three methods were compared as shown in Table 4. Their limitations are also shown in the last column of the same Table. It should also be noted that the execution time for the SHT and the GHTG methods denote their processing in accumulations only and their times for peak detec- tion were not accounted.

Table 4: A comparison of SHT, GHTG and our proposed method

Methods Execution time ( s ) Memory (words) Limitations

SHT 3388 2563 = 1 6 . 7 ~ 1 0 ~ nil

GHTG 1218 256* = 6 5 . 6 ~ 1 0 ~

Proposed 26.6 15(", 15x3 = 45("1 yes('"' method

(i) Case when no refinement or sequential refinement is

(ii) Case when parallel refinement is performed (iii) Concentric circles cannot be detected (iv) Circles occluded or broken by more than half may not be

performed

detected

4 Conclusions

In this paper, a fast method for circle detection is pre- sented. The proposed detection scheme adopts a hypothesis and verification paradigm and the relation employed for hypothesis is a right angle criterion which exists in subsets of point triplets of a circle. A similar technique proposed by Lam et al. [15] requires .C2N enumerations. However, in the proposed method, the required number of enumerations is only Theoreti- cally, only one good occurrence of the condition for a circle is sufficient to initiate a correct hypothesis. How- ever, as the right angle criterion for a point triplet is not a unique distinguishing property of a circle, a hypothesis filtering strategy is introduced. The strategy includes two novel constraints which can filter the invalid hypotheses effectively. Experiments were carried out which include both synthetic and real images to investigate the performance of the detection scheme in terms of accuracy of detection, processing speed, robustness to clutter noise and partial occlusion. It is found that the method performed quite well in all the above aspects.

As compared with the conventional HT methods, the main strengths of the proposed method are its attrac- tively low computational and memory complexities, and good accuracy of detection. However, the improved performance in these many aspects is at the expense of not being able to detect circles which are occluded or broken by more than half. Moreover, a novel contribution of our proposed detection scheme that differs from the work of Leavers [l] and Lam et al. [15] is the introduction of a hypothesis filtering strategy in the adopted detection paradigm. The mechanism limits the heaviest computation effort, i.e. the verifica- tion and refinement (optional) processes, to a small amount of confident hypotheses only. Invalid hypothe- ses that inhibit the processing are effectively screened out in our method as revealed from the performed experiments.

IEE Proc -Vis Image Signal Process, Vol 143, No 5, October 1996

Page 8: Efficient technique for circle detection using hypothesis filtering and Hough transform

5 Acknowledgments

The authors would like to thank the anonymous reviewers for their valuable comments and suggestions.

6 References

1 LEAVERS, V.F.: ‘The dynamic generalized Hough transform: Its relationship to the probabilistic Hough transform and an applica- tion to the concurrent detection of circles and ellipses’, CVGIP: Image Underst., 1992, 56, (3), pp. 381-398

2 DUDA, R.O., and HART, P.E.: ‘Use of the Hough transform to detect lines and curves in pictures’, Commun. ACM, 1972, 15, pp. 11-15 KIMME, C., BALLARD, D., and SKLANSKY, J.: ‘Finding cir- cles by an array of accumulators’, Commun. ACM, 1975, 18, (2),

4 BALLARD, D.H.: ‘Generalizing the Hough transform to detect arbitrary shapes’, Pattern Recognit., 1981, 13, pp. 111-122

5 ILLINGWORTH, J., and KITTLER, J.: ‘A survey of the Hough transform’, Comput. Vis. Graph. Image Process., 1988, 44, pp. 87- 116

6 LEAVERS, V.F.: ‘Survey: Which Hough transform? ’, CVGIP: Image Underst., 1993, 58, pp. 250-264

7 DAVIES, E.R.: ‘A high speed algorithm for circular object loca- tion’, Pattern Recognit. Lett., 1987, 6, (3), pp. 323-333

8 YUEN, H.K., ILLINGWORTH, J., and KITTLER, J.: ‘Com- parative study of Hough transform methods for circle detection’, Image Vis. Comput., 1990, 8, (l), pp. 71-77

9 GERIG, G., and KLEIN, F.: ‘Fast contour identification through efficient Hough transform and simplified interpretation strategy’. Proceedings of the 8th international conference on Pat- tern recognition, 1986, pp. 498-500

10 ILLINGWORTH, J., and KITTLER, J.: ‘The adaptive Hough transform’, IEEE Trans., 1987, PAMI-9, (5), pp. 690-697

11 DAVIES, E.R.: ‘A modified Hough scheme for general circle location’, Pattern Recognit. Lett., 1988, 7, (l), pp. 3744

12 LI, H., LAVIN, M.A., and LEMASTER, R.J.: ‘Fast Hough transform: A hierarchical approach’, CVGIP: Image Underst.,

13 LEAVERS, V.F., B-TZVI, D., and SANDLER, M.B.: ‘Active intelligent vision using the dynamic generalized Hough trans- form’. Proceedings of British Machine vision conference, 1990, pp. 49-54

14 YIP, R.K.K., TAM, P.K.S., and LEUNG, D.N.K.: ‘Modifica- tion of Hough transform for circles and ellipses detection using a 2-dimensional array’, Pattern Recognit., 1992, 25, (9), pp. 1007- 1022

15 LAM, L.T.S., LAM, W.C.Y., and LEUNG, D.N.K.: ‘A Hough- like predictionicorrection approach for circle detection’. Proceed- ings of the 8th Scandinavian conference on Image analysis, 1993,

3

pp. 120-122

1986, 36, pp. 139-161

pp. 151-158

7 Appendix

7. I Input: Interleave scanned sequence of edge points { Pi(xi, yi) : i = 1, ..., n} obtained from an N x N edge image. output: List of circle parameters ,&{(a, b, r)h : h = 1, ..., m}, where m is the number of detected circles. Algorithm: for any edge point P1 with gradient angle

Proposed algorithm for circle detection

{ for any edge point P2 with gradient angle $2 {

//Consistency checking with case 1 in Section 2.1.1

if M i - $jI = 4 { //Search the presence of the third point.

if (P3 exists) { Evaluate the circle parameters using P1, P2 and p3 *

if @ P , bhp) { //Consistency checking with case 2 in Section 2.1.1

//Neighbouring points validation in Section 2.1.2

if (neighbouring points validation for PI, P2 and P3 is satisfied) {

Determine a rectangular template corre- sponding to the hypothetical circle.

IEE Proc.- Vis. Image Signal Process., Vol. 143, No. 5, October 1996

Accumulate rv in the rectangular template with an initialised l -D radius array. Detect local peaks in the 1-D radius array. if (local peaks exists and above a threshold) {

Refine the detected parameters with three SHT modules. Store the circle parameters as (a, b, r)h in

Remove the circle points in the image.

//An optional procedure as described in Section 2.4

Lou,.

I - - -

:.*-; (i) :?.: (ii) t (iii)

I - - -

I

Fig. 19 Analysis of the uncertainties for circle parameters (i) pixel point (ii) pixel point containing hypothetical circle centre (iii) true circle centre location

7.2 Analysis of the uncertainties for the hypo the tical circle parameters Without loss of generality, consider a circle located as shown in Fig. 19, where P3 is at the lower left corner of a circumscribed rectangle. In the following where no ambiguity occurs, we assume parameters with subscript t refer to the predigitised or true values. With this nota- tion, the co-ordinates of the digitised point P,(x,, y,) can be expressed in terms of its predigitised co-ordi- nates P,, (xtl , yt,) and pixel uncertainties ax, and ay, as

By applying eqn. 1, the uncertainties of the centre (ahp, bhp) is determined to be

x, = xtz + b ~ , , ya = yt2 + 6y, for z = 1,. . . , 3 (9)

1 2

1

6a = U h p - at = -{(XI + 2 2 ) - ( Z t l + xt2)) (10) and

6b = b h p - bt = ~ { ( Y I + y 2 ) - ( y t l + y t 2 ) )

After eqns. 10 and 11 are simplified, we have

6a = -{(6x1 + S Z ~ ) } and 6b = -{(by1 + Syz)}

Now let 6x1 - 6x2 = wcosl l , and 6yl - by2 = wsinll, (13) When q is eliminated from the two equations, the fol- lowing relations can be obtained:

Moreover, from Fig. 19, we have 2 1 - 2 2 = 2 T h p cos 0 and y1 - y2 = 2rhp sin 8 (15) Substituting eqns. 9, 13 and 15 into eqn. 2, the predig- itised radius rt can be re-expressed as

(11)

1 1 2 2 (12)

w2 = (6x1 - 6 4 2 + (6y1 - 6y2)2 (14)

299

Page 9: Efficient technique for circle detection using hypothesis filtering and Hough transform

1

1

r; = p t 1 - 5 t 2 ) 2 + (Ytl -

- - q{(Z1 - 5 2 - 651 + 6 5 2 ) 2 + (y1 - y 2 - 6y1 + 6 y 2 ) 2 }

(16) W 2

4 = T;p - T h p W cos(8 - $) + -

Since Yhp, o, 7 ) and 8 are independent, we can obtain (rJmZn and (rJmax by varying 6 and maximising o, i.e. when Q = q!i

(17)

(18)

W m u x (rt)mzn = rhp - - 2

W m a z ( r t ) m a e = r h p + ~ 2

and when 0 = ?r + 1c,

Therefore, the deviation of (rJmax from (rJrnjn, i.e. (Sr)max, can be evaluated as

(8r)mux = (rt)mux - (rt)mzn = wmux (19)

wmux = h (20)

In the worst case, let /6x11 = lSxzl = jSy,j = ]Sy,l = 1/2, we have

With eqns. 12 and 19, the maximum uncertainties of the circle parameters can be determined as follows:

(21)

(S+7Laz = h (22)

1 -

2 (8a)maz = (Jb)mu, =

and

Moreover, using eqns. 17 and 18, the values of (rJmZn and (rJmaX can be determined.

300 IEE Proc.-Vis. Image Signal Process., Vol. 143, No. 5, October I996