![MathJax Logo](/templates/jsp/_style2/_tandf/pb2/images/math-jax.gif)
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 is the geometric locus of the solution to the equation
with
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
. 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 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
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 with
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
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
. 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 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 . In addition, we shall often use the notation
for the basis vectors of the tangent space
to a manifold
at a point
. The set of all tangent vector fields on
is denoted by
. If
is a manifold with a (Pseudo-)Riemannian metric
, we denote the (pseudo-)metric tensor and its inverse by
Furthermore, we use the Einstein summation convention: Any index which occurs twice in a product is to be summed from
up to the space dimension.
Definition 1
Let be a manifold. Then, a map
is called a connection on
, if the following properties are satisfied for all
,
and
:
Moreover, we call a connection
torsion free if for all
,
where
denotes the Lie bracket. If
is a Riemannian manifold with metric
, we call a connection
metric, if for all
,
Definition 2
Let be a manifold with local coordinates
and
be a connection on
. Then, the symbols
defined via
are called the coefficients of the connection
.
We have the following uniqueness result.[Citation9]
Theorem 3
Let be a Riemannian manifold with metric
. Then, there exists a unique torsion free and metric connection
. This connection is given by
and with local coordinates
,
In the situation of Theorem 3, the connection is called the Levi-Civita connection and its coefficients
are called the Christoffel symbols.
Definition 4
Let be a Riemannian manifold,
a curve in
,
and
such that
along
.
is called a geodesic, if
(1)
(1)
is said to be parallel displaced along
, if
(2)
(2)
Using the formula for the Christoffel symbols, we obtain the geodesic equation (Equation3(3)
(3) ) and the equation of parallel translation (Equation4
(4)
(4) ) by expressing (Equation1
(1)
(1) ), respectively, (Equation2
(2)
(2) ) in local coordinates.
Proposition 5
Let be a Riemannian manifold with local coordinates
,
a curve in
,
and
such that
along
.
is a geodesic,if and only if
(3)
(3)
is parallel displaced along
, if and only if
(4)
(4)
2 Optimization in the shape space of triangular meshes
In the sequel, we shall always consider the shape space of triangulated meshes embedded in
with a fixed connectivity graph and a given number of nodes
. For a shape
we will use
to denote the set of all nodes of
. For sure,
and
refer to the same object, the triangular mesh, but from different perspectives; on the one hand,
describes the mesh as an element in an abstract shape space, whereas
characterizes the mesh as a finite subset of
. We also use the notation
for the set containing
and all nodes of
which share a common edge with
and call
the set of all neighbours of
. Likewise,
denotes the set of all triangles of
which have
as a vertex. Moreover, we define
as the set of all
which are neighbours.
Since there is a one-to-one correspondence between meshes and vectors in
, we may identify the shape space
with
. However, to reconstruct the shape
from a vector of
coordinates, knowledge of the local connectivity relation
is necessary. Without this, the vector
represents only an unconnected point cloud. Using
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
with an appropriate geometry. Strictly speaking, these metrics have to be defined on each tangent space
for
; 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 may only be moved along the local surface normal vector
. Consequently, our deformation fields are given by
(5)
(5) with
. Hence, we do not consider all possible tangent vectors in the
-dimensional tangent space
but only vectors of the form (Equation5
(5)
(5) ), which constitute an
-dimensional subspace of
. Mathematically speaking, a deformation of a mesh
is a curve in
passing through
. Thus, we only consider curves in
whose tangent vectors are given by (Equation5
(5)
(5) ). Therefore, all the admissible deformations of a surface
are uniquely determined by the vector field
on
. Now, we have to define properly the normal vector
of a triangulated mesh at a vertex
. We set
(6)
(6) where
and
are the vertices of a generic triangle
with the convention
and consistent orientation, and
denotes the Euclidean norm in
. Note that (Equation6
(6)
(6) ) is a weighted average of the normal vectors to the triangles adjacent to
. 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
for the concatenation of all normal vectors
with
. 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 . 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)
(7) where
is just a different notation for the concatenation of all coordinates of nodes
to a vector in
. Since we only allow deformations along the local surface normals, we also have
and, hence,
where
In a similar way, we rewrite the equation of parallel transport from Proposition 5 as
(8)
(8) where
is the parallel translate of an initial vector
, tangent to the shape space
, along a geodesic
with tangent vector
. Again, we are only interested in tangent vectors
which are locally given by
and, therefore, read
. However, it is not clear up to now that the geodesic equation or the equation of parallel translation admits solutions, for which
, respectively
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
. But we do not know whether this solution is in these
-dimensional subspaces of
for all
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 to the space of triangular meshes
in some shape
. Let us first define the Euclidean metric
where
with
. So far, the metric is defined on the whole tangent space at
. Specifically for
we obtain
It is obvious that
actually defines a Riemannian metric (not only a pseudo metric) on the shape space
.
We next define a metric on which takes geometrical properties of the shape variable into account. We set
for
,
and vectors
. 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
and define the
-metric via the following regularization of
with
:
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 case
with
and
the local surface normal at the point
.
3.1 Motivation for the ![](//:0)
-metric
A special case in the general definition of the -(pseudo-)metric is
, which yields the so-called as-isometric-as-possible (pseudo-)metric
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
. Per definition, a deformation field
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
of each edge
remains constant. If the deformation is differentiable, this is further equivalent to
for all
. Since the induced norm
of
reads
for
, we find that a deformation field
is isometric if and only if
. 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
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
which are as-isometric-as-possible transformed; see also [Citation5] for further details.
Our idea behind the -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
, e.g.
, are not advantageous since the expressions in the denominator become very small and depend extremely sensitive on
. 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
depend for sure on the problem but typically
or
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(7)
(7) ) in such a way to get rid of the Christoffel symbols.
We start with a triangular mesh which has
nodes in
; the collection of these nodes is denoted with
. Since only deformations along the local surface normal vectors are admissible, we have
where
,
and
stands for the scalar multiplication of the corresponding entries of
and
. Now, we want to derive a formula for each
with
using the system of geodesic Equation (Equation7
(7)
(7) ).
Independent from the chosen metric, we can do the following calculation. Let denote one of the Riemannian metrics on
defined above and
(9)
(9) be a vector with all entries zero except at those components which correspond to the point
. Then we get
(10)
(10) where the last equality holds true since both metrics,
and
are local in the sense that they satisfy
for all
if
are not neighbouring points. The task is now to calculate
for the different Riemannian metrics.
For the Euclidean metric ,
since
is a constant independent of the coordinates of
and
. Moreover,
and therefore, the system of geodesic equations for the metric
reads
(11)
(11) for all
. 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 -metric, the calculation of
is more elaborate and – although elementary – quite technical. It turns out that the right-hand side of (Equation10
(10)
(10) ) can be written as
A further calculation shows that
For the details of the arguments leading to these results we refer to [Citation11]. Since Equation (Equation10
(10)
(10) ) holds for all
, we obtain the following matrix equation:
with
and
. A typical diagonal element of
corresponding to a point
is
And an off-diagonal element corresponding to a pair of two neighbouring nodes
is given by
All other entries of
are zero. For
, the
-component of the vector
reads
Now, the task is to guarantee the invertibility of
. Since strict row diagonal dominant matrices are regular, we know that
is regular provided that
for all
. A short calculation shows that this condition holds if
(12)
(12) It is apparent that the constant
depends on the current shape
and we also have that
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 for the
-metric in compact form as
(13)
(13) for all
with
and
defined above.
3.3 Equations of parallel transport
The next task is to derive the equations of parallel translation. For this case, let be a geodesic in the shape space
,
be the field of tangent vectors to the geodesic,
a triangular mesh with
nodes and
the set of all nodes of
. Then we know that Equation (Equation8
(8)
(8) ) defines the parallel translate
along the geodesic
of an initial vector
tangent to
. Here,
,
where
and
. Again,
stands for the scalar multiplication of the corresponding entries of
, respectively,
and
. The following steps towards a formula for each
with
are at some points quite similar to the calculation of the geodesic equations; hence, we will discuss analogous manipulations only briefly.
Let denote one of the Riemannian metrics on
defined above, and let
be the vector defined in Equation (Equation9
(9)
(9) ). Then one finds
where
is the same expression as in Equation (Equation10
(10)
(10) ).
Since for the metric
, we immediately obtain the equation of parallel translation for this metric,
for all
. Consequently,
is constant for every
and
only depends on all the normal vectors
for
.
For the -metric, we proceed along the same lines as for the geodesic equations, which results in
where
denotes the Euclidean inner product in
. Likewise, we have that
Here,
is the solution to the matrix equation
where
is the same matrix as in the previous subsection. The vector
consists of components
for points
. If
is invertible, then the equation of parallel translation in the shape space
for the
-metric formally reads
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 where
stands for the set where the shading values of the surface are prescribed. Moreover, we may choose a coordinate system
of
such that the direction of the observer coincides with the negative
-direction. The direction of the incident parallel light is given as a vector
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 where
,
and
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
; 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
,
and
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
,
,
,
and
where
,
and
. 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
, 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 , 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 function
which assigns to each pair
the shading value of a given shape at this point. Generally,
is a nonlinear function with respect to
and
. However, such a linearization makes sense only if the linear terms in the Taylor series expansion of
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 into
. Doing so, we choose a coordinate system
of
where the
-axis is the direction of the observer. Furthermore,
shall denote the negative direction of the incident light. Within the shape space
we now aim to obtain a mesh
which fits to the given shading image. Let also
denote the set of all nodes of
and
be the collection of the given shading values at the points
. Moreover, we assume that the shading image is taken from a Lambertian surface, i.e. that the shading value at the point
is given by the special reflectance function
Now we define a functional
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
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
can be identified with
, we may define
via
(14)
(14) with
. First of all, the data-fit term measures differences between the given and the current shading image of the mesh
with nodes
. But, the regularization term with its weight
also takes the difference between two neighbouring normal vectors into account; therefore, the functional
‘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 . It can be shown that
is – in general – not a convex function on
. Depending on the shading image
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 from (Equation14
(14)
(14) ) using a sensitivity-based optimization algorithm, we need to calculate its gradient
. Let
and
, then a short calculation yields
where we used
for
.
Now, we are interested in the optimal descent direction for the function . Since we only consider deformations of the mesh
along the local normal vectors, we look for a descent direction given by
. The usual gradient is for sure the optimal descent direction in the shape space
with respect to the Euclidean metric
– but in general not for other Riemannian metrics. To obtain the optimal descent direction for a general Riemannian metric
, we have to solve the following problem:
with
and
. The first-order necessary optimality condition for this problem reads
with
, and therefore
(15)
(15) where the vector
is defined in Equation (Equation9
(9)
(9) ).
If we use the Euclidean metric , then we have
, and consequently
for all
. Moreover, the second-order necessary optimality condition yields
. If
, then – according to (Equation15
(15)
(15) ) –
is orthogonal to
for each
. Hence, the directional derivative of
in the direction of each local normal vector is zero, and consequently, the current mesh is a critical point of the function
. Otherwise,
is a constant, and we may use the
-dimensional vector
(16)
(16) to characterize the optimal direction
to deform the mesh
.
In the case that with
, we have
and therefore – using (Equation15
(15)
(15) ) – we obtain
Here, the second-order necessary optimality condition implies that
is positive semi-definite. If
, see Equation (Equation12
(12)
(12) ), then
is a symmetric and strictly positive row diagonal dominant matrix, and thus positive definite. Hence, we deduce
; and
unless the current mesh
is a critical point of the function
. Therefore, the optimal direction for the
-metric to deform the mesh
is formally given by
(17)
(17) Let us also explicitly rewrite the directional derivative of
in the direction of a local normal vector
for
.
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
,
in case an
-metric is used, a value for the regularization parameter
,
a value for the penalty parameter
,
values for several parameters in the optimization algorithm.
Subsequently, we concentrate our interest on two optimization methods in the shape space of triangulated meshes with fixed connectivity and
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
.
5.1 Geodesic steepest descent method
The idea of the geodesic steepest descent (GSD) method in the shape space is quite the same as in the context of vector spaces. One starts the algorithm at some point
and calculates the direction
of steepest descent of the objective function
. But now this direction also depends on the Riemannian metric as we have seen above. Then, we consider the geodesic
through
with tangent vector
and employ a line search method to minimize the function
along
. For this case, we calculate discrete points
along the geodesic
as long as the values
decrease – or until a prescribed number of points has been calculated. The point
where
is minimal gives us the next iterate
; then the procedure is repeated. If we proceed like this, all the points
are used and no further computational effort is necessary to calculate other intermediate points on the geodesic
.
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 -dimensional vector
denotes the initial point in
,
the initial steplength,
the maximal number of points calculated along a geodesic,
the norm of the descent direction where the algorithm stops, and
the maximal number of iterates
. The output is a
-dimensional vector
which sufficiently minimizes the function
. The variable
counts the number of points along the geodesic path starting at the point
. And the parameter
counts the number of iterates where a new optimal descent direction is calculated. As explained before, we demand
and
. Since the Levi-Civita connection is a metric connection, we know that
is constant along the geodesic
for
. Here, we employ this result to
, which represents the tangent vector
to the geodesic
. At line 18, we calculate the norm (induced from the Riemannian metric
) of the initial tangent vector, and after each step along the geodesic, we scale at line 12 the new tangent vector to have norm
. This correction makes the procedure of explicit Euler-steps at line 11 also more stable. At line 14 we set the point
to the next point
on the geodesic path and increase
by
provided
.
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
; this is the case when
already within the first iteration, then the current step length is too large and has to be reduced. In detail, we use
where
denotes the first
components of
representing
. 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
in time to the size
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 reads
where
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
is the norm of the first time-derivative of
,
and the size of our space discretization is always greater or equal
.
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 and
for different meshes
. In
, endowed with the Euclidean inner product, this is trivial since each tangent space
is identified with
itself. But, in general, we cannot identify
with
. However, we may parallely translate the tangent vector
along a geodesic joining
and
to a tangent vector
; then one can compare the vectors
and
, since they are elements of the same tangent space
.
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 , the gradient
, the search direction
, the new iterate
, the gradient
and the (discrete) geodesic path
joining
and
. Then we parallel translate the vector
along
to a vector
, which is in the same tangent space as
. The new search direction
is then calculated using the Fletcher–Reeves scheme,
where
denotes the Riemannian metric in
.
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
and
have the same purpose as before. The main difference to the GSD-method is described at the lines 19–21. Here, the new search direction
is calculated from the optimal descent direction
and the parallel translate
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
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, -,
-,
-,
-,
- and
-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.](/cms/asset/b9ad51a1-01dc-4a39-9be5-82074fe9c84f/gipe_a_980243_f0001_oc.gif)
Figure 2. A shape together with the descent direction for different Riemannian metrics. From top to bottom and left to right: Euclidiean, -,
- and
-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.](/cms/asset/71023f6d-49ce-4574-b85b-2cc6da452a4f/gipe_a_980243_f0002_oc.gif)
Figure shows the final result of a free geodetic propagation using various Riemannian metrics. The following parameters were used in all cases: regularization , number of steps along the geodesic
and normalized step length
(see Section 5.1 for explanation). The initial shape is the graph of the function defined in Equation (Equation18
(18)
(18) ); the initial ‘direction’ of the geodesic in the shape space is
with
The result obtained with the Euclidean metric is locally quite smooth but contains self-intersections. With the different
-metrics, self-intersections in the process of deforming are more penalized for larger
(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
, e.g.
.
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(18)
(18) ). The current surface is the graph of the function
,
We use
for the calculation of the optimal descent direction. The parameter
is the same as in Equation (Equation14
(14)
(14) ) 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
-metric; in particular, this is the case for larger
.
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.](/cms/asset/f8c495c5-7e29-459f-a521-7951806f1046/gipe_a_980243_f0003_oc.gif)
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 ; these metrics shall be the Euclidean metric, the
- and the
-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
from (Equation14
(14)
(14) ) which shall be minimized, but now we perform a standard steepest descent (SSD) with Armijo–Goldstein stepsize control. Consequently, we do not enforce the
nodes of the surface to move along the local surface normal vectors, but instead we perform an unconstrained minimization process of
w.r.t. all coordinates in
. Now, one also needs appropriate choices for the two parameters
and
which appear in the Armijo-condition
and in the Goldstein-condition
Typically,
and
are chosen such that
. 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 ,
(18)
(18) This surface is shown in Figure . If the direction of the light coincides with the
-axis, we cannot initialize the algorithms with a triangulated planar surface since this is already a critical point of the function
(see Equations (Equation16
(16)
(16) ) and (Equation17
(17)
(17) )). 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
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, - and
-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.](/cms/asset/8c6e09ef-2cca-44a7-99a3-cb505ce3e003/gipe_a_980243_f0004_oc.gif)
Figure 5. Reconstruction of the synthetic shape with the GNCG-method using different Riemannian metrics. From left to right: Euclidean, - and
-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.](/cms/asset/882f2184-68fd-4e2d-aab7-ce6f5d800149/gipe_a_980243_f0005_oc.gif)
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 - or the
-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
- or
-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 (
,
). 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
, regularization
,
for the
-metric and
for the
-metric,
,
,
and
for the first optimization process,
,
,
and
for the second optimization process.
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 and
. Strictly speaking, we use the normalized vector
. 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
, 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
is not even similar to the underlying shape.
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 -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
-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 (
,
) 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
, regularization
,
for the
-metric and
for the
-metric,
,
,
and
for the optimization process.
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 -metric are used. But this is not the case if one employs the
-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 (
,
) 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
, regularization
,
for the
-metric and
for the
-metric,
,
,
and
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.](/cms/asset/8fe45cf9-127a-4b07-8cd1-653b501aa279/gipe_a_980243_f0010_oc.gif)
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 defined above – one may consider
as such a quality measure, where
denotes the set of all nodes of the surface. This functional takes for each point
the difference between the
-component of
and the value of
at the projection of
into the
-plane into account. Since
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 by
which 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
during the process of reconstructing the ceramic cup. Finally, we may also use the functional
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
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 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
for the reconstruction of the ceramic cup and the lower right plot shows
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 significantly faster than all the other methods within the first five iterations of the coarse-grid optimization. But from there on
increases again and becomes nearly as large as at the beginning of the optimization process. But keep in mind that
is the functional which is minimized by all the various methods, not
or
. And since the SSD-method has approximately reached a local minimum of
after 24 iterations (step-size smaller than
), 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,
, respectively,
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
respectively
amongst all the various methods.
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 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
, respectively,
more efficiently. The smallest values of
and
are typically obtained when employing the Euclidean metric, followed by the
- and the
-metric. Nevertheless, the visual impression is somehow contrary since surfaces which have been reconstructed by using the
- or even
-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 -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
-metrics with too large
, e.g.
, 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 -metric and not with the standard Euclidean metric. Further advantages of
-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.