Next Article in Journal
Robust Image Reconstruction Strategy for Multiscalar Holotomography
Previous Article in Journal
Multimodality Imaging in Ischemic Chronic Cardiomyopathy
Previous Article in Special Issue
Nearly Exact Discrepancy Principle for Low-Count Poisson Image Restoration
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Perspective Shape-from-Shading Problem: A Unified Convergence Result for Several Non-Lambertian Models

Department of Mathematics, Alma Mater Studiorum—Università di Bologna, Piazza di Porta San Donato 5, 40126 Bologna, Italy
J. Imaging 2022, 8(2), 36; https://doi.org/10.3390/jimaging8020036
Submission received: 28 November 2021 / Revised: 24 January 2022 / Accepted: 27 January 2022 / Published: 1 February 2022
(This article belongs to the Special Issue Inverse Problems and Imaging)

Abstract

:
Shape-from-Shading represents the problem of computing the three-dimensional shape of a surface given a single gray-value image of it as input. In a recent paper, we showed that the introduction of an attenuation factor in the brightness equations related to various perspective Shape-from-Shading models allows us to ensure the well-posedness of the corresponding differential problems. Here, we propose a unified convergence result of a numerical scheme for several non-Lambertian reflectance models. This result is interesting since it can be easily extended to other non-Lambertian models in a unified and, therefore, powerful framework.

1. Introduction

The Shape-from-Shading (SfS) problem consists of computing the three-dimensional shape of an object starting from a single gray-level image of it. This problem aroused the interest of some opticians in the 1950s–1960s [1,2], and then the problem was formulated by B.K.P. Horn and his collaborators of MIT as a first-order non-linear partial differential equation (PDE) in the 1970s–1980s [3,4,5]. The goal was to enable the 3D surface represented in the input image to solve a Hamilton–Jacobi (HJ) equation or a variational problem. This problem gave rise to an expansion in the field of mathematics, and some researchers tried to prove the well-posedness of it in the framework of weak solutions. The first works of Lions, Rouy and Tourin in the early 1990s [6,7] inserted the SfS problem into the context of the viscosity solutions frameworks, hence in a much more theoretical area.
In general, the SfS problem is described by the following image irradiance equation [8]:
I ( x ) = R ( N ( x ) ) .
In this equation, the gray-level intensity I ( x ) of the given input image at the point x : = ( x , y ) is put in relation to the reflectance function R ( N ( x ) ) , which represents the value of the light reflection on the surface as a function of its orientation, i.e., of the unit normal N ( x ) . Different expressions of the function R produce different reflectance models.
There are three main ingredients for formulating the SfS problem: how we model the light, the camera and the reflectance. The most common setup found in the literature considers the Lambertian reflectance model (for which the intensity I ( x ) depends only on the incident angle between the direction of the light source ω and the direction of the normal unit vector, without considering the viewer), under an orthographic projection (no perspective deformations are considered) with a single light source located far from the object to be reconstructed (located at infinity in the direction of the light versor ω ). In this case, the irradiance Equation (1) can be written as the following HJ equation:
I ( x ) = γ D ω · ( u ( x ) , 1 ) 1 + | u ( x ) | 2 ,
where u is the unknown surface height and γ D is the diffuse albedo, which indicates the reflective power of a diffuse surface.
In general, non-linear PDEs such as (2) do not admit smooth solutions. Hence, we need to look for a proper notion of a weak solution, for example, in the context of the viscosity ones (see [9,10,11]). Unfortunately, under orthographic projection, there is no uniqueness of solution, not only in the classical sense but also in the weak sense, due to the well-known concave/convex ambiguity related to singular points, i.e., points where the intensity of the image is at the maximum and the light direction is parallel to the surface normal, generating countless viscosity solutions to Equation (2). In order to overcome this ambiguity, several attempts have been made by the scientific community in different research directions. Considering a priori information on the object shape model and/or an integrability condition of the height field in order to constrain the ambiguities could be a possibility. From the mathematical point of view, adding information considering more than one input image, taken from the same point of view but with different light sources (photometric-stereo technique [12,13]) or under the same light source but with different viewpoints (stereovision; see [14]), allows us to achieve well-posedness. In order to stay within the scope of a single input image, a perspective Lambertian model was proposed in [15,16,17], with a light source located far from the surface to reconstruct, i.e., located at infinity. In [16], and then in the extended journal version [17] by the same authors, it was observed that the perspective projection is a more realistic projection than the orthographic one, and it improves the performance with respect to considering the orthographic projection, regardless of the specific numerical algorithm employed (in [17], a comparison with [15] and three orthographic SfS methods is also reported, in order to show the better performance of the perspective models). In [18,19], a different setup for the perspective model was proposed, with a pinhole camera and light source located at the optical center. All these works are limited to the assumption of a Lambertian reflectance model, which is known to be not always suitable for describing real-world surfaces. Models for non-Lambertian surfaces (e.g., [20,21,22]) have been proposed in chronologically later works [23,24,25,26]. All these models, when formulated in terms of a differential equation, do not resolve the concave/convex ambiguity (see [27] for an analysis of them). In order to achieve the uniqueness of solution starting from a single input image, in [18,28], the authors introduced an attenuation factor in the Lambertian brightness equation under perspective projection. This factor takes into account the distance between the surface and the light source and, thanks to this attenuation term, the associated HJ equation admits a unique viscosity solution. Starting from the idea in [18] related to the Lambertian model, in [29], the authors showed the well-posedness of several non-Lambertian models in a unified formulation, by validating the assumptions of the Maximum Principle for discontinuous viscosity solutions (see [9]). Many works have focused on the approximation of the different brightness equations derived from the various models considered for solving the SfS problem (the reader can refer to the surveys [30,31] for more details), but only very few of them treat the convergence of the corresponding methods, and the results are often of experimental type. In this paper, we show the convergence of a numerical scheme for the perspective SfS problem associated with different non-Lambertian models, based on the method proposed in [32] and the theoretical results contained in [29]. To the best of our knowledge, this is the first paper in which a theoretical convergent result of a numerical scheme related to different non-Lambertian models in a unified framework is provided.
The paper is organized as follows: in Section 2, we introduce the setup and the notation adopted, briefly recalling the reflectance models we considered and how it is possible to write them in a unified formulation. Then, we recall the definition and basic properties of viscosity solutions and the theoretical results shown in [29]. Section 3 represents the core of this work, in which we state and prove the convergence result. In Section 4, numerical experiments confirm the effectiveness of the proposed scheme. The paper ends with final comments and conclusions reported in Section 5.

2. Preliminary Materials and Models

In this section, we introduce the notation and the setup we adopted, before recalling the four reflectance models considered. Finally, we introduce the definition of viscosity solutions and their basic properties.

2.1. Setup and Notation

For all four models, for the setup, we used the perspective camera projection with one light source located at the optical center of the camera and an attenuation term of the illumination due to the distance between the surface and the light source.
Let Ω R 2 be open and bounded, which represents the image domain. As performed in [18,23,25,28], the scene can be represented by a surface S : Ω ¯ R 3 defined as the following function:
S ( x ) = f u ( x ) | x | 2 + f 2 ( x , f )
where u ( x ) is the unknown height of the surface and f > 0 is the focal length of the camera. The unit vector in the direction of the light source is defined as follows:
ω ( S ( x ) ) = ( x , f ) | x | 2 + f 2 .
The unit normal vector at the point x of S is defined as N ( x ) = n ( x ) | n ( x ) | , where
n ( x ) = S x × S y = ( f u ( x ) f u ( x ) | x | 2 + f 2 x , u ( x ) · x + f u ( x ) | x | 2 + f 2 f )
and
| n ( x ) | = f 2 | u ( x ) | 2 + ( u ( x ) · x ) 2 + u ( x ) 2 f 2 ( f 2 + | x | 2 ) .

2.2. Reflectance Models

We now briefly recall the reflectance models and their corresponding HJ equations, describing them in a unified formulation (see [29] for more details).

2.2.1. Lambertian Model

The Lambertian model (L-model) is the most common and simple reflectance model ([4,5,18,19]), which does not consider the viewer position. The brightness equation for this model, considering an attenuation term, is as follows:
I ( x ) = γ D ( x ) cos ( θ i ) r 2
where I ( x ) denotes the intensity of the image, γ D ( x ) is the diffuse albedo, θ i is the incident angle, i.e., the angle between the light source direction ω ( S ( x ) ) and the unit normal to the surface N ( x ) , and 1 / r 2 is the attenuation term of the illumination due to the distance between the surface and the light source [23]. Under the setup introduced in Section 2.1, supposing γ D ( x ) = 1, i.e., all incident light is reflected, and considering the attenuation term 1 / r 2 , with r = f u ( x ) , the following HJ equation can be associated with (7):
I ( x ) = 1 f 2 u ( x ) 2 u ( x ) Q ( x ) f 2 | u ( x ) | 2 + ( u ( x ) · x ) 2 + u ( x ) 2 Q ( x ) 2
where
Q ( x ) : = f f 2 + | x | 2 .
By defining
W ( x , p ) : = f 2 | p | 2 + ( p · x ) 2 Q 2 ,
we can rewrite Equation (8) as follows:
I ( x ) = 1 f 2 u ( x ) 2 u ( x ) W ( x , u ( x ) ) + u ( x ) 2 .
Supposing that the surface S is in front of the optical center, i.e., it is visible, then u is a strictly positive function. Hence, we can consider the change of variable v ( x ) = ln u ( x ) , arriving at the following HJ equation in the new variable v (cf. [18,28])
e 2 v ( x ) + I ( x ) f 2 W ( x , v ( x ) ) + 1 = 0 ,
to which we associate the Hamiltonian
H L ( x , s , p ) = e 2 s + I ( x ) f 2 W ( x , p ) + 1 .

2.2.2. Oren–Nayar Model

Considering real-world surfaces, e.g., plaster, sand, or concrete, the Lambertian model is an inadequate approximation of the diffuse component, mainly because it does not take into account the roughness of the surface. In the 1990s, Michael Oren and Shree K. Nayar proposed a different diffuse model, suitable for rough surfaces, which are modelled as a set of facets with different slopes, each of them Lambertian in reflectance [22,33]. This model takes into account complex physical phenomena, such as masking, shadowing and interreflections between points on the surface facets, and can be viewed as a generalization of the Lambertian one. The brightness equation for the Oren–Nayar model (ON-model) is as follows:
I ( x ) = cos ( θ i ) ( A + B sin ( α ) tan ( β ) max { 0 , cos ( φ r φ i ) } ) ,
where θ i indicates the incident angle, θ r denotes the angle between the observer V and the normal N directions, α and β are defined as α = max θ i , θ r and β = min θ i , θ r , respectively. φ i and φ r are, respectively, the angles between the projection of the light source direction ω , or the projection of the viewer direction V , and the x axis onto the ( x , y ) -plane. The constants A and B are non-negative quantities and depend on the roughness parameter σ as follows:
A = 1 0.5 σ 2 ( σ 2 + 0.33 ) 1 B = 0.45 σ 2 ( σ 2 + 0.09 ) 1 .
As a consequence of the chosen setup illustrated in Section 2.1, θ i = θ r = α = β , and we can simply call it θ . Hence, adding the attenuation factor 1 / r 2 as proposed in [23], the Oren–Nayar brightness equation is as follows:
I ( x ) = A cos ( θ ) + B sin 2 ( θ ) r 2 .
Note that when σ = 0 , then A = 1 and B = 0 , so the ON-model goes back to the L-model. Since r = f u ( x ) , and cos ( θ ) = N ( x ) · ω ( S ( x ) ) , from which sin 2 ( θ ) = 1 ( N ( x ) · ω ( S ( x ) ) ) 2 , then the brightness Equation (14) becomes:
I ( x ) f 2 u ( x ) 2 = A u ( x ) Q ( x ) f 2 | u | 2 + ( u · x ) 2 + u ( x ) 2 Q ( x ) 2 + B 1 u ( x ) 2 Q ( x ) 2 f 2 | u | 2 + ( u · x ) 2 + u ( x ) 2 Q ( x ) 2 ,
where Q ( x ) is defined as in (9). By using the function W defined in (10), and the change of variable v ( x ) = ln u ( x ) (which is possible since u ( x ) > 0 x Ω ¯ ), we obtain the following HJ equation in v:
e 2 v ( x ) + I ( x ) f 2 ( W ( x , v ( x ) ) + 1 ) A W ( x , v ( x ) ) + 1 + B W ( x , v ( x ) ) = 0 ,
and we associate with it the following corresponding Hamiltonian
H O N ( x , s , p ) : = e 2 s + I ( x ) f 2 ( W ( x , p ) + 1 ) A W ( x , p ) + 1 + B W ( x , p ) .
Note that the function W ( x , p ) , defined in (10), is the same function used in the L-model, which is a useful tool for the unified approach of different reflectance models.

2.2.3. Phong Model

The Phong model (PH-model) [20] belongs to the category of specular reflectance models. The law of specular reflection states that the angle of reflection of a ray equals the angle of incidence, and that the incident direction, the surface normal and the reflected direction are coplanar. The PH-model considers a specular term in the definition of the function I ( x ) :
I ( x ) = k A I A ( x ) + k D γ D ( x ) ( cos θ i ) + k S γ S ( x ) ( cos θ s ) α ,
where I A ( x ) is the ambient light component and k A the percentages of this component, the diffuse component is defined as in the L-model, with k D indicating the percentages of this component, and the third addend represents the specular light component, with k S indicating the percentages of it. This last term is described as a power of the cosine of the angle θ s between the unit vectors V and R ( x ) , with R indicating the reflection of the light ω on the surface; γ S ( x ) denotes the specular albedo, and α represents the characteristics of specular reflection of a material. We assume k A + k d + k S = 1 , and that α is an integer greater or equal to 1 (in [20], Phong assumes α [ 1 , 10 ] ). Under the chosen setup, the direction of the light source and that of the viewer are the same; therefore, θ s = 2 θ i (see [25]). By setting the diffuse and specular albedo to 1 and adding the light attenuation term, we can arrive at the following non-linear PDE associated with the brightness Equation (18):
I ( x ) = k A I A ( x ) + 1 f 2 u ( x ) 2 k D u ( x ) Q ( x ) | n ( x ) | + k S ( 2 u 2 Q ( x ) 2 | n ( x ) | 2 1 ) α ,
where Q ( x ) is defined as in (9), | n ( x ) | as in (6), cos θ i = N ( x ) · ω ( S ( x ) ) and cos θ s = cos 2 θ i = 2 ( cos θ i ) 2 1 = 2 ( N ( x ) · ω ( S ( x ) ) ) 2 1 . By the same change of variable v ( x ) = ln u ( x ) , using the function W ( x , v ( x ) ) defined in (10), we can obtain the following HJ equation in v:
e 2 v ( x ) + ( I ( x ) k A I A ( x ) ) f 2 W ( x , v ( x ) ) + 1 k D + k S W ( x , v ( x ) ) + 1 1 W ( x , v ( x ) ) 1 + W ( x , v ( x ) ) α = 0 .
A different equation was derived in [25], defining an alternative function W, which, however, is not useful for our purpose of a unified formulation.
As stated in [25], since the term 1 W ( x , p ) 1 + W ( x , p ) represents the cosine of the specular term, in the PH-model, this cosine is replaced by zero if cos θ s = 1 W ( x , p ) 1 + W ( x , p ) < 0 . Hence, we can associate to (20) the following Hamiltonian:
H P H ( x , s , p ) : = e 2 s + ( I ( x ) k A I A ( x ) ) f 2 W ( x , p ) + 1 k D if   W ( x , p ) 1 , e 2 s + ( I ( x ) k A I A ( x ) ) f 2 W ( x , p ) + 1 k D + k S W ( x , p ) + 1 1 W ( x , p ) 1 + W ( x , p ) α if   0 W ( x , p ) < 1 .
Note that the Phong model reduces to the Lambertian one (up to a constant) if k S = 0 , i.e., the specular component vanishes.

2.2.4. Blinn–Phong Model

In 1977, Blinn [21] proposed a modification of the Phong model by introducing an intermediate vector H , which bisects the angle between the unit vectors V and ω . If the surface is a perfect mirror, the light reaches the viewer only if the surface normal N is pointed halfway between the viewer direction V and the light source direction ω . The direction of maximum highlight is denoted by H = ω + V | ω + V | . For less than perfect mirrors, the specular component falls off slowly as the normal direction moves away from the specular direction. The cosine of the angle between H and N is used as a measure of the distance of a particular surface from the maximum specular direction. The degree of sharpness of the highlights is adjusted by taking this cosine to some power (in [21], it is stated that this power is typically 50 or 60).
For the Blinn–Phong model (BP-model), the brightness equation is as follows:
I ( x ) = k A I A ( x ) + k D γ D ( x ) ( cos θ i ) + k S γ S ( x ) ( cos δ ) c ,
where δ is the angle between H and the unit normal N , and c measures the shininess of the surface (we assume c 1 ). Using the setup introduced in Section 2.1, the directions of the light source and the viewer are the same. As already carried out for the PH-model, we set γ D ( x ) = γ S ( x ) = 1 and we add the light attenuation term as performed for the previous models. In this way, Equation (22) becomes the following:
I ( x ) = k A I A ( x ) + 1 r 2 k D ( N ( x ) · ω ( S ( x ) ) ) + k S ( N ( x ) · ω ( S ( x ) ) ) c ,
since cos θ i = N ( x ) · ω ( S ( x ) ) and cos δ = N ( x ) · ω ( S ( x ) ) due to the chosen setup. Using the definition of the unit normal N ( x ) , thanks to (5) and (6), the function W ( x , v ( x ) ) as defined in (10), Q ( x ) as defined in (9), and the same change in variable adopted before, i.e., v ( x ) = ln u ( x ) , we obtain the following HJ equation in the new variable v (see [29] for more details):
e 2 v ( x ) + ( I ( x ) k A I A ( x ) ) f 2 ( W ( x , v ( x ) ) + 1 ) c / 2 k D ( W ( x , v ( x ) ) + 1 ) c 1 2 + k S = 0 ,
with which we associate the Hamiltonian
H B P ( x , s , p ) : = e 2 s + ( I ( x ) k A I A ( x ) ) f 2 ( W ( x , p ) + 1 ) c / 2 k D ( W ( x , p ) + 1 ) c 1 2 + k S .
Remark 1.
As already observed for the PH-model, if k S = 0 , the BP-model also reduces to the Lambertian one, up to a constant.

2.3. Reflectance Models in a Unified Formulation

The four different reflectance models presented in Section 2.2 lead to a HJ equation of the following form:
H ( x , v ( x ) , v ( x ) ) = 0 , x Ω ,
where v ( x ) is related to the original unknown u ( x ) , which represents the surface height, thanks to the change of variable v ( x ) = ln u ( x ) . The Hamiltonian H has a peculiar explicit formulation for each of the four models, given by (12), (17), (21) and (24), respectively. Nevertheless, looking at the four Hamiltonians, we can note that (25) can be rewritten separating a term depending only on v ( x ) and a Hamiltonian which depends only on ( x , v ( x ) ) as follows:
e 2 v + H M ( x , v ( x ) ) = 0
where M indicates the acronym of the four models ( M = L , O N , P H , B P ). Since the function W ( x , p ) adopted is the same for all four cases, then H M ( x , p ) corresponds for each one to the following:
Lambertian model
H L ( x , p ) : = I ( x ) f 2 F L ( W ( x , p ) ) ,
where
F L ( s ) = s + 1 .
Oren–Nayar model
H O N ( x , p ) = I ( x ) f 2 F O N ( W ( x , p ) ) ,
where
F O N ( s ) = s + 1 A s + 1 + B s .
Phong model
H P H ( x , p ) = ( I ( x ) k A I A ( x ) ) f 2 F P H ( W ( x , p ) ) ,
where
F P H ( s ) = s + 1 k D if   s 1 ( s + 1 ) α + 1 / 2 k D ( s + 1 ) α + k S ( s + 1 ) 1 / 2 ( 1 s ) α if   0 s < 1 .
Blinn–Phong model
H B P ( x , p ) = ( I ( x ) k A I A ( x ) ) f 2 F B P ( W ( x , p ) ) ,
where
F B P ( s ) = ( s + 1 ) c / 2 k D ( s + 1 ) c 1 2 + k S .
In [29], some useful bounds on the function W were proved. In particular, the authors showed the following:
f 2 | p | 2 W ( x , p ) C ¯ | p | 2
where the constant C ¯ is independent of ( x , p ) Ω ¯ × R 2 . These bounds help to prove our convergence result. Some properties of the four functions F M can also be proved (see Lemma 4 in [29]).

2.4. Viscosity Solutions of Hamilton–Jacobi Equations

Let us recall in this section the definition and basic properties of viscosity solutions in order to study the general Hamiltonian (25) in the case of our reflectance models (the reader can refer to [9,11] for more details on this theory). As already stated in the introduction, a HJ equation such as (25), in general, does not admit a classical solution, and we need to look for a proper notion of a weak solution, for example, in the context of viscosity solutions. However, if a classical solution to the HJ equation exists, it coincides with the viscosity one. Tipically, viscosity solutions are Lipschitz continuous functions, which can be obtained via the method of vanishing viscosity, i.e., as a limit of regular solutions to second-order problems.
We can now give the definition of a viscosity subsolution, supersolution and solution.
Definition 1.
A viscosity supersolution of (25) on Ω R 2 is a lower semicontinuous (LSC) function, v : Ω R , s.t. for any ψ C 1 ( Ω ) , if x 0 Ω is a local minimum point of v ψ , then
H ( x 0 , v ( x 0 ) , ψ ( x 0 ) ) 0 .
A viscosity subsolution of (25) on Ω R 2 is a upper semicontinuous (USC) function, v : Ω R , s.t. for any ψ C 1 ( Ω ) , if x 0 Ω is a local maximum point of v ψ , then
H ( x 0 , v ( x 0 ) , ψ ( x 0 ) ) 0 .
Finally, v is a viscosity solution of (25) if it is both a viscosity super- and subsolution.
To prove the convergence of a numerical scheme using the Barles–Souganidis approach [32], we need the Maximum Principle for discontinuous viscosity solution, which requires the formulation in a weak (viscosity) sense of the boundary conditions for the PDE to be approximated. Of course, this requirement is in addition to the consistency, monotonicity and stability properties of the numerical scheme. Hence, motivated by this remark, we need to introduce the notion of boundary conditions in a weak (viscosity) sense, which means we have to incorporate the boundary condition into the definition. To gain a better understanding, instead of considering, for example, the Dirichlet boundary condition in a pointwise sense associated with the HJ Equation (25), i.e., v ( x ) = g ( x ) x Ω , we introduce the operator B : Ω × R × R 2 R , which represents the boundary condition, and in the case of the Dirichlet boundary condition, it is chosen as B ( x , s , p ) = s g ( x ) . Let us consider a more general boundary value problem of the following form:
H ( x , v ( x ) , v ( x ) ) = 0 , x Ω , B ( x , v ( x ) , v ( x ) ) = 0 , x Ω ,
with the operator B : Ω × R × R 2 R . We now introduce the notion of (discontinuous) viscosity solution for (35).
Definition 2.
A viscosity supersolution of (35) is a LSC function v in Ω ¯ s.t. for any ψ C 1 ( Ω ¯ ) , if x 0 is a local minimum point of v ψ , then
H ( x 0 , v ( x 0 ) , ψ ( x 0 ) ) 0 , i f x Ω , max [ H ( x 0 , v ( x 0 ) , ψ ( x 0 ) ) , B ( x 0 , v ( x 0 ) , ψ ( x 0 ) ) ] 0 , i f x Ω .
A viscosity subsolution of (35) is a USC function v in Ω ¯ s.t. for any ψ C 1 ( Ω ¯ ) , if x 0 is a local maximum point of v ψ , then
H ( x 0 , v ( x 0 ) , ψ ( x 0 ) ) 0 , i f x Ω , min [ H ( x 0 , v ( x 0 ) , ψ ( x 0 ) ) , B ( x 0 , v ( x 0 ) , ψ ( x 0 ) ) ] 0 , i f x Ω .
Finally, v is a viscosity solution of (35) if it is both a viscosity super- and subsolution.
We are now ready to state the Maximum Principle for discontinuous viscosity solutions. We first consider the case of a Dirichlet boundary condition (see [9]).
Theorem 1.
Let Ω R 2 be bounded with Ω of class W 2 , , g : Ω R a continuous function and H : Ω × R × R 2 R satisfying the following two conditions:
( H 1 ) . For any R > 0 , γ R > 0 such that H ( x , v , p ) H ( x , u , p ) γ R ( v u ) for all x Ω , R u v R and p R 2 ,
( H 2 ) . | H ( x , v , p ) H ( y , v , p ) | m R ( | x y | ( 1 + | p | ) ) for all x , y Ω , R v R , p R 2 where m R ( t ) 0 when t 0 .
Moreover, let us assume that there exists a neighborhood Γ of Ω in R 2 , such that
( H 3 ) . R ( 0 , + ) m R ( t ) 0 when t 0 such that | H ( x , v , p ) H ( x , v , q ) | m R ( | p q | ) ) , x Γ , v [ R , R ] , p , q R 2 ,
( H 4 ) . R ( 0 , + ) C R > 0 such that H ( x , v , p + λ n ( x ) ) 0 λ C R ( 1 + | p | ) , ( x , v , p ) Γ × [ R , R ] × R 2 ,
( H 5 ) . R 1 , R 2 R + , H ( x , v , p λ n ( x ) ) + λ + , uniformly for ( x , v , p ) Γ × [ R 1 , R 2 ] × B ( 0 , R 2 ) .
Let v be a USC function in Ω ¯ , subsolution of (35) (u is a LSC function in Ω ¯ , supersolution of (35), respectively) with B ( x , s , p ) = s g ( x ) . Then, v u in Ω.
This theorem implies the uniqueness of the viscosity solution in Ω ¯ , i.e., if v 1 , v 2 C ( Ω ¯ ) are two viscosity solutions of (35), then v 1 = v 2 in Ω ¯ . If we want to consider different boundary conditions and validate the Maximum Principle, it is sufficient to choose the following:
B ( x , s , p ) = N ( x ) · p g ( x ) for the Neumann boundary condition, assuming H is continuous and satisfying the hypothesis (H1)–(H3) reported in Equations (36)–(38).
B ( x , s , p ) = s g ( x ) with g ( x ) for the state constraints condition, assuming H is continuous and satisfying the hypothesis (H1)–(H4) reported in Equations (36)–(39).
Defining
J ( x ) : = I ( x ) if H = H L , H O N , I ( x ) k A I A ( x ) if H = H P H , H B P ,
and assuming that J ( x ) is a Lipschitz continuous function in Ω ¯ and there exists a neighborhood Γ of Ω , such that J ( x ) δ > 0 in Γ , in [29], the authors validated the assumptions for the Maximum Principle related to the four Hamiltonians, H L , H O N , H P H , and H B P defined in (12), (17), (21) and (24), respectively, arriving to prove the well-posedness of the perspective SfS problems.
Remark 2.
Without the introduction of the attenuation term and/or under a different setup, e.g., in the context of orthographic projection, the assumption (36) would not be satisfied; hence, uniqueness would not be guaranteed.

3. Convergence Result

Following [32], we now establish necessary notions for the convergence of numerical schemes in the viscosity sense: consistency, monotonicity and stability. Afterwards, we bring in the convergence theorem [32], with which we can prove the convergence of our scheme.
To approximate (25), we consider a scheme of the following form:
S ( ρ , x , u ρ ( x ) , u ρ ) = 0 in Ω ¯ ,
where S : R + × Ω ¯ × R × B ( Ω ¯ ) R is locally bounded, R + [ 0 , ) , ρ is a discretization parameter and B ( Ω ¯ ) denotes the space of bounded functions defined on Ω ¯ .
Definition 3
(Consistency). The scheme defined by (42) is assumed to be consistent, provided that both the following conditions are satisfied:
For all x 0 Ω ¯ and ψ C 1 ( Ω ¯ )
lim inf ρ 0 , x x 0 , ξ 0 S ρ , x , ψ x + ξ , ψ + ξ ρ H * x 0 , ψ x 0 , D ψ x 0
and
lim sup ρ 0 , x x 0 , ξ 0 S ρ , x , ψ x + ξ , ψ + ξ ρ H * x 0 , ψ x 0 , D ψ x 0 ,
where H * and H * denote viscosity sub- and supersolution, respectively, defined in the previous section.
Definition 4
(Monotonicity). The scheme S in (42) is assumed to be monotone, provided that the following condition is fulfilled
S ( ρ , x , t , u ) S ( ρ , x , t , v )
if u v for all ρ 0 , x Ω ¯ , t R and u , v B ( Ω ¯ ) .
Definition 5
(Stability). The scheme S in (42) is called stable if for all ρ > 0 , there exists a solution u ρ B Ω ¯ of (42) with a bound that is independent of ρ.
Based on these definitions, the convergence theorem in the viscosity framework is elaborated by the following fundamental result (cf. [32]):
Theorem 2
(Convergence). If an HJ equation such as (25) has a strong uniqueness property and if the scheme S as in (42) is consistent, monotone and stable, then the solution u ρ of S converges locally uniformly to the unique viscosity solution u of the original problem (25) as ρ 0 .

3.1. Numerical Discretization

For the sake of simplicity, we stick to the 1-D version of (26) since this suffices to perceive the methodology. The 1-D model of (26) reads as follows:
e 2 v + H M ( x , v x ( x ) ) = 0
where M is the acronym of the models ( M = L , O N , P H , B P ). For each model, the corresponding H M ( x , v x ( x ) ) uses the 1D version of (9), (10) and the various functions F M .
Let Δ x > 0 be the spatial step size, and we denote by N : = N ( Δ x ) the number of grid points x i , i = 1 , , N . We further denote the approximate value of v at the i-th grid point x i by w i and define ψ i ( w ) as the following:
ψ i ( w ) : = max 0 , D + w , D w , i = 1 , , N ,
where w   =   w 1 , , w N , cf. [34]. In addition, for consistency, the approximate spatial derivative is given by the following:
v x ( x i ) w ^ x , i : = ψ i ( w ) = D + w = w i + 1 w i Δ x < 0 if   D + w   is   chosen D w = w i w i 1 Δ x > 0 if   D w   is   chosen .
In order to discretize (46), we introduce the method of artificial time, and we make use of the Euler forward in time scheme in addition to (48), obtaining at each grid point the following approximation scheme:
e 2 w i n + w i n + 1 w i n Δ t + H M x i , w ^ x , i = 0 ,
which we can rewrite to obtain the following update rule:
w i n + 1 = w i n + Δ t e 2 w i n Δ t H M x i , w ^ x , i = : G x i , w i , w ^ x , i .
For simplicity, here, we also assume that the iteration level used for the discrete representations of v x is always the actual level n. This also holds for the source term, i.e., e 2 v e 2 w i n .

3.2. Proof of the Convergence Result

We now state the main result of this paper:
Theorem 3.
Let us assume that the scheme given in (50) satisfies the assumptions of the Theorem 2 and the HJ equation in (46) admits a strong uniqueness property. Then, the solution of (50) converges locally uniformly to the unique continuous viscosity solution of (46).
Proof. 
We have to validate the assumptions of strong uniqueness, consistency, monotonicity and stability.
Regarding the strong uniqueness for (46), Propositions 9 and 11 in [29] already validated the required conditions. In addition, the scheme (50) is consistent with the HJ Equation (46) since this is directly followed by the construction. Moreover, by [35], the stability holds when the scheme is monotone. Hence, the verification of the monotonicity remains. To this end, by [35], it is sufficient to show that G in (50) is a non-decreasing function, which holds if and only if:
( i ) G w i 1 0 , ( i i ) G w i 0 , ( i i i ) G w i + 1 0 .
Due to analogy between case ( i ) and ( i i i ) , we proceed in the following order: case ( i ) ( i i i ) ( i i ) .
Case ( i ) .
In view of (47) and (48), there is a contribution to the following case ( i ) only when the third argument in (47) is taken. Taking a partial derivative of (50) with respect to w i 1 yields the following:
G w i 1 = Δ t H M w i 1 = Δ t ( I f 2 ) F L , O N w i 1 Δ t ( I I a k a ) f 2 F P H , B P w i 1
Note that Δ t ( I f 2 ) or Δ t ( I I a k a ) f 2 are both negative quantities. Therefore, in order to obtain G w i 1 0 , it is necessary to have F M w i 1 0 .
At this point, we need to distinguish the four cases. Note that for construction and for Lemma 3 of [29], the function W ( x , v x ) 0 . In the following, we omit the variable dependencies for brevity.
Lambertian case ( F L ( W ) = W + 1 )
F L w i 1 = 1 2 W + 1 · W w i 1 = 1 2 W + 1 · 2 ( f 2 + x 2 ) ( w i w i 1 ) ( 1 ) Q 2 ( Δ x ) 2 < 0
Hence, G w i 1 0 for the Lambertian case.
Oren–Nayar case ( F O N ( W ) = W + 1 A W + 1 + B W )
F O N w i 1 = W w i 1 ( A W + 1 + B W ) ( W + 1 ) · w i 1 ( A W + 1 + B W ) ( A W + 1 + B W ) 2
Since the denominator is always positive, we focus only on the numerator:
W w i 1 ( A W + 1 + B W ) ( W + 1 ) · w i 1 ( A W + 1 + B W ) = W w i 1 ( A W + 1 + B W ) ( W + 1 ) · A 2 W + 1 W w i 1 + B W w i 1 = W w i 1 < 0 W + 1 ( A 2 ) B 0 if A 2 > B
Hence, F O N w i 1 0 if A 2 > B . As a consequence, G w i 1 0 for the Oren–Nayar case, under the assumption A 2 > B .
Blinn–Phong case ( F B P ( W ) = ( W + 1 ) c / 2 k D ( W + 1 ) c 1 2 + k S , with c 1 )
F B P w i 1 = ( W + 1 ) c / 2 w i 1 · ( k D ( W + 1 ) c 1 2 + k S ) ( W + 1 ) c / 2 · ( k D ( W + 1 ) c 1 2 + k S ) w i 1 ( k D ( W + 1 ) c 1 2 + k S ) 2
Since the denominator is always greater than zero, we continue focusing only on the numerator.
( W + 1 ) c / 2 w i 1 · ( k D ( W + 1 ) c 1 2 + k S ) ( W + 1 ) c / 2 · ( k D ( W + 1 ) c 1 2 + k S ) w i 1 = c 2 > 0 ( W + 1 ) c 2 1 > 0 W w i 1 < 0 · ( k D ( W + 1 ) c 1 2 + k S ) > 0 ( W + 1 ) c 2 < 0 · ( k D c 1 2 ( W + 1 ) c 1 2 1 ) > 0 · W w i 1 < 0 = W w i 1 ( W + 1 ) c 2 1 k D ( W + 1 ) c 1 2 c 2 c 1 2 + c 2 k S = W w i 1 < 0 k D ( W + 1 ) c 2 1 + c 1 2 · 1 2 > 0 + ( W + 1 ) c 2 1 · c 2 k S > 0 < 0
Hence, F B P w i 1 < 0 G w i 1 0 for the Blinn–Phong case.
Phong case F P H ( W ) = W + 1 k D if   W     1 ( W + 1 ) α + 1 / 2 k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α if   0     W < 1
In the case of W 1 , we fall back on the Lambertian case, so it is already proven. In the case 0 W < 1
F P H w i 1 = ( α + 1 2 ) · ( W + 1 ) α + 1 2 1 · W w i 1 · [ k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α ] ( W + 1 ) α + 1 2 · ( k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α ) w i 1 · 1 [ k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α ] 2
Since the denominator is always greater than zero, we continue focusing only on the numerator.
( α + 1 2 ) · ( W + 1 ) α 1 2 · W w i 1 · k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α ( W + 1 ) α + 1 2 · k D α ( W + 1 ) α 1 · W w i 1 + k S 2 ( W + 1 ) 1 / 2 W w i 1 · ( 1 W ) α k S ( W + 1 ) 1 / 2 · α ( 1 W ) α 1 · W w i 1 = ( α + 1 2 ) · ( W + 1 ) α 1 2 · W w i 1 · k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α ( W + 1 ) α + 1 2 · W w i 1 ( k D α ( W + 1 ) α 1 + k S 2 ( W + 1 ) 1 / 2 · ( 1 W ) α k S ( W + 1 ) 1 / 2 · α ( 1 W ) α 1 ) = ( α + 1 2 ) · ( W + 1 ) α 1 2 · W w i 1 · k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α ( W + 1 ) α + 1 2 · W w i 1 ( W + 1 ) α 1 · k D α + k S 2 ( 1 W ) α ( W + 1 ) ( α 1 / 2 ) k S α ( 1 W ) α 1 ( W + 1 ) α + 3 / 2
= W w i 1 · k D ( α + 1 2 ) · ( W + 1 ) 2 α 1 2 + k S ( α + 1 2 ) · ( W + 1 ) α ( 1 W ) α k D α ( W + 1 ) 2 α 1 2 k S 2 ( 1 W ) α ( W + 1 ) α + k S α ( 1 W ) α 1 ( W + 1 ) α + 1 = W w i 1 < 0 · ( W + 1 ) 2 α 1 2 > 0 k D ( α + 1 2 ) k D α 0 + ( W + 1 ) α > 0 ( 1 W ) α > 0 · k S α + k S 2 k S 2 0 + k S α 0 ( 1 W ) α 1 > 0 ( W + 1 ) α + 1 > 0
Hence, we conclude that F P H w i 1 0 , so G w i 1 0 also for the Phong case.
Case ( i i i ) .
For the case ( i i i ) , there is a contribution only when the second argument in (47) is chosen. Taking partial derivative of (50) with respect to w i + 1 yields the following:
G w i + 1 = Δ t H M w i + 1 = Δ t ( I f 2 ) F L , O N w i + 1 Δ t ( I I a k a ) f 2 F P H , B P w i + 1
As for case ( i ) , note that Δ t ( I f 2 ) or Δ t ( I I a k a ) f 2 are both negative quantities. Therefore, in order to obtain G w i + 1 0 , it is necessary to show that F M w i + 1 0 .
We note that
W w i + 1 = 2 f 2 + x 2 w i + 1 w i ( + 1 ) Q 2 Δ x 2 < 0 .
Hence, the quantity W w i + 1 is less than zero in this case, as it was W w i 1 in the case ( i ) . As a consequence of this remark, the proof for this case ( i i i ) is analogous to the previous case ( i ) for all four functions F, resulting in G w i + 1 0 for each model under the same assumptions.
Case ( i i ) .
Taking partial derivatives of (50) with respect to w i results in the following:
G w i = w i w i + Δ t e 2 w i w i Δ t H M w i = 1 2 Δ t e 2 w i Δ t H M w i .
At this point, we need to distinguish the four models.
Lambertian case ( H L = I f 2 F L ( W ) = ( I f 2 ) W + 1 )
G w i = 1 2 Δ t e 2 w i Δ t I f 2 2 ( f 2 + x 2 ) 2 W + 1 Q 2 w ^ x , i w ^ x , i w i ,
recalling that w ^ x , i : = max 0 , D + w , D w .
By definition of w ^ x , i , we note that it is always, in any case, a non-negative quantity and
w ^ x , i w i = 0 if   0   is   chosen 1 Δ x < 0 if   D + w   is   chosen 1 Δ x > 0 if   D w   is   chosen .
Since a violation of case ( i i ) primarily occurs due to the quantity f 2 + x 2 w ^ x , i in the last term of (63), we incorporate a worst case estimate as follows:
w ^ x , i max w ^ x , i = : w ^ max ,
where the maximum is taken over all possible cases in (48). It follows
G w i 1 2 Δ t e 2 w i Δ t I f 2 f 2 + x 2 W + 1 Q 2 w ^ max w ^ x , i w i = 1 2 Δ t e 2 w i Δ t I W + 1 f 2 + x 2 2 w ^ max · 1 Δ x
Hence, we can formulate a sufficient condition for monotonicity on the time step size as follows:
G w i 0 1 2 Δ t e 2 w i Δ t I W + 1 f 2 + x 2 2 w ^ max · 1 Δ x 0 2 Δ t e 2 w i + Δ t I W + 1 f 2 + x 2 2 w ^ max · 1 Δ x 1 Δ t 1 2 e 2 w i + I ( f 2 + x 2 ) 2 W + 1 · w ^ max Δ x
As a consequence, for the Lambertian case, the scheme satisfies monotonicity and, therefore, stability as long as (67) is valid.
Oren–Nayar case ( H O N = I f 2 F O N ( W ) = ( I f 2 ) W + 1 A W + 1 + B W )
G w i = 1 2 Δ t e 2 w i Δ t H O N w i = 1 2 Δ t e 2 w i Δ t I f 2 W w i ( A W + 1 + B W ) ( W + 1 ) A 2 W + 1 W w i + B W w i ( A W + 1 + B W ) 2 = 1 2 Δ t e 2 w i Δ t I f 2 2 ( f 2 + x 2 ) Q 2 w ^ x , i · w ^ x , i w i A W + 1 + B W ( W + 1 ) A 2 W + 1 W w i + B W w i ( A W + 1 + B W ) 2 = 1 2 Δ t e 2 w i Δ t I 2 ( f 2 + x 2 ) 2 w ^ x , i w ^ x , i w i A 2 W + 1 B ( A W + 1 + B W ) 2 0 if A / 2 > B
Recalling the definition w ^ x , i : = max 0 , D + w , D w and the estimate (65) used in the previous Lambertian model case, we arrive at the following condition:
G w i 0 1 2 Δ t e 2 w i 2 Δ t I f 2 + x 2 2 w ^ max · 1 Δ x A 2 W + 1 B ( A W + 1 + B W ) 2 0 Δ t 1 2 1 e 2 w i + I ( f 2 + x 2 ) 2 · w ^ max Δ x A 2 W + 1 B ( A W + 1 + B W ) 2
Hence, for the Oren–Nayar case, the scheme satisfies monotonicity and, therefore, stability as long as (69) is valid.
Blinn–Phong case ( H B P = ( I I a k a ) f 2 F B P ( W ) = ( I I a k a ) f 2 ( W + 1 ) c / 2 k D ( W + 1 ) c 1 2 + k S , with c 1 )
Let us define D E N B P : = k D ( W + 1 ) c 1 2 + k S .
We start focusing on F B P w i :
F B P w i = c 2 ( W + 1 ) c 2 1 · W w i · D E N B P k D c 1 2 ( W + 1 ) 2 c 3 2 · W w i D E N B P 2 = W w i c 2 ( W + 1 ) c 2 1 k D ( W + 1 ) c 1 2 + k S c 2 ( W + 1 ) c 2 1 k D c 1 2 ( W + 1 ) 2 c 3 2 D E N B P 2 = 2 ( f 2 + x 2 ) Q 2 w ^ x , i w ^ x , i w i k S c 2 ( W + 1 ) c 2 1 + ( W + 1 ) 2 c 3 2 k D c 2 k D c 1 2 D E N B P 2 = 2 ( f 2 + x 2 ) 2 f 2 w ^ x , i w ^ x , i w i k S c 2 ( W + 1 ) c 2 1 + k D 2 ( W + 1 ) 2 c 3 2 D E N B P 2 > 0
Since the last term is positive, recalling the estimate (65) where w ^ x , i : = max 0 , D + w , D w , we can finally write the following:
G w i = 1 2 Δ t e 2 w i Δ t H B P w i = 1 2 Δ t e 2 w i Δ t ( I I a k a ) f 2 F B P w i = 1 2 Δ t e 2 w i Δ t ( I I a k a ) f 2 2 ( f 2 + x 2 ) 2 f 2 w ^ x , i · w ^ x , i w i k S c 2 ( W + 1 ) c 2 1 + k D 2 ( W + 1 ) 2 c 3 2 D E N B P 2 1 2 Δ t e 2 w i Δ t ( I I a k a ) 2 ( f 2 + x 2 ) 2 w ^ max · 1 Δ x k S c 2 ( W + 1 ) c 2 1 + k D 2 ( W + 1 ) 2 c 3 2 D E N B P 2 = 1 2 Δ t e 2 w i + ( I I a k a ) ( f 2 + x 2 ) 2 w ^ max · 1 Δ x k S c 2 ( W + 1 ) c 2 1 + k D 2 ( W + 1 ) 2 c 3 2 D E N B P 2
Hence,
G w i 0 Δ t 1 2 1 e 2 w i + ( I I a k a ) ( f 2 + x 2 ) 2 w ^ max · 1 Δ x k S c 2 ( W + 1 ) c 2 1 + k D 2 ( W + 1 ) 2 c 3 2 D E N B P 2
which guarantees monotonicity and, therefore, stability for the Blinn–Phong case.
Phong case F P H ( W ) = W + 1 k D if   W 1 ( W + 1 ) α + 1 / 2 k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α if   0 W < 1
In the case of W 1 , we fall back on the Lambertian case, which we have already seen. In the case 0 W < 1 , let us start computing F P H w i . We define D E N : = k D ( W + 1 ) α + k S ( W + 1 ) 1 / 2 ( 1 W ) α for brevity.
F P H w i = ( α + 1 2 ) ( W + 1 ) α 1 2 · W w i · D E N ( W + 1 ) α + 1 2 · D E N w i D E N 2 = 1 D E N 2 ( α + 1 2 ) ( W + 1 ) α 1 2 · W w i · D E N ( W + 1 ) α + 1 2 · ( α k D ( W + 1 ) α 1 W w i + k S 2 ( W + 1 ) 1 / 2 W w i ( 1 W ) α + k S ( W + 1 ) 1 / 2 α ( 1 W ) α 1 W w i ( 1 ) ) = 1 D E N 2 W w i ( α + 1 2 ) ( W + 1 ) α 1 2 · D E N α k D ( W + 1 ) 2 α 1 2 k S 2 ( W + 1 ) α ( 1 W ) α + α k S ( W + 1 ) α + 1 ( 1 W ) α 1 = 1 D E N 2 W w i ( α + 1 2 ) ( W + 1 ) α 1 2 · k D ( W + 1 ) α + ( α + 1 2 ) ( W + 1 ) α 1 2 k S ( W + 1 ) 1 2 ( 1 W ) α α k D ( W + 1 ) 2 α 1 2 k S 2 ( W + 1 ) α ( 1 W ) α + α k S ( W + 1 ) α + 1 ( 1 W ) α 1 = 1 D E N 2 W w i ( W + 1 ) 2 α 1 2 ( α + 1 2 ) k D α k D + ( W + 1 ) α + 1 ( 1 W ) α 1 α k S + ( W + 1 ) α ( 1 W ) α k S ( α + 1 2 ) k S 2 = 1 D E N 2 W w i k D 2 ( W + 1 ) 2 α 1 2 + α k S ( W + 1 ) α + 1 ( 1 W ) α 1 + ( W + 1 ) α ( 1 W ) α
Hence, we obtain
G w i = 1 2 Δ t e 2 w i Δ t H P H w i = 1 2 Δ t e 2 w i Δ t ( I I a k a ) f 2 F P H w i = 1 2 Δ t e 2 w i Δ t ( I I a k a ) f 2 D E N 2 W w i · ( k D 2 0 ) ( W + 1 ) 2 α 1 2 > 0 + α k S 0 ( W + 1 ) α + 1 ( 1 W ) α 1 + ( W + 1 ) α ( 1 W ) α > 0
Since the last term is ( ) 0 , recalling the definition of w ^ x , i and the estimate (65), we can obtain the following:
G w i 0 1 2 Δ t e 2 w i + ( I I a k a ) D E N 2 ( f 2 + x 2 ) 2 w ^ max · 1 Δ x · k D 2 ( W + 1 ) 2 α 1 2 + α k S ( W + 1 ) α + 1 ( 1 W ) α 1 + ( W + 1 ) α ( 1 W ) α 0 Δ t 1 2 1 e 2 w i + ( I I a k a ) D E N 2 ( f 2 + x 2 ) 2 w ^ max · 1 Δ x k D 2 ( W + 1 ) 2 α 1 2 + α k S T P H
with T P H : = ( W + 1 ) α + 1 ( 1 W ) α 1 + ( W + 1 ) α ( 1 W ) α . Hence, the monotonicity and, therefore, stability is also guaranteed for the Phong case. □
Remark 3.
Note that the convergence result is mainly based on the signs of the common function W ( x , p ) and the different functions F M , with M, indicating the acronym of the four models ( M = L , O N , P H , B P ), with their related properties. Hence, the convergence of the numerical scheme still holds in the case of possible imperfect knowledge of terms such as the percentage of the ambient component k A .

4. Numerical Simulations

In this section, we report some one-dimensional synthetic numerical experiments, which confirm the convergence of the proposed scheme to a viscosity solution. All the numerical tests were implemented in Matlab, by using a Notebook HP EliteBook 830 G6 Intel Core i5-8265U with a speed of 1.60 GHz and 16 GB of RAM.
Test 1.
The unknown function u we want to reconstruct is defined by the following equation:
u ( x ) = x 2 + 3 x [ 0.5 , 0.5 ] .
Since it is a synthetic case, the input image is different for each model, generated by the proper brightness equation. This is clearly visible in Figure 1, where the true and the approximated images for each model are reported. The approximated four image functions I are computed a posteriori using the u computed by the scheme and central finite difference to obtain the gradient of u.
In Figure 2, we can see the exact and the approximated scenes defined according to Equation (3). For all the models, the approximation is really good.
Finally, in Figure 3, we report the plots of the exact and approximated heights of the surfaces related to each of the four reflectance models. Qualitatively, in all four cases, the solution computed by the scheme seems to be a good approximation of the surface height, confirming that the numerical solution converges to the correct (and unique) viscosity solution. In fact, looking at the pictures reported in Figure 3, it is difficult to distinguish the exact solution from the approximate one, except for in the PH-model, where it differs going towards the boundary. In order to also perform a quantitative analysis of these results, we compute the Root Mean Square Errors (RMSEs) related to the solutions of the four cases for each point, as shown in Figure 4 and defined as follows:
E r r o r ( i ) = 1 N ( v ( x i ) w i ) 2 , for i = 1 , , N .
Analyzing those figures, we can state that the RMSEs are of order 10 5 for the L-model and BP-model, whereas they are are of order 10 4 for the ON-model and PH-model.
Test 2.
For this second synthetic test, let us consider the following function:
u ( x ) = cos ( 5 x ) + 5 x [ 0.8 , 0.1 ] .
Looking at Figure 5 and Figure 6, we can see that an ambiguity, which remembers a concave/convex ambiguity typical of an orthographic setup, is present on the right side of the scene, even if the image is perfectly reconstituted, as shown, for example, in Figure 7 for the Phong and Blinn–Phong models. Looking at Figure 8, we can note that for both models the error is close to zero, except on the right side of the pictures, in correspondence to the ambiguity, where there is an error of about 0.01 .
The ambiguity of this particular case is due to the model, not to the specific numerical scheme chosen to solve the problem. The existence of different surfaces which share the same image does not contradict the uniqueness result related to the viscosity solution, since they can correspond to different boundary conditions, or to the same boundary conditions imposed in a different domain of definition. This is just to stress that the uniqueness of the viscosity solution does not completely solve the problem of model ambiguity, since we could be interested in reconstructing a surface described by a weak solution, which is different from the viscosity solution. We refer the reader to [36] for more details on the ambiguities of the model. The mentioned paper refers only to the Lambertian case, but the analysis performed, even if only on a single model, is enough to understand what happens.

5. Conclusions

In this paper, we have shown a convergence result for the recent unified formulation of the perspective SfS models proposed in [29], in which the authors considered an attenuation term in order to achieve the well-posedness of the problem in the context of viscosity solutions. Despite the peculiarities of the different reflectance models considered, by formulating them in a unified framework described by a general Hamiltonian, which has attractive properties, we proved that a monotone, consistent and stable explicit scheme of upwind type converges to a viscosity solution, under uniqueness properties of the Hamiltonian. This result is interesting and powerful since can be easily extended to other non-Lambertian models in a unified framework. The numerical experiments shown confirm the convergence of the proposed scheme. We believe that this work could help to develop convergent numerical methods of refined SfS processes for real-world scenarios in future research.

Funding

This research received no external funding.

Informed Consent Statement

Not applicable.

Acknowledgments

The author thanks the anonymous referees for their useful suggestions, which allowed to improve the original version of the paper. The author is a member of the INdAM Research Group GNCS.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Diggelen, J.V. A Photometric Investigation of the Slopes and Heights of the Ranges of Hills in the Maria of the Moon. Bull. Astron. Inst. Neth. 1951, 11, 283–290. [Google Scholar]
  2. Rindfleisch, T. Photometric Method for Lunar Topography. Photogramm. Eng. 1966, 32, 262–277. [Google Scholar]
  3. Horn, B.K.P. Shape from Shading: A Method for Obtaining the Shape of a Smooth Opaque Object from One View. Ph.D. Thesis, MIT, Cambridge, MA, USA, 1970. [Google Scholar]
  4. Horn, B.; Brooks, M. The Variational Approach to Shape from Shading. Comput. Vis. Graph. Image Process. 1986, 33, 174–208. [Google Scholar] [CrossRef] [Green Version]
  5. Horn, B.; Brooks, M. Shape from Shading; MIT Press: Cambridge, MA, USA, 1989. [Google Scholar]
  6. Rouy, E.; Tourin, A. A Viscosity Solutions Approach to Shape-From-Shading. SIAM J. Numer. Anal. 1992, 29, 867–884. [Google Scholar] [CrossRef]
  7. Lions, P.L.; Rouy, E.; Tourin, A. Shape-from-shading, viscosity solutions and edges. Numer. Math. 1993, 64, 323–353. [Google Scholar] [CrossRef]
  8. Bruss, A. The Image Irradiance Equation: Its Solution and Application; Technical Report ai-tr-623; Massachusetts Institute of Technology: Cambridge, MA, USA, 1981. [Google Scholar]
  9. Barles, G. Solutions de Viscosité des Équations de Hamilton-Jacobi; Mathematics & Applications; Springer: Paris, France, 1994; Volume 17, p. x+194. [Google Scholar]
  10. Crandall, M.; Ishii, H.; Lions, P. User’s Guide to Viscosity Solutions of Second Order Partial Differential Equations. Bull. Am. Math. Soc. 1992, 27, 1–67. [Google Scholar] [CrossRef] [Green Version]
  11. Bardi, M.; Capuzzo-Dolcetta, I. Optimal Control and Viscosity Solutions of Hamilton-Jacobi-Bellman Equations; Modern Birkhäuser Classics, Birkhäuser: Boston, MA, USA, 2008. [Google Scholar]
  12. Mecca, R.; Falcone, M. Uniqueness and approximation of a Photometric Shape-from-Shading model. SIAM J. Imaging Sci. 2013, 6, 616–659. [Google Scholar] [CrossRef] [Green Version]
  13. Tozza, S.; Mecca, R.; Duocastella, M.; Del Bue, A. Direct Differential Photometric Stereo Shape Recovery of Diffuse and Specular Surfaces. J. Math. Imaging Vis. 2016, 56, 57–76. [Google Scholar] [CrossRef] [Green Version]
  14. Chambolle, A. A uniqueness result in the theory of stereo vision: Coupling Shape from Shading and binocular information allows unambiguous depth reconstruction. Annales de l’Istitute Henri Poincaré 1994, 11, 1–16. [Google Scholar] [CrossRef] [Green Version]
  15. Prados, E.; Faugeras, O.D. “Perspective shape from shading” and viscosity solutions. In Proceedings of the Ninth IEEE International Conference on Computer Vision, Nice, France, 13–16 October 2003; Volume 2, pp. 826–831. [Google Scholar] [CrossRef] [Green Version]
  16. Tankus, A.; Sochen, N.; Yeshurun, Y. A new perspective [on] shape-from-shading. In Proceedings of the Ninth IEEE International Conference on Computer Vision, Nice, France, 13–16 October 2003; Volume 2, pp. 862–869. [Google Scholar] [CrossRef] [Green Version]
  17. Tankus, A.; Sochen, N.A.; Yeshurun, Y. Shape-from-Shading Under Perspective Projection. Int. J. Comput. Vis. 2005, 63, 21–43. [Google Scholar] [CrossRef]
  18. Prados, E.; Faugeras, O. Shape From Shading: A well-posed problem? In Proceedings of the International Conference on Computer Vision and Pattern Recognition CVPR05, San Diego, CA, USA, 20–25 June 2005; Volume 2, pp. 870–877. [Google Scholar] [CrossRef] [Green Version]
  19. Okatani, T.; Deguchi, K. Shape Reconstruction from an Endoscope Image by Shape from Shading Technique for a Point Light Source at the Projection Center. Comput. Vis. Image Underst. 1997, 66, 119–131. [Google Scholar] [CrossRef]
  20. Phong, B. Illumination for Computer Generated Pictures. Commun. ACM 1975, 18, 311–317. [Google Scholar] [CrossRef] [Green Version]
  21. Blinn, J. Models of Light Reflection for Computer Synthesized Pictures. Comput. Graph. 1977, 11, 192–198. [Google Scholar] [CrossRef]
  22. Oren, M.; Nayar, S. Generalization of Lambert’s Reflectance Model. In Proceedings of the 21st Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH ’94), Orlando, FL, USA, 24–29 July 1994; pp. 239–246. [Google Scholar]
  23. Ahmed, A.; Farag, A. A New Formulation for Shape from Shading for Non-Lambertian Surfaces. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), New York, NY, USA, 17–22 June 2006; pp. 1817–1824. [Google Scholar]
  24. Ahmed, A.; Farag, A. Shape from Shading Under Various Imaging Conditions. In Proceedings of the IEEE International Conference on Computer Vision and Pattern Recognition CVPR’07, Minneapolis, MN, USA, 18–23 June 2007; pp. X1–X8. [Google Scholar]
  25. Vogel, O.; Breuß, M.; Weickert, J. Perspective Shape from Shading with Non-Lambertian Reflectance. In Pattern Recognition; Lecture Notes in Computer Science; Rigoll, G., Ed.; Springer: Berlin/Heidelberg, Germany, 2008; Volume 5096, pp. 517–526. [Google Scholar] [CrossRef]
  26. Ju, Y.; Tozza, S.; Breuß, M.; Bruhn, A.; Kleefeld, A. Generalised Perspective Shape from Shading with Oren-Nayar Reflectance. In Proceedings of the 24th British Machine Vision Conference (BMVC 2013), Bristol, UK, 9–13 September 2013; BMVA Press: Bristol, UK, 2013; pp. 42.1–42.11. [Google Scholar]
  27. Tozza, S.; Falcone, M. Analysis and Approximation of Some Shape–from-Shading Models for Non-Lambertian Surfaces. J. Math. Imaging Vis. 2016, 55, 153–178. [Google Scholar] [CrossRef] [Green Version]
  28. Prados, E.; Faugeras, O.; Camilli, F. Shape from Shading: A Well-Posed Problem? Technical Report 5297; INRIA: Le Chesnay-Rocquencourt, France, 2004. [Google Scholar]
  29. Camilli, F.; Tozza, S. A Unified Approach to the Well-Posedness of Some Non-Lambertian Models in Shape-from-Shading Theory. SIAM J. Imaging Sci. 2017, 10, 26–46. [Google Scholar] [CrossRef] [Green Version]
  30. Zhang, R.; Tsai, P.S.; Cryer, J.; Shah, M. Shape from Shading: A Survey. IEEE Trans. Pattern Anal. Mach. Intell. 1999, 21, 690–706. [Google Scholar] [CrossRef] [Green Version]
  31. Durou, J.D.; Falcone, M.; Sagona, M. Numerical methods for shape-from-shading: A new survey with benchmarks. Comput. Vis. Image Underst. 2008, 109, 22–43. [Google Scholar] [CrossRef]
  32. Barles, G.; Souganidis, P. Convergence of approximation schemes for fully nonlinear second order equations. Asymptot. Anal. 1991, 4, 271–283. [Google Scholar] [CrossRef]
  33. Oren, M.; Nayar, S. Generalization of the Lambertian Model and Implications for Machine Vision. Int. J. Comput. Vis. 1995, 14, 227–251. [Google Scholar] [CrossRef]
  34. Sethian, J.A. Level Set Methods and Fast Marching Methods: Evolving Interfaces in Computational Geometry, Fluid Mechanics, Computer Vision, and Materials Science, 2nd ed.; Cambridge University Press: Cambridge, UK, 1999. [Google Scholar]
  35. Crandall, M.G.; Majda, A. Monotone difference approximations for scalar conservation laws. Math. Comput. 1980, 34, 1–21. [Google Scholar] [CrossRef]
  36. Breuß, M.; Cristiani, E.; Durou, J.D.; Falcone, M.; Vogel, O. Perspective Shape from Shading: Ambiguity Analysis and Numerical Approximations. SIAM J. Imaging Sci. 2012, 5, 311–342. [Google Scholar] [CrossRef] [Green Version]
Figure 1. Test 1. Plots of the exact and approximated images related to the four reflectance models. From top-left to bottom-right: images related to Lambertian model; ON-model with σ   =   0.1 ; PH-model with k A   =   0 ,   k D   =   0.8 ,   k S   =   0.2 ,   α   =   2 ; BP-model with k A   =   0 ,   k D   =   0.2 ,   k S   =   0.8 ,   c   =   50 .
Figure 1. Test 1. Plots of the exact and approximated images related to the four reflectance models. From top-left to bottom-right: images related to Lambertian model; ON-model with σ   =   0.1 ; PH-model with k A   =   0 ,   k D   =   0.8 ,   k S   =   0.2 ,   α   =   2 ; BP-model with k A   =   0 ,   k D   =   0.2 ,   k S   =   0.8 ,   c   =   50 .
Jimaging 08 00036 g001
Figure 2. Test 1. Plots of the exact and approximated scenes defined according to Equation (3) and related to the four reflectance models. From top-left to bottom-right: images related to Lambertian model; ON-model with σ   =   0.1 ; PH-model with k A   =   0 ,   k D   =   0.8 ,   k S   =   0.2 ,   α   =   2 ; BP-model with k A   =   0 , k D   =   0.2 ,   k S   =   0.8 ,   c   =   50 .
Figure 2. Test 1. Plots of the exact and approximated scenes defined according to Equation (3) and related to the four reflectance models. From top-left to bottom-right: images related to Lambertian model; ON-model with σ   =   0.1 ; PH-model with k A   =   0 ,   k D   =   0.8 ,   k S   =   0.2 ,   α   =   2 ; BP-model with k A   =   0 , k D   =   0.2 ,   k S   =   0.8 ,   c   =   50 .
Jimaging 08 00036 g002
Figure 3. Test 1. Plots of the exact and approximated heights of the surfaces related to the four reflectance models. From top-left to bottom-right: images related to Lambertian model; ON-model with σ   =   0.1 ; PH-model with k A   =   0 ,   k D   =   0.8 ,   k S   =   0.2 ,   α = 2 ; BP-model with k A   =   0 , k D   =   0.2 , k S   =   0.8 ,   c   =   50 .
Figure 3. Test 1. Plots of the exact and approximated heights of the surfaces related to the four reflectance models. From top-left to bottom-right: images related to Lambertian model; ON-model with σ   =   0.1 ; PH-model with k A   =   0 ,   k D   =   0.8 ,   k S   =   0.2 ,   α = 2 ; BP-model with k A   =   0 , k D   =   0.2 , k S   =   0.8 ,   c   =   50 .
Jimaging 08 00036 g003
Figure 4. Test 1. Plots of the RMSEs in the four cases. From top-left to bottom-right: images related to Lambertian model; ON-model with σ = 0.1 ; PH-model with k A   =   0 ,   k D   =   0.8 ,   k S   =   0.2 ,   α   =   2 ; BP-model with k A   =   0 ,   k D   =   0.2 ,   k S   =   0.8 ,   c   =   50 .
Figure 4. Test 1. Plots of the RMSEs in the four cases. From top-left to bottom-right: images related to Lambertian model; ON-model with σ = 0.1 ; PH-model with k A   =   0 ,   k D   =   0.8 ,   k S   =   0.2 ,   α   =   2 ; BP-model with k A   =   0 ,   k D   =   0.2 ,   k S   =   0.8 ,   c   =   50 .
Jimaging 08 00036 g004
Figure 5. Test 2. Plots of the exact and approximated scenes related to two reflectance models. From left to right: scenes related to PH-model and BP-model, with the parameters k a   =   0 ,   k D   =   0.8 ,   k S   =   0.2 , α   =   10 ,   c   =   50 . Focal length f   =   5 .
Figure 5. Test 2. Plots of the exact and approximated scenes related to two reflectance models. From left to right: scenes related to PH-model and BP-model, with the parameters k a   =   0 ,   k D   =   0.8 ,   k S   =   0.2 , α   =   10 ,   c   =   50 . Focal length f   =   5 .
Jimaging 08 00036 g005
Figure 6. Test 2. Plots of the exact and approximated heights of the surfaces related to two reflectance models. From left to right: surface heights related to PH-model and BP-model, with the parameters k a   =   0 ,   k D   =   0.8 ,   k S   =   0.2 , α   =   10 ,   c   =   50 . Focal length f   =   5 .
Figure 6. Test 2. Plots of the exact and approximated heights of the surfaces related to two reflectance models. From left to right: surface heights related to PH-model and BP-model, with the parameters k a   =   0 ,   k D   =   0.8 ,   k S   =   0.2 , α   =   10 ,   c   =   50 . Focal length f   =   5 .
Jimaging 08 00036 g006
Figure 7. Test 2. Plots of the exact and approximated images related to two reflectance models. From left to right: images related to PH-model and BP-model, with the parameters k a   =   0 ,   k D   =   0.8 ,   k S   =   0.2 , α   =   10 ,   c   =   50 . Focal length f   =   5 .
Figure 7. Test 2. Plots of the exact and approximated images related to two reflectance models. From left to right: images related to PH-model and BP-model, with the parameters k a   =   0 ,   k D   =   0.8 ,   k S   =   0.2 , α   =   10 ,   c   =   50 . Focal length f   =   5 .
Jimaging 08 00036 g007
Figure 8. Test 2. Plots of the RMSEs related to the two cases reported in Figure 6. From left to right: images related to PH-model and BP-model, with the parameters k a   =   0 , k D   =   0.8 ,   k S   =   0.2 , α   =   10 ,   c   =   50 . Focal length f   =   5 .
Figure 8. Test 2. Plots of the RMSEs related to the two cases reported in Figure 6. From left to right: images related to PH-model and BP-model, with the parameters k a   =   0 , k D   =   0.8 ,   k S   =   0.2 , α   =   10 ,   c   =   50 . Focal length f   =   5 .
Jimaging 08 00036 g008
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Tozza, S. Perspective Shape-from-Shading Problem: A Unified Convergence Result for Several Non-Lambertian Models. J. Imaging 2022, 8, 36. https://doi.org/10.3390/jimaging8020036

AMA Style

Tozza S. Perspective Shape-from-Shading Problem: A Unified Convergence Result for Several Non-Lambertian Models. Journal of Imaging. 2022; 8(2):36. https://doi.org/10.3390/jimaging8020036

Chicago/Turabian Style

Tozza, Silvia. 2022. "Perspective Shape-from-Shading Problem: A Unified Convergence Result for Several Non-Lambertian Models" Journal of Imaging 8, no. 2: 36. https://doi.org/10.3390/jimaging8020036

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop