On approximating Euclidean metrics by digital distances in 2D and 3D

https://doi.org/10.1016/S0167-8655(00)00022-2Get rights and content

Abstract

In this paper a geometric approach is suggested to find the closest approximation to Euclidean metric based on geometric measures of the digital circles in 2D and the digital spheres in 3D for the generalized octagonal distances. First we show that the vertices of the digital circles (spheres) for octagonal distances can be suitably approximated as a function of the number of neighborhood types used in the sequence. Then we use these approximate vertex formulae to compute the geometric features in an approximate way. Finally we minimize the errors of these measurements with respect to respective Euclidean discs to identify the best distances. We have verified our results by experimenting with analytical error measures suggested earlier. We have also compared the performances of the good octagonal distances with good weighted distances. It has been found that the best octagonal distance in 2D ({1,1,2}) performs equally good with respect to the best one for the weighted distances (〈3,4〉). In fact in 3D, the octagonal distance {1,1,3} has an edge over the other good weighted distances.

Introduction

Distance transforms are widely used in digital shape analysis. In a distance transform each object point in the image has a value measuring the shortest distance to the background points. There are different applications of distance transforms such as in morphological operations, skeletonization, computing Voronoi diagrams, template matching, geometric transformation (Aswatha Kumar et al., 1996), data compression (Aswatha Kumar et al., 1995), computation of cross-sections (Mukherjee et al., 1998), rendering of 3D objects (Mukherjee et al., 1999) etc. An overview of some of these applications is given in (Borgefors, 1994). The distance transform was first proposed by Blum (1964) for a continuous binary picture on a 2-dimensional plane. Then Rosenfeld and Pfaltz (1968) incorporated the idea in digital images. The basic idea behind the computation is to determine the global minimum distances from the background by propagating the local distances between neighboring pixels starting from the boundaries. Rosenfeld and Pfaltz used two types of neighbors, 4-neighbor (horizontal and vertical neighbors), called cityblock distance and 8-neighbor (horizontal, vertical and diagonal neighbors), also called as chessboard distance. One of the prime motivations of using different digital distance functions is to approximate the Euclidean metric. But the 4-neighbor or 8-neighbor distance functions are far from the Euclidean metric. Rosenfeld and Pfaltz (1968) introduced the concept of octagonal distance in 2D for digital pictures which is also a metric. They proved that an alternate sequence of cityblock and chessboard motions defines a new integer valued metric which can approximate the true Euclidean metric better, than the conventional cityblock and chessboard distances. They have also introduced the concept of generalized distances and concluded an optimal distance should be such that for a distance with m cityblock motions followed by n chessboard motions, 2n/m should be as close as possible to 2. However a detailed careful investigation has been carried out by Das and Chatterji (1990). Toriwaki et al. (1981) discussed the sequential algorithm for the octagonal distance by calculating the sequence of pictures using the four raster scanning modes. Das and Chatterji (1990) have extended the definition to allow for arbitrarily long cyclic sequences of cityblock and chessboard motions called neighborhood sequences. This general definition has been shown to be octagonal still, since it always corresponds to discs of constant radii which are digital octagons. Detailed analysis of such octagons with respect to the area and perimeter errors for an Euclidean circle shows that in every such neighborhood sequence the actual order in which the two motions are arranged is of little consequence in an asymptotic sense (of the distance value) so long as the length of the sequence and the numbers of cityblock and chessboard motions remain constant. Thus for all practical purposes and for the ease of analysis it is sufficient to restrict the attention to the neighborhood sequences which are sorted (increasing). The sorted order in the neighborhood also guarantees metricity which is a basic necessity in any analysis.

In this paper we have considered generalized octagonal distances both in 2D and 3D digital spaces. We have evaluated their performances in approximating the Euclidean metric in respective dimensions. Earlier Das (1992) presented a detailed analysis for obtaining the best approximations to Euclidean metric over a set of octagonal distances in 2D. In our work, we have taken a different approach based on the geometry of the digital discs, for the comparative assessments of their performances. Following the similar approach we are also able to get relative performance measures for 3D octagonal distances. It may be noted here that Danielsson (1993) also adopted a similar approach for evaluating octagonal distances in 2D and 3D. But his treatment in 3D was incomplete, as he had considered only those 3D octagonal distances whose digital spheres are of the shape of a convex polyhedron with 26 faces. But there are other octagonal distances having digital spheres in the shape of polyhedra with 6, 12, 14, 18 and 20 faces also. That is why Danielsson (1993) could not explain why some of the 3D octagonal distances performed better than others. In our work, we have considered all possible shapes of the digital spheres for the set of 3D octagonal distances and presented our analysis for obtaining good octagonal distances. It may be noted here that an initial version of this work was briefly reported in (Aswatha Kumar et al., 1995).

It is interesting to note that there are other distance tranforms as well for approximating the Euclidean norms. Borgefors, 1984, Borgefors, 1986, Borgefors, 1993, Borgefors, 1996 considered many such distance transforms. One such interesting distance transform is the weighted distance transform (WDT) both in 2D and 3D. In 2D the weighted distance functions are positive linear combinations of the cityblock and chessboard distance functions. Borgefors, 1984, Borgefors, 1986 has shown that 〈3,4〉, 〈2,3〉, and 〈8,11〉 (for notations and explanations please refer Borgefors, 1984) are some of the good choices in 2D for approximating Euclidean metrics. Similar ideas have been extended to 3D and it has been shown (Borgefors, 1996) that 〈3,4,5〉, 〈8,11,13〉 and 〈13,17,23〉 (for notations and explanations please refer Borgefors, 1996) are reasonably good approximations to the Euclidean metric. In our work we have also presented the relative performances between the good octagonal distances and the good weighted distances.

In Section 2 we present the definitions and notations for generalized octagonal distances both in 2D and 3D. In this section we also present the properties of their digital discs. In Section 3 the computation of geometric features related to the shape of these discs are described. Subsequently, the error analysis is presented for obtaining good octagonal distances. Finally we have also presented the comparative assessments of the performances of good octagonal distances and good weighted distances based on two performance measures.

Section snippets

Generalized octagonal distances

In 2D Euclidean space R2, where R is the set of real numbers, a circle C(q,b), centered at q∈R2 and having radius b∈R is defined as the set of points in R2 whose Euclidean distance from the center q is less than or equal to b, i.e.C(q,b)={p∣(p∈R2)and(E(p,q)⩽b)},where E(p,q) is the Euclidean metric. In 3D Euclidean space R3, a sphere S(q,B) is defined similarly.

In 2D digital space Z2 or 3D digital space Z3 these definitions are immediately extended where digital, instead of Euclidean distances

Vertex approximation

In this section we present an approximation for the digital circles and digital spheres of generalized octagonal distances. This approximation will be used in the subsequent sections to compute various properties of the digital circles (spheres), and further to identify the best digital approximant to the Euclidean metric. We present these approximate expressions for the coordinates of the vertices in Lemma 3, Lemma 4. The proof of Lemma 4 is presented in (Mukherjee et al., 1999). Following the

Error analysis based on the geometric features

Different features of digital circles (spheres) are computed so that they could be compared to those of an Euclidean circle (sphere). These computations are described in the following sections. Throughout we use the approximation presented in the last section to carry out the computations.

Relative performances between good octagonal distances and good weighted distances

For evaluating the relative performances between good octagonal distances and good weighted distances (Borgefors, 1984, Borgefors, 1986, Borgefors, 1996), we have considered the analytical error measures used earlier. One such measure was used by Das (1992) for studying the performances of the octagonal distances in 2D. He had used the following normalized average difference between Euclidean metric and the digital metric for the octagonal distances.Eav(2)=i=0Mj=0iE(i,j)−d((i,j);B)i=0Mj=0i1

Conclusion

By analyzing the geometry of digital circles in 2D and digital spheres in 3D, we have identified the best octagonal distances which are closer approximation to Euclidean norm. A generalization of this approach in n-dimension seems to be interesting. In the present paper our motivation is to identify good approximate digital distances for the Euclidean distance in 2D and 3D. We follow an approach based on the geometry of the circles (spheres) of these distances. First we show that under the

Acknowledgements

The comments of the anonymous reviewers for improving the paper in its final form are gratefully acknowledged.

References (16)

There are more references available in the full text version of this article.

Cited by (0)

View full text