# Affine-invariant geodesic geometry of deformable 3D shapes

###### Abstract

Natural objects can be subject to various transformations yet still preserve properties that we refer to as invariants. Here, we use definitions of affine invariant arclength for surfaces in in order to extend the set of existing non-rigid shape analysis tools. In fact, we show that by re-defining the surface metric as its equi-affine version, the surface with its modified metric tensor can be treated as a canonical Euclidean object on which most classical Euclidean processing and analysis tools can be applied. The new definition of a metric is used to extend the fast marching method technique for computing geodesic distances on surfaces, where now, the distances are defined with respect to an affine invariant arclength. Applications of the proposed framework demonstrate its invariance, efficiency, and accuracy in shape analysis.

## 1 Introduction

Modeling 3D shapes as Riemannian manifold is a ubiquitous approach in many shape analysis applications. In particular, in the recent decade, shape descriptors based on geodesic distances induced by a Riemannian metric have become popular. Notable examples of such methods are the canonical forms [7] and the Gromov-Hausdorff [9, 13, 2] and the Gromov-Wasserstein [12] frameworks, used in shape comparison and correspondence problems. Such methods consider shapes as metric spaces endowed with a geodesic distance metric, and pose the problem of shape similarity as finding the minimum-distortion correspondence between the metrics. The advantage of the geodesic distances is their invariance to inelastic deformations (bendings) that preserve the Riemannian metric, which makes them especially appealing for non-rigid shape analysis. A particular setting of finding shape self-similarity can be used for intrinsic symmetry detection in non-rigid shapes [17, 23, 11, 22].

The flexibility in the definition of the Riemannian metric allows extending the invariance of the aforementioned shape analysis algorithms by constructing a geodesic metric that is also invariant to global transformations of the embedding space. A particularly general and important class of such transformations are the affine transformations, which play an important role in many applications in the analysis of images [14] and 3D shapes [8]. Many frameworks have been suggested to cope with the action of the affine group in a global manner, trying to undo the affine transformation in large parts of a shape or a picture. While the theory of affine invariance is known for many years [4] and used for curves [18] and flows [19], no numerical constructions applicable to manifolds have been proposed.

In this paper, we construct an (equi-)affine-invariant Riemannian geometry for 3D shapes. By defining an affine-invariant Riemannian metric, we can in turn define affine-invariant geodesics, which result in a metric space with a stronger class of invariance. This new metric allows us to develop efficient computational tools that handle non-rigid deformations as well as equi-affine transformations. We demonstrate the usefulness of our construction in a range of shape analysis applications, such as shape processing, construction of shape descriptors, correspondence, and symmetry detection.

## 2 Background

We model a shape as a compact complete two-dimensional Riemannian manifold with a metric tensor . The metric can be identified with an inner product on the tangent plane at point . We further assume that is embedded into by means of a regular map , so that the metric tensor can be expressed in coordinates as

(1) |

where are the coordinates of .

The metric tensor relates infinitesimal displacements in the parametrization domain to displacement on the manifold

(2) |

This, in turn, provides a way to measure length structures on the manifold. Given a curve , its length can be expressed as

(3) |

where denotes the velocity vector.

### 2.1 Geodesics

Minimal geodesics are the minimizers of , giving rise to the geodesic distances

(4) |

where is the set of all admissible paths between the points and on the surface , where due to completeness assumption, the minimizer always exists.

Structures expressible solely in terms of the metric tensor are called intrinsic. For example, the geodesic can be expressed in this way. The importance of intrinsic structures stems from the fact that they are invariant under isometric transformations (bendings) of the shape. In an isometrically bent shape, the geodesic distances are preserved – a property allowing to use such structures as invariant shape descriptors [7].

### 2.2 Fast marching

The geodesic distance can be obtained as the viscosity solution to the eikonal equation with boundary condition at the source point . In the discrete setting, a family of algorithms for finding the viscosity solution of the discretized eikonal equation by simulated wavefront propagation is called fast marching methods [21, 10]. On a discrete shape represented as a triangular mesh with vertices, the general structure of fast marching closely resembles that of the classical Dijkstra’s algorithm for shortest path computation in graphs, with the main difference in the update step. Unlike the graph case where shortest paths are restricted to pass through the graph edges, the continuous approximation allows paths passing anywhere in the mesh triangles. For that reason, the value of has to be computed from the values of the distance map at two other vertices forming a triangle with . Computation of the distance map from a single source point has the complexity of .

## 3 Affine-invariant geometry

An affine transformation of the three-dimensional Euclidean space can be parametrized using twelve parameters: nine for the linear transformation , and additional three, , for a translation, which we will omit in the following discussion. Volume-preserving transformations, known as special or equi-affine are restricted by . Such transformations involve only eleven parameters.

The equi-affine metric can be defined through the parametrization of a curve on the surface [1, 3, 4, 6, 15, 19]. Let be a curve on parametrized by . By the chain rule,

(5) | |||||

where, for brevity, we denote and . As volumes are preserved under the equi-affine group of transformations, we define the invariant arclength through

(6) |

where is a normalization factor for parameterization invariance. Plugging (3) into (6) yields

(7) | |||||

where .

In order to evaluate such that the quadratic form (7) will also be parameterization invariant, we introduce an arbitrary parameteriation and , for which and . The relation between the two sets of parameterizations can be expressed using the chain rule

(8) | |||

It can shown [4] using the Jacobian

(9) |

that

(10) |

and , where . From (10) we evaluate the affine invariant parameter normalization , and define an equi-affine pre-metric tensor [4, 19]

(11) |

The pre-metric tensor (11) defines a true metric only for strictly convex surfaces [4]; A simialr problem appeared in equi-affine curve evolution where the flow direction was determined by the curvature vector. In two dimentions we can encounter non-positive definite metrics in concave, and hyperbolic points. We propose fixing the metric by flipping the main axes of the operator, if needed. In practice we restrict the eigenvalues of the tensor to be positive, and re-avaluate it. From the eigendecomposition of in matrix notation, where is orthonormal and , we compose a new metric , such that is positive definite and equi-affine invariant.

## 4 Discretization

We model the surface as a triangular mesh, and construct three coordinate functions , , and for each triangle. While this can be done practically in any representation, we use the fact that a triangle and its three adjacent neighbors, can be unfolded to the plane, and produce a parameter domain. The coordinates of this planar representation are used as the parametrization with respect to which the first fundamental form coefficients are computed at the barycenter of the simplex (Figure 1). Using the six base functions , , , , and we can construct a second order polynom for each coordinate function. This step is performed for every triangle of the mesh.

Calculating geodesic distances was well studied in past decades. Several fast and accurate numerical schemes [10, 20, 24] can be used off-the-shelf for this purpose. We use FMM technique, after locally rescaling each edge according to the equi-affine metric.

The (affine invariant) length of each edge is defined by Specifically, for our canonical triangle with vertices at and we have

(12) | |||||

(13) | |||||

(14) | |||||

(15) | |||||

(16) | |||||

(17) |

Each edge may appear in more than one triangle. We found that the average length is a good approximation, assuming the triangle inequality holds. In figures 2 and 3 we compare between geodesic distances induced by the standard and our affine-invariant metric.

## 5 Results

The equi-affine metric can be used in many existing methods that process geodesic distances. In what follows, we show several examples for embedding the new metric in known applications such as voronoi tessellation, canonical forms, non-rigid matching and symmetry detection.

### 5.1 Voronoi tessellation

Voronoi tessellation is a partitioning of into disjoint open sets called Voronoi cells. A set of points on the surface define the Voronoi cells such that the -th cell contains all points on closer to than to any other in the sense of the metric . Voronoi tessellations created with the equi-affine metric commute with equi-affine transformations as visualized in Figure 4.

### 5.2 Canonical forms

Methods considering shapes as metric spaces with some intrinsic (e.g. geodesic) distance metric is an important class of approaches in shape analysis. Geodesic distances are particularly appealing due to their invariance to inelastic deformations that preserve the Riemannian metric.

Elad and Kimmel [7] proposed a shape recognition algorithm based on embedding the metric structure of a shape into a low-dimensional Euclidean spaces. Such a representation, referred to as canonical form, reduces the number of degress of freedom by tanslating all deformations into a much simple Euclidean isometry group.

Given a shape sampled at points and an matrix of pairwise geodesic distances, the computation of the canonical form consists of finding a configuration of points in such that . This problem is known as multidimensional scaling (MDS) and can be posed as a non-convex least-squares optimization problem of the form

(18) |

The invariance of the canonical form to shape transformations depends on the choice of the distance metric . Figure 5 shows an example of a canonical form of the human shape undergoing different bendings and affine transformations of varying strength. The canonical form was computed using the geodesic and the proposed equi-affine distance metric. One can clearly see the nearly perfect invariance of the latter. Such a strong invariance allows to compute correspondence of full shapes under a combination of inelastic bendings and affine transformations.

### 5.3 Non rigid matching

Two non-rigid shapes can be considered similar if there exists an isometric correspondence between them, such that there exists with and vice-versa, and for all , where are geodesic distance metrics on . In practice, no shapes are truly isometric, and such a correspondence rarely exists; however, one can attempt finding a correspondence minimizing the metric distortion,

(19) |

The smallest achievable value of the distortion is called the Gromov-Hausdorff distance [5] between the metric spaces and ,

(20) |

and can be used as a criterion of shape similarity.

The choice of the distance metrics defines the invariance class of this similarity criterion. Using geodesic distances, the similarity is invariant to inelastic deformations. Here, we use geodesic distances induced by our equi-affine Riemannian metric tensor, which gives additional invariance to affine transformations of the shape.

Bronstein et al. [2] showed how (20) can be efficiently approximated using an optimization algorithm in the spirit of multidimensional scaling (MDS), referred to as generalized MDS (GMDS). Since the input of this numeric framework are geodesic distances between mesh points, all is needed to obtain an equi-affine GMDS is one additional step where we substitute the geodesic distances with their equi-affine equivalents. Figure 6 shows the correspondences obtained between an equi-affine transformation of a shape using the standard and the equi-affine-invariant versions of the geodesic metric.

### 5.4 Intrinsic symmetry

Raviv et al. [17] introduced the notion of intrinsic symmetries for non-rigid shapes as self-isometries of a shape with respect to a deformation-invariant (e.g. geodesic) distance metric. These self-isometries can be detected by trying to identify local minimizers of the metric distortion or other methods proposed in follow-up publications [16, 23, 11, 22].

Here, we adopt the framework of [17] for equi-affine intrinsic symmetry detection. Such symmetries play an important role in paleontological applications [8]. Equi-affine intrinsic symmetries are detected as local minima of the distortion, where the equi-affine geodesic distance metric is used. Figure 7 shows that using the traditional metric we face a decrease in accuracy of symmetry detection as the affine transformation becomes stronger (the accuracy is the average geodesic mismatch with relation to the ground-truth symmetry). Such a decrease does not occur using the equi-affine metric.

## 6 Conclusions

We introduced a numerical machinery for computing equi-affine-invariant geodesic distances. The proposed tools were applied to applications, like symmetry detection, finding correspondence, and canonization for efficient shape matching. We have extended the ability to analyze approximately isometric objects, like articulated objects, by treating affine deformations as well as non-rigid ones. As our analysis is based on local geometric structures, the affine group could in fact act locally and vary smoothly in space as long as it is encapsulated within our approximation framework. We intend to explore this direction and further enrich the set of transformations one can handle within the scope of metric geometry in the future.

## 7 Acknowledgements

This research was supported in part by The Israel Science Foundation (ISF) grant number 623/08, and by the USA Office of Naval Research (ONR) grant.

## References

- [1] L. Alveraz, F. Guichard, P. L. Lions, and J. M. Morel. Axioms and fundamental equations of image processing. Archive for Rational Mechanics and Analysis, 123(3):199–257, 1993.
- [2] A. Bronstein, M. Bronstein, and R. Kimmel. Efficient computation of isometry-invarient distances between surfaces. SIAM journal Scientific Computing, 28/5:1812–1836, 2006.
- [3] A. M. Bruckstein and D. Shaked. On projective invariant smoothing and evolutions of planarcurves and polygons. Journal of Mathematical Imaging and Vision, 7:225–240, June 1997.
- [4] S. Buchin. Affine differential geometry. Beijing, China: Science Press, 1983.
- [5] D. Burago, Y. Burago, and S. Ivanov. A course in metric geometry, volume 33 of Graduate studies in mathematics. American Mathematical Society, 2001.
- [6] V. Caselles and C. Sbert. What is the best causal scale space for 3d images? SIAM Journal Applied Math., (56):1196–1246, 1996.
- [7] A. Elad and R. Kimmel. On bending invariant signatures for surfaces. IEEE Trans. on Pattern Analysis and Machine Intelligence (PAMI), 25(10):1285–1295, 2003.
- [8] D. Ghosh, N. Amenta, and M. Kazhdan. Closed-form blending of local symmetries. In Proc. SGP, 2010.
- [9] M. Gromov. Structures Métriques Pour les Variétés Riemanniennes. Number 1 in Textes Mathématiques. 1981.
- [10] R. Kimmel and J. A. Sethian. Computing geodesic paths on manifolds. Proc. National Academy of Sciences (PNAS), 95(15):8431–8435, 1998.
- [11] R. Lasowski, A. Tevs, H. Seidel, and M. Wand. A Probabilistic Framework for Partial Intrinsic Symmetries in Geometric Data. In Proc. International Conference on Computer Vision (ICCV), 2009.
- [12] F. Mémoli. Spectral gromov-wasserstein distances for shape matching. In Proc. NORDIA, 2009.
- [13] F. Mémoli and G. Sapiro. A theoretical and computational framework for isometry invariant recognition of point cloud data. Foundations of Computational Mathematics, 5:313–346, 2005.
- [14] K. Mikolajczyk, T. Tuytelaars, C. Schmid, A. Zisserman, J. Matas, F. Schaffalitzky, T. Kadir, and L. V. Gool. A comparison of affine region detectors. IJCV, 65(1–2):43–72, 2005.
- [15] P. Olver, G. Sapiro, and A. Tennenbaum. Invariant geometric evolutions of surfaces and volumetric smoothing. SIAM Journal Applied Math., (57):176–194, 1997.
- [16] M. Ovsjanikov, J. Sun, and L. Guibas. Global intrinsic symmetries of shapes. In Proc. Eurographics Symposium on Geometry Processing (SGP), volume 27, 2008.
- [17] D. Raviv, A. M. Bronstein, M. M. Bronstein, and R. Kimmel. Symmetries of non-rigid shapes. In Proc. Non-rigid Registration and Tracking (NRTL) workshop. See Proc. of International Conference on Computer Vision (ICCV), Oct. 2007.
- [18] G. Sapiro and A. Tannenbaum. On affine plane curve evolution. Journal of Functional Analysis, (1):79–120, January 1994.
- [19] N. Sochen. Affine-invariant flows in the Beltrami framework. Journal of Mathematical Imaging and Vision, 20(1):133–146, 2004.
- [20] V. Surazhsky, T. Surazhsky, D. Kirsanov, S. Gortler, and H. Hoppe. Fast exact and approximate geodesics on meshes. In Proc. SIGGRAPH, pages 553–560, 2005.
- [21] J. N. Tsitsiklis. Efficient algorithms for globally optimal trajectories. IEEE Trans. Automatic Control, 40(9):1528–1538, 1995.
- [22] K. Xu, H. Zhang, A. Tagliasacchi, L. Liu, G. Li, M. Meng, and Y. Xiong. Partial intrinsic reflectional symmetry of 3d shapes. In Proc. SIGGRAPH Asia, 2009.
- [23] X. Yang, N. Adluru, L. Latecki, X. Bai, and Z. Pizlo. Symmetry of Shapes Via Self-similarity. In Proc. International Symposium on Advances in Visual Computing, pages 561–570, 2008.
- [24] L. Yatziv, A. Bartesaghi, and G. Sapiro. O(N) implementation of the fast marching algorithm. J. Computational Physics, 212(2):393–399, 2006.