Geodesics Between 3D Closed Curves Using Path-Straightening

15
Geodesics Between 3D Closed Curves Using Path-Straightening Eric Klassen 1 and Anuj Srivastava 2 1 Department of Mathematics, Florida State University, Tallahassee, FL 32306 2 Department of Statistics, Florida State University, Tallahassee, FL 32306. Abstract. In order to analyze shapes of continuous curves in R 3 , we parameterize them by arc-length and represent them as curves on a unit two-sphere. We identify the subset denoting the closed curves, and study its differential geometry. To compute geodesics between any two such curves, we connect them with an arbitrary path, and then iteratively straighten this path using the gradient of an energy associated with this path. The limiting path of this path-straightening approach is a geodesic. Next, we consider the shape space of these curves by removing shape- preserving transformations such as rotation and re-parametrization. To construct a geodesic in this shape space, we construct the shortest geodesic between the all possible transformations of the two end shapes; this is accomplished using an iterative procedure. We provide step-by-step de- scriptions of all the procedures, and demonstrate them with simple ex- amples. 1 Introduction In recent years, there has been an increasing interest in analyzing shapes of ob- jects. This research is motivated in part by the fact that shapes of objects form an important feature for characterizing them, with applications in recognition, tracking, and classification. For instance, shapes of boundaries of objects in im- ages can be used to short-list possible objects present in those images. Also, shape has been used as a feature in image retrieval [9, 3, 5], [citation removed]. Image-based shape analysis is often restricted to shapes of planar curves [13, 8],[citation removed]; these curves can come, for example, from the boundaries of objects in 2D images. Shapes have also been used for medical diagnosis using non-invasive imaging techniques. Shapes, or growths of shapes, are often used to determine normailty/abnormalty of anatomical parts in computational anatomy [4]. A fundamental tool, central to any differential-geometric analysis of shapes, is the construction of a geodesic path path between any two given shapes in a pre-determined shape space. This tool can lead to a full statistical analysis – computation of means, covariances, tangent-space probability models – on shape spaces. As an example, the construction of geodesics and their use in statistical analysis of shapes of 2D curves is demonstrated in [citation removed]. Extending this framework to other representations of shapes, such as 3D shapes, or shapes

Transcript of Geodesics Between 3D Closed Curves Using Path-Straightening

Geodesics Between 3D Closed Curves UsingPath-Straightening

Eric Klassen1 and Anuj Srivastava2

1 Department of Mathematics, Florida State University, Tallahassee, FL 323062 Department of Statistics, Florida State University, Tallahassee, FL 32306.

Abstract. In order to analyze shapes of continuous curves in R3, weparameterize them by arc-length and represent them as curves on a unittwo-sphere. We identify the subset denoting the closed curves, and studyits differential geometry. To compute geodesics between any two suchcurves, we connect them with an arbitrary path, and then iterativelystraighten this path using the gradient of an energy associated with thispath. The limiting path of this path-straightening approach is a geodesic.Next, we consider the shape space of these curves by removing shape-preserving transformations such as rotation and re-parametrization. Toconstruct a geodesic in this shape space, we construct the shortest geodesicbetween the all possible transformations of the two end shapes; this isaccomplished using an iterative procedure. We provide step-by-step de-scriptions of all the procedures, and demonstrate them with simple ex-amples.

1 Introduction

In recent years, there has been an increasing interest in analyzing shapes of ob-jects. This research is motivated in part by the fact that shapes of objects forman important feature for characterizing them, with applications in recognition,tracking, and classification. For instance, shapes of boundaries of objects in im-ages can be used to short-list possible objects present in those images. Also,shape has been used as a feature in image retrieval [9, 3, 5], [citation removed].Image-based shape analysis is often restricted to shapes of planar curves [13,8],[citation removed]; these curves can come, for example, from the boundariesof objects in 2D images. Shapes have also been used for medical diagnosis usingnon-invasive imaging techniques. Shapes, or growths of shapes, are often used todetermine normailty/abnormalty of anatomical parts in computational anatomy[4]. A fundamental tool, central to any differential-geometric analysis of shapes,is the construction of a geodesic path path between any two given shapes ina pre-determined shape space. This tool can lead to a full statistical analysis –computation of means, covariances, tangent-space probability models – on shapespaces. As an example, the construction of geodesics and their use in statisticalanalysis of shapes of 2D curves is demonstrated in [citation removed]. Extendingthis framework to other representations of shapes, such as 3D shapes, or shapes

2 Eric Klassen1 and Anuj Srivastava2

of surfaces in R3, etc, will require computational tools for constructing geodesicsin appropriate shape spaces.

Although analysis of planar curves are useful in certain image understandingproblems, a more general issue is to study and compare shapes of objects in 3D.Since most objects of interest are 3D objects, and 3D observations of objectsusing laser scans are becoming readily available, an important goal is to analyzeshapes of two-dimensional surfaces in R3. In particular, given surfaces of twoobjects, the task is to quantify differences between their shapes. A differential-geometric analysis of shapes of surfaces, akin to the analysis of planar curvesdiscussed above, remains a difficult and an unsolved problem. To our knowledge,there is no explicit method in the literature for computing geodesic between 3Dclosed curves. Several approximate methods have been pursued over the last fewyears. For example, the papers [11, 10] use histograms of distances on surfacesto represent and compare objects. Another approximate approach that has beensuggested in recent years is to represent surfaces with a finite number of levelcurves, and then compare shapes of surfaces by comparing shapes of correspond-ing level curves [citation removed]. Since these level curves can potentially be 3Dcurves, this approach requires a technique for comparing shapes of closed curvesin R3. However, past research on geometric treatment of shapes of curves wasrestricted mainly to planar curves and a similar differential-geometric approachfor comparing shapes of closed, continuous curves in R3 is not present in theliterature, to the best of our knowledge.

In this paper, we present a differential-geometric technique for constructinggeodesic paths between shapes of arbitrary two closed, continuous curves in R3.Given two curves p1 and p2, our basic approach is to: (i) define a shape space ofall parameterized, closed curves in R3, (ii) construct an initial path connectingp1 and p2 in this space, and (iii) iteratively straighten this path till it becomesa geodesic path. This iteration is performed to minimize an energy associatedwith a path, and flows that minimize that energy are called path-straighteningflows [6, 7], and more recently in [2],[citation removed]. This methodology isquite different from the approach used in [citation removed] where a shootingmethod was used to find geodesic paths between shapes. In a shooting method,one searches for a tangent direction at the first shape such that a geodesic shotin that direction reaches the target shape in a unit time. This search is based onadjusting the shooting direction in such a way that the miss function, defined asan extrinsic distance between the shape reached and the target shape, goes tozero. Intuitively, a path-straightening flow is expected to perform better than ashooting method for the following reasons:

1. While shooting, in principle, one can get stuck in a local minima of themiss function that is bounded away from zero. In other words, the resultinggeodesic may not reach the target shape. In the path-straightening method,by construction, the geodesic always reaches the target shape.

2. Since the shooting is performed using numerical techniques, i.e. using numer-ical gradient of the miss function, these iterations can become unstable if themanifold is sharply curved near the target shape. A path-straightening ap-

Geodesics Between 3D Closed Curves Using Path-Straightening 3

proach, on the other hand, is numerically more stable as it uses the gradientof path length.

We will develop a path-straightening approach to computing geodesics in twosteps. In the first step, we simply consider C, the space of all closed curves inR3, and derive algorithms for computing geodesics in C. Here we do not takeinto account the shapes of these curves, and the fact that many curves havethe same shape. In the second step, we define a shape space S, as a quotientspace of C, and derive algorithms for computing geodesics between elements ofS. Here we take into account the fact that curves that differ by shape-preservingtransformations have identical shape.

The rest of this paper is organized as follows. In Section 2, we present arepresentation of closed curves, and analyze the geometry of C, the space ofsuch curves. Section 3 presents a formal discussion on the construction of path-straightening flows on C, followed by algorithms for computer implementations.This section also presents some illustrative examples on computing geodesicpaths in C. Focusing on shapes of curves, Section 4 extends the construction ofgeodesics to the shape space S. The paper ends with a summary in Section 5.

2 Geometry of Shapes and Shape Spaces

In this section we introduce a geometric representation of curves that underliesour construction of geodesics and the resulting analysis of shapes.

2.1 Representations of Closed Curves

Let p : [0, 2π) 7→ R3 be a curve of length 2π, parameterized by the arc length. Forv(s) ≡ p(s) ∈ R3, we have ‖v(s)‖ = 1 for all s ∈ [0, 2π), in view of the arc-lengthparametrization. Here ‖ · ‖ denotes the Euclidean norm in R3. The function v iscalled the direction function of p and itself can be viewed as a curve on the unitsphere S2, i.e. v : [0, 2π) 7→ S2. Shown in Figure 1(a) is an illustration of thisidea where a closed curve p on R3 is represented by a curve v in S2. There can beseveral representations of the curve p but in this paper we will use the directionfunction v to denote the curve p . It must be noted that v is not necessarilya continuous curve on S2; sharp corners in p will result in discontinuities in v.However, we will assume that v is square integrable. Let P be the set of all squareintegrable maps from [0, 2π) → S2, P = {v|v : [0, 2π) 7→ S2,

∫ 2π

0‖v(s)‖2ds <

∞}. Since we are interested in the shapes of closed curves, and we establish thatsubset as follows. Define a map φ : P 7→ R3 by φ(v) =

∫ 2π

0v(s)ds, and define

C = φ−1(0) ≡ {v ∈ P|φ(v) = 0} ⊂ P. It is easy to see that C is the set of allclosed curves in R3. In the next section we will study the geometry of C in orderto develop tools for shape analysis.

First, we introduce some notation for studying geometry of S2. Recall thatgeodesics on S2 are great circles, and we have analytical expressions for comput-ing them. The geodesic on S2 starting at a point x ∈ S2 in the tangent direction

4 Eric Klassen1 and Anuj Srivastava2

(a) (b)

Fig. 1. (a): A closed curve in R3 is denoted by a curve on S2. (b): For a curve v on S2,f is vector field to S2 on v.

a ∈ Tx(S2) is defined as follows. We want to flow on S2 in the direction given bya, starting at x. This is given by:

χt(x; a) = cos(t‖a‖)x +sin(t‖a‖)‖a‖ a . (1)

χt will be used frequently in this paper to denote geodesics, or great circles, onS2. Another item that we need relates to the rotation of tangent vectors on S2.Let x1 and x2 be two elements in S2, and let a be a tangent to S2 at w1. Then,a vector defined as:

π(a;x1, x2) = a− (2(a · x2)/(‖x1 + x2‖2))(x1 + x2) (2)

is the rotation of a to x2 so that it is now tangent to S2 at x2. Here, (a·b) denotesthe Euclidean inner product of a, b ∈ R3. π(·, x1, x2) : Tx1(S1) 7→ Tx2(S1) is arotation map that takes a tangent vector from x1 to x2; in differential geometrythis is also called the parallel transport.

2.2 Geometry of CTo develop a geometric framework for analyzing elements of C, we would likeunderstand its tangent bundle and to impose a Riemannian structure on it.First, we focus on the set P. On any point v ∈ P, what form does a tangentf to P takes? This tangent f can be derived by constructing a one-parameterflow passing through v, and by computing its velocity at v. Since v is a curve onS2, the tangent f can also be viewed as a field of vectors tangent to S2 on thepath v. This idea is illustrated pictorially in Figure 1(b). We will interchangeablyrefer to f as a tangent vector on P and a tangent vector field on points alongv ⊂ S2. The space of all such tangent vectors, denoted by Tv(P), is given by:Tv(P) = {f |f : [0, 2π) 7→ R3, (f(s) · v(s)) = 0, ∀s}. f(s) and v(s) are vectors inR3. Let f ∈ Tv(P) be a vector field on v such that it is also tangent to C. It canbe shown that f satisfies

∫f(s)ds = 0. That is,

Tv(C) = {f |f : [0, 2π) 7→ R3, (f(s) · v(s)) = 0,

∫ 2π

0

f(s)ds = 0 ∀s} . (3)

Geodesics Between 3D Closed Curves Using Path-Straightening 5

To see that, let α(t) be a path in C such that α(0) = v. Since α(t) ∈ C, wehave

∫ 2π

0α(t)(s)ds = 0, for all t. Taking the derivative with respect to t and

setting t = 0, we get∫ 2π

0α(0)(s)ds = 0. For every tangent vector f at v there

is a corresponding flow α, such that f = α(0), and therefore, this property issatisfied by all tangent vectors.

Riemannian Structure: To impose a Riemannian structure on P, we willassume the following inner product on Tv(P): for f, g ∈ Tv(P), 〈f, g〉 =

∫ 2π

0(f(s)·

g(s))ds.Consider the linear mapping dφv : Tv(P) 7→ R3 defined by dφv(f) =

∫ 2π

0f(s)ds.

Similar to the argument in [citation removed], it can be shown that dφv is sur-jective, and therefore C is a co-dimension three submanifold of P. The adjointof dφv, dφ∗v : R3 → Tv(P) is the unique linear transformation with the propertythat for all f ∈ Tv(P) and w ∈ R3, (dφv(f) · w) = 〈f, dφ∗v(w)〉. Mathematically,this adjoint is given by dφ∗v(w) ≡ f such that f(s) = w − (w · v(s))v(s). Inother words, dφ∗v takes a vector w in R3 and forms a tangent vector-field on v bymaking w perpendicular to v(s) for all s (or by projecting w onto the tangentspace Tv(s)(S2) for each s). This formula makes explicit the role of v in definitionof dφ∗v.

With this framework, we develop tools for projecting v ∈ P into C. Also, wederive a mechanism for projecting f ∈ Tv(P) into Tv(C). For details we refer toa larger paper [citation removed].

3 Path-Straightening Flows in CNow we present our approach for constructing geodesic flows on C. This approachis based on the use of path-straightening flows. That is, we connect the two givenshapes by an arbitrary path in C, and then iteratively straighten it, or shortenit, using a gradient approach till we reach a fixed point. The fixed point of thisiterative procedure becomes the desired geodesic path. In the first subsectionwe present formal mathematical ideas, followed by a discussion of computerimplementations in the following subsection.

3.1 Formal Ideas

For any two closed curves, denoted by v0 and v1 in C, we are interested infinding a geodesic path between them in C. Our approach is to start with anypath α(t) connecting v0 and v1. That is α : [0, 1] 7→ C such that α(0) = v0 andα(1) = v1. Then, we iteratively “straighten” α till it achieves a local minimumof the energy: E(α) ≡ 1

2

∫ 1

0α′(t).α′(t)dt. It can be shown that a local minimum

of E is a geodesic on C. However, it is possible that there are multiple geodesicsbetween a given pair of curves, and a local minimum of E may not correspondto the shortest of all geodesics. Therefore, this approach has the limitation thatit finds a geodesic between a given pair but may not reach the shortest geodesic.

6 Eric Klassen1 and Anuj Srivastava2

Once use certain stochastic techniques to increase the probability of reachingthe shortest geodesic but these are not explored in this paper.

Let H be the set of all paths in C, parameterized by t ∈ [0, 1], and H0 be thesubset of H of paths that start at v0 and end at v1. The tangent spaces of H andH0 are: Tα(H) = {w| ∀t ∈ [0, 1], w(t) ∈ Tα(t)(C)}, where Tα(t)(C) is as specifiedin Eqn. 3, and Tα(H0) = {w ∈ Tα(H)|w(0) = w(1) = 0}. To understand thisspace, consider a path α ∈ H0 and an element w ∈ Tα(H0). Recall that forany t, α(t) is also a curve on S2, which in turn corresponds to a closed curve inR3. Now, w is path of vector fields such that for any t ∈ [0, 1], w(t) is a tangentvector field restricted to the curve α(t) on S2. That is, w(t)(s) is a vector tangentto S2 at the point α(t)(s). Furthermore,

∫ 2π

0w(t)(s)ds = 0 for all t ∈ [0, 1]. Our

study of paths on H requires the use of covariant derivatives and integrals ofvector fields along these paths.

Definition 1 (Covariant Derivative, [1](pg. 309)). For a given path α ∈ Hand a vector field w ∈ Tα(H), one defines the covariant derivative of w along αto be the vector field obtained by projecting dw

dt (t) onto the tangent space Tα(t)(C),for all t. It is denoted by Dw

dt .

Similarly, a vector field u ∈ Tα(H) is called the covariant integral of w along αif the covariant derivative of u is w, i.e. Du

dt = w(t).To make H a Riemannian manifold, we use the Palais metric [12]: for w1,

w2 ∈ Tα(H), 〈〈w1, w2〉〉 = 〈w1(0), w2(0)〉+∫ 1

0

⟨Dw1dt (t), Dw2

dt (t)⟩dt, where Dw/dt

denotes the vector field along α which is the covariant derivative of w. Withrespect to the Palais metric, Tα(H0) is a closed linear subspace of Tα(H), andH0 is a closed subspace of H.

Our goal is to find the minimizer of E in H0, and we will use a gradient flowto minimize E. Therefore, we wish to find the gradient of E in Tα(H0). To dothis, we first find the gradient of E in Tα(H) and then project it into Tα(H0).

Theorem 1. The gradient vector of E in Tα(H) is given by a vector field q suchthat Dq/dt = α′ and q(0) = 0. In other words, q is the covariant integral of α′

with zero initial value at t = 0.

Proof: Refer to a more detailed paper by the authors [citation removed].Given α′, the vector field q is obtained using numerical techniques for covari-

ant integration, as described in the next section. Next want to project tangentfield q ∈ Tα(H) to the space Tα(H0).

Definition 2 (Covariantly Constant). A vector field w along the path α iscalled covariantly constant if Dw/dt is zero at all points on α.

Definition 3 (Geodesic). A path is called a geodesic if its velocity vector fieldis covariantly constant. That is, α is a geodesic if D

dt (dαdt ) = 0 for all t.

Definition 4 (Covariantly Linear). A vector field w along the path α is calledcovariantly linear if Dw/dt is a covariantly constant vector field.

Geodesics Between 3D Closed Curves Using Path-Straightening 7

Lemma 1. The orthogonal complement of Tα(H0) in Tα(H) is the space of allcovariantly linear vector fields w along α.

Definition 5 (Parallel Translation). A vector field u is called the forwardparallel translation of a tangent vector w ∈ Tα(0)(C), along α, if and only ifu(0) = w and Du(t)

dt = 0 for all t ∈ [0, 1].Similarly, u is called the backward parallel translation of a tangent vector

w ∈ Tα(1)(C), along α, when for α(t) ≡ α(1 − t), u is the forward paralleltranslation of w along α.

It must be noted that parallel translations, forward or backward, lead to vectorfields that are covariantly constant.

According to Lemma 1, to project the gradient q into Tα(H0), we simplyneed to subtract off a covariantly linear vector field which agrees with q at t = 0and t = 1. Clearly, the correct covariantly linear field is simply tq(t), where q(t)is the covariantly constant field obtained by parallel translating q(1) backwardsalong α. Hence, we have proved the following theorem.

Theorem 2. Let α : [0, 1] 7→ C be a path, α ∈ H0. Then, with respect to thePalais metric:

1. The gradient of the energy function E on H is the vector field q along αsatisfying q(0) = 0 and Dq

dt = α′.2. The gradient of the energy function E restricted to H0 is w(t) = q(t)− tq(t),

where q is the vector field defined in the previous item, and q is the vectorfield obtained by parallel translating q(1) backwards along α.

Theorem 3. For a given pair v0, v1 ∈ C, a critical point of E on H0 is ageodesic on C connecting v0 and v1.

3.2 Computer Implementations

In this section, we provide step-by-step details for different procedures mentionedin the last section. In particular, we provide algorithms for: (i) finding the di-rection vector representation of a given closed curve p, (ii) given any two closedcurves, v0 and v1, initializing a path α connecting them in C, (iii) computing thevelocity vector α′ for a given path α, (iv) computing the covariant derivative qof α′, (v) computing the backward parallel transport q of q(1), and (vi) updatingthe path α along the gradient direction given by the vector field w. We explainthese procedures one by one next.

1. Direction Function Representation of closed curves: The first com-putational step in our analysis is to find an element of C for a given 3D curve.Let xi ∈ R3, i = 1, . . . ,m be a given order set of samples on a 3D curve. andwe want to re-sample this curve using n uniform samples as follows:

8 Eric Klassen1 and Anuj Srivastava2

Subroutine 1 (Uniform Re-sampling of Curve)set xm+1 = x1

compute ρi = ‖xi+1 − xi‖, i = 1, . . . , mwhile standard-deviation({ρi}) > ε

si =∑i

j=1 ρj, i = 1, . . . , mt = ([1 : n]/n)sm

kj = argmini(si ≥ tj), j = 1, . . . , ny1 = x1

for j = 1, . . . , n− 1yj+1 = ((tj − xkj−1)xkj+1 + (xkj

− tj)xkj)/(xkj+1 − xkj

)wj = yj+1 − yj, and vj = wj

‖wj‖ , ρj = ‖wj‖,end jset m = n and x = y.

end whileproject v into C

Shown in Figure 2 is an example. The given curve with m = 200 is shownin the left panel; it is re-sampled repeatedly for n = 30 with results shownin next two panels. To show that points become increasingly uniform, weshow the standard deviation of ρjs at every iteration. A standard deviationof zero implies that the points are uniformly spaced.

−50

0

50

100

150

200

250

300

350

−100

−50

0

50

100

150

200

250

300

0

50

100

150

200

250

300

350

−100

−50

0

50

100

150

200

250

300

0

50

100

150

200

250

300

350

−100

−50

0

50

100

150

200

250

300 0 5 10 15 20 25 30 350

0.5

1

1.5

2

2.5

3

3.5

4

Fig. 2. Resampling the piecewise-linear curve formed by the given set of points usingSubroutine 1. Right: evolution of standard deviation of distances between resampledpoints.

2. Initialize the path α: Given v0 and v1 in C, we want to form a pathα : [0, 1] 7→ C such that α(0) = v0 and α(1) = v1. There are several ways ofdoing this. One is to form 3D coordinates p0 and p1, respectively, associatedwith the two shapes, and connect p0(s) and p1(s) linearly, for all s, usingpt(s) = tp1(s) + (1− t)p0(s). The intermediate curves are neither uniformlysampled nor closed. We can use Subroutine 1 to re-sample them uniformlyand to close them. The other idea is to use the fact that v0(s), v1(s) ∈ S2,and construct a path in S2 from one point to another, parameterized by t.We summarize this idea in the following subroutine.

Subroutine 2 (Initialize a path α)for all s ∈ [0, 2π]

Geodesics Between 3D Closed Curves Using Path-Straightening 9

define θ(s) = cos−1(v0(s) · v1(s))define f(s) = v1(s)−(v0(s)·v1(s))v0(s), and f(s) = θ(s)f(s)/‖f(s)‖.

end sfor all t ∈ [0, 1]

for all s ∈ [0, 2π)define α(t)(s) = χ1(v0(s); f(s))

end sproject α(t) into C

end t

In case v0(s) and v1(s) are antipodal points on S2, and thus f(s) = 0, onecan arbitrarily choose a path connecting them on the sphere. That is, chooseany f(s) ∈ Tv0(s)(S1) of length θ(s). This situation rarely occurs in practicalsituations.

3. Vector Field α′: In order to compute the gradient of E in Tα(H), wefirst need to compute the path velocity α′. For a continuous path α′(t)automatically lies in Tα(t)(C), but in the discrete case one has to ensurethis property using additional steps. This process uses the approximationx′(t) ≈ (x(t) − x(t − ε))/ε, modified to account for the nonlinearity of C.Let the interval [0, 1] be divided into k uniform bins. The procedure forcomputing α′ at these discrete times is summarized next.

Subroutine 3 (Computation of α′ along α)for τ = 1, . . . , k

for all s ∈ [0, 2π)θ(s) = k cos−1(α( τ

k )(s) · α( τ−1k )(s))

f(s) = −α( τ−1k )(s) + (α( τ−1

k )(s) · α( τk )(s))α( τ

k )(s)α′( τ

k )(s) = θ(s)f(s)/‖f(s)‖.end sproject α′( τ

k ) into Tα( τk )(C)

end τ .

Now we have a vector field α′ ∈ Tα(H) along a given path α ∈ H.4. Computation of Vector field q: We seek a vector field q such that q(0) = 0

and Dqdt = α′. In other words, q is the covariant integral of the vector field

α′.

Subroutine 4 (Covariance Integration of α′ to form q)for τ = 0, 1, 2, . . . , k − 1,

for all sdefine q‖( τ

k )(s) = π(q( τk )(s); α( τ

k )(s), α( τ+1k )(s)).

(π is defined in Eqn. 2)set q( τ+1

k )(s) = 1kα′( τ+1

k )(s) + q‖( τk )(s).

end send τ

q‖( τk ) is the parallel transport of q( τ

k ) from Tα( τk )(C) to Tα( τ+1

k )(C). Thissubroutine results in the gradient vector field {q( τ

k ) ∈ Tα( τk )(C)|τ = 1, . . . , k}.

10 Eric Klassen1 and Anuj Srivastava2

5. Covariant Vector Field q: Given q(1), we need to find a vector field qalong the path α in C that is the backward parallel transport of q(1). Wehave already computed the points α(0), α(1/k), α(2/k), . . . , α(1). Each α( τ

k )is an element of C, i.e. it is a curve on S2. We will perform the backwardparallel transport iteratively, as follows.Subroutine 5 (Backward Parallel Transport)

set q(1) = q(1)let l = (〈q(1), q(1)〉)1/2

for τ = k − 1, k − 2, . . . , 3, 2for all s ∈ [0, 2π)

q( τk )(s) = π(q( τ+1

k )(s); α( τ+1k )(s), α( τ

k )(s))end sproject q( τ

k ) into Tα( τk )(C)

let l1 = (⟨q( τ

k ), q( τk )

⟩)1/2

set q( τk ) = q( τ

k )l/l1;end τq(0) = 0

6. Gradient of E: With the computation of q and q along the path α, thegradient vector field of E is given by: for any τ ∈ {0, 1, . . . , k} and s ∈ [0, 2π)

w(τ

k)(s) ≡ (q(

τ

k)(s)− (

τ

k)q(

τ

k)(s)) ∈ Tα( τ

k )(s)(S2) . (4)

7. Update in Gradient Direction: Now that we have computed the gradientvector field w on the current path α, we update this path in the directiongiven by w: for τ = 1, 2, . . . , k and s ∈ [0, 2π),

α(τ

k)(s) = χ1(α(

τ

k)(s); w(

τ

k)(s)) . (5)

Now we summarize the algorithm to compute a geodesic path between anytwo given closed curves in R3. We assume that the curves are available in formof sampled points on these curves.

Algorithm 1 (Find a geodesic between two curves in C) 1. Compute therepresentations of each curve in C using Subroutine 1. Denote these elementsby v0 and v1, respectively.

2. Initialize a path α between v0 and v1 using Subroutine 2.3. Compute the velocity vector field α′ along the path α using Subroutine 3.4. Compute the covariant integral of α′, denoted by q, using Subroutine 4. If∑k

τ=1 〈α′(τ), α′(τ)〉 is small, then stop. Else, continue to the next step.5. Compute the backward parallel transport of the vector q(1) along α using the

Subroutine 5.6. Compute the full gradient vector field of the energy E along the path α,

denoted by w, using Eqn. 4.7. Update α using Eqn. 5. Return to Step 3.

The desired geodesic path is given by the resulting α, and its length is given bydC(v0, v1) =

∑kτ=1(

⟨α′( τ

k ), α′( τk )

⟩)1/2. For a later use, we highlight α′(0) as the

initial velocity vector in Tα(0)(C) that generates the geodesic at α(0).

Geodesics Between 3D Closed Curves Using Path-Straightening 11

3.3 Experimental Results

In this section we describe some computer experiments for generating geodesicpaths between shapes in C. Let the two curves of interest be: p0(t) = (a cos(t),

b sin(t), c√

b2 − a2 sin2(t)), and p1(t) = (a(1 + cos(t)), sin(t), 2 sin(t/2)), and wewant to compute a geodesic path between them in C. Shown in Figure 3 are theresults. The first two panels show the two curves. The first curve is an exampleof a bicylinder and the second one is an example of a Viviani curve. We applyAlgorithm 1 on these two curves to generate a geodesic path between them.The third panel shows the evolution of the energy E during the iterations inAlgorithm 1. The last panel shows a view of the resulting geodesic path in R3.

−1

−0.5

0

−1

−0.5

0

0.5

1

−0.15−0.1

−0.050

−1.5

−1

−0.5

0

−0.5

0

0.5

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1 1.5 2 2.5 3 3.5 4 4.5 5

3.45

3.5

3.55

3.6

0

2

4

6

8

10

12

14

16

−2

0

2

−1

0

1

Fig. 3. The two shapes used in computing geodesic path, evolution of the energy Eduring path-straightening, and a view of that geodesic in R3.

Shown in Figure 4 is another example, where the two end shapes (left twopanels), evolution of the energy (middle), and a view of the final geodesic path(right) are displayed.

0

0.2

0.4

0.6

0.8

1

1.2−0.2

0

0.2

0.4

0.6

0.8

1

−1

−0.5

0

−0.2

0

0.2

0.4

0.6

0.8

1

1.2 0

0.2

0.4

0.6

0.8

1

1.2

−0.8−0.6−0.4−0.2

00.2

0 2 4 6 8 10 12 1411

12

13

14

15

16

17

18

19

20

21

0 2 4 6 8 10 12 14 16

−1

0

1

2

Fig. 4. Geodesic Computation: The two curves in C, evolution of E as Algorithm 1proceeds, and a view of the resulting geodesic path.

4 Geodesics on Shape Space

So far we have consider the space of closed curves C and have presented a nu-merical technique for finding geodesics between elements of C. However, when

12 Eric Klassen1 and Anuj Srivastava2

considering shapes of these curves we observe that many points in C represent thesame shape. This is because a rigid rotation or a re-parametrization can changethe representation of a curve but not its shape. To study shapes of curves, andnot the curves themselves, we have to remove these shape-preserving transforma-tions from the representation. Towards that end, we introduce the shape spaceas a quotient space of C, modulo shape preserving transformations such as rigidrotations and re-parameterizations. Then, we describe techniques for computinggeodesic paths on the shape space.

4.1 Shape Space

The main goal of this paper is to analyze shapes of closed curves in R3, andwe seek a way to represent shapes of these curves. By representing a closedcurve p with its velocity vector v ∈ C, we have already removed the translationvariability. This is due to the fact that a rigid translation of a closed curvedoes not change its velocity vector, and hence its representation. Similarly, byrequiring the curves to be of length 2π, we have removed the scale variabilityalso. On the other hand, a rigid rotation or a re-parametrization do change thevelocity field along the curve, so we have to remove them explicitly.

For the unit circle S1, and an angle θ ∈ S1, the re-parametrization of a curvev ∈ C, defined by: (θ ◦ v)(s) = v((s − θ)mod 2π

). It is easy to see that θ ◦ vis also in C, and it denotes a curve with the same shape as that of v. S1 iscalled the re-parametrization group. Similarly for rotation: consider the space of3× 3 rotation matrices, the special orthogonal group SO(3), and for O ∈ SO(3)we define a rotated shape Ov(s) = O · v(s), ∀s ∈ [0, 2π). SO(3) is called therotation group. Both these groups, S1 and SO(3), act on C (see [1] for definitionof group action), and we can define the orbit associated with a curve v ∈ Cas: Cv = {w ∈ C|w = θ ◦ Ov, ∀θ ∈ S1, ∀O ∈ SO(3)}. All the elements ofCv has the same shape, and one can view memberships of these orbits as anequivalence relation. These orbits divide C into disjoint equivalence classes, eachsubset being associated with a unique shape. Hence, the shape space is definedto be the quotient space S = C/(S1 × SO(3)). It must be noted that the actionof S1 × SO(3) on C is isometric, i.e. the distance between two points in C doesnot change if we re-parameterize and rotate both of them in the same way, i.e.dC(v0, v1) = dC(θ ◦Ov0, θ ◦Ov1), ∀θ ∈ S1, ∀O ∈ SO(3).

4.2 Geodesics in SThe shape space S is a quotient space of C, and geodesics in S correspond tothose geodesics in C that are of shortest lengths amongst all possible pairs inthe two respective orbits. In other words, given two closed curves v0, v1 ∈ C, weseek the shortest geodesic connecting their orbits Cv0 and Cv1 . Mathematically,we seek a path in C whose length is given by dS(v0, v1) where dS(v0, v1) =minu0∈Cv0 ,u1∈Cv1

dC(u0, u1). Since the action of S1 and SO(3) on C is isometric,we can restate this minimization as:

dS(v0, v1) = minθ∈S1,O∈SO(3)

dC(θ ◦Ov0, v1) . (6)

Geodesics Between 3D Closed Curves Using Path-Straightening 13

We do not have an analytical solution for this minimization, so we are going toperform this numerically using an iterative technique. Let (θ,O) ∈ S1×SO(3) bethe current estimates of the minimizer, and let ψ(t, f, v0) denote a geodesic flowstarting from v0 = θ ◦ Ov0 ∈ C, in the direction f ∈ Tv0(C), and parameterizedby t ∈ R+. The previous section discussed a procedure for finding f such thatψ(1, f, v0) = v1. We can write a four-dimensional subspace Tv0(S1 × SO(3)), asubspace of Tv0(C), such that flows in that direction do not change the shapeof v0. The projection of f into that subspace provides the best incrementalrotation and shift (for re-parametrization) for solving the minimization in Eqn.6. A repeated application of this idea – form a four-dimensional subspace at thecurrent v0 and find the best incremental rotation-shift – leads to the optimalsolution. This procedure is summarized next. Define, E1, E2, and E3 form anorthonormal basis of all 3× 3 skew-symmetric matrices.

Subroutine 6 (Geodesic on S)initialize θ ∈ S1, O ∈ SO(3), and β = [1 1 1 1]T .while ‖β‖ > ε

compute v0 = θ ◦Ov0.find f = FindGeodesic(v0, v1) using Algorithm 1.form functions g1(s) = E1f(s), g2(s) = Esf(s), g3(s) = E3f(s),

and g4(s) = f ′(s).use Gram-Schmidt on gis to obtain his.form βi = 〈f, hi〉, Aij = 〈gi, hj〉, and γ = A−1β.update O = O exp(δ

∑3i=1 βiEi) and θ = θ+δβ4, for a small δ > 0.

end while

Shown in Figure 5 is an illustration of this idea. The left panel shows theevolution of geodesic length as iterations in Subroutine 6 proceeds. The middlepanel shows the geodesic path between the two shapes at the start and the rightpanel shows the final (shortest) geodesic.

0 5 10 15 20 254

6

8

10

12

14

16

02

46

810

1214

16

−1

0

1

2

−2−101

02

46

810

1214

16

−1

0

1

2

−101

Fig. 5. Left: Evolution of the geodesic length under Subroutine 6. Middle: A geodesicpath in C between the end shapes, to initialize the subroutine. Right: the resultinggeodesic path in S.

The incremental update in Subroutine 6 is a local procedure, and dependingupon the initialization of (θ,O), there is a possibility of this procedure getting

14 Eric Klassen1 and Anuj Srivastava2

stuck in a local minima of the geodesic distance function (Eqn. 6). In case ofshapes with rotational symmetries, or re-parametrization symmetries, it is un-derstandable that this greedy procedure gets stuck in a local minima. Our exper-iments indicate that the search over SO(3) in this procedure reaches the globalminima consistently, even though the minimizer may not be unique. Shown inthe top row Figure 6 are two examples of evolution of geodesic length, whenminimizing over O ∈ SO(3), while keeping θ ∈ S1 fixed. Different curves corre-spond to random initial values of O. In each case, starting from random initialorientations of v0, the greedy procedure achieves the minimum geodesic length.

The case of re-parametrization is different. In search for optimal θ, the pro-cedure gets stuck in local minima, with geodesics much longer than the desiredshortest geodesic. To minimize over θ ∈ S1, we can use an exhaustive grid search,as depicted in Figure 6, i.e. minimize O for each θ and select the shortest length.

0 10 20 30 40 501

2

3

4

5

6

7

8

9

0 0.5 1 1.5 2 2.5 3 3.50.5

1

1.5

2

2.5

3

3.5

4

4.5

5

Fig. 6. Example of exhaustive search. Left: Evolutions of geodesic lengths during min-imization over O ∈ SO(3) (keeping θ fixed) for different initial conditions. Right:minimum geodesic lengths achieved for different θ.

5 Summary

We have presented a differential geometric approach to studying shapes of closedcurves in R3. The main tool presented in this study is the construction of geodesicpaths between arbitrary two curves on an appropriate space of closed curves.This construction is based on path-straightening, i.e. we construct an initial pathbetween those two curves, and iteratively straighten it using the gradient of theenergy E. The limit point of this procedure is a geodesic path. Finally, to compareshapes of two curves, we remove the shape-preserving transformations (rotationand re-parametrization) using an iterative local search. We have presented step-by-step procedures for computing these geodesics, and have illustrated themusing simple examples.

References

1. W. M. Boothby. An Introduction to Differential Manifolds and Riemannian Ge-ometry. Academic Press, Inc., 1986.

Geodesics Between 3D Closed Curves Using Path-Straightening 15

2. G. Dziuk, E. Kuwert, and R. Schatzle. Evolution of elastic curves in Rn: existenceand computation. SIAM J. Math. Anal, 33:1228–1245, 2002.

3. J. P. Eakins, K. Shields, and J. Boardman. ARTISAN – a shape retrieval systembased on boundary family indexing. In Storage and Retrieval for Still Image andVideo Databases IV. Proceedings SPIE, volume 2670, pages 17–28, 1996.

4. U. Grenander and M. I. Miller. Computational anatomy: An emerging discipline.Quarterly of Applied Mathematics, LVI(4):617–694, 1998.

5. M. M. Kazhdan. Shape Representations and Algorithms for 3D Model Retrieval.PhD thesis, Computer Science, Princeton, April 2004.

6. J. Langer and D. A. Singer. Curve straightening and a minimax argument forclosed elastic curves. Topology, 24:75–88, 1985.

7. J. Langer and D. A. Singer. Curve straightening in Riemannian manifolds. Ann.Global Anal. Geom., 5:133–150, 1987.

8. P. W. Michor and D. Mumford. Riemannian geometries on spaces of plane curves.Journal of the European Mathematical Society, to appear, 2005.

9. F. Mokhtarian, S. Abbasi, and J. Kittler. Efficient and robust shape retrieval byshape content through curvature scale space. In Proceedings of First InternationalConference on Image Database and MultiSearch, pages 35–42, 1996.

10. M. Novotni and R. Klein. A geometric approach to 3D object comparison. In In-ternational Conference on Shape Modeling and Applications, pages 167–175, 2001.

11. R. Osada, T. Funkhouser, B. Chazelle, and D. Dobkin. Matching 3D modelswith shape distributions. In International Conference on Shape Modeling andApplications, pages 154–166, 2001.

12. R. S. Palais. Morse theory on Hilbert manifolds. Topology, 2:299–340, 1963.13. L. Younes. Optimal matching between shapes via elastic deformations. Journal of

Image and Vision Computing, 17(5/6):381–389, 1999.