Abstract
Distance from the boundary of a shape to its centroid, a.k.a. signature of a shape, is a frequently used shape descriptor. Commonly, the observed shape results from a crisp (binary) segmentation of an image. The loss of information associated with binarization leads to a significant decrease in accuracy and precision of the signature, as well as its reduced invariance w.r.t. translation and rotation. Coverage information enables better estimation of edge position within a pixel. In this paper, we propose an iterative method for computing the signature of a shape utilizing its pixel coverage representation. The proposed method iteratively improves the accuracy of the computed signature, starting from a good initial estimate. A statistical study indicates considerable improvements in both accuracy and precision, compared to a crisp approach and a previously proposed approach based on averaging signatures over \(\alpha \)-cuts of a fuzzy representation. We observe improved performance of the proposed descriptor in the presence of noise and reduced variation under translation and rotation.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
A shape signature is any one-dimensional function which represents a two-dimensional shape. Several versions are proposed in the literature, such as centroid distance, centroidal profile, complex coordinates, tangent angle, cumulative angle; overviews of shape descriptors can be found in [3, 10]. Among them, signature based on centroid distance is popular due to its simple and intuitive definition, as well as its suitability for further processing and, e.g., derivation of Fourier or wavelet descriptors of the shape. As a boundary based descriptor, however, centroid distance signature suffers from noise sensitivity. Additionally, the signature of a discrete shape representation is often altered by translation and/or rotation of a shape, which is an undesired property of a shape descriptor.
We suggest, in this paper, to improve accuracy and precision (i.e., reduce bias and variance) of the centroid distance signature by computing it from a pixel coverage representation of the shape [7, 8], instead of following the traditional approach and utilize a crisp shape representation. Previous results on shape representation based on coverage of pixels by the imaged object have confirmed that such an information rich representation may be utilized to increase accuracy and precision of several shape descriptors, compared to binary (crisp) approaches [6, 7]. In a coverage representation every pixel is assigned an intensity value proportional to the relative coverage of the pixel by the imaged shape. This intensity value can be utilized to determine sub-pixel position of the shape boundary, which can then be used to produce more precise and accurate shape signature. In this paper, we propose a novel method for estimating the shape signature of a starshaped object utilizing a coverage representation of the shape. We present an algorithm which iteratively improves accuracy of the computed signature, alternating between estimation of boundary position and shape normal direction. Evaluation results confirm a number of advantages of the proposed approach. The signature derived for a coverage representation is computed by a simple and fast procedure, and exhibits increased accuracy and precision, and invariance to rotation and translation, as well as decreased sensitivity to noise, compared to previously used crisp approach.
2 Background
Usually, an object is extracted from an image by crisp segmentation, providing a crisp representation of the shape, such that each pixel is either completely included, or completely excluded, in/from it. This process is associated with a loss of information about the original shape. Shape descriptors are then computed utilizing this crisp representation. The reduced amount of information preserved in the crisp representation reduces the descriptors’ accuracy and precision, as well as their invariance under translation and rotation. One way to improve performance of shape descriptors is to compute them from a coverage representation of the shape. Advantages of such an approach, compared to utilizing a crisp representation, are observed in, e.g., [2, 6, 7]. These results motivated our work on development of an estimator for centroid distance shape signature which utilizes coverage representation of the shape. Before presenting the algorithm for signature computation in Sect. 3, and showing the results of its evaluation in Sect. 4, we introduce the main concepts and notions we utilize.
2.1 Fuzzy Set Theory
Fuzzy set theory is a generalization of the classical (crisp) set theory, allowing partial belongingness of elements of some reference set to a fuzzy set.
Definition 1
[9] A fuzzy subset S of a reference set X is a set of ordered pairs \(S=\lbrace (x,\mu _S(x))\ |\ x\in X \rbrace ,\) where \(\mu _S:X \rightarrow [0,1]\) is the membership function of S in X.
A crisp set is a special case of a fuzzy set and its characteristic function, allowing only values \(\{0,1\}\), is a special case of a fuzzy membership function.
Important notions related to fuzzy set are those of \(\alpha \)-cut and support:
Definition 2
[9] For \(\alpha \in (0,1],\) the \(\alpha -\)cut of S, defined by \(\mu _S,\) is the crisp set \(S_{\alpha }=\lbrace x \in S \ |\ \mu _S(x) \ge \alpha \rbrace .\)
Definition 3
[9] The support of a fuzzy set S is the crisp set \(Supp(S)=\lbrace x \in X \ |\ \mu _S(x) > 0 \rbrace .\)
Definition 4
For a fuzzy set \(S=\lbrace ((x,y),\mu (x,y))\ |\ (x,y)\in X \rbrace ,\) defined on a discrete reference set \(X \subset R^2\), the coordinates of its centroid \((x_c,y_c)\) are
Definition 4 can be used to compute the centroid of a crisp shape as well, utilizing the characteristic function of the crisp shape as its membership function.
2.2 Shape Signature
The centroid distance signature of a continuous shape is a continuous function which assigns distance from the shape centroid to every point on the continuous shape boundary, parametrized in some appropriate way. For a starshaped object, it holds that every straight half-line starting from the centroid intersects the boundary of the shape in exactly one point; therefore there exists a one-to-one mapping from the interval \([0,2\pi )\) of angles to the set of boundary points, which we use for parametrization.
Definition 5
The signature of a continuous starshaped object S is a continuous function \(r(\theta )\) which assigns the length of the vector determined by the shape centroid \((x_c,y_c)\) and the boundary point \((x(\theta ), y(\theta ))\), to every angle \(\theta \in [0,2\pi )\), where \(\theta = \arctan \left( \frac{y(\theta )-y_c}{x(\theta )-x_c}\right) \):
Throughout the paper we assume that \(\arctan \left( \frac{y}{x}\right) \) computes the four-quadrant inverse tangent, appropriately handling the case \(x=0\) and providing an output in the range \([0,2\pi )\).
The signature of a discrete representation of a continuous shape is a restriction of the continuous shape signature to some appropriate sample values \(\theta _i\) of the interval \([0,2\pi )\). The sample values \(\theta _i\) can be determined beforehand, or be derived as a part of the process of signature computation. Often used sample points/angles are those of a 4-connected, or an 8-connected boundary.
Definition 6
The signature of a discrete representation of a (continuous) starshaped object S is a collection of pairs \((r(\theta _i),\theta _i)\), where \(r(\theta _i)\) assigns the length of the vector determined by the shape centroid \((x_c,y_c)\) and the boundary point \((x(\theta _i), y(\theta _i))\), to a set of values \(\theta _i \in [0,2\pi )\):
In absence of any information about the boundary location within a pixel, the centre point of the pixel is a reasonable sample point. It is, however, rather unlikely that the centre of a pixel belongs to the boundary of the continuous object, which introduces errors in computation of the signature, and leads to translation and rotation variance of this descriptor.
An approach to compute the signature of a fuzzy shape representation, and by that reduce negative effects of crisp segmentation, is proposed in [1]. Following one of the main fuzzification principles, the signature of a fuzzy shape is computed as the average of the signatures of all its \(\alpha \)-cuts. This approach is shown to outperform crisp approach in terms of achieved precision of the estimator. Bias of the estimator is not addressed/corrected, which affects its accuracy.
2.3 Coverage Model
Let the Voronoi region in \(\mathbb {R} ^2\) of a grid point \(\varvec{x} \in \mathbb {Z} ^2\), i.e., a pixel, be denoted by \(\sigma (\varvec{x})\). Coverage digitization in \(\mathbb {R} ^2\) is defined in [8] as:
Definition 7
For a given continuous object \(S \subset \mathbb {R} ^2,\) inscribed into an integer grid \(\mathbb {Z} ^2,\) the pixel coverage digitization of S is
where |S| denotes area of a set S.
For a real image, the pixel coverage values can be estimated by coverage segmentation methods, [4, 5, 7].
Coverage representation of a continuous crisp shape is characterized by pixel values equal to one, for pixels completely covered by the shape, pixel values equal to zero for pixels completely covered by the background, and pixel values strictly between 0 and 1, for partly covered pixels that typically form a one pixel thick discrete shape boundary.
The coverage function a is a particular type of fuzzy membership function, suitable for representation of imaged objects. Definitions and properties derived for (spatial) fuzzy sets are thus directly applicable to the coverage representation.
3 Shape Signature with Sub-pixel Precision
We present a novel approach for estimating shape signature based on a pixel coverage representation of the object. If we approximate the boundary of a shape within a pixel with a straight line segment, we can estimate the edge position with sub-pixel accuracy from the pixel (coverage) value, assuming that we know the edge direction. We can then compute a discrete signature of the shape by selecting a sample point on the estimated edge. Any point on the edge segment is a possible choice. To have a well defined inner point of the pixel, we use the midpoint of the estimated edge as a sample point for the proposed signature computation. Based on the above, we propose the following Pixel Coverage Shape Signature (PCSS), in accordance with Defintion 6.
The pixel coverage signature of a starshaped continuous object S is a set of pairs \((r(\theta _i),\theta _i)\), where \(r(\theta _i)\) assigns the length of the vector given by the shape centroid \((x_c,y_c)\) and the point \((x_\text {mid}(\theta _i), y_\text {mid}(\theta _i))\), to every angle \(\theta _i \in [0,2\pi )\), such that \(\theta _i = \arctan \left( \frac{y_\text {mid}(\theta _i)-y_c}{x_\text {mid}(\theta _i)-x_c}\right) \), where \((x_\text {mid}(\theta _i), y_\text {mid}(\theta _i))\) is the midpoint of the edge in the i-th pixel along the object boundary and
3.1 Computation of Midpoint of Edge Segment Within a Pixel
Assuming that the object boundary within a pixel centred at (x, y) can be approximated by a straight edge, let us denote the normal direction of the edge by \(\varvec{n}=(\cos \varphi , \sin \varphi )\), and the coverage value of the observed pixel by a.
The coordinates of the midpoint of the edge inside the observed pixel can be expressed as
where, for angles \(\varphi \in [0,\pi /4]\), it holds that
Due to (anti)symmetry of the above expressions, it is enough to consider values \(0 \le a \le 0.5\) and \(\varphi \in [0,\pi /4]\); other cases can be obtained by changing the sign and/or swapping the coordinates of the computed midpoint.
3.2 Algorithm for Shape Signature Estimation
To compute PCSS using (4) and (5), we need to estimate the normal direction \(\varvec{n}=(\cos \varphi , \sin \varphi )\) of the edge within each boundary pixel. We propose an iterative procedure which utilizes the current signature estimate to derive the normal direction of the edge, and then to improve the signature itself. This method is simple and fast, utilizes only the values of the observed pixel and its two neighbours, and does not require convolution masks for gradient estimation.
An initial signature is computed as a sequence of distances from the shape centroid to midpoints of the edges in each boundary pixel. We consider boundary pixels to be pixels with \(a>0\) which are 8-connected to the pure background pixels, having coverage \(a=0\). For an object without holes, such boundary consists of a thin 4-connected sequence of pixel which is easily detected and indexed. For computation of initial midpoints, normal directions are initialized as \(\varphi _i = \theta _i\).
In each iteration the estimate of the edge position in a pixel is updated by computing the normal of the line connecting the midpoints of the edges in the two boundary pixels neighbouring the observed one. These midpoints are determined based on the signature estimate in the previous iteration. The new edge position (and its new midpoint) is computed using the new normal estimate and the given coverage value. Figure 1 illustrates this process. The procedure terminates when the difference between two consecutive signature estimates stays below a given tolerance, or when some predefined number of iterations is reached.
The complete algorithm is presented below. Each line in the algorithm assumes parallel/vectorized computation for all \(i \in \{1,2,\ldots ,N\}\). Cyclic indexing is assumed when index \(i \pm 1\) reaches the end values of the sequence.
For poorly resolved non-smooth objects, there may be cases where one boundary pixel is intersected several times by the shape boundary, i.e., where a single straight edge segment poorly models the boundary position. In such cases the above algorithm may produce suboptimal edge position estimates. We therefore adjust utilization of coverage values for edge direction estimation if a pixel is visited more than once while the boundary is traversed. We appropriately split its coverage and utilize it for each of the edge estimates separately. This is conveniently achieved by a simple update of the coverage values to be used by the algorithm, as follows:
This pre-processing step results in improved boundary estimation at sharp corners, as illustrated in Fig. 2.
4 Evaluation
We evaluate performance of the proposed method for computation of the signature from a coverage representation of a shape, by comparing it with methods utilizing crisp shape representation, according to Definition 6, and utilizing \(\alpha \)-cuts of a fuzzy representation of the shape, as proposed in [1]. The approaches are denoted by BSS (Binary Shape Signature), ACSS (\(\alpha \)-cut Shape Signature) and PCSS (Pixel Coverage Shape Signature). Our evaluation is focused on accuracy, precision, noise sensitivity, and invariance to translation and rotation.
The observed test objects are disks, 6-cornered stars, and rectangles, for which the true signatures used in comparisons are analytically derived. Crisp shape representations of the observed objects are obtained by Gauss centre point digitization of continuous shapes. The coverage representations of these objects are analytically derived, and therefore exact (to the level of floating point operations). The fuzzy representation considered is the coverage representation, i.e., ACSS and PCSS are applied to the same shape representations. Tolerance used for the exit criterion in Algorithm 1 is set to \(\varepsilon =0.0001\) and maxiter = 100.
We first show an illustrative example motivating our proposed approach. Figure 3 presents centroid distance signatures estimated by BSS, ACSS, and PCSS, of a disk with radius \(r=66.64\) pixels. Comparing with the true signature of the disk (constant function \(y=66.64\)), we observe very high accuracy and precision of the proposed PCSS method, compared to rather precise, but non-accurate (biased) ACSS, and comparably imprecise and also biased BSS.
The distributions of errors for the different methods are presented in Fig. 4, estimated for a disk and a 6-cornered star, both of a radius \(r=66.64\). Each object is digitized 100 times, at random positions (and rotations) in the grid, and errors are computed relative to the resp. true continuous shape. Both 4- and 8-connected boundaries are considered for BSS, whereas only 8-connected boundary is observed for ACSS (per recommendation in [1]). For PCSS it is most natural to use the 4-connected boundary, which gives more sample points than the 8-connected one. Excellent performance of the proposed PCSS in terms of accuracy is clearly visible and confirmed by the significantly smaller range of errors, compared to the range of errors of both BSS (4- and 8-connected boundary), and ACSS. The biases of BSS and ACSS are also clearly visible.
We further present results of a statistical study of the estimation error, for the three observed signature estimators for objects of increasing sizes. We observe the root-mean-square error \(\text {RMSE}=\sqrt{\frac{1}{N}\sum _{i=1}^{N}(\hat{x}_i-x_i)^2}\,,\) where N is the number of boundary pixels, \(x_i\) are true values of the shape signature and \(\hat{x}_i\) are estimated shape signature values. We also analyse the maximal absolute error (MaxErr) of the methods. For each radius in the range 0 to 100 pixels, 100 disks (100 stars) with centres randomly translated within one pixel, are observed and their signatures compared with the ground truth (true signatures of the corresponding continuous objects). For the case of stars, random rotations of the objects are included as well.
To compare and evaluate performance of the estimators in terms of their precision, we correct for the bias of BSS and ACSS. We estimate their resp. bias by averaging signatures of 100 randomly positioned disks of a radius 1000, and subtract it from estimated signatures observed in the test.
Figure 5 presents plots of obtained RMSE and MaxErr. Outstanding performance of the proposed PCSS estimator on the disks can better be appreciated in the log-log plots. Linear decrease of both RMSE and MAE is observed for PCSS for disks, with increase of object size (or image resolution). The proposed method clearly outperforms the competitors also when applied to the more complex objects (stars) with non-smooth boundaries.
Rotation invariance of the proposed PCSS estimator is illustrated in Fig. 6. Three rotations of a rectangle (\(9 \times 11\) pixels), shown in Fig. 6(b) by their coverage representations, are observed. Corresponding signatures of these shapes, estimated by the three compared methods, are shown in Fig. 6(a). Each plot represents signatures of the three shapes, with differently marked points (triangles, squares, and stars), estimated by one of the three observed methods. The blue continuous line indicates the true signature of the observed rectangle. The signatures are shifted to the same starting angle so that they, in the ideal case, should coincide. Translation and rotation invariance is however violated for BSS, but also ACSS, due to discretization. The cloud of points clearly deviates from the blue line (lack of accuracy) for both BSS and ACSS as well as between observations (lack of precision). For the PCSS estimate, the points are consistently correctly positioned, exhibiting both high accuracy and high precision.
Sensitivity to noise of PCSS is evaluated in comparison with the performance of BSS and ACSS, observing RMSE of the estimated signatures of a star, in presence of increasing levels of added zero mean Gaussian noise with standard deviation in the range [0, 0.25] (where a white pixel has level 1). Each object is segmented by either Otsu thresholding (for crisp approaches) or with the fast soft thresholding technique proposed in [7] (for ACSS and PCSS). We observe, in Fig. 7, that both PCSS and ACSS perform better than what a noise free crisp approach does (blue dotted line), even when the coverage based approaches are degraded by up to 20 % of noise.
Illustration of convergence of the proposed algorithm is given in Fig. 7(c). Results of the empirical evaluation indicate that the sequence \(\left||\varvec{r}^k - \varvec{r}^{k-1} \right||_\infty \) showing difference of two consecutive signature estimates (non-monotonically) decreases for shapes which do not have sharp corners. Convergence of the algorithm when signature of a star is estimated is violated, so the algorithm terminates with the reached maximal number of iterations. However, if the sharp peaks of the star are smoothed by a morphological opening, the algorithm converges, and so it does when applied to both noisy and noise-free disks.
Processing time is around 0.01 s for a 600 pixel long signature (Star) on a single 3 GHz CPU in Matlab. The algorithm is easy to parallelize if higher processing speed is required.
5 Conclusion
We propose a novel method for estimating the centroid distance signature of a shape utilizing its pixel coverage representation. Pixel value, representing fraction of the pixel area covered by the imaged object, is used to estimate the edge position of the object inside the pixel. Midpoint of the estimated edge is used to define the signature. An iterative procedure is suggested to improve edge direction estimation, and by that to improve the signature estimate in each iterative step. Evaluation of the proposed method confirms its superiority regarding accuracy, precision, robustness to noise, and invariance w.r.t. rotation and translation, compared to the shape signatures estimated from crisp shape representation, or by averaging the signatures of the \(\alpha \)-cuts of the coverage representation. The proposed iterative algorithm is fast, intuitive and simple.
We have, on the example of shape signature, again confirmed that the information rich coverage representation enables estimation of shape descriptors with high accuracy and precision.
References
Chanussot, J., Nyström, I., Sladoje, N.: Shape signatures of fuzzy star-shaped sets based on distance from the centroid. Patt. Recogn. Lett. 26, 735–746 (2005)
Gustavson, S., Strand, R.: Anti-aliased Euclidean distance transform. Patt. Recogn. Lett. 32, 252–257 (2011)
Kindratenko, V.: On using functions to describe the shape. J. Math. Imag. Vis. 18, 225–245 (2003)
Lindblad, J., Sladoje, N.: Coverage segmentation based on linear unmixing and minimization of perimeter and boundary thickness. Patt. Recogn. Lett. 33(6), 728–738 (2012)
Malmberg, F., Lindblad, J., Sladoje, N., Nyström, I.: A graph-based framework for sub-pixel image segmentation. Theor. Comput. Sci. 412, 1338–1349 (2011)
Sladoje, N., Lindblad, J.: Estimation of moments of digitized objects with fuzzy borders. In: Roli, F., Vitulano, S. (eds.) ICIAP 2005. LNCS, vol. 3617, pp. 188–195. Springer, Heidelberg (2005)
Sladoje, N., Lindblad, J.: High-precision boundary length estimation by utilizing gray-level information. IEEE Trans. Patt. Anal. Mach. Intell. 31, 357–363 (2009)
Sladoje, N., Lindblad, J.: The coverage model and its use in image processing. In Selected Topics on Image Processing and Cryptology, Zbornik Radova (Collection of Papers), vol. 15, pp. 39–117 (2012). Math. Inst. of Serbian Academy of Sciences and Arts
Zadeh, L.: Fuzzy sets. Inf. Control 8, 338–353 (1965)
Zhang, D., Lu, G.: Review of shape representation and description techniques. Pattern Recogn. 37, 1–19 (2004)
Acknowledgments
Authors are supported by the Ministry of Science of the Republic of Serbia through Project ON174019 (V. Ilić) and Projects ON174008 and III44006 (J. Lindblad, N. Sladoje). N. Sladoje is supported by the Swedish Governmental Agency for Innovation Systems (VINNOVA).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Ilić, V., Lindblad, J., Sladoje, N. (2016). Signature of a Shape Based on Its Pixel Coverage Representation. In: Normand, N., Guédon, J., Autrusseau, F. (eds) Discrete Geometry for Computer Imagery. DGCI 2016. Lecture Notes in Computer Science(), vol 9647. Springer, Cham. https://doi.org/10.1007/978-3-319-32360-2_14
Download citation
DOI: https://doi.org/10.1007/978-3-319-32360-2_14
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-32359-6
Online ISBN: 978-3-319-32360-2
eBook Packages: Computer ScienceComputer Science (R0)