A shape representation scheme for 2D images using distributions of centroid contour distances and their local variations T. Gokaramaiah1, P. Viswanath1, B. Eswara Reddy2 1
1 Dept. of Computer Science and Engineering, Rajeev Gandhi Memorial College of Eng. and Tech., Nadyal-518501. 1
E-mail:
[email protected],
[email protected]
2
2
Dept. of Computer Science and Engineering, JNTUA college of Engineering, Anantapur-515002. 2
E-mail:
[email protected]
Abstract.Content based image retrieval system (CBIR) retrieves images from a database based on the contents of the query image.Retrieval based on the shape of the 2D object present in the image is important in several applications. Shape of an objectis invariant to translation, scaling, rotation and mirror-reflection. Hence, the representation scheme which possesses all theseproperties is important. Signature histogram and kth order augmented histogram have all invariance properties [17]. But,they are applicable only to convex shapes. This representation scheme assumes that centroid to contour distance is a functionof angle (with a predefined axis). This is not true for non-convex and open shapes, since for some angles there can be more than onecentroid to contour distance. The current paper does not make this assumption, but considers distribution of centroid tocontour distances. Further, to reduce the false positive rate, distribution of local variations of the centroid contour distancesare also considered. Experimental studies are done using a standard image database and handwritten symbols database. The present technique is comparedagainst a similar recent technique. Keywords: Signature, Signature histogram, Kth order augmented histogram.
1 Introduction Shape recognition has severalapplications, like content-based image retrieval [20], character recognition [4], object classification where input is image of an object [18], online hand-drawn text or shaperecognition [1], writer recognition [15], etc. In general, shape representation methods are categorized as (i) contour-based methods, and (ii) region-based methods. In contour based methods only the boundary is taken into account, whereas in region-based methods entire region is considered. Each category is further divided into global and structural approaches. Structural approach sees the object as consisting of several parts along with their relationships [10]. Some of the structural approaches are chain code representation [5, 6], polygon decomposition [11, 12], smooth curve decomposition [2], etc. The other approach is
V.V. Das and N. Thankachan (Eds.): CIIT 2011, CCIS 250 pp. 320–324, 2011. © Springer-Verlag Berlin Heidelberg 2011
T Gokaramaiah, P Viswanath and B Eswara Reddy
321
called global which represents boundary as a whole. The area, circularity (ratio of squared perimeter and area), eccentricity (ratio of major axis’ length and minor axis’length), major axis orientation, bending energy, etc., [19] are some of simple global approaches. Shape signatures [14], boundary moments [13], etc. are other relevant global approaches. Elaborated reviews of several methods are given by Zhang et. al. [20].Shape signature is a one dimensional function which corresponds to the boundary points and there are several shape signatures like centroidal profile, complex coordinates, centroid distance, tangent angle, curvature, turning function, two segmented angle function [14, 20, 16]. The centroid distance signature [20] or centroid-contour distance (CCD) curve [18] is a function which is a mapping from a set of angles to a set of distances. Angle is taken between a predefined axis and the line joining centroid to a boundary point. Distance is the distance of the line joining centroid to the boundary point. In two segment turning function (2STF) [16] approach the angle between two consecutive segments is calculated. 2STF representation is calculated by traversing a polygon in anticlockwise direction and assigning certain value of 2STF for each linear segment curve. The x-value of step is equal to length of linear segment which is normalized with respect to the complete curve. The y-value is directional angle of the line segment with respect to its previous segment. We have compared our approach with 2STF.This is a generalization of our earlier shape representation method called signature histograms and kth order augmented histograms [17] which are suitable only for convex shapes. The present paper proposes “a shape representation method using distributions of centroid contour distances and their local variations” which works for both convex and non convex shapes. The rest of the paper is organized as follows. Section 2 describes about the proposed shape representation method. Section 3 gives the kth order augmented representation method. Section 4 presents the hierarchical retrieval system which uses the proposed scheme. Section 5 gives the experimental details that were conducted to find the effectiveness of the proposed scheme against a similar method. Finally, Section 6 concludes the paper.
2 Distribution of distances from centroid to boundary Centroid distance signature fails for non convex shapes, because centroid distance signature function has more than one length for a same value. New signature is defined based on probability theory, which is called probability mass function (PMF) for shape. The lengths are taken from centroid to boundary with respect to the predefined horizontal axis. The lengths are normalized by dividing all lengths with the maximum length value, so that all the lengths are in the range [0,1]. Probability mass function for shape was derived from these lengths. The horizontal axis of PMF for shape is divided into equal intervals in the range [0,1], each interval is called a bin. Ifa length falls within a particular bin, then count of that corresponding bin is incremented by one. This process has to be repeated for all lengths. The bin count indicates frequency of a particular length within a range. All bin count values are divided by total number of lengths, which gives probability mass function for shape(PMF for shape). This PMF for shape is invariant to rotation, scale, translation
322
A shape representation scheme for 2D images
and flip. Let the set of contour points be S = {(x1 , y1), (x2, y2), ..... (xM, yM)}. We assume that this is an ordered set where the ordering is obtained as follows. Let (xc, yc) bethecentroid of the contour, i.e., mean of the points in S. The contour is translated such that centroid becomes the new origin. Starting from the nearest point to origin the contour is traversed in the anti-clockwise direction. The ordering of S is according to this ordering. The lengths L = (l( 1), l( 2),..,l( M)) are distances from centroid (xc, yc) to contour points. These lengths are normalized by dividing each length by the maximum length. The interval [0,1] is divided into equi-width bins. Let the number of lengths falling into the ith bin be bi. Then in the PMF for shape, the ith bin’s probability is bi/ M.This PMF is called the 0th order PMF and is denoted by PMF0. The PMF0 for any shape is invariant to translation, scale, rotation and flip.
3 kth order augmented PMF for shape PMF for shape works for non convex shape but it has a drawback, namely it increases false positives. This problem was solved by taking into account the distribution of local variations of the centroid contour distances. kthorder difference distance is defined as :
For k = 1 to M-1, PMFs are obtained similar to PMF0. These PMFs are respectively denoted by PMF1,PMF2,…,PMFM-1. A shape is represented by augmenting all these PMFs.That is the representation for the shape is , and this is called the kth order augmented representation .
4 Shape based kth order hierarchical retrieval system Shape based image retrieval system, retrieves similar images from database for given input image of an object. Each shape is represented by its kth order augmented representation. From a database of these representations, based on the query image, similar shaped objects are retrieved. The searching is done in a hierarchical way. That is, first only 0th order PMFs (i.e., PMF0) are compared and a few matching images are stored. In our experiments, 25% of matching (i.e., nearest) images are retrieved. Then, from this subset of images, further filtering is done based on PMF1. Likewise the searching is done and finally 5 images are presented the user.
T Gokaramaiah, P Viswanath and B Eswara Reddy
323
5 Experimental results Proposed method PMF for shape was tested using leafs database available at the University of California Museum of Paleontology (URL: http://www.ucmp.berkeley.edu/science/clearedleaf.php)and a handwritten symbols database which consists of 16 handwritten symbols like +, @, #, etc.Leaves database consists of a total of 1500 images. For each image four more versions are created by applying transformations like rotation, scaling, translation, flip. So, a total of 6000 images is present in the leaves database. Out of this 300 images are randomly chosen for testing purpose. The handwritten symbols database consists of 1600 images, collected from ten different persons where each person is asked to draw the symbol on a writing pad for ten times (each time the writing pad is slightly rotated). Out of these 1600 symbols, 80 are chosen for the testing purpose. The results are summarized below which shows recall rates for each data set. Comparison is done with the 2STF method [16]. Table 1 Results showing recall rates. Method 2STF The proposed method
Leaf images 0.55 0.81
Data Set Handwritten symbols 0.67 0.84
6 Conclusions This paper presented a new shape based representation method based on distribution of distances from centroid to contour which is invariant to translation, scale, rotation and flip which is simple to implement, but is effective at the same time. The proposed representation works for both convex, non-convex and open shapes. The proposed method is compared with a similar recent method and is shown to be effective. Acknowledgments.The work is supported by an AICTE sponsored Project (under RPS Scheme). Ref: File No: 8023/BOR/RID/RPS-51/2009-10.
References 1. T. Artieres, S. Marukatat, and P. Gallinari.Online handwritten shape recognition using segmental hidden markov models.IEEE Transactions on Pattern Analysis and Machine Intelligence, 29(2):205–217, 2007. 2. S. Berretti, A. Bimbo, and P. Pala.Retrieval by shape similarity with perceptual distance and effective indexing.IEEE Transactions on Multimedia, 2(4):225–239, 2000.
324
A shape representation scheme for 2D images
3. H. Blum. A transformation for extracting new descriptors of shape, in: W. Whaten-Dunn (Ed.), Models for the Perception of Speech and Visual Forms. MIT Press, Cambridge, MA, 362–380, 1967. 4. V. S. Chakravarthy and B. Kompella.The shape of handwritten characters.Pattern Recognition Letters, 24:1901–1913, 2003. 5. H. Freeman. On the encoding of arbitrary geometric configurations.IRE Trans. Electron.comput. EC-10, pages 260–268, 1961. 6. H. Freeman and A. Saghri. Generalized chain codes for planar curves.Proceedings of the Fourth International Joint Conference on Pattern Recognition, Kyoto, Japan:701–703, 7–10 November 1978. 7. K. Fu. Syntactic Methods in Pattern Recognition. Academic Press, New York, 1974. 8. T. Gevers and A.W.Smeulders.Combing color and shape invariant features for retrieval.IEEE Transactions on image processing,9(1):102–119, 2000. 9. R. C. Gonzalez and R. E. Woods.Digital Image Processing. Second Edition, Pearson Education, 2002. 10. L. Gorelick, M. Galun, E. Sharon, R. Basri, and A. Brandt. Shape representation and classification using the Poisson equation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(12):1991–2005, 2006. 11. W. Groskey, P. Neo, and R. Mehrotra.Index-based object recognition in pictorial data managemenet.Computer Vision Graphics Image Processing, 52:416–436, 1990. 12. W. Groskey, P. Neo, and R. Mehrotra.A pictorial index mechanism for model-based matching.Data Knowlege Engineering, 8:309–327, 1992. 13. M. Sonka, V. Hlavac, and R. Boyle.Image Processing, Analysis and Machine Vision. Chapman & Hall, London, UK, NJ, 2 edition, 1993. 14. P.J. Van Otterloo. A Contour-Oriented Approach to Shape Analysis.Prantice-Hall International(UK) Ltd, Englewood Cliffs, NJ, 2 edition, 1991. 15. S. N. Srihari, S.-H.cha, H. Arora, and S. Lee. Individuality of handwriting.Journal of Forensic Sciences, 47(4):1–17, 2002. 16. O. Starostenko, C. K.Cruz, A. Chavenz-Aragon, and R. Contreras. A novel shape indexing method for automatic classification of lepidoptera. IEEE Computer Society, 2007. 17. T.Gokaramaiah, P. Viswanath, and B. E. Reddy. A novel shape based hierarchical retrieval system for 2d images.ARTcom-2010, IEEE Computer Society, pages 10–14, 2010. 18. Z. Wang, Z. Chi, and D. Feng. Shape based leaf image retrieval. In IEE Proc.-Vis. Image Signal Process., volume 150, Feb 2003. 19. I. Yong, J.Walker, and J. Bowie. An analysis technique for biological shape.Computational Graphics and Image Processing, 25:357–370, 1974. 20. D. Zhang and G. Lu. Review of shape representation and description techniques. Pattern Recognition, 37:1–19, 2004.