Retrieval of Similar Shapes Under Affine Transform Using Affine Length Parameterization 1

Problem statement: In this study, a new descriptor for shape retrieval under affine transformations had been proposed; the affine length parameterization was used in this approach. Approach: The zero crossing of affine curvature was used to extract a descriptor of shapes in database. For each two successive zero crossing points we extract two parameters: the first parameter was a maximal surface area of the triangle constructed by these points and a point between them. The second parameter is the average of affine curvature of the arc constructed by these two points. Results: The method was also evaluated objectively through a three classified databases which are a subset of the MCD database with a vast variety of shapes. The obtained results and the comparison with geometric moment and Fourier descriptors indicated a promising performance of our method. Conclusion: In this study, we examined the performance of the proposed descriptor under affine transformations. It was observed that the performance of the proposed method is promising even under severe deformations caused by shear.


INTRODUCTION
Image databases are consisted of single objects which can be simplified as shape images. In these cases, image retrieval becomes shape retrieval. Shape is also one of the important visual features for image representation. Shape descriptors can be divided into two main categories: region-based and contour-base methods (Choras, 2007). Region-based methods use the whole area of an object for shape description. Regionbased shape descriptors can be applied to general applications. Some of the region based methods are grid based method, geometric moments and moments constructed orthogonal functions (Zhang, 2002), Zernike moment descriptors (Zhang and Lu, 2002a), Fourier descriptors (Sonk et al., 1998;Sajjanhar et al., 2008;Zhang and Lu, 2002b). For region based matching of shapes. Region based method, however, they usually involve more computation and its descriptors usually need more storage than contourbased descriptors. While contour-based methods use only the information present in the contour of an object, it transforms a shape image into one dimensional signature function for shape representation; it is much more efficient than the generally complex region based representation techniques which require two dimensional processing. Since they are computed using only boundary pixels, in general, their computational complexity is low and the sizes of their features are compact. Some of the contour-based methods are boundary moment descriptors (Chen, 1993;Sonk et al., 1998), curvature scale space descriptor (Abbasi et al., 2000;Mokhtarian and Bober, 2003;Mokhtarian et al., 1996;Mokhtarian and Mackworth, 1992) and Fourier descriptor (Zhang and Lu, 2005). A number of shape representations have been proposed to recognize shapes under affine transformation. Some of them are the extensions of well known methods, such as Fourier descriptors (Arbter et al., 1990), moment invariants (Flusser and Suk, 1993;Guggenheim, 1963) and CSSD with affine length parameterization (Mokhtarian and Abbasi, 2001). In this study, a new descriptor based on a contour is proposed for 2d shape retrieval under affine transformations. The proposed method uses the smoothed contour for extracting the vectors describing a shape under affine transformations. After smoothing the curve, we calculate the surfaces areas of triangles constructed by each successive zero crossing points and a point between them so that this surface area is maximal, then we choose the n (the value of n is justified in the part of discussion) first values of the biggest surfaces areas of the triangles. These values construct the first vector of our descriptor, then we calculate the average affine curvature for each arc between two successive zero crossing points constructing the chosen triangles for constructing the second vector. Both vectors are used to charactering the shape. In this study we will examine the utility of using affine length rather than arc length to parameterize the curve prior to computing the proposed method. The proposed method is then used to find similar shapes from 280 shapes extracted of MCD database with a vast variety of shapes. Also the two classified databases consist of original as well as affine transformed shapes. This study begins by describing the proposed method, the experimental results, the discussion and finally the conclusion.

MATERIALS AND METHODS
Affine length: In computer vision, we always look for those descriptors of a shape which are invariant under certain transformations. For example, curvature is invariant under similarity transforms; i.e. rotation, translation and uniform scaling. However, under general affine transforms, the change in curvature is not a linear function of the transformation matrix. Affine curvature has been defined as an alternative for curvature which changes linearly under affine transforms. Therefore the normalized arc length parameter Eq. 1 is replaced by the normalized affine length parameter (Zhao and Chen, 1997) Eq. 2: (2) Affine curvature: The definition of affine curvature is based on affine length parameterization τ Eq. 2, which is a replacement for arc length parameterization s. The main disadvantage of the affine length is that its computation requires higher order derivatives.
However, by using the method described in (Mokhtarian and Abbasi, 2001), we can parameterize the curve. The definition of affine curvature is based on affine length parameterization, as follows: Consider a parametric vector equation for a continuous curve Γ: where, τ is the normalized affine length parameter for the original curve Γ. Affine curvature is then defined as the following: It is much easier to compute affine curvature if it is expressed as a function of arbitrary parameter u. The final formula for affine curvature as a function of an arbitrary parameter u is obtained as follows (Mokhtarian and Abbasi, 2001;Matusiak, 1999): && , x &&& and x % denote the first, second, third and fourth derivatives of x with respect to u respectively. Derivatives of y are defined similarly. The main advantage of this descriptor is expected to be invariance under general affine transformations (Mokhtarian and Abbasi, 2001).
Curve smoothing prior to affine curvature measurement reduces the effects of noise. The computation starts from convolving each coordinate x(u) and y(u) of the curve with a Gaussian function g(u,σ). In continuous form we have: The 1D Gaussian function g(u,σ) of width σ is defined as follow: where, "*" denotes the convolution operation, according to the properties of convolution, the derivatives of every component can be calculated easily: The same for X &&& and X % . We will have similar formulas for Y. As the exact form derivative of each order of g(u,σ) is known, the affine curvature of an evolved digital curve can be computed easily.
Vectors descriptor extracting: before extracting the vectors descriptor, we must smooth the curve to reduce the effects of noise. The standard deviation parameter σ must be properly chosen, the information imported by the curve must be kept and the noise must be eliminated. For this reason, we have fixed σ at σ 0 = 5 because experiments showed that σ = 5 gave good results with almost all shapes. The affine curvature zero crossing points should be determined at this level of smoothing. Due to the denominator in Eq. 4 affine curvature has not been defined at inflection points. As a result, whenever conventional curvature approaches to zero, affine curvature goes to infinity. The affine curvature zero crossings of the curve Γ σo will be obtained by using method (Mokhtarian and Abbasi, 2001). For every curvature zero crossing point, we associated a point P i of coordinates (x(u),y(u)), 1≤i≤N where N is the number of inflections points of the curve Γ σo . For each two successive zero-crossing points P i and P i+1 , we search a point S i of the arc t t 1 P P + ) of the curve Γ σo where the surface of the triangle P i S i P i+1 is maximal as illustrated in the Fig. 1, then we choose the n first maximal value of the surfaces areas calculated. Denote V S the vector descriptor constructed by n maximal value of the surfaces areas of the triangles called Surface-Vector. Then we calculated the average affine curvature between each successive zero-crossing points P i and P i+1 where 1≤i≤n for constructing the second vector called Curvature-Vector noted V C .

Similarity measurements:
The process of the feature extraction is applied to each curve in the database. At the end, each curve in the database is represented and indexed using its feature vectors. Fig. 1: Part of the boundary curve of the shape Given a query feature vectors V CQ and V sQ , respectively the Curvature-Vector and Surface-Vector and the target feature vectors V CT and V ST . For measuring the similarity between the query and the database shape, we have calculated the distance between the feature vectors of them, the City-block distance is used since it is very easy to compute. If we suppose two points p = (x,y) and q = (u, v), the distance function is defined as follows: Then the similarity between the query shape Q and the shape of the database (target) T is measured as distance between the query feature vectors and target feature vectors which defined as: where,

General affine transformation: A general affine transformation T in R 2 is defined as
where, X∈R 2 , A is a nonsingular square matrix (a real matrix 2×2 with positive determinant) representing the rotation, scaling and shearing transformations and the vector T∈R 2 represents the translation vector. The Eq. 6 can be represented as follows: where, (x (τ),y (τ)) represents a point on the contour parameterized by the affine length parameter τ, (x a (τ),y a (τ)) is the corresponding point after the affine transformation. The affine transformation matrix A can be expressed by several parameters as follows: x y S 0 cos sin 1 k A 0 S sin cos 0 1 Scaling, rotation and shear may be represented by the following matrices: If T is an affine transformation and A its matrix, the surfaces areas of the original and affine transformed curve respectively is related by this equation: By substituting x and y in Eq. 4 by x a and y a from Eq. 7, we obtain the following result: where, x and x a denote affine curvature of the original and affine transformed curves respectively.
Invariant to translation and rotation: since we use the affine length parameterization, the vectors V S and V C are the same for both the original shape and the transformed shape under translation and rotation.
Invariant to scaling: the general affine transformation becomes the scaling transformation when we substitute the matrix A by the matrix A scaling , the Eq. 8 is rewritten as: where, α = S x .S y and Area(∆) represents the surface area constructing the vector V S , we normalized this vector by dividing each component of this vector by the maximal value of these components. By substituting the matrix A by A scaling in Eq. 9 the relation between the affine curvature of the original shape and the transformed shape under scaling is given by: The vector V C is constructed now, by normalizing each component of this vector by a maximal value of these components. Therefore, our descriptor becomes invariant to scaling transformation.
Invariant to shear: the shear transformation is represent mathematically by the Eq.7 if we substitute the matrix A by A shear , as the determinant of this matrix is unit (det(A shear ) = 1), Eq. 8 and 9 becomes: The Eq. 12 and 13 show that the surface triangle area and the affine curvature are the same for both original shape and the transformed shape under shearing transformation, by following the vectors V S and V C are invariant to shear transformation.

RESULTS
Retrieval performance test: in order to test the retrieval performance and the measurement of the proposed method using MCD database. The retrieval performance of our method is also compared with widely used shape descriptors: Geometric Moment Descriptor (GMD) and Fourier Descriptor using centroid distance (FD).

Database of test:
The MCD database comprises 40 curve categories, each corresponding to a curve drawn from an MPEG-7 curve class. Each category in the dataset contains 14 curve samples that correspond to different perspective distortions of the original curve. We use 280 images as our test set of the MCD database, these shapes have been classified into 20 class as mentioned in the Fig. 2 (14 similar shapes in each  class). The 20 class of shapes are used to test the overall robustness of a shape descriptor. In our experiment, all the 280 shapes from the 20 groups are used as queries to test the retrieval.

Performance measurement and test dataset:
There are a number of ways to evaluate a shape descriptor. In the field of shape retrieval, precision and recall are the most widely used methods. Basically, recall measures the capacity to retrieve relevant items from the database and precision measures the retrieval accuracy:

Number of relevant returned images Precision
Number of returned images =

Number of relevant returned images Re call
Number of images in the class of the query = The subset of the MCD database mentioned above are used to compare the retrieval of the three methods using the rappel-precision curve, all the 280 shapes in the subset are used as queries. The common retrieval performance measure precision and the recall are used as the evaluation of the query results. For each query, the precision of the retrieval at each level of the recall is obtained. The result precision of retrieval is the average precision of all the queries retrievals. The average precision and recall of the retrieval using the three descriptors are shown in Fig. 3. To test the retrieval performance of the proposed method, we have used the subset of the MCD database as mentioned below. After making a sequence of experiments, we concluded that by giving the parameter α in Eq. 5 the value 0.7, the best results can be achieved. The retrievals of some queries are shown in the Fig. 4.
Invariance to shear: we will examine the performance of the proposed method under shear transformation with the constructed database as mentioned under. The measure of shape deformation depends upon the parameter k called shear ratio in the matrix A shear . In the present form of the matrix A shear , x axis is called shear axis, as the shape is pulled toward this direction. Figure 5 shows the effects of shear transformation on the shapes, the deformation is much more severe for values k is superior than 1.
To create a database, we choose nine different values for shear ratio parameter k, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2 and 2.5. We then apply the transformation on a database of 40 original object shapes, each class of MCD database is represented by one shape from this class. From every original object, we obtain 9 transformed shapes with different values of k as mentioned before. Therefore the database consists of 40 original and 360 transformed shapes. Therefore, the database consists of 400 shapes. We then carry out a series of experiments on this database to verify the robustness of the proposed method under shear transformation. Every original shape was selected as the input query and the first 10 outputs of the system were observed to see if the transformed versions of the query are retrieved by the system. We found out that for 99% of queries, all transformed versions of a shape appear in the first 10 outputs of the system. The results for some queries and the shapes retrievals by system are presented in Fig. 6.
Invariance to scale transformation: to examine the performance of our descriptor under uniform scaling transformation (S x = S y = s), we create a database by choosing nine different values for scaling parameter s, 0.75; 1.25; 1.50… 3 as shows in Fig. 7. We then apply the scaling transformation as we made for shear examine. The results for some queries and the shapes retrievals by system are presented in Fig. 8.

DISCUSSION
The choice of n, the size of the vectors V S and V C must takes in consideration the following reasons: • The number n must be big enough so that the characteristic vectors represent well the shape, but still take into consideration the time of calculation • It must not depend on a threshold which is related to the triangles areas calculated because we can lose important information concerning the shapes whose surfaces areas decrease sharply • Some shapes after smoothing the number of triangles found very few, sometimes it does not exceed 10 triangles, then the value of n should not be very big For these reasons we fixed the value of n in 20. The boundary curve of some shapes after smoothing doesn't contain the sufficient triangles (n<20), so the vectors V S and V C are not completed. Therefore, for completing these vectors, we completing their components by zero.

CONCLUSION
In this study, we have proposed a method which uses the shape contour for indexing the shape.
Experiments have been performed on the MCD database.
Experiments performed show the effectiveness of the proposed method and it is better than other methods using a subset of MCD database. We also show the robustness of our method under affine transformations.