6
A Dynamic Combinatorial Hough transform for Straight Lines and Circles. V. F. Leavers**, D. Ben-Tzvi*, and M. B. Sandier* A new algorithm for the Hough transform is presented. It uses information available in the distribution of image points to calculate the pa- rameters associated with combinations of the min- imum number of points necessary to define an in- stance of the shape under detection. The method requires only one dimensional accumulation of evi- dence to determine the parameters associated with a given shape. Using the algorithm, the Hough transform of sparse images is more efficiently cal- culated. Dense images may be segmented and sim- ilarly processed. The method also provides a feed- back mechanism between image and transform space whereby contiguity of feature points and endpoints of curves may be determined. The Hough transform[l], [2] is a powerful tool in shape analysis. It is used to extract global features from shapes and gives good results even in the presence of noise or occlusion. While the the- oretical potential of parametric transform meth- ods has been demonstrated they have made little impact on large scale industrial applications be- cause of supposed excessive storage requirements and computational complexity[3] The development of fast, efficient implementations of parametric trans- formation methods of shape detection has accord- ingly received much attention in the recent lit- erature [4], [5], [6], [3], [7], [8]. An up-to-date and comprehensive review of the use of the Hough transform is given by Illingworth and Kittler[9]. Previous suggested approaches may be di- vided into two categories. The first seeks to reduce the computational load by using evidence from the image to reduce the generation of evidence group- ings of points. Such methods are: 1. Using edge direction information as an indi- cation of the parameter range to be consid- ered^], [10]. Using this approach requires an accurate estimation of the 6 range from the edge direction data. A large mask needs to be used in the edge detection stage, which merely shifts the computational burden. ** King's College London, Department of Physics * King's College London, Department of Electri- cal Engineering 2. For straight line detection, a local opera- tor may be applied which exploits the con- straint that at least two points are required to define a line[7]. This algorithm does suc- ceed in reducing the memory allocation re- quirements. However, because of the com- plexity of its implementation it does not of- fer a significant reduction in computational load and the net result of using a local op- erator is a reduction in resolution. 3. A further method for straight line detec- tion preprocesses the edge data to form a list whose elements are ordered on contigu- ity and form the equivalent of a chain coded representation of the edge image data[8]. A variable sized sliding window is then used in conjunction with this list to generate point pairs which are mapped into the parameter space. Again the method simply shifts the computational burden to the preprocessing stage and offers no reduction in memory al- location. A significant disadvantage of the method is that it inherits all of the weak- nesses inherent in the chain coding process. The second class of methods involves absolute or iterative reductions in resolution of either the trans- form or the image space. 4. Segmenting the image. In [11] segmenta- tion of the image is considered. Segments of the same line contribute separately to the same entry in the transform space. But still all possible values of the dependent param- eter, are calculated. Segmenting the image in this case is equivalent to a reduction in resolution, which may not be acceptable. 5. Using an adaptive method[4], [5], [6], in which a coarse resolution in transform space is initially made, advancing to a finer reso- lution around candidate peaks. It is an iter- ative process, with the results of each stage depending on results obtained in the pre- vious one. This method may work well for simple images, but for images with multiple instances of curves, a coarse search in the transform space may not detect all maxima, thus failing to detect them in the iterations that follow. Evaluation of the information generated in the transform space may present difficulties. Prob- lems associated with the detection of maxima in the transform space may be partially solved by the use of matched filtering techniques to detect those maxima[l2], [13]. However, a major shortcoming 163 AVC 1989 doi:10.5244/C.3.28

A Dynamic Combinatorial Hough transform for …A Dynamic Combinatorial Hough transform for Straight Lines and Circles. V. F. Leavers**, D. Ben-Tzvi*, and M. B. Sandier* A new algorithm

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Dynamic Combinatorial Hough transform for …A Dynamic Combinatorial Hough transform for Straight Lines and Circles. V. F. Leavers**, D. Ben-Tzvi*, and M. B. Sandier* A new algorithm

A Dynamic Combinatorial Hough transformfor Straight Lines and Circles.

V. F. Leavers**, D. Ben-Tzvi*,and M. B. Sandier*

A new algorithm for the Hough transformis presented. It uses information available in thedistribution of image points to calculate the pa-rameters associated with combinations of the min-imum number of points necessary to define an in-stance of the shape under detection. The methodrequires only one dimensional accumulation of evi-dence to determine the parameters associated witha given shape. Using the algorithm, the Houghtransform of sparse images is more efficiently cal-culated. Dense images may be segmented and sim-ilarly processed. The method also provides a feed-back mechanism between image and transform spacewhereby contiguity of feature points and endpointsof curves may be determined.

The Hough transform[l], [2] is a powerfultool in shape analysis. It is used to extract globalfeatures from shapes and gives good results even inthe presence of noise or occlusion. While the the-oretical potential of parametric transform meth-ods has been demonstrated they have made littleimpact on large scale industrial applications be-cause of supposed excessive storage requirementsand computational complexity[3] The developmentof fast, efficient implementations of parametric trans-formation methods of shape detection has accord-ingly received much attention in the recent lit-erature [4], [5], [6], [3], [7], [8]. An up-to-dateand comprehensive review of the use of the Houghtransform is given by Illingworth and Kittler[9].

Previous suggested approaches may be di-vided into two categories. The first seeks to reducethe computational load by using evidence from theimage to reduce the generation of evidence group-ings of points. Such methods are:

1. Using edge direction information as an indi-cation of the parameter range to be consid-ered^], [10]. Using this approach requiresan accurate estimation of the 6 range fromthe edge direction data. A large mask needsto be used in the edge detection stage, whichmerely shifts the computational burden.

** King's College London, Department of Physics* King's College London, Department of Electri-

cal Engineering

2. For straight line detection, a local opera-tor may be applied which exploits the con-straint that at least two points are requiredto define a line[7]. This algorithm does suc-ceed in reducing the memory allocation re-quirements. However, because of the com-plexity of its implementation it does not of-fer a significant reduction in computationalload and the net result of using a local op-erator is a reduction in resolution.

3. A further method for straight line detec-tion preprocesses the edge data to form alist whose elements are ordered on contigu-ity and form the equivalent of a chain codedrepresentation of the edge image data[8]. Avariable sized sliding window is then used inconjunction with this list to generate pointpairs which are mapped into the parameterspace. Again the method simply shifts thecomputational burden to the preprocessingstage and offers no reduction in memory al-location. A significant disadvantage of themethod is that it inherits all of the weak-nesses inherent in the chain coding process.

The second class of methods involves absolute oriterative reductions in resolution of either the trans-form or the image space.

4. Segmenting the image. In [11] segmenta-tion of the image is considered. Segmentsof the same line contribute separately to thesame entry in the transform space. But stillall possible values of the dependent param-eter, are calculated. Segmenting the imagein this case is equivalent to a reduction inresolution, which may not be acceptable.

5. Using an adaptive method[4], [5], [6], inwhich a coarse resolution in transform spaceis initially made, advancing to a finer reso-lution around candidate peaks. It is an iter-ative process, with the results of each stagedepending on results obtained in the pre-vious one. This method may work well forsimple images, but for images with multipleinstances of curves, a coarse search in thetransform space may not detect all maxima,thus failing to detect them in the iterationsthat follow.

Evaluation of the information generated inthe transform space may present difficulties. Prob-lems associated with the detection of maxima inthe transform space may be partially solved by theuse of matched filtering techniques to detect thosemaxima[l2], [13]. However, a major shortcoming

163 AVC 1989 doi:10.5244/C.3.28

Page 2: A Dynamic Combinatorial Hough transform for …A Dynamic Combinatorial Hough transform for Straight Lines and Circles. V. F. Leavers**, D. Ben-Tzvi*, and M. B. Sandier* A new algorithm

of the technique remains in that all informationabout feature points contributing to a maxima inthe transform space is lost in the transformationprocess. It is therefore not possible to determineeither contiguity of feature points nor end pointsof curves. Gerig[14] attempts to solve these prob-lems, in the case of circle detection, using a tech-nique which maps information from the parameterspace back to the image space. In this way eachimage point has associated with it a most prob-able parametrisation. A second transformation isperformed where, for each image point, only thecell in parameter space associated with the mostprobable parametrisation of that image point is in-cremented. The technique works well in that it is areliable strategy for interpreting the accumulatorspace. It is however still computationally complexand offers no reduction in memory allocation.

The proposed method seeks both to cut sig-nificantly the computational burden involved inthe implementation of the transform, to provide anefficient feedback mechanism linking the accumu-lated boundary point evidence and the contribut-ing boundary point data and to facilitate the de-tection of maxima.

1 . Combinatorial Hough transform

An expression for the Generalized HoughTransform, GHT, may be written in the form sug-gested by Deans[15]

F(x,y)6(p-C(x,y;Z))dxdy (1)

where F(x, y) is an arbitrary generalized function[16]defined on the xy plane D. The argument of thedelta function defines some family of curves in thexy plane parametrized by the scalar p and the com-ponents 6>6>---fn of the vector f. If, F(x,y),represents a binary image the integral of equation1 will have a value of 1 when the argument of thedelta function evaluates to zero. The evaluation ofthe argument, in its discrete form,

Pj = C{xi,yi\Zj)

is used to calculate the standard GHT. The i, jsubscripts refer to ordered pairs in the image andthe transform space respectively. For every point,(£i)2/t), of the image, i is fixed and the values pjare calculated using combinations of stepwise in-crements of the components of £j. Each point,(Pj,£j), in the transform space will refer to a possi-ble curve in image space which passes through thepoint (xi,yi). The SHT therefore provides a great

redundancy of information concerning the image.This is because each image point is treated inde-pendently.

The present technique proposes that eachimage point be tested for the most probable, asopposed to all possible, membership of curves. If,when the image is scanned for candidate featurepoints, a list of those feature points is maintained,then probable membership of curves may be testedby calculating the parameters associated with com-binations of the minimum number of points nec-essary to define an instance of the shape underdetectibn[l7].

It is clear that where n parameters are as-sociated with the shape under detection then aminimum of n points are required to test the mem-bership of a curve of any given n — 1 points withthe image point under consideration. For an imagecontaining m points, to test each point in this waywould require C£ = /^~\7^r computation cycles.If the number of feature points, m, is large enough,the number of computations required far exceedsthose required when using a standard GHT algo-rithm. This problem may be resolved by applyingthe technique dynamically in a manner appropriateto the curve under detection.

1.1 Dynamic Combinatorial Hough Transform forStraight line detection

The simplest possible combination of imagepoints is that of two point colinearities. For twosuch co-linear points, (x\,yi)y (x2,2/2)1 the equa-tion of the line joining them is given by:

p — x cos 9 — y sin 9 (2)

where:

\ -The Dynamic Combinatorial Hough Transform, DCHTproposes that the value of 9 be calculated for eachtwo-point colinearity involving the first point, (a*!, t/i),and the remaining points, (a;t-,y,:), on the list ofimage points. These values are then accumulatedin a 9 histogram. If m of the points in the listare co-linear with the first point, it results in apeak of value m at the 9 value of this line in the 9histogram. After such a peak has been detected,the value of r for this line may be calculated us-ing the {x,y) coordinates of the first point. It canbe reasonably assumed that the m co-linear pointsdo not reside on another line. Thus, they may beremoved from the list, and the next pass of thealgorithm handles a shortened list. In each of thefollowing passes the first point in the shorted list

164

Page 3: A Dynamic Combinatorial Hough transform for …A Dynamic Combinatorial Hough transform for Straight Lines and Circles. V. F. Leavers**, D. Ben-Tzvi*, and M. B. Sandier* A new algorithm

is combined with all other points, and a new 6 his-togram is generated. Points contributing to peaksare successively deleted from the list. Each setof points may be tested for contiguity and the endpoints of line segments determined. The procedurecontinues till all points in the list are deleted.

1.2 The Dynamic Combinatorial Hough Trans-form for Circle detection

In general, the Hough technique requiresthat a new parametric transform space be usedwith respect to each new shape, the dimension-ality of the transform space being a function ofthe number of parameters associated with a par-ticular shape. Using the Dynamic CombinatorialHough Transform this massive memory require-ment may be avoided and the computational loadsignificantly decreased.

Circles may be successively detected by cal-culating the parameters associated with the circlewhich passes through combinations of three non-colinear points such that the first image point,(^liJ/i), in each combination is fixed. The calcu-lated parameters are accumulated in one dimen-sional histograms. Peaks in the histograms willindicate the parameters associated with the mostprobable instance of the circle in image space ofwhich the point, (2:1,2/1), is a member.

To calculate the parameters of the circle,the present approach uses the following property,that the perpendicular bisector of a chord passesthrough the center of the circle. For a triplet ofedge points, (2:1,2/1), (2:2,2/2), (2:3,2/3), on a circle,the perpendicular bisectors of the two chords gen-erated by these three points will intersect at thecenter of the circle. For example, the equation ofthe perpendicular bisector of the chord formed bythe colinearity of the points (2:1,2/1) and (2:2,2/2)may be expressed in the form:

y - ybl = nnix - xbl) (4)

where xbl = ( a '+ a ;) and ybl = (y '*y;) are theco-ordinates of the foot of the perpendicular andits orientation is given by:

- 2:2im = tan (5)

V 2/1 - 2/2 /The center co-ordinates, (xc,yc), and the radius,r, of the circle on which all three points reside aregiven by:

b, +(2/fc! - Vb2)

(6)He - J/bj + mi(xc - xbl)

r = ((* - xcf - (y - ycf))>

The calculated center co-ordinates and radius areaccumulated in three one dimensional histograms.Maximum values in the three histograms indicatethe parameters of the circle of which the pointix\, V\) is most probably a member. Any points re-siding on this circle may then be removed and thenext pass of the algorithm handles a shortened listof feature points.

2 . Implementation and Illustrations

Fig l(a) shows a 256 x 256 test image ofan hexagonal nut. A Laplacian edge detector isapplied to the test image. Fig l(b) shows the re-sulting binarized edge image. To reduce the com-putational load, the edge image is segmented intosixteen sub-images, each processed independently.

Following the method outlined in section1.1, the co-ordinates of the edge points in a seg-ment are listed in the order of their appearance. Apoint on the list is then fixed. The fixed point ispaired with all other points in that segment pro-vided that the distances between the points arelarge enough to minimize inaccuracies in grid rep-resentation.

A 0 histogram is generated using equation(3) and the peak extracted. Using equation (2) pis calculated for the extracted value of 6. Pointswhich contribute to this value of (p, 6) are removedfrom the list and the next pass of the algorithmhandles a shortened list. The process continuesuntil all points contributing to straight line seg-ments have been removed from the list and fromthe edge image, See Fig l(c).

Circle detection proceeds using this reducededge image, Fig l(c). In this second stage the samesegments are used. One image point is fixed andused in combinatorial variations of that point andtwo other points from the list following it, providedthat such sets of points are not co-linear. The cir-cle parameters are calculated as outlined in section1.2. Three histograms are generated for xc, yc andr, the circle parameters. Each histogram exhibitsa peak, these are detected and the points whichhave contributed to that particular circle are re-moved from the list.

If the choice of first image point is goodthen the values accumulated in the histograms con-verge to single maximum values in the first iter-ations of this particular stage of the algorithm.Should it happen that the first point is a poorchoice, i.e. a spurious point not located on a circle,then multiple peaks will occur in the histograms.

165

Page 4: A Dynamic Combinatorial Hough transform for …A Dynamic Combinatorial Hough transform for Straight Lines and Circles. V. F. Leavers**, D. Ben-Tzvi*, and M. B. Sandier* A new algorithm

Such multiple peaks begin to develop in the firstiterations of the algorithm. Thus a check can bemade relatively early in the computation cycle andwhere multiple local maxima are detected then thispass of the algorithm may be abandoned at littlecomputational cost and a new first point chosen.

Extraneous associations of points which re-side on different line segments, or on a line and acircle, occur, but their incidence is much reducedby segmentation, and by the removal of straightline segments from the image before the algorithmfor circle detection is applied.

Once all segments have been processed, alist of parameters of straight lines and circles in theimage is obtained, and can be used to reconstructthe image (fig. Id).

3 . Conclusion

A new algorithm, the Dynamic Combinato-rial Hough Transform, DCHT, has been presented.It uses information present in the location of thefeature points to reduce the generation of evidencein the transformation process. The DCHT offerssignificant improvements to previously suggestedimplementations of the Hough transform. The al-gorithm is computationally less intensive. It is alsomuch more efficient in memory utilization. Ratherthan using an accumulator array whose dimension,7i, corresponds to the number of parameters un-der detection, it requires only n one dimensionalvectors in which to accumulate the results of thetransformation. The length of the vectors is cho-sen with respect to the required resolution of thedetection process.

Further computational savings may be madeby segmenting the image. In addition, if the cal-culated parameters are not within the range ofpossibilities suggested by the shape under detec-tion, this pass of the algorithm may be abandoned.Such a strategy will deal with membership of ex-traneous curves accidentally generated.

A further advantage of using the algorithmis that peak detection is one dimensional and themethod provides a feedback mechanism wherebythe end points of curves may be detected.

References

[1] Hough P.V.C. Method and means for Recog-nising complex patterns. U.S. Patent No.3069654, 1962

[2] Ballard D.H. Generalizing the Hough Trans-,form to detect arbitrary shapes, Pattern Recog-nition, Vol 13. No. 2, 111-122, 1981.

[3] Gerig G. and Klein F. Fast contour iden-tification through efficient Hough transformand simplified interpretation strategies. Proc,8th Int. Conf. Pattern Recognition, Vol 1,Paris 1986.

[4] Li H., Lavin M.A. and LeMaster R.J. FastHough Transform Proc. of 3rd workshop oncomputer vision: Bellair, Michgan 1985

[5] Li H. Fast Hough Transform for multidi-mensional signal processing, IBM Researchreport, RC 11562, York Town Heights 1985

[6] Illingworth J. and Kittler J. The adaptiveHough transform in press IEEE T-PAMI1987

[7] Forman A.V A modified Hough transformfor detecting lines in digital imagery, 151-160, SPIE, Vol 635, Applications of Artifi-cial Intelligence III, 1986.

[8] Jain A.N. and Krig D.B. A robust Houghtransform technique for machine vision, Proc.Vision 86, Detroit, Michigan, 86.

[9] Illingworth J. and Kittler J. A survey of theHough transform, accepted for publicationin IEEE Trans, on Pattern Analysis andMach. Intell., 1987.

[10] Leavers V.F. and Sandier M. B. An efficientRadon transform BPRA 4th InternationalConf., Cambridge, 1988.

[11] R.S. Wallace A modified Hough transformfor lines, IEEE conference on computer vi-sion and pattern recognition, San Francisco1985, 665-667.

[12] Leavers V.F. Method and Means of ShapeParametrisation, British Patent Applica-tion NO. 8622497. September 1986.

[13] Leavers V.F. and Boyce J.F. The Radontransform and its application to shape de-tection in computer vision, Image and Vi-sion Computing Vol.5, May 1987.

166

Page 5: A Dynamic Combinatorial Hough transform for …A Dynamic Combinatorial Hough transform for Straight Lines and Circles. V. F. Leavers**, D. Ben-Tzvi*, and M. B. Sandier* A new algorithm

[14] Gerig G. Linking image-space and accvmvlaior-space. A new approach for object recogni-tion Proc. of First Int. Conf. on ComputerVision, London, June 1987

[15] Deans S.R. Hovgh transform from the Radontransform. IEEE Trans. Pattern Analysisand Machine Intelligence. Vol. PAMI-3,No., March 1981.

[16] Gel'fand I.M., Graev M.I. and Vilenkin N.Ya.Generalized functions Vol 5, Academic Press,;New York, 1966.

[17] Leavers V.F. Dynamic Generalized HoughTransform, British Patent Application, April1989.

167

Page 6: A Dynamic Combinatorial Hough transform for …A Dynamic Combinatorial Hough transform for Straight Lines and Circles. V. F. Leavers**, D. Ben-Tzvi*, and M. B. Sandier* A new algorithm

(a) (b)

(c) (d)

Fig. 1 Applying the DCHT algorithm to an image :(a) the original image (b) the edge image(c) the edge image after the removal of straight lines(d) the reconstruction of straight lines and circles in

the image.

168