9
Tristage Hough transform for multiple ellipse extract ion H.K. Muammar, MSc M. Nixon, PhD, MlEE Indexing terms: Computer graphics, Design Abstract: The importance of rapid and accurate extraction of ellipses in images for model-based computer vision systems has long been recognised. The Hough transform technique has established itself as a robust method for shape extraction, however, its application to ellipses has been restricted by excessive computational and storage requirements. Direct extension of the Hough tech- nique to ellipses is particularly demanding since a five-dimensional accumulator array is required. This paper presents a novel tristage technique for ellipse extraction based on decomposing the problem into sequentially executed stages. Candi- date ellipse centres are determined using an improved centre-finding procedure and novel Hough-based procedures extract the remaining parameters in two further stages. Although multi- stage parameter extraction is not new, many of the problems that exist in previous schemes are resolved. In the new technique, the dimensionality of the accumulator arrays used does not exceed two, while their ranges are predefined. Memory savings are therefore significant. Concentric ellipses of the same orientation are shown to be extracted with little extra computational demand. Two extensions of the tristage technique to multi- ple ellipse extraction are presented and compared. When applied to real images, the new technique extracted multiple, concentric ellipses reliably and with reduced complexity. 1 Introduction I. 1 Ellipse detection A fundamental requirement in many computer vision systems is the ability to extract parametrically defined shapes from images. Many manufactured objects are cir- cular, and appear as ellipses when viewed from an oblique angle. Two-dimensional contour information can be used in three-dimensional shape analysis, to improve the accuracy and robustness of object-shape matching [l]. In ACRONYM [2], ellipse contour data is used to aid the process of object recognition. The rapid and accu- rate extraction of ellipses from images can, therefore, be highly important for any model-based vision system. Fast extraction of ellipse contours is possible using methods Paper 7412E (C2), first received 22nd September 1989 and in revised form 20th March 1990 The authors are with the Department of Electronics and Computer Sci- ence, University of Southampton, Highfield, Southampton, SO9 5NH, United Kingdom IEE PROCEEDINGS-E, Vol. 138, NO. 1, JANUARY 1991 such as Freeman chain coding and polygonal approx- imation (see Reference 3); however, the reliability of these techniques is likely to suffer if the edge data is noisy or if the image feature space is cluttered. The Hough transform (HT) was introduced in 1962 as a technique for detecting lines in digitised images. Since then, it has been improved and extended to detect other parametrically defined shapes and arbitrary shapes [4]. Its popularity has increased steadily owing mainly to its robustness and ability to cope with image noise. In its standard form, the HT has been shown to be equivalent to template matching [SI, and as such, maximises the signal-to-noise ratio of shape detection when white noise is present. The process of gathering evidence in param- eter space independently from edge data in the image space, indicates that the HT is capable of recognising objects even when they are partially hidden or data seg- ments are missing. A number of disadvantages are associated with the standard implementation of the Hough transform for ellipses. An ellipse can be conveniently parameterised by its centre co-ordinates, major and minor radii and orien- tation. An extension of the standard parametric HT to ellipses imposes the requirement of a five-dimensional parameter space. If accurate extraction of ellipses is to be carried out, a uniformly fine quantisation of this param- eter space is necessary. This, however, can lead to unac- ceptable demands in terms of computer storage required and the computation needed to perform the HT mapping. The task of extracting ellipses from images can be made practical by making use of the gradient direction of contour points and by breaking down the problem into one that can be solved in two, or more, sequentially executed stages. A number of ellipse recognition schemes that have followed this approach have emerged. I .2 Previous approaches Tsuji and Matsumoto [6] have presented a scheme for ellipse recognition whereby the centres of candidate ellipses are extracted during the initial pass. The tech- nique by which ellipse centres are found is based on a simple geometric property of ellipses. If a pair of points with equal tangents lie on the contour of the same ellipse, then their midpoint is the centre of the ellipse. In the first stage of the centre-finding procedure, pairs of image points with equal, or near equal, tangents are extracted. A two-dimensional histogram of the midpoints of each extracted pair of points is then constructed. Peaks in this histogram define centres of candidate ellipses in the image. The set of points which contributed to the extracted centre are then identified and a least mean squares technique is applied to these points to obtain estimates of all five parameters. The least squares method 21

1991 Tristage Hough Transform for Multiple Ellipse Extraction

Embed Size (px)

Citation preview

Page 1: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

Tristage Hough transform for multiple ellipse extract ion

H.K. Muammar, MSc M. Nixon, PhD, MlEE

Indexing terms: Computer graphics, Design

Abstract: The importance of rapid and accurate extraction of ellipses in images for model-based computer vision systems has long been recognised. The Hough transform technique has established itself as a robust method for shape extraction, however, its application to ellipses has been restricted by excessive computational and storage requirements. Direct extension of the Hough tech- nique to ellipses is particularly demanding since a five-dimensional accumulator array is required. This paper presents a novel tristage technique for ellipse extraction based on decomposing the problem into sequentially executed stages. Candi- date ellipse centres are determined using an improved centre-finding procedure and novel Hough-based procedures extract the remaining parameters in two further stages. Although multi- stage parameter extraction is not new, many of the problems that exist in previous schemes are resolved. In the new technique, the dimensionality of the accumulator arrays used does not exceed two, while their ranges are predefined. Memory savings are therefore significant. Concentric ellipses of the same orientation are shown to be extracted with little extra computational demand. Two extensions of the tristage technique to multi- ple ellipse extraction are presented and compared. When applied to real images, the new technique extracted multiple, concentric ellipses reliably and with reduced complexity.

1 Introduction

I. 1 Ellipse detection A fundamental requirement in many computer vision systems is the ability to extract parametrically defined shapes from images. Many manufactured objects are cir- cular, and appear as ellipses when viewed from an oblique angle. Two-dimensional contour information can be used in three-dimensional shape analysis, to improve the accuracy and robustness of object-shape matching [l]. In ACRONYM [2], ellipse contour data is used to aid the process of object recognition. The rapid and accu- rate extraction of ellipses from images can, therefore, be highly important for any model-based vision system. Fast extraction of ellipse contours is possible using methods

Paper 7412E (C2), first received 22nd September 1989 and in revised form 20th March 1990 The authors are with the Department of Electronics and Computer Sci- ence, University of Southampton, Highfield, Southampton, SO9 5NH, United Kingdom

IEE PROCEEDINGS-E, Vol. 138, N O . 1, J A N U A R Y 1991

such as Freeman chain coding and polygonal approx- imation (see Reference 3); however, the reliability of these techniques is likely to suffer if the edge data is noisy or if the image feature space is cluttered.

The Hough transform (HT) was introduced in 1962 as a technique for detecting lines in digitised images. Since then, it has been improved and extended to detect other parametrically defined shapes and arbitrary shapes [4]. Its popularity has increased steadily owing mainly to its robustness and ability to cope with image noise. In its standard form, the HT has been shown to be equivalent to template matching [SI, and as such, maximises the signal-to-noise ratio of shape detection when white noise is present. The process of gathering evidence in param- eter space independently from edge data in the image space, indicates that the HT is capable of recognising objects even when they are partially hidden or data seg- ments are missing.

A number of disadvantages are associated with the standard implementation of the Hough transform for ellipses. An ellipse can be conveniently parameterised by its centre co-ordinates, major and minor radii and orien- tation. An extension of the standard parametric HT to ellipses imposes the requirement of a five-dimensional parameter space. If accurate extraction of ellipses is to be carried out, a uniformly fine quantisation of this param- eter space is necessary. This, however, can lead to unac- ceptable demands in terms of computer storage required and the computation needed to perform the HT mapping. The task of extracting ellipses from images can be made practical by making use of the gradient direction of contour points and by breaking down the problem into one that can be solved in two, or more, sequentially executed stages. A number of ellipse recognition schemes that have followed this approach have emerged.

I .2 Previous approaches Tsuji and Matsumoto [6] have presented a scheme for ellipse recognition whereby the centres of candidate ellipses are extracted during the initial pass. The tech- nique by which ellipse centres are found is based on a simple geometric property of ellipses. If a pair of points with equal tangents lie on the contour of the same ellipse, then their midpoint is the centre of the ellipse. In the first stage of the centre-finding procedure, pairs of image points with equal, or near equal, tangents are extracted. A two-dimensional histogram of the midpoints of each extracted pair of points is then constructed. Peaks in this histogram define centres of candidate ellipses in the image. The set of points which contributed to the extracted centre are then identified and a least mean squares technique is applied to these points to obtain estimates of all five parameters. The least squares method

21

Page 2: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

can, however, suffer if outliers or irrelevant data is present in the image. Such a situation is likely to arise if concentric ellipses exist in the image. To identify the exis- tence of concentric ellipses a geometric test is applied. The least squares technique is then applied separately to each ellipse in the concentric set, if it exists. The centre- finding technique they use has several limitations. If, owing to occlusion, insufficient pairs of points with equal tangents remain on the ellipse contour, the technique is liable to fail. Secondly, straight lines in the image must be located and removed before ellipses are searched for, as these generate false ridges during the centre-finding process.

Tsukune and Goto [7] apply the same centre-finding technique, but recover the remaining parameters using an implementation based on the polynomial representation of the ellipse. If a translation is applied to image points such that their origin lies on the estimated ellipse centre, the polynomial equation of an ellipse can be expressed as follows:

(1)

Extracting B, C and D using a direct Hough transform- ation based on this parameterisation would require a three-dimensional accumulator array. Tsukune and Goto decompose this problem into two further steps by using an alternative parameterisation obtained by differentiat- ing eqn. 1 with respect to x . This gives

( 2 )

x 2 + By2 + 2Dxy + C = 0 B - D2 > 0

x + Byy' + D(xY' + y ) = 0 Using edge gradient direction y', a two-dimensional HT is applied to determine B and D. Once B and D have been estimated, a one-dimensional histogram can be used to estimate the final parameter C using eqn. 1. A number of disadvantages exist with this scheme. The range of parameters used in the polynomial representa- tion of an ellipse is generally large and difficult to define. This can mean that large amounts of computer storage are required, even for the two-dimensional accumulator array. Savings in computer storage may therefore not be significant. Secondly, edge gradient direction information is used extensively throughout the scheme. Errors as a result of inaccurate edge direction estimation are likely to propagate to the second stage of the ellipse recognition procedure. This can result in inaccurate estimation of orientation and radii of the ellipse.

Nagata, Tamura and Ishibashi [SI describe a recursive least mean squares based scheme for detecting ellipses. Before applying the least squares technique, the image is segmented using a procedure that is based on statistically determining an optimum set of thresholds from a multi- mode histogram of the image. This is followed by the application of a noise reduction method to the binary image. Region boundaries are finally obtained by apply- ing a contour tracking algorithm to each region. The recursive least squares method is applied to the extracted contours to recover all five parameters. As with most least squares procedures, the presence of irrelevant points can be detrimental to the accuracy of the technique. Careful consideration must be given to the choice of an appropriate weighting scheme which ensures that outlier points do not significantly affect the overall calculation of parameters.

A new centre-finding technique has recently been pre- sented by Yuen, Illingworth and Kittler [9] as part of a scheme for ellipse detection. Their improved centre- finding technique can tolerate higher levels of partial occlusion of the ellipse. The adaptive Hough transform

28

(AHT) [lo] is used to extract the remaining three param- eters from a parameterisation based on the polynomial representation of the ellipse (eqn. 1). The AHT implemen- tation uses a small (9 x 9 x 9) accumulator array and iteratively focusses in on parameter regions of highest accumulator density. It does this by dynamically and independently increasing the resolution of each param- eter in the array, thereby reducing its coverage. It over- comes the main problem associated with the polynomial parameterisation of the ellipse, namely that of large storage requirements owing to large parameter ranges. However, problems with the AHT include its complex implementation. Thin, ridge-like peaks in parameter space can result in errors during the redimensioning stage of the parameter space and this can result in incorrect peak identification.

1.3 The tristage approach In this paper, a novel scheme for ellipse recognition is presented whereby ellipse parameters are extracted in three sequentially executed stages. During the first pass, candidate ellipse centres are found using the centre- finding method adopted by Yuen et al. [9]. The remain- ing parameters are found in two further stages using Hough-based parameterisations that overcome the prob- lems associated with previous schemes. Once a candidate ellipse centre has been determined, a set of points lying on the axes of symmetry of the ellipse is generated. These points are then mapped to a one-dimensional orientation histogram from which ellipse orientation is determined. Ellipse contour points are then passed to a third stage where the estimated centre and orientation are used to determine the major and minor ellipse radii. Pairs of contour points are rotated through an angle equal to the measured orientation about the estimated ellipse centre. Ellipse radii are subsequently found by applying a novel two-dimensional HT to the rotated points. A block diagram of the tristage technique is shown in Fig. 1.

Errors in edge direction estimates are less likely to be introduced during the estimation of orientation and

acquire image + edge detecton and gradient direction

estimation

I

I I

centre finding

feature pant labelling I

I

r- find Orientation

I v

_ _ _ I I I I I I

use symmetry of ellipse

I I I

rotate points an3 apply HT

I

Fig. 1 Tristage Hough transform for ellipse recognition

I E E PROCEEDINGS-E, Vol. 138, No . I , J A N U A R Y 1991

Page 3: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

ellipse radii, since edge positional information is used

parameter ranges encountered in the polynomial param- eterisation of an ellipse is resolved. Parameter limits in the tristage technique bear a one-to-one relationship with

take. Consequently, significant savings in computer storage are achieved. The extraction of concentric ellipses with equal orientation can be carried out efficiently since these can be accurately resolved by the algorithm in the final stage. Previous methods based on the polynomial parameterisation of an ellipse [7,9] are not directly suited to the extraction of concentric ellipses. Least squares based techniques [6, 81 require additional tests to determine the existence of concentric ellipses.

mainly in the later stages. The problem of undefined

D the possible parameter values the unknown ellipse may

2

2.1 Centre estimation The first stage in most Hough-based ellipse detection schemes is that of centre-finding. It is perhaps the most important, since the accuracy with which the remaining three parameters can be determined frequently depends on the ellipse centre measurements. Successful extraction of the ellipse boundary is made possible if good centre- finding techniques are used. One centre-finding method (used in References 6 and 7) evaluated the midpoints of pairs of contour points with approximately equal tangents. If the contour points were both located on the boundary of an ellipse then their midpoint defined the ellipse centre. A two-dimensional histogram was used to accumulate the midpoint locations. Peaks in the histo- gram defined the locations of possible ellipse centres. However, partial occlusion of the ellipse, often resulted in a significant reduction in the number of points symmetri- cal about the ellipse centre. In these situations, the tech- nique was liable to fail.

Because of its ability to handle partial occlusion, we have used the ellipse centre-finding method of Yuen et al. [9]. This procedure is based on a simple geometric pro- perty of ellipses. Consider the two points, p , ( ~ , , y,) and P 2 ( x 2 , y2), lying on the boundary of an ellipse as shown in Fig. 2. Given that P , and P , have intersecting

Details of the tristage technique

Fig. 2

tangents, then the line through the intersection point T ( t , , t,), and the midpoint M ( m x , my), of P , and P 2 will pass through the centre of that ellipse. The equation of line T M can be expressed as :

Ellipse showing intersecting tangent point T , and midpoint M

y = c x + d

where x and y are the co-ordinates of points on the line. The gradient of the line c , and the offset d are given by:

t, - my

tx - mx C = d = my - cm,

The co-ordinates of T are given as:

Y , - Y z - S l X l + 92x2 9 2 - 91

t , =

Yl92 - Y291 + 9291(x2 - x1) t , = g2 - 91

and for the point M :

+ x 2 =~ Y l + Y 2

2 mx = ~

2

where g1 and g2 are the slopes of the tangents of P , and P , , respectively.

Lines constructed from all pairs of points lying on the same ellipse will intersect at one point, O ( x , , yo), the centre of the ellipse. In a practical implementation of this scheme, P , and P , cast their votes in a two-dimensional accumulator array called the centre array. Locations in this array which intersect the line T M are incremented. Local peaks in the array give evidence for possible ellipses and their centres in the image. Votes cast by pairs of points resulting from random noise or other shapes in the image will, in most cases, give rise to background accumulation in the centre array. In certain situations however, the accumulation of votes caused by pairing points on different ellipses or shapes can result in false peaks in the accumulator array. These peaks may disrupt the interpretation of the parameter space by masking out significant peaks relating to the centres of smaller or par- tially occluded ellipses.

If the maximum expected size of ellipse is taken into account, then the likelihood of false peaks arising can be reduced by setting upper limits on the spacing of pairs of points which are included in the voting process. Pairs of points whose separation exceeds this limit are assumed unlikely to lie on the contour of the same ellipse. Simi- larly, we can avoid pairing points which are too close to each other, as errors in edge gradient direction estimation are likely to result in an invalid set of votes being gener- ated.

Hence, we need only include a pair of image points, P , ( x , , y,) and P 2 ( x , , y2 ) , in the voting process if they satisfy the following criteria:

where d,,, and dmin are some preset values. This criterion was applied by Yuen et al. [9] in their implementation of the ellipse centre-finding scheme. Careful choice of d,,, and dmin provided a degree of control over the particular size of ellipse that was extracted. In general, d,,, was set to a value equal to twice the expected maximum of the major radius.

The process of pairing up a set of points results in a line along T M that passes at some point through the centre of the ellipse. For practical purposes, lines of length L, starting from M , in the direction of the expected ellipse centre were generated. In order that sufficient votes were generated to allow accurate estimates of ellipse centres, the length L was set in the region of the expected maximum of the major ellipse radius.

Since the Hough transform is an incremental evidence gathering procedure, shape extraction is possible even if part of the data is only processed. Point hopping was introduced to speed extraction, whereby qualifying feature points were paired with every nth point in the feature list rather than with every point.

29 IEE PROCEEDINGS-E, Vol . 138, N O . 1, J A N U A R Y 1991

Page 4: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

2.2 Determining ellipse orientation Once an estimate of the location of an ellipse centre has been made, the process of determining ellipse orientation can be carried out. If a shape is known to have an axis of symmetry with slope 0,, then the angular slopes (in radians) of its k axes of symmetry are given by :

An ellipse possesses two axes of symmetry, 0, and e,, whose angular slopes are given by:

and

The procedure for estimating ellipse orientation involves identifying the set of midpoints M , and tangent intersec- tions T , which lie on either axis of symmetry of the ellipse. An important assumption is that the intersection point of the axes of symmetry of the ellipse lies on the estimated ellipse centre. If the distances O P , and O P , , from any given pair of points, P , P , , respectively, to the el!ipse centre are equal, then the points M and T are assumed to lie on either axis of symmetry of the ellipse. Points M and T which lie on the axes of symmetry are then rotated by a factor of n/2 about the estimated ellipse centre, so that they lie in the first quadrant of a co- ordinate frame whose origin lies on that centre.

The angles subtended by O M and OT increment a one-dimensional orientation histogram. The mode in the histogram defines the angular slope of either the major or the minor axis (0, or 0,) of the ellipse. Which axis the angular slope relates to is unimportant at this stage and can be resolved after the major and minor radii have been determined. The procedure for determining ellipse orientation is outlined in Fig. 3. A weighting scheme similar to that used by Van Veen and Groen [ 111 was incorporated into the voting process. The coefficients of a Gaussian function whose mean coincided with the angle subtended by OM and OT were added to the histogram locations during the voting process. The Gaussian func- tion was chosen to compensate for errors in ellipse orien- tation owing to inaccurate edge tangent direction data. The coefficients of the function were evaluated over nine elements with a standard deviation (namely width) equal to 1.0. This configuration was observed to improve the robustness of orientation estimates with a negligible increase in computational demand.

D O i = l , M !Pointpi

Oi = 8, + (i - l)n/k i = 1, 2, . . . , k

e, = 0,

6 2 = eo + 4 2

D O j = i + 1, M

dl =OPi d2 = OPj

IF ( ( d l . EO d2) . A N D

!Point Pj

(Pi . N E . P i ) ) T H E N

{Work out M and r )

{Rotate M and T about 0 by a factor of pi/2 so that they lie in the first quadrant of a co-ordinate frame centered at 0)

thetal =arctan ( ( m y - y o ) / ( m x - ,YO) )

theta2 = arctan ( ( t y - yo)/(tw -,YO))

acc (thetal ) = acc (thetal ) + 1 acc (theta2) = acc (theta2) + 1

ENDlF

E N D D O E N D D O

{The location with maximum votes in array 'acc' is obtained}

Fig. 3 ellipse and orientation

30

Outline of procedure for determining the axes of symmetry of

2.3 Estimating the major and minor ellipse radii Once a maximum, O,,,, has been extracted from the orientation histogram, the estimation of ellipse radii can proceed. Pairs of points, P,P, , in a third pass through the image are rotated to P;(x;,y;) and P;(x;,y;), through an angle eopt about the estimated ellipse centre, according to the transformation [ 123 :

x' = ( x - xo) cos O,,, - ( y - y o ) sin Oopt + xo

Y' = ( x - xo) sin 0,,, + (Y - Y o ) cos Oopt + Y o This results in a subset of transformed points situated on the boundary of an unrotated ellipse. For a pair of points P',(x;, y ; ) and P2(x; , y;) on the contour of an unrotated ellipse, with centre O(xo, yo), we have

(3)

(4) (4 - X O ) , (Y; - Y o ) ,

+ 7 = l

These can be combined by eliminating b to give

Solving for a,

We can also combine the two equations so as to elimi- nate a and solve for b to give

For a pair of points attributed to lie on the ellipse, eqns. 5 and 6 can be used to calculate values for the major and minor radii, a and b.

Points P', and P ; vote for major and minor radii in a quantised 2-dimensional radius accumulator array. The location of a peak in this array defines the a and b radii of the detected ellipse. Ellipse orientation is generally defined as the angle subtended by the major axis with the horizontal co-ordinate of the image frame. Symmetry of the ellipse about n/2 means that the ambiguity arising in the measurement of orientation can be resolved by inspection of the measured a and b radii. If b is greater than a, the ellipse orientation becomes

8, = o,,, + n/2 and a and b are exchanged. Otherwise, the measured parameters remain valid. In a situation where contours of concentric ellipses with equal orientation exist in the feature map, these will map to separate peaks in the radius array.

2.4 Feature point labelling and accumulator array simplification

Applying the orientation and radius finding procedures (stages 2 and 3) directly to a feature map in which candi- date ellipse centres have been extracted is likely to be computationally expensive. Also, it may yield inaccurate results if the feature space is complex and multiple ellipses exist. To reduce the complexity of the image feature space, it was necessary to identify the points from which the significant accumulator counts originated. That is, a subset of points lying on the contour of the

IEE P R O C E E D I N G S - E , Vol. 138, N o . I , J A N U A R Y l Y Y 1

Page 5: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

ellipse whose c e n t r e has bcen found was required. Appli- cation of stages 2 and 3 to the subset of contour points representing the ellipse boundary meant that procedures implemented for extracting the remaining three param- eters were more robust and less computationally inten- sive. Extraction of the relevant boundary points was achieved using a method derived from a backmapping technique introduced by Gerig and Klein [13]. The back- mapping technique is based on the assumption that a given boundary point should be a member of only one curve in image space. Membership to that curve is defined by an accompanying accumulator cell with the highest count, and hence, an optimum parameter set aopr.

To identify the optimum parameter set for a given boundary point, the Hough procedure is repeated a second time. But instead of incrementing cells intersected by each voting surface, the location of the cell with the highest count a,,,, is found. The boundary point is then labelled with this location. The identification of boundary points that contributed to a peak (optimum parameter set) in the accumulator array becomes straightforward. Incorporating the Gerig and Klein backmapping pro- cedure can also result in a simplification of the accumula- tor array. During the backmapping procedure, if all cells except for aopr that intersect the voting surface are can- celled, then the distribution of votes in the accumulator array is concentrated at peak locations (optimum param- eter sets). Sidelobes associated with local peaks generated during the voting process can obscure peaks relating to nearby or smaller ellipses. Accumulator simplification will suppress these sidelobes thus simplifying the process of multiple ellipse detection.

The basic strategy for incorporating the Gerig and Klein procedure into the ellipse centre-finding routine is shown in Fig. 4. A modified version of the centre-finding procedure is applied to the image contour points, after

c for all

pairing criteria as in - for all apply the same point

centre finding

i' 7 I

generate voting function

f @ , , , a ) = O

identify the cell w i th maximum votes along f (p, , , a ) = 0,

accumulate a 1 -dimensional - histogram wi th aoDt ,, L,(aop, ,,I = L,bODt ,,I + 1

1 identify the cell in L, wi th

maximum votes

aODr I

1 Fig. 4 applied to ellipse centre-finding

IEE PROCEEDINGS-E. Vol. 138. N o I , J A N U A R Y 1991

Flow diayram for Geriy and Klein hackmappiny procedure

candidate ellipse centres have been accumulated. Each contour point Pi is paired with all points Pi, provided that Pi and P j do not have equal tangent gradients. The process of backmapping identifies the accumulator loca- tion aopr, i . Centre array simplification can be carried out by accumulating votes at locations in a second accumulator array of similar dimensions to the centre array. The process of feature point labelling using the Gerig and Klein procedure reduces the centre-finding transform to a many-to-one mapping. The identification and extraction of a subset of points labelled as having contributed most to the candidate ellipse centre during the centre-finding process is now possible.

Yuen et al. [9] have included the backmapping tech- nique of Gerig and Klein [ 131 in their scheme for ellipse recognition. The computational cost of the backmapping technique, in their implementation is the same as the centre-finding. The process of centre-finding and back- mapping can be computationally intensive, particularly if a large number of points exist in the image. Positional information relating to local peaks in the centre array was used, in our scheme, to carry out feature point label- ling and centre array simplification in the initial centre- finding pass. This resulted in an additional saving in computation.

3 Extending the technique to detect multiple ellipses

Two extensions of the tristage Hough transform to detect instances of multiple ellipses are outlined.

3.1 Ellipse contour removal (ECR) In the first extension, ellipses extracted using the tristage technique are removed from the binary contour map. This is carried out by setting edge pixels which lie on the contour of a simulated ellipse with the extracted param- eters to zero. The centre-finding procedure is reapplied and further peaks searched for until the extracted peak is below a predetermined threshold. At this point, no further ellipses are assumed to be present in the image and the search ends. Peak threshold selection is arbitrary but is largely governed by the expected ellipse size and the extent to which it may be obscured.

3.2 Accumulator peak removal (APR) Rather than delete the detected ellipse from the binary edge map, we can instead delete the associated peak it1 the accumulator array. This forms the basis of the second extension. Centre-finding and feature point labelling are applied only once to points in the binary edge map. Peaks associated with the extracted ellipse are removed by setting accumulator cells in a 5 x 5 neighbourhood centred at the extracted peak location to zero. Remaining peaks are subsequently searched for until the extracted peak is below a predetermined threshold, at which point the search ends. This extension to multiple ellipse detec- tion is more likely to be successful if applied to the sim- plified centre array resulting from the Gerig and Klein procedure [lo]. This is because, in the simplified centre array, sidelobes which would otherwise obscure further peaks resulting from smaller or partially obscured ellipses are suppressed.

3.3 Analytic comparison of the complexity of each method

A comparison of the approximate complexity for each method can be made by considering the simple case of an image containing k ellipses each composed of n points.

31

Page 6: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

Only the computation required during centre-finding will be considered. The number of possible point pairs on one ellipse is given as

n ! (n - 2)!

np - n(n - 1) 2 -

In order that accurate feature point labelling can occur during centre-finding, permutations of points on the ellipse must be considered. Assuming that no point pairing occurs between different ellipses, then the number of votes, V,,, , cast by all k ellipses is

k

Y o * = c v i = 1

where V is the number of votes cast by each ellipse and is equal to Ln(n - 1). L is defined as the length, in pixels, of the voting line cast by each pair of points. The total number of votes, VEcR, cast by all k ellipses using ellipse contour removal (ECR) is

k - 1 k - i

Using the extension based on accumulator peak removal (APR), and assuming that the cost incurred in peak delet- ing is negligible in comparison, then the total votes cast is

1

v,,, = 2 v i = 1

The ratio of votes cast by the two extensions can be expressed as

i = 1

which simplifies to

It appears, therefore, that a saving in the number of votes cast using the APR extension is only obtained when there are two or more ellipses in the image. Although this may be true for the simulation described above, in practice, real images are often cluttered with irrelevant shapes resulting in extensive pairing between points other than those lying on the ellipse contours. It is faster, in practical situations to delete the peaks associated with the extracted ellipse than to reaccumulate the centre space.

4 Experimental results

In this Section the proposed ellipse contour removal (ECR) and the accumulator peak removal (APR) exten- sions of the tristage technique to multiple ellipse detec- tion were compared experimentally. The algorithms, coded in VAX FORTRAN 77 and run on a MicroVax 11, were applied to real images quantised to 256 x 256 pixels, containing multiple ellipses. Storage requirements for the tristage method were as follows. Ellipse centres were extracted to integer resolution from a 256 x 256 cell accumulator array. Orientation and major and minor radius estimates were obtained to integer resolution from a 91 element orientation-histogram and a 51 x 51 element radius-accumulator array. Ellipses with arbitrary orientation and whose major and minor radii were less

than or equal to 50 pixels could therefore be accommo- dated.

Image PARTS, (Fig. 5), is a typical industrial scene and consists of two metal rings, a metal bracket and 9 operator [14] was applied to the image and the resulting feature map, to which the ellipse finding procedures were applied, is shown in Fig. 6. Two sets of concentric ellipses were formed by the metal rings, the rightmost set labelled as concentric set A, the leftmost as concentric set B. The circular cutting in the metal bracket viewed from an angle has resulted in a single ellipse contour. A total of 1247 points exist in the feature map of image PARTS. To ensure that accurate centre-finding and feature point labelling would result, d,,, and dmin were set at 60 and 5 pixels, respectively, and L was set at 40 pixels. These are rough figures and were obtained as described earlier. Pairing each feature point with every 15th in the feature

bolt, bar;klit by il JiTcueeiJ 1iCjht BOUTSS. A G - a n n T

Fig. 5 Test image P A R T S

n

Fig. 6 Feature map

32 IEE P R O C E E D I N G S - E , Vol. 138, N O . I , J A N U A R Y 1991

Page 7: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

map coIisiderably reduced thc computation required by the centre-finding procedure without noticeably impair- ing its robustness.

The subsels of kature points identified with the ellipst- centres are shown in Figs. 7-9. Note that the point label- ling procedure has failed to identify all the points on each ellipse contour. In addition, points not on the ellipse contour have also been identified. Outliers present in the subset of points identified by the feature point labelling procedure can present problems to l e a t squares based methods. These inaccuracies in point labelling have not affected the performance of stages 2 and 3 of the ellipse finding procedure.

The proposed ellipse-finding procedure is particularly suitable for the extraction of concentric ellipses with equal orientation but differing radii. A three-dimensional representation of the radius accumulator array for the concentric ellipse set B is shown in Fig. 10. The major

.-- . + .io

and minor radii of each ellipse in the concentric set were identified simply by extracting peaks in the array which exceeded a preset threshold. Identification of ellipse radii i n a cvncentric set is likely to be more complex in methods which are based on the polynomial representa- tion of the ellipse [7,9]. The existence of concentric ellipses would have to be confirmed and additional pro- cessing required before the least squares technique is applied to the subset of points.

A benchmark for comparing the accuracy of ellipse parameters extracted using the ECR and APR extensions was provided by a partial implementation of the stan- dard Hough transform for ellipses. This was made practi- cal by limiting the search space using a priori knowledge of the approximate ellipse parameters. The parameters extracted by all three methods are tabulated in Fig. 12. Both the APR and ECR extensions of the ellipse-fintling procedure successfully extracted all the ellipses in PARTS. It can be observed that co-ordinate values delivered by both versions of the three stage technique

.- .- ...-

Fig. 7 Subset of points labelled with centre of concenrric' ellip.se set A

Fig. 9 Subset of points labelled with centre ofsingle ellipse conrojdr

I

Fig. 10 for conc.entric ellipse set B

Three-dimensional representation of radius uccumulutor urray Fig. 8 Subset o/ points lubelled with centre of concentric' ellipse s e t B

33 I E E PROCEEDINGS-E. Vol. 138. N O . 1. J 4 . V C 4 R Y 1991

Page 8: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

differ at most by one pixel value from the values obtained by the standard HT. In Fig. 11, the ellipses extracted by the APR extension are shown to fit the edge map repre- sentation well. Spurious peaks were detected by each method, however they were rejected since the number of feature points labelled with the peak locations was low.

Fig. 11 map

Evtracted ellipses using A P R eztumioii oi-erluyed orrr c d y r

The processor time required by the ECR and APR extensions of the tristage technique to extract each ellipse set are shown in the table of Fig. 12. Because the centre- finding stage is applied only once by the APR extension, processor times required to extract the parameters of the concentric set B and ellipse 5 were less than that con- sumed by the ECR extension. Note that the CPU time shown for the APR extension for the extraction of con- centric set A includes the time required to apply the centre-finding transform. It is difficult to give clear guide- lines as to the processor time consumed by each stage of the tristage technique since this depends on the nature of the feature space and on the original image. Processor time consumed is generally dominated by the centre-

Ellipse Method

1 SHT ECR APR

2 SHT ECR APR

3 SHT ECR APR

4 SHT ECR APR

5 SHT ECR APR

Centre y o Yo

142 195 143 196 143 196 142 195 143 196 143 196 141 51 142 51 142 51 142 51 142 51 142 51

145 152 145 152 145 152

~~ ~

Orientation e

~~

Major radws

Minor radius

Points CPU (secs)

26 26 26 27 26 26 153 154 154 153 154 154

145 146 145

41 41 41 33 32 32 33 34 34 38 38 38

22 22 22

15 15 15 11 11 11 23 23 23 26 27 27

15 15 15

338 338

- 362 327

122 163

-

~

102 101

~

85 38 -

23 10

Fig. 12 Standard HT ( S H T ) , ellipse conrour remoral ( t C R ) und accumulator peak remocal ( A P R ) algorithms upplird to imuge P.4 R T S Total CPU time using ECR extension: 220 seconds (includes 10 seconds reaccumu- lating the centre array after ellipse 5 was extracted) Total CPU times using APR extension: 149 seconds. Ellipses 1 and 2 constitute concentric set A whereas ellipses 3 and 4 constitute concentric set B.

finding procedure particularly when the image feature set is cluttered with irrelevant data. In this case the nurriber

is likely to be much less than the total number of points in the image feature set. Thus. processor time consumed by the orientation and radius-finding stages is low and is roughly equally divided between each stage. On the 01 her hand, when concentric ellipses exist in the feature set (as in image PARTS), the level of point pairing carried out during stages 2 and 3 is likely to increase and processor time is more equally divided between all three stage:;. A speed-up factor of 2201149 = 1.48 was obtained using the APR extension over ECR. The relative saving obtained is modest since the feature set was dominated by concentric ellipses.

The counting of plaque on Petri dishes is a highly labour intensive task in biological and medical work. Ellipses were fitted to plaque contours in digitised images of Petri dishes in an attempt to carry out a plaque coint. Overlapping or connected plaque were characterised by highly asymmetric ellipses. With this assumption in mind, if the ratio of major to minor radii was R , then R plaque were assumed to exist within the detected ellipse. A IT ag- nified sector of the Petri dish, containing 84 plaque (excluding plaque touching the image boundary) was used as a test image, (Fig. 13). Inter-ellipse pairing during centre-finding was reduced by setting d,,, to 8 pixels. and d,,, and L were set to 1 and 6. respectively. The ECR extension of the ellipse-finding procedure required 1740 seconds of CPU time to extract 81 plaque. Only 137 seconds o f CPU time were required using the APR exien- sion to extract 82 plaque. These are shown overlayed on the original test image in Fig. 14. A speed increasc of nearly 13 times by the APR extension over the ECR extension highlights the computational savings that can be obtained in some practical situations using this method of multiple shape extraction. However, shape extraction using accumulator peak removal may not be as robust. Reaccumulation of the parameter space after ellipse contour removal may impose an additional com- putational load during centre-finding, but is likely to result in more accurate feature point labelling.

of feature points identified with a candidate ellipse ce . i tre

L

Fig. 13 Digitised segmerit o f P e r r i dish

Page 9: 1991 Tristage Hough Transform for Multiple Ellipse Extraction

Fig. 14 Extracted plaque contours using ECR el-tension

5 Conc lus ions

A tristage Hough transform for ellipse extraction has been presented. Candidate ellipse centres were found using an improved centre-finding technique and the remaining parameters were extracted in two sequentially executed stages using one- and two-dimensional Hough parameterisations. A qualitative comparison has shown that the new technique appears to solve many of the problems associated with previous ellipse-finding schemes. Parameterisations based on the polynomial rep- resentation of an ellipse can require large accumulator arrays whose ranges are difficult to define. Computa- tional savings in the tristage technique are significant since the dimensionality of the accumulator arrays used in the tristage technique is restricted to two and the range of parameter values is predefined. Schemes that estimate ellipse orientation and radii using least squares procedures can suffer from the presence of outliers. These, it was shown, do not seriously affect the robustness of the new technique.

Although the likelihood of a systematic propagation of errors increases with the number of stages required, multistage parameter estimation can result in a greater degree of control and flexibility in shape extraction. The tristage technique was shown to be particularly suited to extract concentric ellipses.

Two extensions of the technique to multiple ellipse extraction have been presented. I t was shown that delet-

ing peaks representing ellipse centres in the accumulator array was computationally less demanding than dele1 ing the contour of the ellipse in feature space. However, the latter extension is likely to be more robust. A practical application of the technique to count plaque sites on a Petri dish demonstrated that removing peaks in the accu- mulator array achieved a speed-up factor of nearly 13 times over ellipse contour removal. The technique was also demonstrated to successfully extract ellipses assxi- ated with an arrangement of mechanical parts.

Problems that remain are the excessive computational effort incurred during centre-finding owing to the irrele- vant point-pairing that occurs between different ellipses and other shapes. This is experienced, to a degree, in later stages when concentric ellipses exist in the feature space. This problem may, to an extent, be resolved if some form of image segmentation is applied in conjunction with edge detection. Future work will continue to investigate these possibilies.

6

I

7

3

4

5

6

7

8

9

I O

1 1

12

13

14

References

YANG, H.S.. and KAK, A.C.: ‘Determination of the identity, .,osi- tion and orientation of the topmost object in a pile’. Proc. 01 3rd workshop on computer vision: Representation and control. Bellair, Michigan, 1985, pp. 3 8 4 8 BROOKS. R.A.: ‘Symbolic reasoning among 3-D models and 2-D images’. Artificial Intelligence. 1981. 17, pp. 285-348 PAVLIDIS. T.: ‘Algorithms for shape analysis of contours and waveforms’, / E € € Trans., 1980, PAMI-2, (4), pp. 301-312 ILLINGWORTH. J.. and KITTLER, J.: ‘A survey of the Hough transform‘. Computer Vision. Graphics and Image Processing, 988. 44, pp. 87-1 16 SKLANSKY, J . : ‘On the Hough technique for curve deteclion‘. IEEE Trans., 1978, C-27, (10). pp. 923-926 TSUJI. S.. and MATSUMOTO, M. : ’Detection of ellipses by niodi- fied Hough transformation’, I E E E Trans., 1978, C-27, (81, pp. 777- 78 1 TSUKUNE, H.. and GOTO. K.: ‘Extracting elliptical figures :ram an edge vector field‘. Proc. of IEEE Computer Vision and Partern Recognition Conference, Washington, DC. 1983. pp. 138-141 NAGATA. T., TAMURA, H., and ISHIBASHI. K.: ‘Detection of an ellipse b> use of a recursive least squares estimator’, J . Robotic Systems. 1985, 2, (2), pp. 163-177 YUEN, H.K., ILLINGWORTH, J.. and KITTLER, J.: ‘DeteLtinp partially occluded ellipses using the Hough transform’, Image and Vision Computing, 1989, 7, ( l ) , pp. 31-37 ILLINGWORTH. J., and KITTLER. J.: ‘The adaptive Hough transform‘. I E E E Trans., 1987, PAMI-9, ( 5 ) , pp. 69Ck697 VAN VEEN. T.M.. and GROEN, F.C.A.: ‘Discretization errors in the Hough transform’, Pattern Recognition. 1981. 14, pp. 137-145. ROGERS, D., and ADAMS, A.: ‘Mathematical elements for com- puter graphics’ (McGraw-Hill, New York, NY, 1976) GERIG, G., and KLEIN. F.: ‘Fast contour identification thrt,ugh efficient Hough transform and simplified interpretation strategy’. Proc. 8th Int. Conf. on Pattern Recognition. Paris, October 986. pp. 498-500 CANNY, J.: ‘A computational approach to edge detection’. I E E E Trans.. 1986. PAMI-8, (6), pp. 679-698

35