267
Views
0
CrossRef citations to date
0
Altmetric
Articles

Riemannian methods for optimization in a shape space of triangular meshes

&
Pages 1011-1039 | Received 08 Apr 2013, Accepted 20 Oct 2014, Published online: 17 Nov 2014

Abstract

In this paper, the applicability of two optimization algorithms in the context of Riemannian manifolds is investigated. More precisely, the steepest descent method and the nonlinear conjugate gradient method are used to solve the Shape-From-Shading problem in a shape space of triangular meshes. For this reason, appropriate Riemannian metrics are introduced in this shape space. Instead of taking steps along straight lines, propagation along geodesics with respect to the Riemannian metric is employed. This requires to formulate the geodesic equation and the equation of parallel translation in the shape space of triangular meshes. In general, the proposed geodesic optimization algorithms outperform the standard steepest descent method concerning various quality measures and the visual impression of the reconstructed surface. In addition, it is shown that an appropriately chosen Riemannian metric can guide the optimization process towards a desired class of surfaces.

AMS Subject Classifications:

1 Introduction and prerequisites

The solution of optimization on differentiable manifolds is – on the one hand – a very well investigated field, especially if dealing with embedded implicit manifolds. In this case, the manifold Mn-k is the geometric locus of the solution to the equation h(x)=0 with hC1(Rn,Rk) and the whole extremely well-developed machinery of constrained optimization applies. The iterative optimization problem is set up in the embedding space and produces either feasible points which lie on the manifold in every step or infeasible points for which only the limit of the sequence of approximate solutions is an element of Mn-k. If the manifold is either not embedded or already given in (local) coordinates, the situation seems even less complicated because the optimization algorithm can be set up in parameter space and the available techniques of unconstrained optimizations apply, with the possible complication that the parametrization might have to be changed if the sequence of approximate solutions leaves a coordinate patch. It is, however, obvious that one and the same algorithm will produce very different iterates if applied within different coordinate systems. Especially, the measurement of step lengths, distances between subsequent iterates, angles which will be used in projection formulas etc. will be dependent on the coordinate system and might not reflect the actual geometry of the manifold.

It has been suggested by several authors (see e.g. [Citation1] or the monograph [Citation2]) to use an appropriate Riemannian structure on the manifold for the metric aspects occurring in optimization algorithms. Moreover, geodesics (see [Citation3] for an introduction) on the manifold can be viewed as a natural generalization of straight lines in vector space. Consequently, geodesics can be used to define lines along which the cost functional decreases and which serve as one-dimensional search regions. It has been shown that gradient-type, Newton-type and Quasi-Newton or CG-type algorithms can be formulated and analysed in the Riemannian context. The use of differential geometric methods for the solution of optimization problems over feasible sets of geometric variables ΩRn is rather a recent development. The terminology ‘shape space’ is used in this context as an umbrella term for sets of geometric variables endowed with an appropriate topological, metric or differential structure. Mumford and Michor [Citation4] introduced a general class of metrics on equivalence classes of parametrized curves obtaining geometric metrical structures which are independent of the chosen parametrization. Even though the paper is not explicitly aimed towards optimization, it is manifest to use the construction of geodesics and parallel transport (see e.g. [Citation3]) in shape space for the solution of problems in computer vision such as shape interpolation or shape identification. Pottman and co-workers constructed and implemented metrics on spaces of discretized surfaces in R3 also for the solution of problems occurring in computer vision. (See [Citation5] for an overview.) Very recently, Schulz [Citation6] presented a general framework for the construction and analysis of algorithms for the solution of shape optimization problems using a Riemannian structure on the underlying shape space. In [Citation7] some classes of optimization algorithms on Riemannian manifolds using the concepts of geodesic propagation and parallel transport are analysed and applied in a shape space framework.

In this article, we discuss the steepest descent and the nonlinear conjugate gradient method formulated in the shape space of triangulated surfaces in R3 with N nodes. See e.g. [Citation8] for an introduction to the steepest descent and the nonlinear conjugate gradient method in vector spaces. The standard inner product in R3N might not describe the underlying geometry of the shape space in an appropriate way. Consequently, the deformation of a surface corresponding to a straight line in the shape space is probably not a ‘natural’ evolution of the surface in R3. We, thus, endow this space with Riemannian metrics which give rise to geodesics different from straight lines. In principle, we construct the metrics in such a way that the resulting geodesics correspond to deformations which join different surfaces in the desired fashion. Our shape space versions of the steepest descent and the nonlinear conjugate gradient algorithm are essentially the same as their standard formulations up to the fact that steps along straight lines are replaced by steps along geodesics. This approach allows one to guide the optimization process in shape space within a certain class of surfaces.

The structure of the paper is the following. In the remainder of this introductory section, we provide standard concepts and results from differential geometry explaining geodesic and parallel movement in Riemannian manifolds. Section 2 is devoted to the introduction of a space of triangulated surfaces in R3 together with an appropriate tangent bundle. In Section 3, a class of metrics on the shape space is defined which measures the deviation from isometric distortion. The geodesic equation and the equation of parallel transport with respect to this class are derived. As a reference, the Euclidian metric in the parameter space is also investigated. The next Section 4 introduces the shape-from-shading problem and its formulation as a shape optimization problem. In Section 5, a steepest descent algorithm and a nonlinear conjugate gradient method are formulated in the described Riemannian framework. Several numerical experiments documented in Section 6 conclude the paper.

For the remainder of the paper, we make the following conventions. Every manifold is assumed to be a differentiable manifold; and every curve in a manifold is assumed to be of class C. In addition, we shall often use the notationi:=uifor the basis vectors of the tangent space TpMn to a manifold Mn at a point pMn. The set of all tangent vector fields on Mn is denoted by V(Mn). If Mn is a manifold with a (Pseudo-)Riemannian metric ·,·, we denote the (pseudo-)metric tensor and its inverse bygij:=i,jandgij:=(G-1)ijwhereG:=(gij)ij.Furthermore, we use the Einstein summation convention: Any index which occurs twice in a product is to be summed from 1 up to the space dimension.

Definition 1

Let Mn be a manifold. Then, a map D:V(Mn)×V(Mn)V(Mn) is called a connection on Mn, if the following properties are satisfied for all v,w,X,YV(Mn), a,bR and fC(Mn):DX(av+bw)=aDXv+bDXw,DaX+bYv=aDXv+bDYv,DX(fv)=X(f)v+fDXv.Moreover, we call a connection Dtorsion free if for all X,YV(Mn),[X,Y]=DXY-DYX,where [X,Y] denotes the Lie bracket. If Mn is a Riemannian manifold with metric ·,·, we call a connection Dmetric, if for all ZV(Mn),XY,Z=DXY,Z+Y,DXZ.

Definition 2

Let Mn be a manifold with local coordinates (u1,,un) and D be a connection on Mn. Then, the symbols Γjki defined viaDjk=iΓjkiare called the coefficients of the connection D.

We have the following uniqueness result.[Citation9]

Theorem 3

Let Mn be a Riemannian manifold with metric ·,·. Then, there exists a unique torsion free and metric connection :V(Mn)×V(Mn)V(Mn). This connection is given byXY,Z=12(XY,Z+YZ,X-ZX,Y-X,[Y,Z]+Y,[Z,X]+Z,[X,Y])and with local coordinates (u1,,un),Γjki=12gligljuk+gkluj-gjkul.

In the situation of Theorem 3, the connection is called the Levi-Civita connection and its coefficients Γjki are called the Christoffel symbols.

Definition 4

Let Mn be a Riemannian manifold, x a curve in Mn, YV(Mn) and TV(Mn) such that T=dx/dt along x.

  • x is called a geodesic, if(1) TT=0.(1)

  • Y is said to be parallel displaced along x, if(2) TY=0.(2)

Using the formula for the Christoffel symbols, we obtain the geodesic equation (Equation3) and the equation of parallel translation (Equation4) by expressing (Equation1), respectively, (Equation2) in local coordinates.

Proposition 5

Let Mn be a Riemannian manifold with local coordinates (u1,,un), x=x(u(t)) a curve in Mn, YV(Mn) and TV(Mn) such that T=dx/dt along x.

  • x is a geodesic,if and only if(3) d2uidt2+Γjkidujdtdukdt=0for alli{1,,n}.(3)

  • Y is parallel displaced along x, if and only if(4) dYidt+ΓjkidujdtYk=0for alli{1,,n}.(4)

2 Optimization in the shape space of triangular meshes

In the sequel, we shall always consider the shape space S of triangulated meshes embedded in R3 with a fixed connectivity graph and a given number of nodes N. For a shape MS we will use PR3 to denote the set of all nodes of M. For sure, M and P refer to the same object, the triangular mesh, but from different perspectives; on the one hand, M describes the mesh as an element in an abstract shape space, whereas P characterizes the mesh as a finite subset of R3. We also use the notation N(p) for the set containing p and all nodes of M which share a common edge with p and call N(p) the set of all neighbours of p. Likewise, T(p) denotes the set of all triangles of M which have p as a vertex. Moreover, we define CP2 as the set of all (p,q)P2 which are neighbours.

Since there is a one-to-one correspondence between meshes MS and vectors in R3N, we may identify the shape space S with R3N. However, to reconstruct the shape M from a vector of 3N coordinates, knowledge of the local connectivity relation C is necessary. Without this, the vector xR3N represents only an unconnected point cloud. Using R3N with its generic inner product as parameter space consequently means that the local geometry of the shape is not taken into account. In contrast – depending on the specific problem – we shall propose to use special Riemannian metrics to endow the shape space S with an appropriate geometry. Strictly speaking, these metrics have to be defined on each tangent space TMS for MS; this will be done below.

In the context of optimization, we are interested to define a consistent framework for the update of the shape variable (i.e. a deformation of the shape). We will restrict the admissible deformations of a triangular mesh to those which are normal to the surface. Specifically, every node pP may only be moved along the local surface normal vector npR3. Consequently, our deformation fields are given by(5) (Xp)pP=(κpnp)pPTMS(5) with κpR. Hence, we do not consider all possible tangent vectors in the 3N-dimensional tangent space TMS but only vectors of the form (Equation5), which constitute an N-dimensional subspace of TMS. Mathematically speaking, a deformation of a mesh MS is a curve in S passing through M. Thus, we only consider curves in S whose tangent vectors are given by (Equation5). Therefore, all the admissible deformations of a surface MS are uniquely determined by the vector field κ:=(κp)pPRN on S. Now, we have to define properly the normal vector npR3 of a triangulated mesh at a vertex pP. We set(6) np:=T(p)(t2-p)×(t3-p)-1T(p)(t2-p)×(t3-p)(6) where t1,t2 and t3 are the vertices of a generic triangle T with the convention t1=p and consistent orientation, and · denotes the Euclidean norm in R3. Note that (Equation6) is a weighted average of the normal vectors to the triangles adjacent to p. More precisely, the normal vectors of triangles with larger areas have a larger contribution than the ones with small areas. Below, we shall often use the notation n:=(np)pPR3N for the concatenation of all normal vectors np with pP. See Table for a collection of the notations introduced above.

Table 1. Definitions of some frequently used notations.

Let us now formulate the geodesic equation within this setting. For this case, we assume to have given a Riemannian metric on the shape space S. Then, due to Theorem 3, we may consider the Levi-Civita connection with its coefficients Γαβγ – the Christoffel symbols. Now, from Proposition 5, we see that we can easily reduce the geodesic equation to the following system of first-order differential equations:(7) u˙γ=Tγ,T˙γ=-ΓαβγTαTβ,(7) where (uγ)γ{1,,3N}=(p)pP is just a different notation for the concatenation of all coordinates of nodes pP to a vector in R3N. Since we only allow deformations along the local surface normals, we also have p˙=κpnpR3 and, hence, T=κ·nR3N whereκ·n=κ1n1κNnNIn a similar way, we rewrite the equation of parallel transport from Proposition 5 as(8) X˙γ=-ΓαβγXαTβ(8) where X is the parallel translate of an initial vector X0, tangent to the shape space S, along a geodesic u with tangent vector T. Again, we are only interested in tangent vectors X which are locally given by Xp=λpnp and, therefore, read X=λ·nR3N. However, it is not clear up to now that the geodesic equation or the equation of parallel translation admits solutions, for which T=κ·n, respectively X=λ·n holds throughout the propagation of the shape. For sure, we know from the Theorem of Picard and Lindelöf (see e.g. [Citation10]) that both differential equations have unique solutions at least within a sufficiently small time interval I. But we do not know whether this solution is in these N-dimensional subspaces of TM(t)S for all tI provided this is true for the initial data. Nevertheless, we shall see below that we are able to show the unique existence of such solutions, at least for those metrics which we consider.

3 Construction of Riemannian metrics

We now introduce different Riemannian metrics on the tangent space TMS to the space of triangular meshes S in some shape MS. Let us first define the Euclidean metricX,YEu:=pPxp,ypwhere X=(xp)pP,Y=(yp)pPTMS with xp,ypR3. So far, the metric is defined on the whole tangent space at MS. Specifically for N1=(κpnp)pP,N2=(λpnp)pPTMS we obtainN1,N2Eu=pPκpλp.It is obvious that ·,·Eu actually defines a Riemannian metric (not only a pseudo metric) on the shape space S.

We next define a metric on S which takes geometrical properties of the shape variable into account. We setX,Y0Hn:=(p,q)Cxp-xqp-qn,p-qyp-yqp-qn,p-qfor nN, X=(xp)pP,Y=(yp)pPTMS and vectors xp,ypR3. We emphasize that the notation is motivated by Hölder type estimates, and not by Sobolev spaces. Since the right-hand side only defines a Riemannian pseudo-metric, we write ·,·0Hn and define the Hn-metric via the following regularization of ·,·0Hn with ρR>0:X,YρHn:=(p,q)Cxp-xqp-qn,p-qyp-yqp-qn,p-q+ρpPxp,yp.As we are interested in deformations of a shape along its local surface normals, we also state the form of the metric for this special caseN1,N2ρHn=(p,q)Cκpnp-κqnqp-qn,p-qλpnp-λqnqp-qn,p-q+ρpPκpλpwith N1=(κpnp)pP,N2=(λpnp)pPTMS and np the local surface normal at the point pP.

3.1 Motivation for the Hn-metric

A special case in the general definition of the Hn-(pseudo-)metric is n=0, which yields the so-called as-isometric-as-possible (pseudo-)metricX,YI=(p,q)Cxp-xq,p-qyp-yq,p-q.This metric was used by Kilian et al. [Citation5] to study geometric modelling tasks, such as shape morphing and deformation transfer in the shape space S. Per definition, a deformation field X(t)=(xp(t))p(t)P(t) of a surface is isometric if and only if the distances measured on the surface are preserved during the deformation. For triangular meshes, this is equivalent to the fact that the length p-q of each edge (p,q)C remains constant. If the deformation is differentiable, this is further equivalent to p˙-q˙,p-q=xp-xq,p-q=0 for all (p,q)C. Since the induced norm ·I of ·,·I readsXI=(p,q)Cxp-xq,p-q21/2for XTMS, we find that a deformation field X is isometric if and only if XI=0. Let us assume that the (generic) case of a rigid triangulated surface is given which cannot be deformed without changing distances between neighbours. Then controlling the norm ·I means to control the deviation of the deformation from a pure rigid body movement (translation and/or rotation). In this sense, using the as-isometric-as-possible norm as a penalty term yields deformations with exactly this property. Consequently, geodesics for this metric join shapes in S which are as-isometric-as-possible transformed; see also [Citation5] for further details.

Our idea behind the Hn-metric is to adopt the as-isometric-as-possible metric in such a way that small distances between two points, and therefore also nearly singular triangles receive an additional penalty. Note, however, that although this inner product is able to prevent the local contraction of several points to one point, it is still possible that self-intersections of the surface occur in the process of deformation. This is not surprising since the metric only takes the distances from one point to each of its neighbours into account and two non-neighbouring points may still become arbitrarily close to each other. In our experience large values for n, e.g. n5, are not advantageous since the expressions in the denominator become very small and depend extremely sensitive on p-q. In addition, it is possible that large distances between certain points are preferred in this case, and this may lead to unnatural ‘peaks’ in the shape (see Figure ). Appropriate choices for n depend for sure on the problem but typically n=1 or n=2 is a good choice to combine the isometry- and non-singularity-conditions.

3.2 Geodesic equations

Now, we will establish the systems of geodesic equations which correspond to the above metrics. For this reason, we manipulate the system of geodesic equations from (Equation7) in such a way to get rid of the Christoffel symbols.

We start with a triangular mesh MS which has N nodes in R3; the collection of these nodes is denoted with PR3. Since only deformations along the local surface normal vectors are admissible, we haveT=κ·nR3NandT˙=κ˙·n+κ·n˙R3Nwhere κRN, nR3N and · stands for the scalar multiplication of the corresponding entries of κ and n. Now, we want to derive a formula for each κ˙p with pP using the system of geodesic Equation (Equation7).

Independent from the chosen metric, we can do the following calculation. Let ·,·S denote one of the Riemannian metrics on S defined above and(9) n~p:=0R3T,,0R3T,npT,0R3T,,0R3TTR3N(9) be a vector with all entries zero except at those components which correspond to the point pP. Then we get(10) κ˙·n+κ·n˙,n~pS=-eγΓαβγTαTβ,n~pS=-eγΓαβγTαTβ,eδn~pδS=-eγ,eδSΓαβγTαTβn~pδ=-ΓαβγgγδTαTβn~pδ=-12gδαuβ+gβδuα-gαβuδTαTβn~pδ=-12k=13npkq,rN(p)l,m=13TqlTrmepk,eqlrm+erm,epkql-eql,ermpk=:A(10) where the last equality holds true since both metrics, ·,·Eu and ·,·ρHn are local in the sense that they satisfy esi,etj=0 for all i,j{1,2,3} if s,tP are not neighbouring points. The task is now to calculate A=A(p,q,r,k,l,m) for the different Riemannian metrics.

For the Euclidean metric ·,·Eu, A=0 since epi,eqjEu=δpqδij is a constant independent of the coordinates of p and q. Moreover,κ˙·n+κ·n˙,n~pEu=κp˙np,np+κpnp˙,np=κp˙and therefore, the system of geodesic equations for the metric ·,·Eu reads(11) p˙=κpnp,κp˙=0,(11) for all pP. This pair of equations describes the deformation of a surface along its local normal vectors where κ, the speed of the deformation, remains constant.

For the Hn-metric, the calculation of A is more elaborate and – although elementary – quite technical. It turns out that the right-hand side of (Equation10) can be written as-12k=13npkq,rN(p)l,m=13TqlTrmA(p,q,r,k,l,m)=np,qN(p)\{p}p-qp-q2nnp-q,Tp-Tq2p-q2-Tp-Tq2.A further calculation shows thatκ˙·n+κ·n˙,n~pρHn=κ˙pρ+qN(p)\{p}np,p-q2p-q2n+qN(p)\{p}κ˙qnp,p-qnq,q-pp-q2n+np,qN(p)\{p}p-qp-q2nκpn˙p-κqn˙q,p-q.For the details of the arguments leading to these results we refer to [Citation11]. Since Equation (Equation10) holds for all pP, we obtain the following matrix equation:Un,ρκ˙=vwith Un,ρRN×N and vRN. A typical diagonal element of Un,ρ corresponding to a point pP is(Un,ρ)p,p=ρ+qN(p)\{p}np,p-q2p-q2n.And an off-diagonal element corresponding to a pair of two neighbouring nodes p,qP is given by(Un,ρ)p,q=np,p-qnq,q-pp-q2n.All other entries of Un,ρ are zero. For pP, the p-component of the vector v readsvp=np,qN(p)\{p}p-qp-q2nnp-q,Tp-Tq2p-q2-κpn˙p-κqn˙q,p-q-Tp-Tq2. Now, the task is to guarantee the invertibility of Un,ρ. Since strict row diagonal dominant matrices are regular, we know that Un,ρ is regular provided thatρ+qN(p)\{p}np,p-q2p-q2n>qN(p)\{p}np,p-qnq,q-pp-q2nfor all pP. A short calculation shows that this condition holds if(12) ρ>ρ0:=maxpPqN(p)\{p}1p-q2(n-1).(12) It is apparent that the constant ρ0 depends on the current shape MS and we also have that ρ0 if a triangle becomes singular. But we shall see that in many cases, a rather small value for ρ works sufficiently to regularize the whole optimization process.

Finally, we state the system of geodesic equations in the shape space S for the Hn-metric in compact form as(13) p˙=κpnp,κ˙=Un,ρ-1v(13) for all pP with Un,ρ and v defined above.

3.3 Equations of parallel transport

The next task is to derive the equations of parallel translation. For this case, let u(t) be a geodesic in the shape space S, T(t) be the field of tangent vectors to the geodesic, MS a triangular mesh with N nodes and PR3 the set of all nodes of M. Then we know that Equation (Equation8) defines the parallel translate X along the geodesic u of an initial vector X0 tangent to S. Here, T=κ·nR3N,X=λ·nR3NandX˙=λ˙·n+λ·n˙R3Nwhere κ,λRN and nR3N. Again, · stands for the scalar multiplication of the corresponding entries of κ, respectively, λ and n. The following steps towards a formula for each λ˙p with pP are at some points quite similar to the calculation of the geodesic equations; hence, we will discuss analogous manipulations only briefly.

Let ·,·S denote one of the Riemannian metrics on S defined above, and let n~p be the vector defined in Equation (Equation9). Then one findsλ˙·n+λ·n˙,n~pS=-eγΓαβγXαTβ,n~pS=-eγΓαβγXαTβ,eδn~pδS=-eγ,eδSΓαβγXαTβn~pδ=-ΓαβγgγδXαTβn~pδ=-12gδαuβ+gβδuα-gαβuδXαTβn~pδ=-12k=13npkq,rN(p)l,m=13XqlTrmepk,eqlrm+erm,epkql-eql,ermpk=A where A=A(p,q,r,k,l,m) is the same expression as in Equation (Equation10).

Since A=0 for the metric ·,·Eu, we immediately obtain the equation of parallel translation for this metric,λ˙p=λ˙·n+λ·n˙,n~pEu=0for all pP. Consequently, λp(t) is constant for every pP and X(t)=λ·n(t) only depends on all the normal vectors np for pP.

For the Hn-metric, we proceed along the same lines as for the geodesic equations, which results in-12k=13npkq,rN(p)l,m=13XqlTrmA(p,q,r,k,l,m)=np,qN(p)\{p}p-qp-q2n(nXp-Xq,p-qTp-Tq,p-qp-q2-Xp-Xq,Tp-Tq)where ·,· denotes the Euclidean inner product in R3. Likewise, we have thatλ˙·n+λ·n˙,n~pρHn=λ˙pρ+qN(p)\{p}np,p-q2p-q2n+qN(p)\{p}λ˙qnp,p-qnq,q-pp-q2n+np,qN(p)\{p}p-qp-q2nλpn˙p-λqn˙q,p-q.Here, λ˙ is the solution to the matrix equationUn,ρλ˙=wwhere Un,ρRN×N is the same matrix as in the previous subsection. The vector wRN consists of componentswp=np,qN(p)\{p}p-qp-q2n(nXp-Xq,p-qTp-Tq,p-qp-q2-λpn˙p-λqn˙q,p-q-Xp-Xq,Tp-Tq)for points pP. If Un,ρ is invertible, then the equation of parallel translation in the shape space S for the Hn-metric formally readsλ˙=Un,ρ-1w.

4 Shape from shading

The Shape From Shading (SFS) Problem is the following: Suppose we are given a shading image of a surface, i.e. the projection of the light reflected from the surface if it is illuminated in a known way. From this shading image, we want to reconstruct the unknown reflecting surface. Generally, the shading image is given as a grey-level image and the underlying surface is interpreted as the graph of a function F:DR2R where DR2 stands for the set where the shading values of the surface are prescribed. Moreover, we may choose a coordinate system (x,y,z) of R3 such that the direction of the observer coincides with the negative z-direction. The direction of the incident parallel light is given as a vector lR3 with unit length.

The first method to reconstruct the surface structure from a shading image was presented by Horn in [Citation12]. His idea is to determine several paths on the surface which start from a set of points (x,y,F(x,y)) where F(x,y), Fx(x,y) and Fy(x,y) are given. These paths are called characteristics. In order to get an impression of the resulting shape, one may calculate various characteristics which are close enough to each other. In detail, Horn suggested to choose a small curve around a local maximum or minimum of F; this curve serves then as the set of initial points for the characteristics. Around the extremal point, the surface can be approximated with a concave or convex parabola. Hence, we can calculate F(x,y), Fx(x,y) and Fy(x,y) approximately, if we can estimate the curvature of the surface at the extremal point. Finally, one arrives at a system of five ordinary differential equations for x, y, z, p and q where zF(x,y), pFx(x,y) and qFy(x,y). However, it may happen that the resulting characteristics are restricted to a certain region on the surface. Generally, these regions are bounded by various types of edges, e.g. discontinuities of F, view edges and shadow edges. For further details, see [Citation12] and also [Citation13].

Within the last decades, numerous approaches have been proposed. An overview of these methods and their applicabilities in different situations is given in [Citation14, Citation15]. In [Citation14], the authors divide the investigated methods into four categories. The first one contains algorithms which propagate the information about the surface from a set of points over the surface. Horn’s approach described above is a special propagation method. The second category is made of those algorithms which minimize a certain functional. Such a functional involves in general a data-fit term and a certain regularization term. Certain constraints – often incorporated in the algorithm as regularization terms – are frequently used in the minimization process. Such constraints may enforce a smooth surface, or a surface for which Fxy=Fyx, or a surface whose shading image has the same intensity gradients as the given shading image. Thirdly, there are some algorithms which assume a certain local surface type. In this case, the reconstructed surface is approximated with patches which have a prescribed geometrical shape. In [Citation14], an algorithm is presented which locally approximates the surface with spherical patches. Finally, the fourth group of algorithms uses a linearization of the reflectance functionR:D[0,1],(x,y)R(Fx(x,y),Fy(x,y)),which assigns to each pair (x,y) the shading value of a given shape at this point. Generally, R is a nonlinear function with respect to Fx and Fy. However, such a linearization makes sense only if the linear terms in the Taylor series expansion of R dominate. Otherwise, the reconstructed surface might have an essentially different topography than the true surface.

Our approach falls into the class of variational algorithms with a conventional data-fit term. The optimization approach and the regularization term, however, are designed corresponding to the geometric framework described in the previous sections. In the sequel, we assume to have a grey-level shading image of the shape which we want to reconstruct. In addition, we consider this shape as the graph of a function from a subset DR2 into R. Doing so, we choose a coordinate system (x,y,z) of R3 where the z-axis is the direction of the observer. Furthermore, lR3 shall denote the negative direction of the incident light. Within the shape space S we now aim to obtain a mesh M which fits to the given shading image. Let also P denote the set of all nodes of M and (sp)pP be the collection of the given shading values at the points pP. Moreover, we assume that the shading image is taken from a Lambertian surface, i.e. that the shading value at the point p is given by the special reflectance functionR(p)=np,l.Now we define a functional f which assigns to a triangular mesh a non-negative real number; this number should be small, if the shading image of the mesh approximately coincides with the given one, and large otherwise. But f should also penalize meshes which are far away from being smooth, hence, we will add a certain regularization term to the data-fit term. Since S can be identified with R3N, we may define f:R3NR0 via(14) f(P):=12pP(np(P),l-sp)2+α2(p,q)Cnp(P)-nq(P)2(14) with αR0. First of all, the data-fit term measures differences between the given and the current shading image of the mesh M with nodes P. But, the regularization term with its weight α also takes the difference between two neighbouring normal vectors into account; therefore, the functional f ‘prefers’ meshes which are more smooth in the sense of mildly varying normal vectors.

We briefly address the issue of convexity of the SFS cost functional. The notion of convexity is usually connected to functions on (linear) vector spaces; thus, we restrict our attention to the Euclidean metric ·,·Eu. It can be shown that f is – in general – not a convex function on (R3N,·,·Eu). Depending on the shading image (sp)pP and the direction of the incident light, there may exist several surfaces which all give rise to the same shading image. In this situation, all these triangulated surfaces constitute isolated global minima of the unregularized objective function, which can, consequently, not be convex. In order to find the global minimum of a non-convex function, one often relies on stochastic optimization techniques, such as simulated annealing. Nevertheless, we shall only deal with deterministic optimization techniques in this article and leave the implementation of stochastic methods for future studies on this topic.

5 Design of algorithms

In order to minimize the function f from (Equation14) using a sensitivity-based optimization algorithm, we need to calculate its gradient f. Let r=(r1,r2,r3)TP and k{1,2,3}, then a short calculation yieldsfrk=pN(r)(np,l-sp)l+αqN(p)\{p}np-nq,nprkwhere we used np/rk=0 for pN(r).

Now, we are interested in the optimal descent direction for the function f. Since we only consider deformations of the mesh M along the local normal vectors, we look for a descent direction given by (κrnr)rP. The usual gradient is for sure the optimal descent direction in the shape space S with respect to the Euclidean metric ·,·Eu – but in general not for other Riemannian metrics. To obtain the optimal descent direction for a general Riemannian metric ·,·S, we have to solve the following problem:minJ(κr)rP:=rPk=13frkκrnrksuch thate(κr)rP:=κ·n,κ·nS-1=0with J:RNR and e:RNR. The first-order necessary optimality condition for this problem readsJ(κr)rP+λe(κr)rP=0,e(κr)rP=0,with λR, and therefore(15) k=13frknrkrP+2λκ·n,n~rSrP=0,κ·n,κ·nS=1(15) where the vector n~r is defined in Equation (Equation9).

If we use the Euclidean metric ·,·S=·,·Eu, then we have κ·n,n~rEu=κr, and consequentlyfrkk{1,2,3},nrrP+2λκ=0for all rP. Moreover, the second-order necessary optimality condition yields λ0. If λ=0, then – according to (Equation15) – nr is orthogonal to (f/rk)k{1,2,3} for each rP. Hence, the directional derivative of f in the direction of each local normal vector is zero, and consequently, the current mesh is a critical point of the function f. Otherwise, λ>0 is a constant, and we may use the N-dimensional vector(16) κ=-(frk)k{1,2,3},nrrP(16) to characterize the optimal direction (κrnr)rP to deform the mesh M.

In the case that ·,·S=·,·ρHn with nN, we haveκ·n,n~pρHn=κpρ+qN(p)\{p}np,p-q2p-q2n+qN(p)\{p}κqnp,p-qnq,q-pp-q2nand therefore – using (Equation15) – we obtainfrkk{1,2,3},nrrP+2λUn,ρκ=0.Here, the second-order necessary optimality condition implies that λUn,ρ is positive semi-definite. If ρ>ρ0, see Equation (Equation12), then Un,ρ is a symmetric and strictly positive row diagonal dominant matrix, and thus positive definite. Hence, we deduce λ0; and λ>0 unless the current mesh M is a critical point of the function f. Therefore, the optimal direction for the Hn-metric to deform the mesh M is formally given by(17) κ=-Un,ρ-1((frk)k{1,2,3},nr)rP.(17) Let us also explicitly rewrite the directional derivative of f in the direction of a local normal vector nr for rP.(frk)k{1,2,3},nr=pN(r)(np,l-sp)l+αqN(p)\{p}np-nq,k=13nprknrk.To solve the Shape-From-Shading problem numerically, it is necessary to make appropriate choices for each of the subsequent mathematical constructs and parameters:

  • A Riemannian metric for the shape space S,

  • in case an Hn-metric is used, a value for the regularization parameter ρR>0,

  • a value for the penalty parameter αR0,

  • values for several parameters in the optimization algorithm.

The optimal choices depend, for sure, on the image, the information about the underlying shape and the algorithm which is used. Unfortunately, we do not have a formula for these optimal values and, consequently, have to rely on a-posteriori comparisons of the results obtained with different values. There are, nevertheless, some guiding principles for finding appropriate values for the various parameters. Higher values for the penalty parameter α typically result in more smooth surfaces, but if α is too large, then the reconstructed surface may not contain all details of the underlying surface. Since the regularization parameter ρ determines the admixture of the Euclidean metric to the Hn-metric, it should be chosen as small as possible in order to preserve the characteristics of the employed Hn-metric. The performance of some different metrics will be discussed in Section 6. In this paper, we do not change the above-mentioned parameters during the optimization procedure; this could be a subject for future research.

Subsequently, we concentrate our interest on two optimization methods in the shape space S of triangulated meshes with fixed connectivity and N points. First, we consider the steepest descent method, which is a fundamental optimization technique employing the gradient of a function only at the current iterate. And second, we study the nonlinear conjugate gradient method using the Fletcher–Reeves scheme. The convergence of this method in Riemannian manifolds has been analysed in [Citation7]. The fact that this algorithm also makes use of previous search directions to determine a new one has the advantage that the objective function is typically minimized more rapidly. On the other hand, reusing search directions may also lead to an unstable behaviour of the algorithm and require additional stabilization techniques. Other optimization algorithms involving higher derivatives, such as Newton’s method, are not considered in this paper. This would require to calculate the Hessian of the objective function and, hence, second derivatives of the normal vectors np.

5.1 Geodesic steepest descent method

The idea of the geodesic steepest descent (GSD) method in the shape space S is quite the same as in the context of vector spaces. One starts the algorithm at some point x0S and calculates the direction v0Tx0S of steepest descent of the objective function f. But now this direction also depends on the Riemannian metric as we have seen above. Then, we consider the geodesic u through x0 with tangent vector v0 and employ a line search method to minimize the function f along u. For this case, we calculate discrete points yi along the geodesic u as long as the values f(yi) decrease – or until a prescribed number of points has been calculated. The point yi0 where f is minimal gives us the next iterate x1; then the procedure is repeated. If we proceed like this, all the points yi are used and no further computational effort is necessary to calculate other intermediate points on the geodesic u.

The main steps of the GSD-method are described in Algorithm 1. This algorithm requires several input parameter; however, only the essential ones are mentioned in the algorithm. The 3N-dimensional vector x0 denotes the initial point in S, δ0 the initial steplength, itereq the maximal number of points calculated along a geodesic, maxgrad the norm of the descent direction where the algorithm stops, and maxit the maximal number of iterates xi. The output is a 3N-dimensional vector x which sufficiently minimizes the function f. The variable ind counts the number of points along the geodesic path starting at the point x. And the parameter h counts the number of iterates where a new optimal descent direction is calculated. As explained before, we demand inditereq and hmaxit. Since the Levi-Civita connection is a metric connection, we know that T,T is constant along the geodesic u for T=du/dt. Here, we employ this result to κ, which represents the tangent vector T to the geodesic u. At line 18, we calculate the norm (induced from the Riemannian metric ·,·S) of the initial tangent vector, and after each step along the geodesic, we scale at line 12 the new tangent vector to have norm a. This correction makes the procedure of explicit Euler-steps at line 11 also more stable. At line 14 we set the point x to the next point y on the geodesic path and increase ind by 1 provided f(y)<f(x).

In addition, the step length ϵ at line 10 is defined in such a way that it is small if the node positions rapidly change; the scalar δ determines the normalized step length. Finally, δ is also reduced if ind=1; this is the case when f(y)f(x) already within the first iteration, then the current step length is too large and has to be reduced. In detail, we useϵ=δvec(1)where vec(1) denotes the first 3N components of vec representing (p˙)pP. Now, there is a certain analogy between the step length ϵ and the Courant-Friedrichs-Lewy-condition (CFL-condition). In the context of partial differential equations solved with a finite-difference scheme, this condition relates the step length Δt in time to the size Δx of the spatial discretization. This condition is a necessary condition for the convergence of the finite-difference scheme. See e.g. [Citation16] for a more detailed explanation of the CFL-condition. In one dimension and for explicit Euler steps, this condition readsuΔtΔx1where u is the velocity of the system associated with the equation. For sure, we do not solve a partial differential equation, but nevertheless, we also use a discretized surface in space and discrete time steps. The step length ϵ satisfies the CFL-condition since vec(1) is the norm of the first time-derivative of (p)pP, δ0.05 and the size of our space discretization is always greater or equal 0.05.

5.2 Geodesic nonlinear conjugate gradient method

In contrast to the steepest descent method, the nonlinear conjugate gradient method also uses gradients and search directions from previous iterates to calculate the new search direction. Therefore, it is necessary to ‘compare’ tangent vectors from different tangent spaces, say XTM1S and YTM2S for different meshes M1,M2S. In Rn, endowed with the Euclidean inner product, this is trivial since each tangent space TxRn is identified with Rn itself. But, in general, we cannot identify TM2S with TM1S. However, we may parallely translate the tangent vector X along a geodesic joining M1 and M2 to a tangent vector XTM2S; then one can compare the vectors X and Y, since they are elements of the same tangent space TM2S.

Generally, the geodesic nonlinear conjugate gradient (GNCG) algorithm follows the same ideas as the GSD-algorithm presented in Section 5.1, except that the search direction is calculated in a different manner. For this case, consider the old iterate x0S, the gradient f(x0)Tx0S, the search direction v0Tx0S, the new iterate x1S, the gradient f(x1)Tx1S and the (discrete) geodesic path u joining x0 and x1. Then we parallel translate the vector v0 along u to a vector v0Tx1S, which is in the same tangent space as f(x1). The new search direction v1Tx1S is then calculated using the Fletcher–Reeves scheme,v1:=f(x1)+γv0withγ:=f(x1),f(x1)Sf(x0),f(x0)Swhere ·,·S denotes the Riemannian metric in S.

The structure of the GNCG-method is shown in Algorithm 2. The output and those input arguments which are explicitly mentioned are the same as in Algorithm 1. The parameters ind and h have the same purpose as before. The main difference to the GSD-method is described at the lines 1921. Here, the new search direction λ is calculated from the optimal descent direction κ and the parallel translate λ0 of the previous search direction. In addition, the search direction λ can be reset to the optimal descent direction κ after a prescribed number of iterations – or if f(y)f(x) already within the first iteration, then a restart, i.e. using the optimal descent direction as the new search direction, might be advantageous. Below we will denote the number of iterations after which a restart is performed by restart.

6 Numerical experiments and results

In this section, we first give some examples describing the visual behaviour of the different Riemannian metrics used in the shape space. Afterwards, we present the results of the optimization algorithms, which we described above, in different situations. For this case, we consider three grey-level shading images. The first image contains the calculated shading values of a smooth synthetic surface which is the graph of a function. We use this surface to generate various shading images; one image for a light direction which coincides with the direction of the observer and two further images for the case of an oblique light source. The second shape which we want to reconstruct is the bottom of a small ceramic cup. This shape has quite a challenging topography with smooth parts and a sharp circular elevation. Finally, we test our optimization methods with a shading image of the face of one of the authors.

Figure 1. A free geodetic propagation with different Riemannian metrics. From top to bottom and left to right: Initial shape, Euclidiean, H0-, H1-, H2-, H3-, H5- and H8-metric.

Figure 1. A free geodetic propagation with different Riemannian metrics. From top to bottom and left to right: Initial shape, Euclidiean, H0-, H1-, H2-, H3-, H5- and H8-metric.

Figure 2. A shape together with the descent direction for different Riemannian metrics. From top to bottom and left to right: Euclidiean, H0-, H1- and H2-metric.

Figure 2. A shape together with the descent direction for different Riemannian metrics. From top to bottom and left to right: Euclidiean, H0-, H1- and H2-metric.

Figure shows the final result of a free geodetic propagation using various Riemannian metrics. The following parameters were used in all cases: regularization ρ=0, number of steps along the geodesic itereq=100 and normalized step length δ=0.01 (see Section 5.1 for explanation). The initial shape is the graph of the function defined in Equation (Equation18); the initial ‘direction’ of the geodesic in the shape space is (κpnp)pP withκp=e1|px|-1e1|py|-1.The result obtained with the Euclidean metric is locally quite smooth but contains self-intersections. With the different Hn-metrics, self-intersections in the process of deforming are more penalized for larger n (strictly speaking only self-intersections which are due to the local contraction of several points to one point). Nevertheless, unnatural peaks may appear in the shape during the deformation process when using too large values for n, e.g. n=8.

Another example which describes the effects of the different metrics is given in Figure . Here, we consider the reconstruction of the shape defined in Equation (Equation18). The current surface is the graph of the function g¯:[-1,1]×[-1,1]R,g¯(x,y)=1+20|x|510e1x2-1e1y2-1cos10(x+.2)2+y2+cos10(x-.2)2+y2.We use α=0.05 for the calculation of the optimal descent direction. The parameter α is the same as in Equation (Equation14) and determines the regularization of the resulting shape. Obviously, the deformation vectors for the current shape are quite equally distributed over several regions if the Euclidean metric is employed. However, the deformation vectors are more concentrated to certain parts of the surface when using an Hn-metric; in particular, this is the case for larger n.

Figure 3. The synthetic shape, its shading image, the initial shape and its reconstruction using the SSD-method.

Figure 3. The synthetic shape, its shading image, the initial shape and its reconstruction using the SSD-method.

We discussed two algorithms, the GSD-method and the GNCG-method. Now, we have to find appropriate values for various parameter in the optimization algorithms; these values shall only depend on the shape which we want to reconstruct. We do this in order to compare the performance of the algorithms using different Riemannian metrics in the shape space S; these metrics shall be the Euclidean metric, the H0- and the H2-metric. Below, we collect these values for each shape and discuss the advantages of these metrics in the different situations. In addition, we also present the reconstruction of the various surfaces using a standard variational approach. For this case, we use the functional f from (Equation14) which shall be minimized, but now we perform a standard steepest descent (SSD) with Armijo–Goldstein stepsize control. Consequently, we do not enforce the N nodes of the surface to move along the local surface normal vectors, but instead we perform an unconstrained minimization process of f w.r.t. all coordinates in R3N. Now, one also needs appropriate choices for the two parameters σ and μ which appear in the Armijo-conditionf(x+αd)f(x)+ασf(x)Tdand in the Goldstein-conditionf(x+αd)f(x)+αμf(x)Td.Typically, σ and μ are chosen such that 0<σ<1/2<μ<1. We will give the values of σ and μ below for each surface.

6.1 Synthetic surface

First, we consider a synthetic surface, which is the graph of the function g:[-1,1]×[-1,1]R,(18) g(x,y)=e1x2-1e1y2-1cos10(x+.2)2+y2+cos10(x-.2)2+y2.(18) This surface is shown in Figure . If the direction of the light coincides with the z-axis, we cannot initialize the algorithms with a triangulated planar surface since this is already a critical point of the function f (see Equations (Equation16) and (Equation17)). Hence, we use a triangulated mesh which slightly differs from a plane. Then, we reconstruct the shape in two steps. First, we use a coarse mesh (with edge length 0.1) to construct a shape which has the correct surface topography. If the resolution is too coarse, then we may not reconstruct all details of the topography; otherwise, if the resolution is too fine, the reconstruction is generally not smooth enough. An increase of the regularization term of f is not the best choice since this also causes the final reconstruction to be overly smooth in comparison to the given data. However, this first optimization process results in a certain shape. Now, we refine the corresponding mesh and use this refined mesh (with edge length 0.05) as the initialization of the second optimization process on a finer level. This finer level is also the resolution which will be used for the reconstruction of the remaining shapes.

Figure 4. Reconstruction of the synthetic shape with the GSD-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 4. Reconstruction of the synthetic shape with the GSD-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 5. Reconstruction of the synthetic shape with the GNCG-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 5. Reconstruction of the synthetic shape with the GNCG-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

The Figures and show the final reconstruction of the surface for the three considered Riemannian metrics using the GSD-and the GNCG-method, respectively. If the H0- or the H2-metric is used, then the elevations in the reconstruction are more smoothly connected, in comparison to the Euclidean metric. Moreover, we see that the GNCG-algorithm together with the Euclidean metric does not converge to the underlying shape; however, if the H0- or H2-metric is used, then the algorithm does reconstruct the correct surface topography. Apart from the difference concerning the Euclidean metric, the GNCG-method generally results in a shape where elevations are a bit more suppressed than with the GSD-method. Figure also shows the reconstruction when applying the SSD-method (σ=0.25, μ=0.9). One immediately sees that the surface topography is not correctly reproduced, especially the first ‘valley’ seen from the observer does not appear at all. The results were obtained with the following choices for the parameters which we already described in Sections 5.1 and 5.2.

  • light direction l=(0,0,1), regularization α=0.05,

  • ρ=0.0001 for the H0-metric and ρ=1 for the H2-metric,

  • itereq=5, maxit=30, delta=0.01 and restart=5 for the first optimization process,

  • itereq=5, maxit=20, delta=0.02 and restart=5 for the second optimization process.

For the H2-metric, a higher regularization is necessary as for the H0-metric. This fact can also be seen from Equation (Equation12), since the lower bound for the regularization, ρ0, increases if the type n of the Hn-metric increases.

In addition, we also apply the GSD-method together with the Euclidean metric to reconstruct the synthetic shape from the shading image of an oblique light source at l=(0.1,0,1) and l=(0,0.1,1). Strictly speaking, we use the normalized vector l¯=l/l. For this case, we use exactly the same approach as for the reconstruction of the synthetic surface described above. The results are shown in Figure . For the case l=(0.1,0,1), the algorithm is able to reconstruct the global topography of the surface but not with all details. Whereas the final shape obtained with a light source at l=(0,0.1,1) is not even similar to the underlying shape.

Figure 6. Reconstruction of the synthetic shape using the GSD-method, the Euclidean metric and an oblique light source l/l. From left to right: l=(0.1,0,1), l=(0,0.1,1).

Figure 6. Reconstruction of the synthetic shape using the GSD-method, the Euclidean metric and an oblique light source l/‖l‖. From left to right: l=(0.1,0,1), l=(0,0.1,1).

Figure 7. The bottom of the ceramic cup, its shading image, the initial shape and its reconstruction using the SSD-method.

Figure 7. The bottom of the ceramic cup, its shading image, the initial shape and its reconstruction using the SSD-method.

6.2 Ceramic cup

The second shape is the bottom of a small ceramic cup. We use a grey-level image, which is a part of a usual jpg-image, to reconstruct the surface. However, the surface of the ceramic is also specular and thus some reflexions appear in the image. These reflexions are removed in the course of pre-processing the shading image. Figure also shows the initial shape for the optimization algorithms, which is a flat parabolic surface. Here, we only use one resolution to reconstruct the surface. Figures and show the final result for the three different Riemannian metrics using the GSD- and GNCG-method. Here, we see that the H2-metric, with both algorithms, yields a reconstructed surface which is considerably better than that for the Euclidean metric. First, the size of the triangles is much more homogeneous, and second, the circular elevation has nearly at all parts the same height, if the H2-metric is used. Moreover, we see that the quality of the reconstruction – concerning rotational symmetry of the surface – is slightly better when applying the GSD-method. The result obtained by the SSD-method (σ=0.01, μ=0.1) is shown in Figure . Here, it is necessary to choose smaller values for σ and μ; otherwise, the algorithm gets stuck in some local minima which are not close enough to the global one. At first glance, the surface is quite similar to the original one. But in contrast to the shape space optimization methods, the reconstructed surface is not the graph of a function. In principle, this is not an essential problem. However, it reveals an important advantage of the shape space optimization methods, namely the tendency to prevent singular triangles and regions with strongly deviating normal vectors. The choices for the parameters in the algorithms are

  • light direction l=(0,0,1), regularization α=0.1,

  • ρ=0.001 for the H0-metric and ρ=10 for the H2-metric,

  • itereq=5, maxit=100, delta=0.02 and restart=5 for the optimization process.

Figure 8. Reconstruction of the bottom of the ceramic cup with the GSD-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 8. Reconstruction of the bottom of the ceramic cup with the GSD-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 9. Reconstruction of the bottom of the ceramic cup with the GNCG-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 9. Reconstruction of the bottom of the ceramic cup with the GNCG-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

6.3 Face

A challenging problem is the reconstruction of a face from a shading image. Firstly, this is the case since a face consists of rather smooth parts together with regions where the local gradient is quite large. Secondly, some parts of the face may even not be visible, for example the side of the nose; strictly speaking, we therefore cannot consider the face as the graph of a function as explained in Section 4. And thirdly, a face is generally not an ideal Lambertian surface. Especially, the black eyebrow and eyelash have to be removed in the image; otherwise, the algorithms ‘interpret’ the eyelash as a region with a large gradient, in contrast to the reality. The initial shape for the reconstruction and the shading image of the face, where the eyebrow and eyelash are toned down, is shown in Figure. However, neither the GSD-method nor the GNCG-method converges to a final shape which is sufficiently close to a face. Figures and contain the reconstruction of the face after 100 iterations. One immediately sees that several ‘balls’ emerge in the optimization process if the Euclidean or the H0-metric are used. But this is not the case if one employs the H2-metric, which smoothly connects the local maxima and minima of the surface. For the reconstruction of the face, the results obtained by the GSD- and GNCG-method hardly differ. The reconstruction of the face shown in Figure using the SSD-method (σ=0.25, μ=0.9) is in some sense similar to that of the ceramic cup. The surface also contains quite a sharp elevation at the boundary of the face itself. And the variation of the size of the triangles is considerably higher as for the shape space optimization methods. For the algorithms, we use

  • light direction l=(0,0,1), regularization α=0.1,

  • ρ=0.0001 for the H0-metric and ρ=1 for the H2-metric,

  • itereq=5, maxit=100, delta=0.02 and restart=5 for the optimization process.

Figure 10. The shading image of the face, the initial shape and its reconstruction using the SSD-method.

Figure 10. The shading image of the face, the initial shape and its reconstruction using the SSD-method.

Figure 11. Reconstruction of the face with the GSD-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 11. Reconstruction of the face with the GSD-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 12. Reconstruction of the face with the GNCG-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

Figure 12. Reconstruction of the face with the GNCG-method using different Riemannian metrics. From left to right: Euclidean, H0- and H2-metric.

6.4 Quality measures and error estimation

In order to mathematically describe the quality of the reconstructed surfaces, one can define various functionals which return a small number for surfaces approximating the underlying shape quite well. For the synthetic surface – given by the function g defined above – one may considerfshape(P):=pP(p3-g(p1,p2))212as such a quality measure, where PR3 denotes the set of all nodes of the surface. This functional takes for each point pP the difference between the z-component of p and the value of g at the projection of p into the xy-plane into account. Since fshape requires an explicit representation of the underlying surface as the graph of a function, we can apply it only to the synthetic shape. Another possible functional is given byfshade(P):=pP(np(P),l-sp)212which is essentially the data-fit term measuring differences between the prescribed shading values and that of the current surface. Below, we will present the evolution of fshade during the process of reconstructing the ceramic cup. Finally, we may also use the functional f itself as a natural quality measure since it includes both the adaptation of the shading values and a sufficient smoothness of the surface. We will use f to visualize the progress of the reconstruction of the face.

In Figure , there are four plots showing the behaviour of the above-introduced functionals in different situations. The upper left plot contains the evolution of fshape for the coarse-grid optimization process of the synthetic shape, the upper right plot contains the same for the fine-grid optimization process. The lower left plot shows fshade for the reconstruction of the ceramic cup and the lower right plot shows f itself for the reconstruction of the face.

6.5 Performance of the SSD-method

Concerning the synthetic shape, it can be clearly seen from Figure that the SSD-method reduces fshape significantly faster than all the other methods within the first five iterations of the coarse-grid optimization. But from there on fshape increases again and becomes nearly as large as at the beginning of the optimization process. But keep in mind that f is the functional which is minimized by all the various methods, not fshape or fshade. And since the SSD-method has approximately reached a local minimum of f after 24 iterations (step-size smaller than 10-9), the algorithm terminates. The following fine-grid optimization process essentially cannot leave this local minimum and only refines the structure of the surface. This behaviour of the SSD-method also appears in a similar manner within the reconstruction of the ceramic cup and that of the face. At the beginning, fshade, respectively, f decreases quite fast, but then the algorithm gets stuck in a local minimum. After 100 iterations, the SSD-method provides even the largest value of fshade respectively f amongst all the various methods.

Figure 13. Convergence of several optimization techniques in different situations. Top left: Synthetic shape (coarse-grid optimization). Top right: Synthetic shape (fine-grid optimization). Bottom left: Ceramic cup. Bottom right: Face. The legend applies to all four plots.

Figure 13. Convergence of several optimization techniques in different situations. Top left: Synthetic shape (coarse-grid optimization). Top right: Synthetic shape (fine-grid optimization). Bottom left: Ceramic cup. Bottom right: Face. The legend applies to all four plots.

6.6 Comparison of the GSD-method, GNCG-method and various metrics

The performance of the two shape space optimization methods strongly depends on the problem. For the synthetic surface, the GSD-method always reaches a smaller value of fshape than the GNCG-method – independent of the employed metric. Besides, we already pointed out that the surface is not correctly reconstructed when using the GNCG-method with the Euclidean metric; this fact is also shown in Figure . However, the best result is also obtained with the Euclidean metric, but together with the GSD-method. The situation is quite different for the reconstruction of the ceramic cup and the face. Here, the GNCG-method is able to minimize fshade, respectively, f more efficiently. The smallest values of fshade and f are typically obtained when employing the Euclidean metric, followed by the H0- and the H2-metric. Nevertheless, the visual impression is somehow contrary since surfaces which have been reconstructed by using the H0- or even H2-metric are by far more smooth than surfaces for which the Euclidean metric has been used. We thus see that – independent of the optimization method – an appropriate choice of a Riemannian metric can direct the optimization process towards a desired class of surfaces in the shape space.

A further difference between the GSD- and the GNCG-method is the computational cost for the respective algorithms. The most expensive part of the GSD-method is the repeated evaluation of the right-hand side of the system of geodesic equations (line 9 of Algorithm 1). A similar computational effort is necessary to calculate the parallel translate of the previous search direction. Thus, the GNCG-method requires almost twice the numerical effort of the GSD-method. The costs for the various Hn-metrics are approximately the same but significantly higher as for the Euclidean metric, where the right-hand side of the geodesic equations is much simpler. Above, we have already seen that Hn-metrics with too large n, e.g. n=8, lead to unstable behaviour of the algorithms and to unnatural peaks in the reconstructed surface (see Figure ). As in the situation of vector spaces, the GNCG-method is – on the one hand – able to minimize the objective functional more efficiently compared to the GSD-method. But, on the other hand, it has to be restarted with the optimal descent direction from time to time in order to obtain an efficient and stable algorithm.

7 Conclusion

In this paper, we presented two algorithms designed for optimization in a shape space of triangular meshes. These algorithms are the geodesic steepest descent (GSD) and the geodesic nonlinear conjugate gradient (GNCG) method, which are essentially the same as their non-geodesic counterparts apart from the fact that we now take steps along geodesics instead of straight lines. But the geodesics themselves depend on the Riemannian metric which is used in the shape space. Consequently, the performance of the two algorithms also depends on the employed Riemannian metric.

In Section 6, we described with several examples basic properties of various metrics as well as the GSD- and the GNCG-method. We showed that, in most cases, the geodesic optimization algorithms outperform the standard steepest descent (SSD) method (see Figure). In addition, the reconstructed surfaces are generally more smooth in comparison to the SSD-method when applying a geodesic optimization method. Depending on the underlying surface, the GSD- or the GNCG-method is more advantageous (see the discussion at the end of Section 6). Generally, the reconstructed surfaces are more smooth if the shape space is endowed with some Hölder type Hn-metric and not with the standard Euclidean metric. Further advantages of Hn-metrics are the ability to prefer triangles which all have a similar size, and the tendency to smoothly connect elevations and depressions of a surface.

Compared to some methods presented in the reviews [Citation14, Citation15] our approach does not give rise to sharp edges in the reconstructed surface. This is mainly a consequence of the regularization term within the objective functional, which penalizes differences between neighbouring surface normal vectors. Another feature of the strategy outlined in this article is the tendency to determine the global surface topography correctly (see the reconstruction of the synthetic surface and the ceramic cup). For surfaces with a more complex structure, this is often a problem (see [Citation15] for another synthetic surface). The topography of the face is, nevertheless, not correctly reproduced also when applying our geodesic shape space methods. However, the freedom to choose an appropriate Riemannian metric in the shape space of triangular meshes makes it possible to adapt the optimization procedure to the structure of the underlying surface.

References

  • Smith ST. Optimization techniques on Riemannian manifolds. In: Bloch A, editor. Hamiltonian and gradient flows, algorithms and control. Vol. 3, Fields institute communications. Providence (RI): American Mathematical Society; 1994. p. 113–136.
  • Udrişte C. Convex functions and optimization methods on Riemannian manifolds. Vol. 297, Mathematics and its applications. Dordrecht: Kluwer Academic Publishers Group; 1994.
  • Frankel T. The geometry of physics. An introduction. Cambridge (UK): Cambridge University Press; 2001.
  • Michor P, Mumford D. An overview of the Riemannian metrics on spaces of curves using the Hamiltonian approach. Appl. Comput. Harmonic Anal. 2007;23:74–113.
  • Kilian M, Mitra NJ, Pottmann H. Geometric modeling in shape space. ACM Trans. Graph. (Proc. SIGGRAPH’ 07). 2007;26:64.
  • Schulz V. A Riemannian view on shape optimization. Forschungsbericht Universität Trier, Mathematik, Informatik. Report No.: 1; 2012.
  • Ring W, Wirth B. Optimization methods on Riemannian manifolds and their application to shape space. SIAM J Optim. 2012;22:596–627.
  • Nocedal J, Wright SJ. Numerical optimization. New York (NY): Springer; 2006.
  • Jost J. Riemannian geometry and geometric analysis. Heidelberg: Springer; 2005.
  • Amann H. Ordinary differential equations: an introduction to nonlinear analysis. Berlin: de Gruyter; 1990.
  • Kniely M. Riemannian methods for optimization in shape space [master’s thesis]. Graz: Karl-Franzens-Universität; 2012.
  • Horn B. Obtaining shape from shading information. In: Winston PH, editor. The psychology of computer vision. New York (NY): McGraw-Hill; 1975. Chapter 4; p. 115–155.
  • Kimmel R. Numerical geometry of images. Theory, algorithms and applications. New York (NY): Springer; 2003.
  • Zhang R, Tsai PS, Cryer J, Shah M. Shape from shading: a survey. IEEE Trans. Pattern Anal. Machine Intell. 1999;21:690–706.
  • Durou JD, Falcone M, Sagona M. A survey of numerical methods for shape from shading. Rapport de recherche IRIT, Université Paul Sabatier. Report No.: 2004-2-R. Toulouse, France; 2004.
  • LeVeque RJ. Numerical methods for conservation laws. Basel: Birkhäuser; 1992.

Reprints and Corporate Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

To request a reprint or corporate permissions for this article, please click on the relevant link below:

Academic Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

Obtain permissions instantly via Rightslink by clicking on the button below:

If you are unable to obtain permissions via Rightslink, please complete and submit this Permissions form. For more information, please visit our Permissions help page.