A signature analysis based method for elliptical shape

8
A signature analysis based method for elliptical shape Ivana Guarneri, Mirko Guarnera, Giuseppe Messina and Valeria Tomaselli STMicroelectronics - AST Imaging Lab, Stradale Primosole 50, Catania, Italy ABSTRACT The high level context image analysis regards many fields as face recognition, smile detection, automatic red eye removal, iris recognition, fingerprint verification, etc. Techniques involved in these fields need to be supported by more powerful and accurate routines. The aim of the proposed algorithm is to detect elliptical shapes from digital input images. It can be successfully applied in topics as signal detection or red eye removal, where the elliptical shape degree assessment can improve performances. The method has been designed to handle low resolution and partial occlusions. The algorithm is based on the signature contour analysis and exploits some geometrical properties of elliptical points. The proposed method is structured in two parts: firstly, the best ellipse which approximates the object shape is estimated; then, through the analysis and the comparison between the reference ellipse signature and the object signature, the algorithm establishes if the object is elliptical or not. The first part is based on symmetrical properties of the points belonging to the ellipse, while the second part is based on the signature operator which is a functional representation of a contour. A set of real images has been tested and results point out the effectiveness of the algorithm in terms of accuracy and in terms of execution time. Keywords: Signature, Elliptical, Shape detection 1. INTRODUCTION The detection of elliptical or circle shapes is a widely treated argument of image retrieval topic. In 1 - 2 techniques based on the well known Hough transform (HT) are presented. The authors of 3 - 4 propose methods based on the Randomized Hough Transform (RHT) which is a variant of the standard HT that requires less memory resources. Other works 5 fit the data points to an elliptical model, in particular, in 6 a technique based on robust regression is presented , in 7 the least square statistical model is used and in 8 the re-weighted least square method is employed. Other techniques are based on geometric properties of ellipses or circles as in 9 - 10 - 11 . The goal of our work was to develop a simple routine both in terms of computational complexity and in term of performance accuracy. The elliptical shape detection routine can be applied in different topics, it can be used as a single module of a generic image processing pipeline as, for example, one relative to red eye removal, or one relative to signal detection etc. The proposed work has been tested by processing cluster maps provided by a red eyes detection algorithm. In this context, the role of our technique was to enforce the final classification in red or not red eye. In particular, through the shape identification, the algorithm discerns the elliptical shape of the pupil eye, handling some particular conditions, as the detection of pupils which have lost their elliptical shapes due to the glitter produced by the camera flash. Results show a robust behavior to discriminate not only the near elliptical shapes, but also the tidy ones. Furthermore, the computational cost is not too high due to the small size and binary format of input clusters. The rest of the paper is organized as follows. In the Section 2 a description of the main steps of the algorithm is presented; results obtained by processing a database of real images are showed in the Section 3. 2. ALGORITHM The algorithm processes binary input clusters in two main steps as shown in Figure 1. In the first step the ellipse detection, based on symmetrical properties of points belonging to the ellipse contour, is achieved. The second step is a refinement of the result obtained from the first part; it regards the computation and the comparison of two signatures, one relative to the detected ellipse and, the other one relative to the cluster object contour. The comparison comprises the check of fixed constraints relative to few selected features which characterize the two signature, if these are verified then an elliptical shape has been detected. The signature examination leads to a good reduction of the false positive percentage and preserves the hit rate as will be shown in the Section 3. Ivana Guarneri: [email protected]

Transcript of A signature analysis based method for elliptical shape

A signature analysis based method for elliptical shape

Ivana Guarneri, Mirko Guarnera, Giuseppe Messina and Valeria Tomaselli

STMicroelectronics - AST Imaging Lab, Stradale Primosole 50, Catania, Italy

ABSTRACTThe high level context image analysis regards many fields as face recognition, smile detection, automatic red eye removal,iris recognition, fingerprint verification, etc. Techniques involved in these fields need to be supported by more powerfuland accurate routines. The aim of the proposed algorithm is to detect elliptical shapes from digital input images. It canbe successfully applied in topics as signal detection or red eye removal, where the elliptical shape degree assessment canimprove performances. The method has been designed to handle low resolution and partial occlusions. The algorithm isbased on the signature contour analysis and exploits some geometrical properties of elliptical points. The proposed methodis structured in two parts: firstly, the best ellipse which approximates the object shape is estimated; then, through theanalysis and the comparison between the reference ellipse signature and the object signature, the algorithm establishes ifthe object is elliptical or not. The first part is based on symmetrical properties of the points belonging to the ellipse, whilethe second part is based on the signature operator which is a functional representation of a contour. A set of real imageshas been tested and results point out the effectiveness of the algorithm in terms of accuracy and in terms of execution time.

Keywords: Signature, Elliptical, Shape detection

1. INTRODUCTIONThe detection of elliptical or circle shapes is a widely treated argument of image retrieval topic. In1-2 techniques basedon the well known Hough transform (HT) are presented. The authors of3-4 propose methods based on the RandomizedHough Transform (RHT) which is a variant of the standard HT that requires less memory resources. Other works5 fitthe data points to an elliptical model, in particular, in6 a technique based on robust regression is presented , in7 the leastsquare statistical model is used and in8 the re-weighted least square method is employed. Other techniques are based ongeometric properties of ellipses or circles as in9-10-11 . The goal of our work was to develop a simple routine both in termsof computational complexity and in term of performance accuracy. The elliptical shape detection routine can be appliedin different topics, it can be used as a single module of a generic image processing pipeline as, for example, one relativeto red eye removal, or one relative to signal detection etc. The proposed work has been tested by processing cluster mapsprovided by a red eyes detection algorithm. In this context, the role of our technique was to enforce the final classificationin red or not red eye. In particular, through the shape identification, the algorithm discerns the elliptical shape of the pupileye, handling some particular conditions, as the detection of pupils which have lost their elliptical shapes due to the glitterproduced by the camera flash. Results show a robust behavior to discriminate not only the near elliptical shapes, but alsothe tidy ones. Furthermore, the computational cost is not too high due to the small size and binary format of input clusters.The rest of the paper is organized as follows. In the Section 2 a description of the main steps of the algorithm is presented;results obtained by processing a database of real images are showed in the Section 3.

2. ALGORITHMThe algorithm processes binary input clusters in two main steps as shown in Figure 1. In the first step the ellipse detection,based on symmetrical properties of points belonging to the ellipse contour, is achieved. The second step is a refinementof the result obtained from the first part; it regards the computation and the comparison of two signatures, one relative tothe detected ellipse and, the other one relative to the cluster object contour. The comparison comprises the check of fixedconstraints relative to few selected features which characterize the two signature, if these are verified then an ellipticalshape has been detected.

The signature examination leads to a good reduction of the false positive percentage and preserves the hit rate as willbe shown in the Section 3.

Ivana Guarneri: [email protected]

Figure 1. Algorithm block scheme.

2.1 Elliptical detectionThe algorithm pre-processes images in order to eliminate spurious pixels and for filling the possible holes caused by theglint. Considering that input images are binary maps, the hole filling function has been implemented in a very simple way(Figure 2) which is based on a consideration: if it does not exists a hole then each line will contain only two edge points,otherwise it will have more than two edge pixels.

(a) Hole detection (b) Hole filled

Figure 2. Hole detection procedure.

Each line is processed from left to right and all detected points belonging to a hole are filled. To avoid to fill the areasbetween two separate objects, a further control verified that in the up and down directions of the pixel belonging to thehole lay pixels belonging to the object. The filling operation is performed only on the image rows, because to processalso the image columns causes a strong fill-effect leading to a wrong elliptical detection. During the hole filling processthe edge pixel coordinates are stored into a list. Also their position, in terms of plane zone, is stored. Using the simplemethod suggested in12 , edge pixels are grouped, according to their position in the plane, in one of the four classes shownin Figure 3.

U

R

U

L R

D

R

D

U

L P R

D

U

L P

D

U

L P R

D

U

L P

D

Left Up

Left Down Right Down

Right Up

P P

PL

L

D

U

Figure 3. Edge pixels belong to one of the four plane sections.

To each edge pixel P correspond two points (Hp, Vp), defined in (1). The Hp, named ”horizontal buddy point”, comesfrom the intersection of the ellipse contour and the line passing through P and parallel to x-axis, while Vp, named ”verticalbuddy points”, comes from the intersection of the ellipse contour and the line passing through P and parallel to y-axis. Thistwo points will be used to find the symmetric point of P .

if P ≡ (xp, yp) ∈ LUorLD ⇒ HP ≡ (xp, y) ∈ right side of P

if P ≡ (xp, yp) ∈ RUorRD ⇒ HP ≡ (xp, y) ∈ left side of P

if P ≡ (xp, yp) ∈ LUorRU ⇒ VP ≡ (x, yp) ∈ down side of P (1)if P ≡ (xp, yp) ∈ LDorRD ⇒ VP ≡ (x, yp) ∈ up side of P

The Figure 4 shows, according to the P pixel position, where buddy points lay. For example, if P is on the right-upportion of the plane then the Hp will be on its left and the Vp will be down.

H Ph

w

Hp

Vp

P h

w

Hp

Vp

P

h

w

Hp

Vp

Ph

w

Vp

Hp

Figure 4. Examples of the four classes.

Once all the edge pixels have been classified in one of the four plane classes the symmetric pairs research is performed.Two points P and P’ are defined symmetric if they have the same w and h values (2) and (3). Where h is the distancebetween P and the Hp and, in an analogous manner, w represents the distance between P and Vp:

|PHp| = |P ′H ′p| = h (2)

|PVp| = |P ′V ′p | = w (3)

In the Figure 5 is shown an example of symmetry between two points, P and P’ :

HP

P

P’ VPHP’

VP’

w

h

HP

P

P’ VPHP’

VP’

w

h

Figure 5. Example of symmmetric points.

The research of symmetric pairs is the weakest step of the algorithm, actually, in case of absence of symmetry, thealgorithm does not perform any further processing. Considering the size of the input images (very small pixels clusters)it is highly probable to deal with clusters with no symmetric points. So, it must be highlighted that the performances of

the algorithm are limited by this important aspect. According to this observation the research of the symmetric points isextended to a neighborhood δ of its expected position (i.e., δ = 4 pixels). So the equations (2) and (3) become:

|PHp| = |P ′H ′p ± δ| = h (4)

|PVp| = |P ′V ′p ± δ| = w (5)

For each symmetric pair P(x,y) and P’(x’,y’) the relative center point is computed by using the following formulas:

x0 =(x + x′)

2y0 =

(y + y′)2

(6)

All tuples of points P, Hp and Vp (7), which have been originated by the same center point, are grouped and linked tothe relative center, taking into account how many times it has been computed. The points having the larger counted valuesare considered the elliptical center candidates. For each selected center is calculated the relative ellipse; each ellipse ischaracterized by the tuple (a, b, θ), where a and b are the half-minor and the half-major ellipse axes, and θ is the ellipseangle. The values of a, b and θ are computed by resolving the following linear system.

P ≡ (xp, yp)Hp ≡ (x1, yp)Vp ≡ (xp, y1)x1 6= xp

y1 6= yp

(7)

Firstly, each tuple (P,Hp, Vp) is shifted by (x0, y0) in order to move the elliptical center to the Cartesian origin (0, 0).Then the shifted coordinates are substituted in the ellipse parametric equation; thus we obtain a system of three equations(8) which solution is the tuple of parameters (d, e, f).

dx2p + expyp + fy2

p = 1dx2

1 + ex1yp + fy2p = 1

dx2p + ex1yp + fy2

1 = 1(8)

Obtained the values (d, e, f) it is possible to estimate the three geometric parameters (a, b, θ) by using the following:

θ =tan−1 e

d−e

2(9)

a =

√1

(d ∗ cos2θ) + (e ∗ sin θ cos θ) + (f ∗ sin2 θ)(10)

b =

√1

(f ∗ cos2θ)− (e ∗ sin θ cos θ) + (d ∗ sin2 θ)(11)

Once all possible ellipses have been detected, the algorithm will select the best one in terms of best matching with theobject area. So, a local peaking algorithm is applied to select the best (a, b, θ) tuple. The classification of a cluster areainto ”elliptical” or ”not-elliptical” is based on the ratio evaluation between the cluster object area and the detected ellipsearea. The ellipse which better approximates the cluster is the one which ratio value is nearest to the value 1. Furthermore,at least the 50% of the object area must belonging to the ellipse area, this constraint helps to avoid the detection of wrongellipses. According to the specific target application, it is possible to introduce suitable constraints to enforce the ellipticaldetection. For example, we have tested the algorithm to detect the pupil eye shape, so, as selection criteria, it has been alsotaken into account the ratio between the two parameters a (half of major axis) and b (half of minor axis); when this valueis under a given threshold it means that the cluster area is too much crashed and it probably does not represent an eye.

2.2 Signature AnalysisThe second part of the algorithm regards the matching between object and ellipse signatures. The signature is a functionalrepresentation of a contour and is invariant to the translation the scale and the rotation. The Figure 6 shows the circle andthe square signatures.

�� ��� � � �

� � ���� � ��� �

Figure 6. Example of signatures relative to a circle and to a square contours.

The idea is to measure the similarity between a reference signature, which is the one relative to the ellipse detectedin the first part of the algorithm, and a test signature, which is the one relative to the object. The more regular and tidyis the signature of the object, the more likely is the detection of an elliptical shape. Firstly, the algorithm calculates thecontours of the object and of the ellipse. As starting contour point is selected the first edge point detected scanning theimage in a left-right and top-down order. Then the object contour is computed by using the label relative to the position(left, right etc.) of each edge points (1). The same process is achieved to generate the ellipse contour. Finally, for each oneof the shapes (ellipse and object) the relative signature is estimated. The signature can be generated in various ways, wehave used the distance of boundary points from the center of gravity, assuming as object center of gravity the center of thedetected ellipse.Signatures have been characterized by the following features:

1. Length of signature;

2. Amplitude of local max value;

3. Standard deviation.

The algorithm detects an elliptical shape into the image if the constraints (12) are verified.

∆length < TH1

∆stand dev < TH2

∆max amplitude < TH3

(12)

The threshold values TH1, TH2, and TH3 have been chosen by empirical analysis of the statistical signature trends.An example of ellipse detection and signature analysis is shown in Figure 7. The input of our algorithm is the binary inputillustrated in Figure 7-(b) (In our tests the binary clusters are provided by a red eye detection algorithm). Firstly is foundthe ellipse which approximates the object into the cluster (Figure 7-(c)). Then the algorithm computes the two signatures,

one relative to the object and one relative to the ellipse. As show in Figure 7-(d) the two signatures are very similar. Infact, shifting in the left direction the object signature (Figure 7-(e)) it closely overlaps the ellipse’s signature. In this caseall the conditions in (12) are verified and the algorithm detects an elliptical shape.

(a) input (b) Binary input. (c) Ellipse detected

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 103 109 115 121 127

points of contours

Sig

natu

res

Object Signature

Ellipse signature

(d) Signature comparison.

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 103 109 115 121 127

point of contours

Sig

nau

res

Object Signature shifted

Ellipse signature

(e) Comparison after shifting the object signature

Figure 7. Example of ellipse detection obtained by signature comparison.

An example which illustrates a case where the signature analysis leads to a rejection of an misleading ellipse detectionmade in the first part of the algorithm is reported in the next figure. We know a priori that the input cluster does not containan elliptical object, but our algorithm detects an ellipse which approximates the object (Figure 8-(b)). The analysis and thecomparison, based on constraints (12), certify that the two signatures, the one relative to the object contour and the otherone relative to the ellipse contour, are too much different as it can be observed in Figure 8-(a) and in Figure 8-(b). Thus,the ellipse accepted in the first step is rejected in the second one.

3. RESULTSIn this section are reported results obtained by testing the algorithm over a dataset of around 1.500 images coming froma previous red eye detection algorithm. The proposed approach has been used to enforce the final classification in red ornot red eyes, by analyzing the object shape, and by verifying if it is elliptical as the pupil one. The following charts showthe accuracy of the algorithm and, being known a priori which input clusters represent eyes and not eyes, we have usedthe following terminology: the EYE represents the input eye clusters detected as elliptical, while the NO EYE representsclusters with no eyes and correctly classified as not containing elliptical shapes. The False Positive (FP) are input clusterswhich do not contain eyes, but are wrongly classified as containing elliptical shapes. Finally, the elements marked as LOSTare the input clusters which are not detected as elliptical shapes but are actually eyes. In order to highlight the improvementprovided by the signature analysis, we have tested the algorithm firstly disabling and then enabling the second step. Figure 9shows the accuracy obtained without the signature analysis. It means that only the first step of the algorithm, where thedetection of the ellipse is based on the comparison of the object and ellipse areas, has been performed. In this case thepercentage of false positive is of around 46%, which is to high for our target. Figure 10 shows results obtained by using

Ellipse detection

Ellipse’s signature

(a) Ellipse signature trend

Object contour

Contour’s signature

(b) Contour signature trend

Figure 8. Example of rejection of an misleading detected ellipse through the signature analysis.

the signature analysis. It can be observed that the second part of the algorithm really improves performances because thefalse positive percentage decreases by 15%, preserving the eye percentage which decreases only by 1%. Furthermore, itis important to specify that this elliptical detector has been integrated into a pipeline that contains further filters and thuspermit to avoid higher computational costs on eyes candidates analysis.

Accuracy with No Signature

91%

9%

54%

46%

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

EYE FP LOST NO_EYE

EYE

FP

LOST

NO_EYE

Figure 9. Accuracy with no-signature analysis.

4. CONCLUSIONSIn this paper an efficient ellipse detection method has been proposed. The approach does not involve complex mathematicalcomputations and does not need heavy memory recourses differently to other classical methods as the ones based on theHough transform or others based on statistical approaches. This algorithm processes images in binary format and isarticulated in two main steps: in the first part the best ellipse, which better approximates the object shape, is detected; inthe second part a strict analysis and comparison between the object and the ellipse signature is performed. A set of realimages has been tested as experimental validation of the approach and the final results show a robust behaviors in detectingalso not near elliptical shapes as those affected by occlusions coming from external shape alterations.

Accuracy with signature analysis

90%

31%

10%

69%

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

EYE FP LOST NO_EYE

EYE

FP

LOST

NO_EYE

Figure 10. Accuracy with signature analysis.

REFERENCES1. P. V. C. Hough, “Method and means for recognizing complex patterns,” U.S. Patent US3069654, 1962.2. H. Yuen, J. Illingworth, and J. Kittler, “Detecting partially occluded ellipses using the hough transform,” Image and

Vision Computing 1898, pp. 31–37, 1989.3. P. Kultanen, L. Xu, and E. Oja, “Randomized hough transform,” Medical Imaging: Image Processing 1, pp. 631–635,

1990.4. R. A. McLaughlin, “Randomized hough transform: Improved ellipse detection with comparison,” Pattern Recognition

Letters 19, pp. 299–305, 1998.5. G. Danuser and M. Stricker, “Parametric model fitting: from inlier characterization to outlier detection,” IEEE Trans.

Pattern Analysis and Machine Intelligence 20, pp. 263–280, 1998.6. P. Meer, D. Mintz, A. Rosenfeld, and D. Kim, “Robust regression methods for computer vision: A review,” IJCV 1,

pp. 59–70, 1991.7. W. Gander, G. Golub, and R. Strebel, “Least square fitting of circles and ellipses,” BIT Numerical Mathematics 34,

pp. 558–578, 2005.8. P. Huber, Robust Statistics, Wiley, New Jersey, 2004.9. X. Ying and H. Zha, “Efficient detection of projected concentric circles using four intersection points on a secant

line,” Pattern Recognition, ICPR, pp. 1–4, 2008.10. Y. Xie and Q. Ji, “A new efficient ellipse detection method,” International Conference on Pattern Recognition,

pp. 957–960, 2002.11. A. Ajdari, R. Karim, and F. N. Qaragozlou, “Fast circle detection using gradient pair vectors,” Proc. of Digital Image

Computing: Techniques and Applications, pp. 879–887, 2003.12. C.-T. Ho and L.-H. Chen, “A high-speed algorithm for elliptic object detection,” IEEE transactions on image pro-

cessing 5, pp. 547–550, 1996.