International Journal of Engineering and Applied Physics (IJEAP)
Vol. 1, No. 2, May 2021, pp. 192–197 · ISSN: 2737-8071

Shape Classification Via Contour Matching Using the Perpendicular Distance Functions

Ratnesh Kumar1, Kalyani Mali2
1Dept. Of Computer Science & Engineering, University of Kalyani, kalyani, Nadia, West Bengal-741235, India
2Dept. Of Computer Science & Engineering, University of Kalyani, Kalyani, Nadia, West Bengal-741235, India

Abstract

We developed a novel shape descriptor for object recognition, matching, registration and analysis of two-dimensional (2-D) binary shape silhouettes. In this method, we compute the perpendicular distance from each point on the object contour to the line passing through the fixed point. The fixed point is the centre of gravity of a shape. As a geometrically invariant feature, we measure the perpendicular distance function for each line that satisfies the centre of gravity of an object and one of the points on the shape contour. In the matching stage, we used principal component analysis concerning the moments of the perpendicular distance function. This method gives an excellent discriminative power, which is demonstrated by excellent retrieval performance that has been experimented on several shape benchmarks, including Kimia silhouettes, MPEG7 data set.

Keywords: Perpendicular distance functions; Principal component analysis; (PCA); Straight line; Contour; Moore boundary

Received: Sep 29, 2020 · Revised: Jan 29, 2021 · Accepted: Feb 4, 2021 · Published: 2021-05-25

Corresponding author: Ratnesh Kumar, [email protected]

This is an open access article under the CC BY 4.0 license.

How to cite: Ratnesh Kumar, Kalyani Mali, "Shape Classification Via Contour Matching Using the Perpendicular Distance Functions," International Journal of Engineering and Applied Physics, vol. 1, no. 2, pp. 192–197, 2021.

1. INTRODUCTION

Geometrically invariant feature in shape classification and matching is a very critical problem in computer vision, which is widely used in many applications such as object recognition [1], [2], part structure and articulation [3], character recognition [4], robot navigation [5], shape evolution [6], topology analysis in sensor networks [7] and medical image and protein analysis [8], etc. It is a very difficult task to recognize and classified a similar object from an object database which looks similar to human vision. Therefore, one key problem of geometrically invariant (translation, rotation, scaling, etc.) shape matching is to define a shape descriptor which is informative, discriminative and efficient for the matching process. An excellent shape descriptor should not only tolerate the geometric differences of objects from the same category but at the same time, it should allow discriminating objects from different shape classes. There are mainly two types of shape descriptors: contour-based and region-based descriptor, the details of classification of shape descriptor is given in [14].

In the study stage [14],[15], we can see that local or global features alone are not to be excellent features for shape classification. Global feature vectors overwhelmed by local feature vectors or local feature vectors overwhelmed by global feature vectors. In addition, many expensive computational feature vectors having large dimensions overwhelming the small dimensions feature vectors even though the small feature vectors may contain large discriminating information.

Therefore, we need an effective feature selection algorithm that reduces expensive computational feature vectors into small dimensions and combines large and small dimensions feature vectors into a comprised single feature vector. In this paper, we develop a two-dimensions (2-D) feature vectors for binary object silhouettes known as perpendicular distance functions. To effectively combine the new features with traditional small dimensions shape features and produce a compact feature vector for object classification. We used principal component analysis (PCA) for dimensions reduction and selection tools on moments of standardized perpendicular distance functions. Its decorrelation ability serves to decorrelate redundant features, and its energy packing property serves to compact useful information into new dominant features.

The rest of this paper is organized as follows: Section II presents the some basics of shape-preserving features in details. Section III discusses shape descriptors using perpendicular distance function. Section IV presents experimental results. Finally, section V draws some conclusions.

2. SHAPE FEATURES

One key problem in contour-based object classification and recognition in computer vision is a sampling that produced lossy information. In this case, shape feature vectors depend on points of a contour that intolerance contour sampling. Contour sampling, used by [1], [3], find shape-preserving features by considering only some points from number of points on object contour, that results misclasification of objects.

Let ⟨ ⟩ ⟨ ⟩denotes the number of points on the outer contour and index is the points along the outer contour of a given shape. To compute the perpendicular distance functions along a given straight line is the most important step in our algorithm. The method which computes the perpendicular distance function on a given straight line across all points on outer contour. Here the key observation is the projection line that provides an excellent reference line for perpendicular distance functions. For each point on contour and centre of gravity () of a shape formed reference line for perpendicular distance

A. Centre of gravity

A shape features of a given contoure is describe as follows. The concept of centre of gravity ()of an object for point ()on contour is defined as follows:

B. Equation of straight line

The equation of straight line passing through centre of gravity ()and() on object contour is given below:

C. Perpendicular distance

The perpendicular distance()from a point to the straight line is defined as follows: Here we consider()as a point to compute perpendicular distance on a line. The general equation of a line is given as. Then | | is given below.

Theorem: A straight line is such that the algebraic sum of the perpendiculars drawn upon it from any number of fixed points is zero, show that the line always passes through a fixed point.

Proof: Let the fixed points be (); ⟨ ⟩ and the given line be.

From it is clear that line passes through the fixed point

Corollary: The algebraic sum of the perpendicular distance from a set of points on the line passing through a centre of gravity of a set is zero.

3. SHAPE DESCRIPTOR USING PERPENDICULAR DISTANCE FUNCTION

Symbolically, the perpendicular distance between () line and () point on contour is defined as distance value. Specifically, the is positive, negative or zero when the points on contour is to the left of, to the right of or just on the line which passes through centre of gravity () of a given object and points on contour. Obviously, the positive or negative symbol of the distance value makes a more precise representation for the relative location of the point to the line. We know not only the distance, but also which side it stands on. Note that line passes through centre of gravity () of the shape, which divided the shape contour into two or more parts. Figure 1(a) shows the contour of a given shape and fig.1(b) shows their centre of gravity.

Figure 1. The shape is selcted from kimia-99 data set. (a) Contour of a shape (b) And their centre of gravity.

Figure 2. Line passing through the centre of gravity and points on the contour of a shape (a) The single line (b) Multiple line.

Figure 3. Represent (a) The perpendicular distance from contour points. (b) The distance descriptor d1,j={D1,j=1, D1,j=2,...,D1,j=N}.

The line passes through the centre of gravity and the point on the object contour is represented in figure 2(a). Figure 2(b) shows an example of multiple lines passing through a fixed point called the centre of gravity and points on the object contour. We calculate the perpendicular distance values of every contour point to the line. Then the shape descriptor of the point with respect to the shape is defined as follows:

Where, denotes the perpendicular distance value between line and point on contour of a given shape. Here, we observe that for every and we treat as a row vector. The proposed descriptor depends not only on the direction of line, but also on the location of the contour point of a shape. In fig.3(a), the perpendicular distance descriptors are represents in black background and white foreground and in fig.3(b), the distance descriptors for three points D1,j=1, D1,j=2 and D1,j=N are given. It is obvious that our descriptor may be totally different because the reference line has totally different properties. This leads to a strong discriminative power to find out the correct correspondence between the points from two shapes.

Since the reference line and perpendicular distance values are defined directly on the contour points, the proposed descriptor explicitly contains the information of the geometric relationship of the contour points. This makes the perpendicular distance function representation invariant to translations and rotations, as all the contour points will translate and rotate synchronously and the geometric relationship between them will remain unchanged. However, the descriptor defined above consists of the relative location for every single contour point to the reference line. Such a precise description may be too sensitive to local boundary deformations. One solution to this problem is to extract the boundary by using the Moore boundary tracking algorithm after Moore [1968].

A. Scale invariant feature

In order to make our matrix called representation of perpendicular distance function as scale invariant feature vectors, we normalized by dividing by the standard deviation of each row.

From corollary, Since mean = 0. Therefore, may be deduced as follows:

If denotes the central moment of the row of a matrix(), then we consider a matrix having some special characteristics is given below:

Further, we analysis the largest eigenvalue corresponding to moment generating matrix given in Eq.(7) and remove the others smallest eigenvalues that have small discriminating power. Therefore, perpendicular distance functions generate a one-dimensional (1-D) features vector of largest eigenvalue corresponding to moment generating matrix for each row in. For the task of shape recognition, usually a shape similarity or dissimilarity is computed by finding the optimal correspondence of contour points, which is used to rank the data set shapes for shape retrieval. In this paper, we use a Dynamic Programming (DP) algorithm to find the correspondence. Then the shape similarity or dissimilarity is the sum of the distance of the corresponding points, i.e. for given two shapes () and () for and, we compute cost matrix of one-dimensional (1-D) features vector corresponding to largest eigenvalue.

The similarity or dissimilarity between two shapes normalized by their shape complexity values is used in [1] given by:

Where the factor, which is used to avoid divide-by-zero, is set empirically (Generally it is 0.01). ()and ()are shape complexity, i.e. standard deviation of one-dimensional (1-D) features vector of largest eigenvalue corresponding to moment generating matrix for each row in.

4. EXPERIMENTS AND ANALYSIS

The experimental results on popular benchmarks data sets using our proposed algorithm achieve encouraging results. We used kimia’s 99 [16] and MPEG-7 [17] data set for the experiments. All experiments are conducted using a python tool and tested on intel CORE-i5 CPU with 3GB RAM on Linux Mint Operating System (OS).

A. Kimia’s data set

The kimia’s [16] data set is widely used for testing the performances of shape-preserving descriptors in the recent era for shape matching and classification. It contains 99 images from nine categories, each category contains eleven images (as shown in fig.4). In the experiment, every binary object in the data set is considered a query, and the retrieval result is summarized as the number of tops 1 to top 10 closest matches in the same class (excluding the query object). Therefore, the best possible result for each of the rankings is 99. Table I lists the results of perpendicular distance functions and some other recent methods. The performance of our approach is comparably better than recent approaches.

Figure 4. The kimia’s 99 data set.

Table I. Retrieval results on kimia’s 99 data set.

Algorithm 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th
Salient Points [13] IDSC [3] Height function [1] Perpendicular distance function (PDF) 99 99 98 96 95 93 93 90 84 77 99 99 99 98 98 97 97 98 94 79 99 99 99 99 98 99 99 96 95 88 99 99 99 99 98 99 98 98 97 91

B. MPEG-7 data set

The other widely tested data set is MPEG-7 CE-Shape-1 [17], that consists of 1400 silhouette images from 70 classes. Each class has 20 different binary objects, some typical objects are shown in fig.5. The recognition rate is measured by the Bullseye test used by several authors in literature [1],[3]. The Bullseye score for every query image in the data set is it is matched with all other images and the top 40 most similar images are counted. Of these 40 images, at most 20 images are from the query image class that is correctly hit. The score of the test is the ratio of the number of correct hits of all images to the highest possible number of hits. In this case, the highest possible number of hits is. Table II shows the result of our proposed algorithm and comparison with some other existing context.

Figure 5. The MPEG-7 CE-Shape-1 data set.

Table II. Retrieval Rate (Bullseye Score) of Different Algorithms for the MPEG-7 CE-Shape-1 Data Set.

Algorithms Score
IDSC+DP [3] 85.40%
Salient Points [13] 95.36%
A bioinformatics approach [10] 96.10%
Height functions+LCDP [1] 96.45%
Perpendicular Distance Functions (PDF) 97.10%

5. CONCLUSIONS AND FUTURE WORKS

We presented a new shape-preserving features vector based on the perpendicular distance functions of each point on the contour of an object. The distance function (or reference line) between a point on the contour and the centre of gravity of an object compute the shortest distance (perpendiculars distance) of all the other points on the contour. The proposed descriptors are more compact and produce loss-less information of an object, it achieves excellent retrieval results, which makes it attractive to adoption in different applications. The experiment on popular benchmarks data sets proved that the proposed method is effective under geometric transformations.

Here, perpendiculars distance functions are only used for binary images to analyze the outer closed contour of objects. It is possible to extend this work to combine the inner and outer contour of an object in addition to several known small features.

References

  1. J. Wang, X. Bai, X. You, W. Liu, and L. J. Latecki, "Shape matching and classification using height functions," Pattern Recognit. Lett., vol. 33, pp. 134–143, 2012.
  2. A. El-ghazal, O. Basir, and S. Belkasim, "Farthest point distance: A new shape signature for Fourier descriptors," Signal Process.: Image Commun., vol. 24, pp. 572–586, 2009.
  3. H. Ling and D. W. Jacobs, "Shape classification using the inner-distance," IEEE Trans. Pattern Anal. Mach. Intell., vol. 29, no. 2, Feb. 2007.
  4. G. Amayeh, S. Kasaei, G. Bebis, A. Tavakkoli, and K. Veropoulos, "Improvement of Zernike moment descriptors on affine transformed shapes," in Proc. IEEE Conf., 2007.
  5. D. Wolter and L. J. Latecki, "Shape matching for robot mapping," in Proc. Pacific Rim Int. Conf. Artificial Intelligence (PRICAI), 2004.
  6. S. Lewin, X. Jiang, and A. Clausing, "Perceptually motivated shape evolution with shape-preserving property," Pattern Recognit. Lett., vol. 31, no. 6, pp. 447–453, 2010.
  7. H. Jiang et al., "CASE: Connectivity-based skeleton extraction in wireless sensor networks," in Proc. IEEE INFOCOM, 2009, pp. 2916–2920.
  8. Z. Wang and M. Liang, "Locally affine invariant descriptors for shape matching and retrieval," IEEE Signal Process. Lett., vol. 17, no. 9, pp. 803–806, 2010.
  9. J. Wang, Y. Li, X. Bai, Y. Zhang, C. Wang, and N. Tang, "Learning context-sensitive similarity by shortest path propagation," Pattern Recognit., vol. 44, no. 10–11, pp. 2367–2374, 2011.
  10. M. Bicego and P. Lovato, "A bioinformatics approach to 2D shape classification," Comput. Vis. Image Underst., vol. 145, pp. 59–69, 2016.
  11. N. Alajlan, I. E. Rube, M. S. Kamel, and G. Freeman, "Shape retrieval using triangle-area representation and dynamic space warping," Pattern Recognit., vol. 40, pp. 1911–1920, 2007.
  12. X. Tang, F. Lin, S. Samson, and A. Remsen, "Binary plankton image classification," IEEE J. Ocean. Eng., vol. 31, no. 3, pp. 728–735, Jul. 2006.
  13. Y. Shen, J. Yang, and Y. Li, "Finding salient points of shape contour for object recognition," in Proc. IEEE Conf. Robotics and Biomimetics, Zhuhai, China, Dec. 6–9, 2015.
  14. Y. Mingqiang, K. Kidiyo, and R. Joseph, "A survey of shape feature extraction techniques," in Pattern Recognition, P.-Y. Yin, Ed., 2008, pp. 43–90.
  15. S. Loncaric, "A survey of shape analysis techniques," Pattern Recognit., vol. 31, no. 8, pp. 983–1001, 1998.
  16. T. B. Sebastian, P. N. Klein, and B. B. Kimia, "Recognition of shapes by editing their shock graphs," IEEE Trans. Pattern Anal. Mach. Intell., vol. 25, pp. 116–125, 2004.
  17. L. J. Latecki, R. Lakamper, and U. Eckhardt, "Shape descriptors for non-rigid shapes with a single closed contour," in Proc. IEEE Conf. Computer Vision and Pattern Recognition (CVPR), 2000, pp. 424–429.