# A Partial Differential Equation Obstacle Problem for the Level Set Approach to Visibility

In this article we consider the problem of finding the visibility set from a given point when the obstacles are represented as the level set of a given function. Although the visibility set can be computed efficiently by ray tracing, there are advantages to using a level set representation for the obstacles, and to characterizing the solution using a Partial Differential Equation (PDE). A nonlocal PDE formulation was proposed in Tsai et. al. (Journal of Computational Physics 199(1):260-290, 2004): in this article we propose a simpler PDE formulation, involving a nonlinear obstacle problem. We present a simple numerical scheme and show its convergence using the framework of Barles and Souganidis. Numerical examples in both two and three dimensions are presented.

## Authors

• 8 publications
• 3 publications
06/13/2018

### Geometric Shape Features Extraction Using a Steady State Partial Differential Equation System

A unified method for extracting geometric shape features from binary ima...
03/03/2021

### Partial differential equation solver based on optimization methods

The numerical solution methods for partial differential equation (PDE) s...
06/13/2018

### Shape Features Extraction Using a Partial Differential Equation

This paper presents a unified method for extraction of geometrical shape...
03/05/2020

### Methods to Recover Unknown Processes in Partial Differential Equations Using Data

We study the problem of identifying unknown processes embedded in time-d...
01/16/2020

### Isogeometric continuity constraints for multi-patch shells governed by fourth-order deformation and phase field models

This work presents numerical techniques to enforce continuity constraint...
10/14/2021

### Unsupervised Learning of Full-Waveform Inversion: Connecting CNN and Partial Differential Equation in a Loop

This paper investigates unsupervised learning of Full-Waveform Inversion...
10/07/2021

### Solving the Dirichlet problem for the Monge-Ampère equation using neural networks

The Monge-Ampère equation is a fully nonlinear partial differential equa...
##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1. Introduction

In this article we consider the problem of finding the visibility set from a given viewpoint given a set of known obstacles using a Partial Differential Equation (PDE). In principle, the visibility set is simply given by ray tracing and there are numerous algorithms for solving the visibility problem using explicit representations of the obstacles [CT97, DDTP00, AS96a, AS96b].

Finding the visibility set plays a crucial role in numerous applications including rendering, visualization [HZ00], etching [SA97], surveillance, exploration [VTS14], navigation [LTC06], and inverse problems, to only name a few. Specifically, in [CT05] the level set framework [OS88, Set99] developed in [TCO04] was extended to deal with the optimal placing of a single viewer or a group of viewers and -to- optimal path planning, where optimality is measured in terms of the volume of the visible region. More recently, in [LT18]

a convolutional neural network is proposed to determine the vantage points that maximize visibility in the context of surveillance and exploration, with the visibility sets of the training data being computed efficiently using the PDE formulation introduced in

[TCO04]. For applications which involve optimization of the viewpoint, the discontinuity of the visibility can make optimization more difficult. The advantage of using level set/PDE methods is the improved regularity of the solution.

It is clear then that the ultimate goal of the work is inverse problems involving visibility. As is the case with inverse problems, a better understanding of the forward problem is essential for better results of the more challenging inverse problem. In this work, we focus our attention in the forward problem and do not go further and study the inverse problem. We propose a simple formulation of the visibility problem - the visibility set is the subzero level set of the solution of a nonlinear obstacle problem.

In [TCO04] the visibility problem is presented as a boundary value problem for a first order differential equation: the visibility set to a given viewpoint is given by where the function is the solution of

 (1) ∇ψ⋅x−x∗|x−x∗|=min{H(ψ−g)∇g⋅x−x∗|x−x∗|,0}

with . Here

is the characteristic function of

and is a signed distance function to the obstacles, positive outside the obstacles and negative inside. Despite the complex nature of the operator in (1), in [KT08] the visibility function

is shown to be the viscosity solution of an equivalent Hamilton-Jacobi type equation involving jump discontinuities in the Hamiltonian. A numerical scheme to solve this equation is presented and its convergence is established.

For our formulation, is still a signed distance function to the obstacles, but is instead negative outside and positive inside. Then the visibility set is given as where the function solves the following nonlinear first order local PDE

 min{u(x)−g(x),(x−x∗)⋅∇u(x)}=0

with . This is not only considerably simpler than (1), but can also be generalized to allow multiple viewpoints as we will show. Moreover, each sublevel set of is in fact the visibility set of the corresponding superlevel set of . Efficiencies then arise when the obstacles are given by the graph of a function (for example, heights of buildings). In this case, we can reduce the dimension of the problem, and compute the horizontal visibility set from a given height, using the level set representation. Similarly, if the superlevel set of represents the position of the obstacles at a certain time ( can for instance be the solution of an Eikonal equation), then the PDE needs to be solved only once and the visibility set at any given time can be extracted from the corresponding sublevel set.

The paper is organized as follows. In section 2, we characterize visibility sets as star-shaped envelopes. In section 3 we derive the new visibility PDE and its generalization to multiple viewpoints. In section 4 we present the numerical scheme, while in section 5 we establish its convergence. Finally, in section 6 we present both two-dimensional and three-dimensional examples of visibility sets computed using the new proposed PDE.

## 2. Star shaped sets and functions

In this section we give an interpretation of the visibility set from a given point as the star-shaped envelope with respect to the point . The definitions of star-shaped sets and envelopes are then extended to functions. Finally, we provide explicit formulas for the star-shaped envelopes of a function.

We star by recalling the definition of a star-shaped set.

###### Definition 2.1.

We say the set is star-shaped with respect to if

 x∈S⟹tx∗+(1−t)x∈S, for all t∈[0,1].

A simple example of a star-shaped set is a convex set. Indeed, convex sets are star-shaped with respect to every point inside. Moreover, intersections of convex sets are convex, but unions are not. As a consequence there is a natural (outer) convex envelope, but not an inner one. On the other hand, star-shaped sets are closed under both intersections and unions, which means one can define two star-shaped envelopes (with respect to ) for sets, the inner and outer envelopes.

###### Definition 2.2.

Given and , the outer star-shaped envelope of with respect to is the intersection of all star-shaped sets with respect to which contain . The inner star-shaped envelope of is the union of all star-shaped sets contained in it.

Looking at Figure 1, one immediately sees how the inner star-shaped envelope corresponds to the visibility subset of if there is an illumination source at the point . The remainder of is the invisible part. One the other hand, the outer star-shaped envelope minus corresponds to the least amount of obstacles which would need to be removed so that all of is visible from .

We now discuss star-shaped functions which are the main building block to characterize the visibility set as the solution of a nonlinear obstacle PDE. We write for the -sublevel set of a function and let be a star-shaped domain with respect to .

###### Definition 2.3.

We say that the function is star-shaped with respect to if

 Sα(u) is star-shaped with respect to x∗

for all .

###### Remark 2.1.

Notice the similarity to quasiconvex functions: is said to be quasiconvex if is convex for all .

We now characterize star-shaped functions with a zero-order condition.

###### Lemma 2.4.

A function is star-shaped with respect to if and only if

 (2) u(tx∗+(1−t)y)≤u(y), for all y∈Ω,0≤t≤1.
###### Proof.

By definition, is star-shaped with respect to if and only if for all , is star-shaped with respect to . This is equivalent to the condition

 u(y)≤α⟹u(tx∗+(1−t)y)≤α, for all y∈Ω,0≤t≤1

for all all , which in turn is equivalent to (2). ∎

We use this result to describe the monotonicity of a star-shaped function.

###### Proposition 2.5.

Let be a function. Then is star-shaped with respect to if and only if is increasing along rays from to . Moreover, if is star-shaped with respect to , then is a global minimum of .

###### Proof.

This follows immediately from Lemma 2.4. ∎

Next, in a similar way to star-shaped envelopes of a set, we define upper and lower star-shaped envelopes of a function with respect to a point .

###### Definition 2.6.

Let be bounded by below. The lower star-shaped envelope of with respect to is defined as

 (3) SS−(g)(x)=sup{v(x)∣ v is star-shaped with respect to x∗ % and v≤g},

while the upper star-shaped envelope is given by

 (4) SS+(g)(x)=inf{v(x)∣ v is star-shaped with respect to x∗ % and v≥g}.
###### Remark 2.2.

We require that is bounded by below in order for the lower star-shaped envelope to be well defined since otherwise there would no star-shaped function with respect to bounded from above by .

We finish this section by proving the following simple explicit solution formulas for the star-shaped envelope of a function.

###### Proposition 2.7.

Let be bounded by below and define to be given by

 (5) w(x)=min{g(y)∣y=x+t(x−x∗)∈Ω,t≥0}

with . Then is star-shaped with respect to and .

###### Proof.

By the assumptions on , is well-defined. By construction, is increasing along rays from to , and so, by Proposition 2.5, is star-shaped with respect to . Moreover, it is clear that .

We want to show that . Suppose by contradiction that it is not. This means that there exists a star-shaped with respect to function with such that for some . Without loss of generality, assume that . We have and that there exists such that

 y∈argmin{g(y)∣y=x+t(x−x∗)∈Ω,t>0}.

Hence and therefore is not increasing along the ray from to . Finally, we invoke Proposition 2.5 to conclude that is not star-shaped with respect to , which leads to the desired contradiction. ∎

###### Remark 2.3.

Intuitively, we can find by tracing the values from the boundary along rays to and taking the minimum of along the way.

###### Proposition 2.8.

Let and define to be given by

 (6) u(x)=max{g(y)∣y=x∗+t(x−x∗)∈Ω,t∈[0,1]}.

Then is star-shaped with respect to and .

###### Proof.

From the definition of , it is clear that is increasing along rays from to , and so, by Proposition 2.5, is star-shaped with respect to . Moreover, , again by definition of .

We want to show that . Suppose by contradiction that it is not. This means that there exists a star-shaped with respect to function with such that for some . Without loss of generality assume . We have and that there exists such that

 y∈argmax{g(y)∣y=x∗+t(x−x∗)∈Ω,t∈[0,1)}.

Hence , which means, just like in the proof of Proposition 2.7, that is not increasing along the ray from to . Hence is not star-shaped with respect to according to Proposition 2.5 and we have obtained our contradiction. ∎

###### Remark 2.4.

This formula corresponds to the classic ray tracing algorithm to find the visibility set. We trace the values towards the boundary along rays from taking the maximum of along the way.

## 3. PDEs and Visibility

In this section, we present the new PDE formulation of visibility sets from a single viewpoint and its extension to multiple viewpoints. We start with a level set PDE interpretation for star-shaped envelopes. Given that the inner star-shaped envelope of a set corresponds to its visibility set, the PDE obtained computes the visibility set for each sublevel set. We then generalize it to multiple viewpoints.

### 3.1. Viscosity Solutions

Viscosity solutions [CIL92] provide the correct notion of weak solution to a class of degenerate elliptic PDEs which includes the PDEs considered here. We review it briefly here.

Let be the set of real symmetric matrices, and take to denote the usual partial ordering on , namely that is negative semi-definite.

###### Definition 3.1.

The operator is degenerate elliptic if

 F(x,r,p,M)≤F(x,s,p,N)whenever r≤s and N≤M.
###### Remark 3.1.

For brevity we use the notation .

###### Definition 3.2 (Upper and lower semi-continuous envelopes).

The upper and lower semicontinuous envelopes of a function are defined, respectively, by

 u∗(x) =limsupy→xu(y), u∗(x) =liminfy→xu(y).
###### Definition 3.3 (Viscosity solutions).

Let . We say the upper semi-continuous (lower semi-continuous) function is a viscosity subsolution (supersolution) of in if for every , whenever has a local maximum (minimum) at ,

 F(x,u(x),∇ϕ(x))≤0 (≥0).

Moreover, we say u is a viscosity solution of if is both a viscosity sub- and supersolution.

###### Remark 3.2.

For brevity we use the notation . In addition, when checking the definition of a viscosity solution we can limit ourselves to considering unique, strict, global maxima (minima) of with a value of zero at the extremum. See, for example, [Koi04, Prop 2.2].

### 3.2. Regularity

We briefly discuss the regularity of the star-shaped envelopes. We start by observing that the star-shaped functions need not be continuous.

###### Example 3.1.

In one dimension, the function for and is star-shaped with respect to . In two dimensions, take and define as the characteristic function of the complement of , i.e., if and otherwise. Once again is star-shaped with respect to the origin, but it is not continuous. In fact, is lower semicontinuous.

As for the star-shaped envelopes of functions, the upper star-shaped envelope is continuous while the lower star-shaped envelope is only lower semicontinuous as it may be discontinuous at .

###### Proposition 3.4.

Let be bounded by below. Then is lower semicontinuous in and continuous in except at , while is continuous in . If is a global minimum of then is also continuous in .

###### Proof.

The proof follows from the solutions formulas (5) and (6) since we take the minimum and maximum of a continuous function along rays to and from , respectively, as pointed out in Remarks 2.3 and 2.4. ∎

###### Example 3.2.

Let and let . Then the lower and upper star-shaped envelopes are given by

 w(x)=⎧⎨⎩−x−1if x<−1,0if −1≤x≤0,x+1if x>0,andu(x)=⎧⎨⎩−x−1%ifx<−2,1if −2≤x≤0,x+1if x>0.

A two-dimensional example is given in Figure 2: is given by the distance to two points and is chosen as a point on the level set of . The upper and lower envelopes are pictured. The lower one is discontinuous at . Replacing with leads to a function whose global minimum is attained at and therefore both star-shaped envelopes are continuous in this case. This is depicted in Figure 3.

### 3.3. A local PDE for star-shaped envelopes

We start by establishing a first order condition for star-shaped functions.

###### Proposition 3.5.

Suppose is differentiable. Then is star-shaped with respect to if and only if for all .

###### Proof.

By the mean value theorem, given any there exists such that

 u(tx∗+(1−t)x)−u(x)=t∇u(x+s(x∗−x))⋅(x∗−x).

Thus if is star-shaped with respect to to we obtain using Lemma 2.4

 ∇u(x+s(x∗−x))⋅(x∗−x)≤0.

Taking the limit as leads to the desired inequality .

Now, suppose that for all . We argue by contradiction. Assume that is not star-shaped with respect to . Hence, by Lemma 2.4, there are and such that

 u(tx∗+(1−t)y)>u(y).

Then, again by the mean value theorem,

 ∇u(y+s(x∗−y))⋅(x∗−y)>0

for some . However, taking in leads to

 ∇u(y+s(x∗−y))⋅(y+s(x∗−y)−x∗)≥0 ⟺ ∇u(y+s(x∗−y))⋅(y−x∗)(1−s)≥0 ⟺ ∇u(y+s(x∗−y))⋅(y−x∗)≥0 ⟺ ∇u(y+s(x∗−y))⋅(x∗−y)≤0.

We have the desired contradiction and so the proof is complete. ∎

We are interested in star-shaped functions that may not be differentiable since typically the visibility set has corners. Thus we need to characterize star-shaped functions in the weak sense. We will do so using viscosity solutions. Throughout the rest of this section let be a bounded star-shaped domain with respect to and denote its boundary by .

###### Proposition 3.6.

Suppose . Then is star-shaped with respect to if and only if is a viscosity subsolution of .

###### Proof.

Suppose is star-shaped with respect to . Let be such that has a local maximum at . Without loss of generality assume that . Then we have in a neighborhood of . Since is star-shaped with respect to , is increasing along arrays from to by Proposition 2.5 and therefore

 u(x)≤u(x+h(x−x∗))

for . Hence, given the choice of ,

 ϕ(x)≤ϕ(x+h(x−x∗))

for sufficiently small. Since

 ϕ(x+h(x−x∗))−ϕ(x)h=∇ϕ(x+s(x∗−x))⋅(x−x∗)

for , we obtain as . This shows that is a viscosity subsolution of .

Suppose now that is a viscosity subsolution of and that is not star-shaped with respect to . Then there exists such that and with lying on the line segment from to . Without loss of generality assume that . We can then construct a linear such that and has a local maximum at with . But then

 ∇ϕ(x)⋅(x−x∗)=(u(z)−u(y))(z−y)⋅(x−x∗)<0

We can now finally write the PDEs for the upper and lower star-shaped envelopes of with respect to .

###### Proposition 3.7.

Let be bounded by below and let be the lower star-shaped envelope of with respect to . Assume is continuous. Then is the viscosity solution of the obstacle problem

 max{w(x)−g(x),(x∗−x)⋅∇w(x)}=0

along with boundary conditions on .

###### Proof.

By Proposition 2.7, is star-shaped with respect to and therefore we can write

 w(x)=sup{v(x)∣ v∈USC(Ω) is star-shaped with respect to x∗ and v≤g}.

Now, according to Proposition 3.6, is precisely the supremum of all subsolutions of the PDE and so the proof follows directly from Perron’s method. ∎

###### Proposition 3.8.

Let and let be the upper star-shaped envelope (visibility) of with respect to . Then is the viscosity solution of the obstacle problem

 (7) min{u(x)−g(x),(x−x∗)⋅∇u(x)}=0,

along with .

###### Proof.

By definition the upper star-shaped envelope is given by

 u=inf{v(x)∣v(y)≥g(y) for all y, v is star-shaped with% respect to x∗}.

We observe that this is equivalent to

 −u=sup{v(x)∣v(y)≤−g(y) for all y, −v is star-shaped % with respect to x∗}

and so is the solution of

 max{U−(−g),−(x∗−x)⋅∇U(x)}=0,

by a similar reasoning to the one in Proposition 3.7. Now, since the equation can be rewritten as

 min{−U−g,(x∗−x)⋅∇U(x)}=0,

we conclude that is the solution of

 min{u−g,(x−x∗)⋅∇u(x)}=0

as desired. ∎

###### Remark 3.3.

Contrary to Proposition 3.7 we do not need to assume the continuity of the start-shaped envelope as this follows directly from the assumptions on (see Proposition 3.4).

### 3.4. Comparison Principle

An important property of elliptic equations, from which uniqueness follows, is the comparison principle that states that subsolutions lie below supersolutions. In addition, it also plays a crucial role when establishing the convergence of approximation schemes using the the theory of Barles and Souganidis [BS91], which we intend to do later on. However, in such setting, the comparison principle required is a strong comparison principle: The boundary conditions are satisfied in the viscosity sense. In general, such a comparison is only available when the solutions are continuous up to the boundary (see [CIL92] for more details).

We focus our attention in PDE (7) as it is the one we are most interested in: Its solution allows us to determine the visibility set. A strong comparison principle is however not satisfied: Notice that any function that is nonincreasing along any direction away from is a subsolution and thus given any supersolution we can always construct a subsolution that lies above it by adding a large enough constant. We can however circumvent this by requiring that the subsolution satisfies . This will also prove to be enough to establish convergence of our numerical scheme. Intuitively, imposing that the subsolution satisfies guarantees that lies below . This, together with the fact that the solution of (7) is the infimum of all supersolutions according to Perron’s method, is enough to reach the desired conclusion.

###### Proposition 3.9.

Let . Let be a viscosity subsolution of (7) such that and let be a supersolution of (7). Then in .

###### Proof.

Suppose there exists such that by contradiction. Since is a supersolution (7),

 v(x)≥SS+(g)(x)=max{g(y)∣y=x∗+t(x−x∗)∈Ω,t∈[0,1]}

where we used Perron’s characterization of and Proposition 2.8. In particular, we have and . Hence and by assumption on . Therefore there exists a linear function such that has a local maximum at with and . We have derived a contradiction with the assumption that is a subsolution of (7) and the proof is complete. ∎

### 3.5. Visibility from multiple viewpoints

We are now interested in the visibility set from multiple viewpoints where a point is consider visible if is seen by at least one viewpoint. We follow the same ideas as before, starting by generalizing the definition of star-shaped set.

###### Definition 3.10.

We say that a set is star-shaped with respect to if

 y∈S⟹∃x∗∈{x∗1,…,x∗r}∀t∈[0,1]ty+(1−t)x∗∈S.

As in section 2 we can define star-shaped functions with respect to according to Definition 3.10. More importantly, Proposition 3.5 can be generalized.

###### Proposition 3.11.

Suppose is differentiable and bounded by below. Then is star-shaped with respect to according to Definition 3.10 if and only if

 maxi=1,…,rmint∈[0,1]∇u(x∗i+t(x−x∗i))⋅(x−x∗i)≥0.
###### Remark 3.4.

The presence of the minimum in may not appear obvious at first, but it is crucial here. In order for a point to be visible from then must be increasing along the ray from to which guarantees that all the points along the ray will be in the visible set. Without the minimum in a point could be consider visible by first moving along a ray towards and then follow a different viewpoint.

In this case, is the solution of the following PDE

 (8) min{u(x)−g(x),maxi=1,…,rmint∈[0,1]∇u(x∗i+t(x−x∗i))⋅(x−x∗i)}=0.

Despite being a non-local PDE, unlike the previous ones with a single viewpoint , we still have a fast solver available: The solution is given by

 u=mini=1,…,rui,

where is the solution of

 min{u(x)−g(x),(x−x∗i)⋅∇u(x)}=0.

This follows from noticing that

In addition, the following solution formula is also available

 u(x)=mini=1,…,rmax{g(y)∣y∈x∗i+t(x−x∗i)∈Ω,t∈[0,1]}.

At this point, a natural question to ask is what other visibility definitions will lead to PDEs following the approach taken here. For instance, given viewpoints a point can be considered visible if (i) it is seen by at least two viewpoints; (ii) it is seen by or both and (iii) it is seen by all viewpoints. All these can be computed efficiently computed by first determining the visibility of each viewpoint and then taking the appropriate combination of maximums and minimums. However, determining a corresponding PDE following the approach considered here will in general fail. Consider for instance case (iii) where a point is visible if it is seen by all viewpoints. In this setting, one can no longer define star-shaped like sets as the visibility set may be disconnected (see Figure 4 for a simple example with two viewpoints). The fundamental difference is that it is no longer true that if a point is visible then all points along the ray from to the viewpoint are visible.

## 4. Convergent finite difference schemes

In this section, we discuss the numerical schemes used to solve the PDEs introduced in the previous section, focusing our attention on the visibility PDE (7). As we will see, the scheme proposed here is degenerate elliptic finite difference schemes for which there exists a well established convergence framework.

Before we begin we introduce some notation. For simplicity, we will assume we are working on the hypercube . We write . The domain is discretized with a uniform grid, resulting in the following spatial resolution:

 h≡2N−1,

where is the number of grid points used to discretize . We denote by the computational domain which in our case reduces to .

Our schemes are written as the operators , where is the set of grid functions . We assume they have the following form:

 Fh[u](x)=Fh(u(x),u(x)−u(⋅))for x∈Ωh

where corresponds to the value of u at points in .

### 4.1. Finite difference for the visibility PDE

For simplicity, we present the scheme in the two-dimensional setting. The generalization to higher dimensions is straightforward.

Let

. Define the vector

for . If is one of the four grid points enclosing , let . Otherwise, let denote the intersection between the line that passes through and and a line segment formed by 2 of the 8 neighbors of . Then and its upwind approximation is given by

 uhv(x)≡u(x)−Ihu(~x)|x−~x|,

where

is the piecewise linear Lagrange interpolant. The numerical scheme for the visibility PDE (

7) is then given by

 (9) Fh[u](x)=min{u(x)−g(x),uhv(x)},x∈Ωh.

### 4.2. Fast sweeping solver

We implement a fast sweeping solver to compute the solutions of (9). Solving the equation for the reference variable, , leads to the update formula

 u(x)=max{g(x),Ihu(~x)},

where was defined in the previous section. Since all characteristic are straight lines and flow away from , the domain only needs to be swept once (but in a very specific ordering). For simplicity, we will assume that . Let denote the solution at where

 xi,j=(−1+(i−1)h,−1+(j−1)h).

Set such that (here the inequalities are interpreted component-wise). Set as well . The domain is then divided into four quadrants and each is swept in the following way:

• , (sweeping bottom right square)

• , (sweeping top right square)

• , (sweeping bottom left square)

• , (sweeping top left square)

###### Remark 4.1.

Alternatively, the solver can be seen as a direct consequence of the solution formula (6).

## 5. Convergence of Numerical Solutions

In this section we recall the notion of degenerate elliptic schemes and show that the solutions of the proposed numerical scheme converges to the solutions of (7) as the discretization parameter tends to zero. The standard framework used to establish convergence is that of Barles and Souganidis [BS91], which we state below. In particular, it guarantees that the solutions of any monotone, consistent, and stable scheme converge to the unique viscosity solution of the PDE.

### 5.1. Degenerate elliptic schemes

Consider the Dirichlet problem for the degenerate elliptic PDE, , and recall its corresponding finite difference formulation:

 {Fh(x,u(x),u(x)−u(⋅))=0,x∈Ωh,u(x)−g(x)=0,x∈∂Ωh,

where is the discretization parameter.

###### Definition 5.1.

is a degenerate elliptic scheme if it is non-decreasing in each of its arguments.

###### Remark 5.1.

Although the convergence theory in [BS91] is originally stated in terms of monotone approximation schemes (schemes with non-negative coefficients), ellipticity is an equivalent formulation for finite difference operators [Obe06].

###### Definition 5.2.

The finite difference operator is consistent with if for any smooth function and ,

 limh→0,y→x,ξ→0Fh(y,ϕ(y)+ξ,ϕ(y)−ϕ(⋅))=F(x,ϕ(x),∇ϕ(x)).
###### Definition 5.3.

The finite difference operator is stable if there exists independent of such that if then .

###### Remark 5.2 (Interpolating to the entire domain).

The convergence theory assumes that the approximation scheme and the grid function are defined on all of . Although the finite difference operator acts only on functions defined on , we can extend such functions to via piecewise linear interpolation. In particular, performing piecewise linear interpolation maintains the ellipticity of the scheme, as well as all other relevant properties. Therefore, we can safely interchange and in the discussion of convergence without any loss of generality

### 5.2. Convergence of numerical approximations

Next we will state the theorem for convergence of approximation schemes, tailored to elliptic finite difference schemes, and demonstrate that the proposed scheme fits in the desired framework. In particular, we will show that the schemes are elliptic, consistent, and have stable solutions.

###### Proposition 5.4 (Convergence of approximation schemes [Bs91]).

Let denote the unique viscosity of the degenerate elliptic PDE with Dirichlet boundary conditions for which there exists a strong comparison principle. For each , let denote the solutions of , where the finite difference scheme is a consistent, stable and elliptic scheme. Then locally uniformly on as .

Now, we check that our scheme is consistent, stable and elliptic.

###### Lemma 5.5 (Consistency).

The scheme is consistent.

###### Proof.

It is sufficient to show that

 (x−x∗)⋅∇u(x)=uhv(x)+O(h)

which follows immediately from a Taylor expansion argument and the definition of . ∎

###### Lemma 5.6 (Stability).

Suppose is bounded. Then the scheme is stable.

###### Proof.

Since the solution satisfies

 uh(x)=max{g(x),Ihuh(~x)},x∈Ωh,

it follows that . ∎

###### Lemma 5.7 (Ellipticity).

The scheme is elliptic.

###### Proof.

The term is trivially elliptic. Since belongs to the line segment of two grid points, is a convex combination of neighboring grid values and therefore is elliptic. Hence , being the minimum of two elliptic schemes, is also elliptic. ∎

###### Theorem 5.8.

Suppose . Then the solutions of (9) converge locally uniformly on as to the unique viscosity solution of (7) along with .

###### Proof.

By Lemmas 5.5, 5.6 and 5.7, we see that (9) is consistent, stable and elliptic.

In order to apply Proposition 5.4, our PDE must satisfy a strong comparison principle which is not the case here. However, inspecting the proof of Proposition 5.4 in [BS91], one notices that it is enough to show that in , where

 ¯¯¯u(x)=limsuph→0,y→xuh(x) and u––(x)=liminfh→0,y→xuh(x).

This will follow from Proposition 3.9 by proving that . Indeed, due to the continuity of ,

 ¯¯¯u(x∗) =limsuph→0,y→x∗uh(x∗) =limϵ→0sup{uh(y):y∈B(x∗,ϵ)∖{x∗},0

## 6. Numerical results

In this section we present the numerical results. We focus on solving equation (7) as it is the one we are mainly interested since the sublevel sets of its solution provide us with the visibility set. We present results both in two and three dimensions.

###### Example 6.1.

We start with a simple example to show a numerical convergence test. We take as the viewpoint and consider as the obstacle function the cone and therefore each level-set of corresponds to a circle with center at the origin and a different radius. The exact solution was obtained using (6). The difference between the numerical solution and the exact solution in the norm is presented in Table 1, where we also confirm the expected first order convergence. Moreover, in Figure 5, we plot the level sets of both and the numerical solution, as well as their respective surface plots. As we can see, the visibility set is computed for each level set of .

###### Example 6.2.

In this example we are interested in computing the visibility set where we have four different obstacles: two squares with centers , and side lengths , respectively and two circles with origins , and radius . We achieve this by considering the obstacle function

 g(x)=−min{g1(x),g2(x),g3(x),g4(x)}

where

 g1(x) =2max{|x1+1.5|,|x2+0.2|}, g2(x) =max{|x1|,|x2−0.3|}, g3(x) =√(x1+0.3)2+(x2−1.5)2, g4(x) =√(x1+0.3)2+(x2+1.4)2,

and looking into the level set. We first solve (7) with and . We compute as well the visibility set with respect to when a point is consider visible if it is seen by any of the viewpoints and by both viewpoints simultaneous. The former corresponds to the solution of (8). All results are displayed in Figure 6.

###### Example 6.3.

We consider a simple three-dimensional example where the obstacle function is given by

 g(x)=−min{g1(x),g2(x)}

where

 g1(x)=max(|x1+2|,|x2|,x3)−1andg2(x)=max(|x1−3|),|x2−4|,x3)−2.

It can be interpreted as the visibility set of a camera in the middle of two buildings. The results are displayed in Figure 7.

###### Example 6.4.

The Stanford 3D Scanning Repository provides a dataset of 35947 distinct points that form what is known as the “Stanford Bunny”. In this example we considered it as the obstacle by taking the function to be the signed distance function to the dataset points. The results are displayed in Figure 8.

## 7. Conclusions

In this article, we described a new simpler PDE to compute the visibility set from a given viewpoint given a set of known obstacles. We proposed a finite difference numerical scheme to compute its solution and showed its convergence. We discuss the generalization of the result to multiple viewpoints and present a PDE for the visibility set where a point is visible if it is seen by at least one of many viewpoints. Numerical examples of different visibility sets computed as the solution of the new proposed PDE in both two and three dimensions are presented.

## Acknowledgments

This material is based upon work supported by the Air Force Office of Scientific Research under award number FA9550-18-1-0167. The second author thanks the hospitality of the Mathematics and Statistics department of McGill University during its visit where the work for this paper was carried out.

## References

• [AS96a] Pankaj K. Agarwal and Micha Sharir, Ray shooting amidst convex polygons in 2d, Journal of Algorithms 21 (1996), no. 3, 508 – 519.
• [AS96b] Pankaj K. Agarwal and Micha Sharir, Ray shooting amidst convex polyhedra and polyhedral terrains in three dimensions, SIAM J. Comput. 25 (1996), no. 1, 100–116. MR 1374052
• [BS91] Guy Barles and Panagiotis E. Souganidis, Convergence of approximation schemes for fully nonlinear second order equations, Asymptotic Anal. 4 (1991), no. 3, 271–283. MR 92d:35137
• [CIL92] Michael G. Crandall, Hitoshi Ishii, and Pierre-Louis Lions, User’s guide to viscosity solutions of second order partial differential equations, Bull. Amer. Math. Soc. (N.S.) 27 (1992), no. 1, 1–67. MR 92j:35050
• [CT97] Satyan Coorg and Seth Teller, Real-time occlusion culling for models with large occluders, Proceedings of the 1997 Symposium on Interactive 3D Graphics (New York, NY, USA), I3D ’97, ACM, 1997, pp. 83–ff.
• [CT05] Li-Tien Cheng and Yen-Hsi Tsai, Visibility optimization using variational approaches, Commun. Math. Sci. 3 (2005), no. 3, 425–451.
• [DDTP00] Frédo Durand, George Drettakis, Joëlle Thollot, and Claude Puech, Conservative visibility preprocessing using extended projections, Proceedings of SIGGRAPH 2000 (July 2000), Held in New Orleans, Louisiana.
• [HZ00] Aaron Hertzmann and Denis Zorin, Illustrating smooth surfaces, 2000.
• [Koi04] Shigeaki Koike, A beginner’s guide to the theory of viscosity solutions, MSJ Memoirs, vol. 13, Mathematical Society of Japan, Tokyo, 2004. MR 2084272 (2005d:35002)
• [KT08] Chiu-Yen Kao and Richard Tsai, Properties of a level set algorithm for the visibility problems, Journal of Scientific Computing 35 (2008), no. 2, 170–191.
• [LT18] Louis Ly and Yen-Hsi Richard Tsai, Autonomous exploration, reconstruction, and surveillance of 3d environments aided by deep learning, CoRR abs/1809.06025 (2018).
• [LTC06] Yanina Landa, Richard Tsai, and Li-Tien Cheng, Visibility of point clouds and mapping of unknown environments, Advanced Concepts for Intelligent Vision Systems (Berlin, Heidelberg) (Jacques Blanc-Talon, Wilfried Philips, Dan Popescu, and Paul Scheunders, eds.), Springer Berlin Heidelberg, 2006, pp. 1014–1025.
• [Obe06] Adam M. Oberman, Convergent difference schemes for degenerate elliptic and parabolic equations: Hamilton-Jacobi equations and free boundary problems, SIAM J. Numer. Anal. 44 (2006), no. 2, 879–895 (electronic). MR MR2218974 (2007a:65173)
• [OS88] Stanley Osher and James A. Sethian, Fronts propagating with curvature-dependent speed: algorithms based on Hamilton-Jacobi formulations, J. Comput. Phys. 79 (1988), no. 1, 12–49.
• [SA97] J. A. Sethian and D. Adalsteinsson, An overview of level set methods for etching, deposition, and lithography development, IEEE Transactions on Semiconductor Manufacturing 10 (1997), no. 1, 167–184.
• [Set99] J. A. Sethian, Level set methods and fast marching methods

, second ed., Cambridge Monographs on Applied and Computational Mathematics, vol. 3, Cambridge University Press, Cambridge, 1999, Evolving interfaces in computational geometry, fluid mechanics, computer vision, and materials science. MR MR1700751 (2000c:65015)

• [TCO04] Y.-H. R. Tsai, L.-T. Cheng, S. Osher, P. Burchard, and G. Sapiro, Visibility and its dynamics in a pde based implicit framework, J. Comput. Phys. 199 (2004), no. 1, 260–290.
• [VTS14] Luca Valente, Yen-Hsi R. Tsai, and Stefano Soatto, Information-seeking control under visibility-based uncertainty, J. Math. Imaging Vis. 48 (2014), no. 2, 339–358.