10
A new circle/ellipse detector using genetic algorithms Peng-Yeng Yin * Department of Information Management, Ming Chuan University, 250 Sec. 5, Chung Shan N. Rd., Taipei 111, Taiwan, ROC Received 19 June 1998; received in revised form 9 December 1998 Abstract A new circle and ellipse detector is presented in this paper. The proposed method adopts a hybrid scheme which consists of a genetic algorithm (GA) phase and a local search phase. In the GA phase, an ecient fitness evaluation procedure and specific genetic operators are proposed for this application. The candidates with fitness values above a threshold are added into a candidate list. In the local search phase, the members of the candidate list are locally im- proved and their fitness values fall into two groups. The candidates belonging to the group with higher fitness values are output. The experimental results show that the proposed method can detect circles and ellipses correctly, and the computation and storage cost is very little. Ó 1999 Elsevier Science B.V. All rights reserved. Keywords: Circle detection; Ellipse detection; Hough transform; Hybrid scheme; Genetic algorithms; Local search algorithm 1. Introduction Shape analysis is an important task in computer vision. In the real images, circular and elliptical shapes are most frequently seen since they usually appear as the projections of three-dimensional objects when the images are produced. The Hough transform (Hough, 1962), HT, has long been used to characterize analytic features, such as straight lines, circles and ellipses. It is less sensitive to noises, shape disconnectedness and occlusions. However, it suers the disadvantage of massive requirements of computations and memory stor- age. Both complexities grow exponentially with the number of the feature parameters. Many re- searchers have devoted themselves to the modifi- cations of HT to detect circles and ellipses more eciently. These approaches can be classified into two types. The methods of the first type are based on the decomposition of parameterization; the ones of the second type make use of geometric property of uniqueness. Decomposition-based approaches divide the detection process into multiple stages. Parts of parameters are estimated in each stage to reduce the requirements of computations and storage. They usually start with the detection of shape centers by using the tangents of edge points. Then the remaining parameters (the radius for circles, or the semimajor axis, semiminor axis and ori- entation for ellipses) are calculated in various ways such as the least mean square fitting method (Tsuji and Matsumoto, 1978), the lower-dimen- sional HT (Tsukune and Goto, 1983; Davies, 1988; Yuen et al., 1989), and some geometric properties (Yip et al., 1992; Nair and Saunders, 1996). All of these methods use tangent infor- mation which is hard to be correctly estimated in digital images because of noises and quantization www.elsevier.nl/locate/patrec Pattern Recognition Letters 20 (1999) 731–740 * E-mail: [email protected] 0167-8655/99/$ – see front matter Ó 1999 Elsevier Science B.V. All rights reserved. PII: S 0 1 6 7 - 8 6 5 5 ( 9 9 ) 0 0 0 3 7 - 9

A new circle/ellipse detector using genetic algorithms

Embed Size (px)

Citation preview

Page 1: A new circle/ellipse detector using genetic algorithms

A new circle/ellipse detector using genetic algorithms

Peng-Yeng Yin *

Department of Information Management, Ming Chuan University, 250 Sec. 5, Chung Shan N. Rd., Taipei 111, Taiwan, ROC

Received 19 June 1998; received in revised form 9 December 1998

Abstract

A new circle and ellipse detector is presented in this paper. The proposed method adopts a hybrid scheme which

consists of a genetic algorithm (GA) phase and a local search phase. In the GA phase, an e�cient ®tness evaluation

procedure and speci®c genetic operators are proposed for this application. The candidates with ®tness values above a

threshold are added into a candidate list. In the local search phase, the members of the candidate list are locally im-

proved and their ®tness values fall into two groups. The candidates belonging to the group with higher ®tness values are

output. The experimental results show that the proposed method can detect circles and ellipses correctly, and the

computation and storage cost is very little. Ó 1999 Elsevier Science B.V. All rights reserved.

Keywords: Circle detection; Ellipse detection; Hough transform; Hybrid scheme; Genetic algorithms; Local search algorithm

1. Introduction

Shape analysis is an important task in computervision. In the real images, circular and ellipticalshapes are most frequently seen since they usuallyappear as the projections of three-dimensionalobjects when the images are produced. The Houghtransform (Hough, 1962), HT, has long been usedto characterize analytic features, such as straightlines, circles and ellipses. It is less sensitive tonoises, shape disconnectedness and occlusions.However, it su�ers the disadvantage of massiverequirements of computations and memory stor-age. Both complexities grow exponentially withthe number of the feature parameters. Many re-searchers have devoted themselves to the modi®-cations of HT to detect circles and ellipses moree�ciently. These approaches can be classi®ed into

two types. The methods of the ®rst type are basedon the decomposition of parameterization; theones of the second type make use of geometricproperty of uniqueness.

Decomposition-based approaches divide thedetection process into multiple stages. Parts ofparameters are estimated in each stage to reducethe requirements of computations and storage.They usually start with the detection of shapecenters by using the tangents of edge points. Thenthe remaining parameters (the radius for circles,or the semimajor axis, semiminor axis and ori-entation for ellipses) are calculated in variousways such as the least mean square ®tting method(Tsuji and Matsumoto, 1978), the lower-dimen-sional HT (Tsukune and Goto, 1983; Davies,1988; Yuen et al., 1989), and some geometricproperties (Yip et al., 1992; Nair and Saunders,1996). All of these methods use tangent infor-mation which is hard to be correctly estimated indigital images because of noises and quantization

www.elsevier.nl/locate/patrec

Pattern Recognition Letters 20 (1999) 731±740

* E-mail: [email protected]

0167-8655/99/$ ± see front matter Ó 1999 Elsevier Science B.V. All rights reserved.

PII: S 0 1 6 7 - 8 6 5 5 ( 9 9 ) 0 0 0 3 7 - 9

Page 2: A new circle/ellipse detector using genetic algorithms

errors. Besides, due to the multistage nature ofthese methods, additional errors may be intro-duced by propagation through various stages. Toovercome these shortcomings, Ho and Chen(1993) proposed a circle detector which uses thegeometric uniqueness property instead of tangentinformation. They took three-representative edgepoints to uniquely determine the parameters ofthe circle which contains all the three points. Theimage is scanned to accumulate all possible can-didate parameters, and the peaks in the accumu-lator array are ®nally output. Yin and Chen(1994) extended this concept to ellipses detectionby taking ®ve-representative edge points to eval-uate the parameters. Both of the approaches arevery fast since they map several edge points in theimage space to only one point in the parameterspace. For the same reason, the peaks in the ac-cumulator array are sharper and more separatedthan those produced by the decomposition-basedapproaches and are easily detected. The disad-vantage is the memory requirement is not re-duced.

To retain the advantages of both kinds ofmethods and avoid their drawbacks, several re-searchers have adopted genetic algorithms (GAs)to detect geometric features. The detection processis transformed into an optimization problem ofwhich the objective is to maximize the matchingscore of the trials of possible candidates of pa-rameters to the original image. Hill and Taylor(1992) applied GAs in model-based image inter-pretation of ventricular boundaries which are de-scribed by 10 parameters. Roth and Levine (1994)coded the minimal subsets of the representativepoints of features as GA chromosomes to reducethe search space of the parameters. Lutton andMartinez (1994) used the distance image tosmoothen the objective function and to provide anerror tolerance of matching. Another similar ap-proach was proposed by Kawanishi and Hagiwara(1995). They defocused the original image tomeasure the closeness of matching. They alsoprovided a coding scheme of multi-typed featuresin one chromosome.

In this paper, a hybrid scheme consisting of aGA and a local search algorithm is adopted. In theGA phase, the parameter candidates with higher

®tness values are copied into the candidate list.Then, in the local search phase, the true parametercandidates are ®ltered out by looking around theirneighborhood and improving their ®tness values.We use the multi-valued edge image which notonly preserves the bene®t of defocusing image butsaves the computation. The ®tness evaluationprocedure is speeded up by geometric symmetryand look-up tables. The proposed method has thefollowing features: (1) no tangent information isused, (2) no propagation error is generated, (3) fast®tness evaluation and little memory storage, (4) anumber of features are detected by a single pass ofthe two-phase procedure, and (5) no need of ex-istence veri®cation process after the true candi-dates are output.

The remainder of this paper is organized asfollows. Section 2 renders the proposed method indetail. In Section 3, some experimental results withseveral test images are given. Finally, conclusionsare made in Section 4.

2. Proposed method

GAs are stochastic search algorithms whichsimulate the biology evolution system (Goldberg,1989). They perform parallel search by a popu-lation of solutions called chromosomes. Thesechromosomes represented as strings improvetheir ®tness values by three genetic operators:(1) reproduction, (2) crossover and (3) mutation.Reproduction mimics the natural selection basedon Darwinian survival of the ®ttest amongchromosomes. These selected individuals inter-change parts of their information by crossover toextend the exploration toward `better' portions ofthe search space. Mutation is an occasional al-teration of the gene allele, which may not beobtained by crossover. GAs are powerfulsearching tools even the search space is notcontinuous and they have various applications inimage processing, such as feature labeling (An-kenbrandt et al., 1990), segmentation (Bhanuet al., 1995), matching (Singh et al., 1997) andpolygonal approximation (Yin, 1998). In thissection, the application of GAs in circle/ellipsedetection is proposed.

732 P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740

Page 3: A new circle/ellipse detector using genetic algorithms

2.1. String representation and ®tness evaluation

Various string representations are available forone application and may have an in¯uence on thee�ciency and correctness of the search. For theapplication of geometric feature detection, somestring representations have been proposed. Rothand Levine (1994) encoded the indices of the rep-resentative points for a geometric feature as a so-lution string to reduce the complexity of searchspace. However, the locus of the feature derived bythe representative points may have signi®cant dis-placement due to the quantization errors of thesepoints (Yin and Chen, 1994). Lutton and Martinez(1994) modi®ed the coding scheme by combiningthe coordinates of the representative points and thevalues of the shape parameters into one string tolimit the redundancy of representation. In this pa-per, we only take into account encoding the shapeparameters to enhance the accuracy. The extrasearch complexity caused can be treated by speed-ing up the ®tness evaluation procedure.

Let g�x; y� be an N � N graylevel image. A circleappearing in g�x; y� can be characterized by a set ofthree integer parameters �h; k; r� where �h; k� arethe coordinates of the center and r the radius. Eachcandidate of the sets of the circle parameters isencoded into a binary string as

Scircle � h k r;

where 0 6 h; k 6 N ÿ 1 and rmin6 r 6 rmax. Thevalues of rmin and rmax are the minimal and themaximal lengths of radius for a circle recognizablein an N � N image.

Similarly, an ellipse appearing in g�x; y� can bedescribed by a set of ®ve integer parameters�h; k; a; b; h� where �h; k� are the coordinates of thecenter, a and b the lengths of the semimajor andsemiminor axes, and h the orientation angle. Eachcandidate of the sets of the ellipse parameters isencoded into a binary string as

Sellipse � hk abh;

where 0 6 h; k 6 N ÿ 1, emin 6 a; b 6 emax,0� 6 h < 180�. The values of emin and emax are theminimal and the maximal lengths of the semimajorand semiminor axes for an ellipse recognizable inan N � N image.

The ®tness of a string should express the sig-ni®cance of existence of the shape characterized bythe string. There are three ways of measuring theexisting evidence of the features. One is to match atemplate along the feature boundaries to thebilevel edge image (Roth and Levine, 1994), andone is to convert the original image to the defo-cusing image (Lutton and Martinez, 1994; Kawa-nishi and Hagiwara, 1995) for allowing thetolerance of errors. The use of bilevel edge imagemay lose some useful information, and the trans-formation of the defocusing image costs too muchcomputation. The last way which we adopt is touse the multi-valued edge image to prevent thesedrawbacks. Let e�x; y� be the multi-valued edgeimage of the original image g�x; y�, S be a pa-rameter string, LS be the locus of the shape de-scribed by S. The ®tness function of S is de®ned as

f �S� �X�x;y�2LS

e�x; y�: �1�

The larger f �S� is, the more possible the presenceof the shape. However, the value of f �S� is de-pendent on the scale of the shape. To avoid thisphenomenon, LS is quantized into 360 points forall shapes in this image (note that the number ofquantization levels should be adequate for the lo-cus of the maximal possible shape which is de-pendent on the image size; here, our test imagesare all of size 128 ´ 128, for larger images, thenumber of quantization levels should be in-creased). Let �h; k; r� be the parameters of a circle,the locus is quantized by

�xw; yw� � �r cosw� h; r sinw� k�; �2�where 0�6w < 360� and �xw; yw� representing thequantized coordinates of the loci and rounded tothe nearest integer values. For an ellipse describedby �h; k; a; b; h�, the locus is quantized by

�xw; yw� � �acoswcosh� b sinw sinh� h;

ÿ acosw sinh� b sinwcosh� k�; �3�

where 0�6w < 360�.The evaluation of ®tness values often contrib-

utes the major computational costs in GAs(Goldberg, 1989) since it is computed iteratively ineach generation for all string individuals. Theprevious works did not treat this issue. Here, we

P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740 733

Page 4: A new circle/ellipse detector using genetic algorithms

propose a fast ®tness evaluation procedure basedon the geometric symmetry and the look-up tables.For a point P1 on a circle as shown in Fig. 1(a),the coordinates of its three symmetric points P2,P3 and P4 along the horizontal, diagonal andvertical orientations are given by

�x2; y2� � �2 � hÿ x1; y1�;�x3; y3� � �2 � hÿ x1; 2 � k ÿ y1�;�x4; y4� � �x1; 2 � k ÿ y1�:

�4�

Therefore, only one fourth of the coordinates ofthe loci needs be computed by Eq. (2) which con-tains sine/cosine calculations, the others are easilyderived by Eq. (4).

Similarly, the ®tness evaluation for an ellipsecandidate can be speeded up as follows. First, let Ebe an ellipse with its center on the origin of thecoordinate system and its major axis along the X-axis, the coordinates of its loci on the ®rst quarterare computed by

�xw; yw� � �acosw; b sinw�; �5�where 0�6w6 90�, a and b are the lengths of thesemimajor and semiminor axes. Then, consider Eis rotated by h and translated by �h; k� as shown inFig. 1(b), the coordinates of the four symmetricpoints P1, P2, P3 and P4 can be derived from�xw; yw� as

�x1; y1� � �xw cosh� yw sinh� h;

ÿ xw sinh� yw cosh� k�;�x2; y2� � �ÿxw cosh� yw sinh� h;

xw sinh� yw cosh� k�;�x3; y3� � �ÿxw coshÿ yw sinh� h;

xw sinhÿ yw cosh� k�;�x4; y4� � �xw coshÿ yw sinh� h;

ÿ xw sinhÿ yw cosh� k�:

�6�

Since h is constant for all loci of E and there aremany replicated terms in the right hand sides ofEq. (6), they can be further simpli®ed to

�x1; y1� � �A� D� h; ÿB� C � k�;�x2; y2� � �ÿA� D� h; B� C � k�;�x3; y3� � �ÿAÿ D� h; Bÿ C � k�;�x4; y4� � �Aÿ D� h; ÿBÿ C � k�;

�7�

where A � xw cosh, B � xw sinh, C � yw cosh andD � yw sinh, respectively, and they are computedin advance. Hence, the ®tness of E can be evalu-ated using Eqs. (5) and (7).

Moreover, the look-up tables for sine/cosinevalues of 0±90° are prestored and are read intomemory in the beginning; hence, the computationof the coordinates of the loci on the ®rst quarter isalso fast.

2.2. Genetic operators

2.2.1. ReproductionBefore applying the reproduction operator, the

®tness values of the strings should be properlyscaled (Singh et al., 1997) to prevent an out-standing string from taking over a signi®cantproportion of the population, which is the leadingcause of the premature convergence.

In GAs, each string survives with a selectionprobability in proportion to its ®tness. Among

Fig. 1. (a) The four symmetric points of a circle parameterized

by �h; k; r�. (b) The four symmetric points of an ellipse

parameterized by �h; k; a; b; h�:

734 P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740

Page 5: A new circle/ellipse detector using genetic algorithms

many reproduction schemes, roulette wheel selec-tion is the simplest, but it is plagued with thestochastic errors. In the proposed method, weemployee Brindle's scheme (Brindle, 1981) as fol-lows. Each string is associated with a count as its®tness divided by the average ®tness of the currentpopulation. First, each string is allocated samplesaccording to the integer part of its count. Then theremaining population slots are ®lled according tothe fractional parts of the string counts usingroulette wheel. The Brindle's scheme has beenproven to be superior than the single roulettewheel selection.

2.2.2. CrossoverIn the proposed method, two di�erent crossover

operators are used in various scenarios. Let S1 andS2 be the parents chosen randomly to performcrossover. Assume

S1 � p11p1

2 � � � p1m;

S2 � p21p2

2 � � � p2m;

where m is equal to 3 for circles detection and 5 forellipses detection. If both of the ®tness values ofthe parents are greater than the average ®tness ofall individuals in this generation, the arithmeticcrossover (Chen and Liao, 1997) is used. The twoo�springs are produced by

Snew1 � q1

1q12 � � � q1

m;

Snew2 � q2

1q22 � � � q2

m;

where

q1i � ap1

i � �1ÿ a�p2i ;

q2i � �1ÿ a�p1

i � ap2i ; 16 i6m;

and a is a random value picked within (0, 1), i.e.,the parameter values of the o�spring are the linearcombinations of its parents' parameter values.Otherwise, the single point crossover is applied byinterchanging the substrings of the parents after arandom position.

The arithmetic crossover is used to narrow thesearch around the highly ®tted parents, and thesingle point crossover is used to extend the ex-plored area of the search space. Both crossoveroperators are taken with a crossover probabilitywhich is ®xed to 0.9 in our method.

2.2.3. MutationEach gene of a string in the generation has a

little mutation probability (which is 0.03 in ourmethod) to undergo mutation. If a gene is deter-mined to perform mutation, its bit value is ¯ipped,i.e., from 1 to 0 or 0 to 1.

2.3. Execution plan

The hybrid system of the global search and thelocal search procedures has become more popularsince it preserves both advantages of jump outfrom the local optima and the e�ectiveness ofsearch (Goldberg, 1989). The previous GA-basedgeometric feature detection methods used only thepure GA search which prolongs the process ofdetection by output the most signi®cant feature inthe ®rst run, the next salient feature in the secondrun, and so forth (Roth and Levine, 1994; Kawa-nishi and Hagiwara, 1995), or by the idea of niche(Hill and Taylor, 1992; Lutton and Martinez,1994). The execution plan of the proposed methodis a hybrid structure consisting of a GA and a localsearch algorithm. In the GA phase, parametercandidates with ®tness values above a giventhreshold are copied into a candidate list. Then inthe local search phase, the true candidates whichdo exist in the image are ®ltered out from thecandidate list.

2.3.1. The GA phaseIn each generation, the strings with ®tness

values above a speci®ed threshold are copied intoa candidate list. When a new candidate is to beinserted, the candidate list is checked whetherthere already exists a member which is too closeto the new candidate in the parameter space; if so,retain the better one according to their ®tnessvalues. Besides, the Elitist model (Bhandari et al.,1996) which preserves the best string obtained sofar within the current population is applied toenhance the search. After the GA phase termi-nates, the candidate list will contain the stringswhich are close to the regions where the trueparameter strings of the existing features reside.The proposed GA procedure is described asfollows.

P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740 735

Page 6: A new circle/ellipse detector using genetic algorithms

Input: the size of the population P, the candi-date threshold T1, the maximal number of gen-erations G and the sine/cosine look-up tables.Output: a candidate list L.Step 1: Randomly generate the initial popula-tion of P strings.Step 2: Evaluate the ®tness values of all stringsand copy the best string Sb of the initial popu-lation in a separate location.Step 3: Apply the proposed reproduction, cross-over and mutation operators to generate thenext population.Step 4: Evaluate the ®tness values of all stringsin the current population.Step 5: Add the strings with ®tness values great-er than T1 to L. Retain the better one if twomembers of L are too close.Step 6: Compare the best string Sc of the cur-rent population with Sb. If Sc has a higher ®t-ness value, then substitute Sb with Sc.Step 7: Replace the worst string Sw of the cur-rent population by Sb.Step 8: Go to Step 3 until there are G genera-tions.

The value of T1 can be determined as, for ex-ample, picking the top 5% of the individuals ineach generation.

2.3.2. The local search phaseTo ®nd out the true parameters of the existing

features, each member of the candidate list shouldlook around its neighborhood and choose the bestdirection to move. The idea is based on the ob-servation that the ®tness values of true candidatescan be increased more drastically than those offalse candidates by a local search algorithm. Theneighborhood of the candidate is determined bytwo heuristic searches. One is improving the can-didates by changing the values of successive pa-rameters, the other is based on copying theparameter values from other candidate members.The details of the local search procedure are givenas follows.

Input: the candidate list L produced by the GAphase, a small amount of adjusting value v anda threshold T2.

Output: the parameters of all detected features.Step 1: Select each member from L, do Steps 2and 3.Step 2: For each parameter of the current mem-ber, do the following:

2.1 Change the parameter value by each of thethree ways: adding v, subtracting v and copy-ing the parameter value from other members.2.2 If the ®tness is improved, retain the bestone as the new parameter value; otherwise,stay unchanged.

Step 3: Repeat Step 2 if any parameter value ofthe current member has been changed.Step 4: Check any two members of L. If they aretoo close, retain the better one according totheir ®tness values.Step 5: Output the members with ®tness valuesgreater than T2.

The local search algorithm is successful in sep-arating the true candidates from the candidate list.The reason is as follows. The true candidates willreceive large gains in improving their ®tness valuesby adjusting the parameter values locally, whilethe false ones are scarcely improved by looking totheir neighbors. The value of T2 can be determinedautomatically by clustering the ®tness histograminto two groups.

3. Experimental results

We implement our method on a PC withPentium-120 CPU inside. To test the robustness ofthe proposed method, the test trademark images ofFigs. 2 and 3 are added noises by altering 5% ofthe pixels with their complement values. In the GAphase of our method, we use a population of 100strings and run for 100 generations. It is seen fromFig. 2 the three circles are correctly detected(Fig. 2(b)) and superimposed on the original im-age (Fig. 2(c)). The proposed method is not onlyimmune from noises but also capable of detectingoccluded features (see the leftmost circle). Fig. 3shows the results of the detected elliptical featurein a noisy image.

For complex images as shown in Figs. 4 and 5,we let the GA run for 300 generations with the

736 P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740

Page 7: A new circle/ellipse detector using genetic algorithms

same population size. There are two ellipses de-tected in Fig. 4, one is on the wheel cover, theother is on the headlight. For images with mixedcircular and elliptical features, they can be pro-cessed only by the proposed ellipse detector sincecircles are described by a speci®c type of ellipses.Fig. 5 shows such a phenomenon, two circles andone ellipse are detected from many mechanicalparts by the proposed ellipse detector.

To demonstrate the contribution of the localsearch phase, we calculate the improving ratio asthe increase of ®tness in the local search phasedivided by the original ®tness after the GA phase.Fig. 6 shows the mean improving ratios for eachtest image by applying the proposed method 10times. The improving ratio of the true candidatesis about 2±6 times of that of all candidates for bothcases of circles and ellipses. This means the ®tness

values of the candidates will fall into two separategroups after the local search phase and the truecandidates belong to the one with higher ®tnessvalues.

The time complexity and storage complexity forthe standard HT are O�eN dÿ1� and O�Nd�, where eis the number of edge points, N is the maximalnumber of quantization levels for various param-eters and d is the number of parameters. Bothcomplexities grow exponentially with the value ofd. The modi®cations of HT provide reduction ofone to two orders of magnitude. For the proposedmethod, the time complexity consists of two parts.The time complexity of the GA phase isO�G � P � �tf � ts � Pc � tc � Pm � tm��, where G isthe maximal number of generations, P is thepopulation size, Pc and Pm are the crossover andmutation probabilities, tf , ts, tc and tm are the

Fig. 3. The trademark image and the detected ellipse.Fig. 2. The trademark image and the detected circles.

P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740 737

Page 8: A new circle/ellipse detector using genetic algorithms

average CPU time for ®tness evaluation, repro-duction, crossover and mutation, respectively, ofone string. Since Pm is very little and ts, tc, tm aremuch less than tf , the time complexity is aboutO�GPtf�. In the other hand, the time complexity ofthe local search phase is O�L2 dk�, where L is theaverage length of the candidate list and k is theaverage number of iterations. Consequently, thetotal time complexity of our method is O�GPtf �L2 dk� which is linear to the number of parameters.However, G should be larger for complex imagesas in our experiments. The memory requirement ofthe proposed method includes the storage for theindividual strings and the candidate list, resultingin the storage complexity of O�Pd � Ld� which isalso linear to the number of parameters. Table 1shows the average cost of CPU time and the av-erage length of the candidate list by applying the

proposed method 10 times for each of the testimages. All features are detected very fast and theCPU time is linear to the number of parameters of

Fig. 5. The mechanical parts image and the detected circles and

ellipse.

Fig. 6. The mean improving ratios of all candidates and the true

candidates by the local search procedure.

Fig. 4. The car image and the detected ellipses.

738 P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740

Page 9: A new circle/ellipse detector using genetic algorithms

the features. Also, the average length of the can-didate list is very small and independent of thenumber of parameters, this means the memoryrequirement is very limited.

We conclude the distinct features of the pro-posed method from the Hough-based methods andthe previous GA-based methods as follows.

1. The proposed method does not use the tangentsof edge points which are hard to be correctly es-timated.

2. The proposed method does not decompose theparameterization process into multiple stages,so no propagation error is produced.

3. The time complexity and the storage complexi-ty of the proposed method are linear to thenumber of parameters of the detected features.

4. The proposed method uses the multi-valuededge image instead of defocusing image to savecomputation, and provides a fast ®tness evalu-ation procedure based on geometric symmetryand look-up tables.

5. The proposed method detects a number of fea-tures by a single run of the hybrid system of aGA and a local search algorithm, while the pre-vious GA-based methods detects these featuresby repeating GA runs or niches.

6. Since the ®tness is measured by the matchingscores between the original image and the can-didate features, no veri®cation process of exis-tence is needed after the true candidates areoutput.

4. Conclusions

In this paper, a new circle/ellipse detector hasbeen proposed. The proposed method is a hybrid

system consisting of a GA phase and a local searchphase. In the GA phase, we present an e�cientway of ®tness evaluation based on the geometricsymmetries and look-up tables. We also proposespeci®c genetic operators for the application. Thecandidates with ®tness values greater than athreshold are added into a candidate list. In thelocal search phase, the true candidates are ®lteredout from the list by an iterative local search al-gorithm. The experimental results show that theproposed method can detect circles and ellipsesaccurately and the computation and memory re-quirement is very little.

References

Ankenbrandt, C.A., Buckles, B.P., Petry, F.E., 1990. Scene

recognition using genetic algorithms with semantic nets.

Pattern Recognition Letters 11, 285±293.

Bhandari, D., Murthy, C.A., Pal, S.K., 1996. Genetic algorithm

with elitist model and its convergence. Internat. J. Pattern

Recognition and AI 10, 731±747.

Bhanu, B.S., Lee, Ming, J., 1995. Adaptive image segmentation

using a genetic algorithm. IEEE Trans. Pattern Anal. Mach.

Intell. 25, 1543±1567.

Brindle, A., 1981. Genetic algorithms for function optimization.

Doctoral Dissertation, University of Alberta, Edmonton.

Chen, M.S., Liao, F.H., 1997. The application of genetic

algorithm in control systems. In: Proceedings of the NCS

Conference on Computer, Taiwan, pp. 154±159.

Davies, E.R., 1988. A modi®ed Hough scheme for general circle

location. Pattern Recognition Letters 7, 37±43.

Goldberg, D.E., 1989. Genetic Algorithms: Search, Optimiza-

tion and Machine Learning. Addison-Wesley, Reading,

MA.

Hill, A., Taylor, C.J., 1992. Model-based image interpretation

using genetic algorithms. Image and Vision Computing 10,

295±300.

Ho, C.T., Chen, L.H., 1993. High-speed algorithm for locating

circular objects. J. Electronic Imaging 2, 108±113.

Hough, P.C.V., 1962. Method and means for recognizing

complex patterns. US Patent No. 3069654.

Kawanishi, H., Hagiwara, M., 1995. A shape detection method

using improved genetic algorithm. In: Proceedings of the

IEEE Conference on Systems, Man and Cybernetics,

pp. 235±240.

Lutton, E., Martinez, P., 1994. A genetic algorithm for the

detection of 2D geometric primitives in images. In: Pro-

ceedings of the IAPR Conference on Pattern Recognition,

pp. 526±528.

Nair, P.S., Saunders Jr., A.T., 1996. Hough transform based

ellipse detection algorithm, Pattern Recognition Letters 17

(1996) 777±784.

Table 1

The average CPU time and average length of candidate list for

various test images by applying the proposed method 10 times

Fig. 2 Fig. 3 Fig. 4 Fig. 5

Average CPU

time in seconds

3.1 6.5 21.9 20.6

Average length

of candidate list

54.1 31.2 53.7 52.2

P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740 739

Page 10: A new circle/ellipse detector using genetic algorithms

Roth, G., Levine, M.D., 1994. Geometric primitive extraction

using a genetic algorithm. IEEE Trans. Pattern Anal. Mach.

Intell. 16, 901±905.

Singh, M.A., Chatterjee, A., Chaudhury, S., 1997. Matching

structural shape descriptions using genetic algorithms.

Pattern Recognition 30, 1451±1462.

Tsuji, S., Matsumoto, F., 1978. Detection of ellipses by a

modi®ed Hough transform. IEEE Trans. Comput. 27,

777±781.

Tsukune, H., Goto, K., 1983. Extracting elliptical ®gures from

an edge vector ®eld. In: Proceedings of the IEEE Confer-

ence on Computer Vision and Pattern Recognition, Wash-

ington, DC, pp. 138±141.

Yin, P.Y., 1998. A new method for polygonal approximation

using genetic algorithms. Pattern Recognition Letters 19,

1017±1026.

Yin, P.Y., Chen, L.H., 1994. New method for ellipse

detection by means of symmetry. J. Electronic Imaging

3, 20±29.

Yip, R.K.K., Tam, P.K.S., Leung, D.N.K., 1992. Modi®ca-

tion of Hough transform for circles and ellipses detection

using a 2-dimensional array. Pattern Recognition 25, 1007±

1022.

Yuen, H.K., Illingworth, J., Kittler, J., 1989. Detecting partially

occluded ellipses using the Hough transform. Image and

Vision Computing 7, 31±37.

740 P.-Y. Yin / Pattern Recognition Letters 20 (1999) 731±740