31
weighted minimal surface model for surface reconstruction from scattered points, curves, and/or pieces of surfaces. joint work with (S. Osher, R. Fedkiw and M. Kang) Desired properties for surface reconstruction: has the ability to handle complicated topology and geometry as well as noise and non-uniformity of the data. the constructed surface is a good approximation of the data set and has some smoothness. has a data structure that is good for static rendering as well as dynamic deformation and other operations. extends to high dimensions. 34

joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

weighted minimal surface model for surface reconstructionfrom scattered points, curves, and/or pieces of surfaces.

joint work with (S. Osher, R. Fedkiw and M. Kang)

Desired properties for surface reconstruction:

• has the ability to handle complicated topology and geometryas well as noise and non-uniformity of the data.

• the constructed surface is a good approximation of the dataset and has some smoothness.

• has a data structure that is good for static rendering as wellas dynamic deformation and other operations.

• extends to high dimensions.

34

Page 2: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

previous approaches

• explicit representation: find f s.t. Γ = f(u, v).

– triangulated surfaces using Voronoi diagram and Delaunay

triangulations.

– parametric surfaces, such as NURBS.

– variational and PDE formulation.

membrane model: min∫ |∇f |2dx subject to: f(xi) = fi

• implicit representation: find φ(x) s.t. Γ = {x|φ(x) = const.}

– the scalar function is a combination of basis functions.

– the scalar function is a signed distance function.

35

Page 3: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

our approach

• Define a minimal surface model and a convection model on

the continuous level using variational formulation and PDEs.

• Develop efficient numerical algorithms based on rectangular

grids for processing data, computing distance and defining

the initial surface.

• Construct the final surface Γ, as an implicit surface by contin-

uous deformation using the level set method, i.e., construct

a signed distance function φ(x) s.t. Γ = {x : φ(x) = 0}.

36

Page 4: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

the weighted minimal surface model

Let S denote a general data set and d(x) = dist(x,S).

Variational formulation:

Minimize E(Γ) =[∫

Γdp(x)ds

]1p

. 1 ≤ p ≤ ∞,

The energy functional:

• uses distance which is independent of parametrization and isinvariant under rotation and translation.

• if p < ∞, E(Γ) ≈ ∫Γ dp(x)ds, a weighted surface area.

if p = ∞, E(Γ) = maxx∈Γ d(x)

• p = 1, scale invariant E(Γ) =∫Γ d(x)ds

37

Page 5: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

geodesic model for image segmentation

Denote I(x) to be the intensity function. Define the boundary

to be the curve Γ that minimizes∫Γ

g(∇I)ds

where g(∇I) is an edge detection function, e.g.

g(∇I) = (1 + ‖∇I‖p)−1

The gradient flow is:

vn = −∇ · (g(∇I)n) = −∇g · n − gκ

where n is the unit normal and κ is the curvature.

38

Page 6: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

the gradient descent flow

dt=−

[∫Γ

dp(x)ds

]1p−1

dp−1(x)

[∇d(x)·n+

1

pd(x)κ

]n,

• balance between attraction ∇d · n and surface tension dκscaled by distance, where κ is the mean curvature.

•[∫

Γdp(x)ds

]1p−1

dp−1(x) scales the motion of Γ,

if p � 1,

[∫Γ

dp(x)ds

]1p−1

dp−1(x) ≈[d(x)

dmax

]p−1

where

dmax = maxx∈Γ

d(x) ≈ [∫Γ

dp(x)ds]1/p

In practice, we often use p = 1 (scale invariant) or p = 2(least square).

39

Page 7: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

the Euler-Lagrange equation

The minimizer satisfies the weighted minimal surface equation:

dp−1(x)

[∇d(x) · n +

1

pd(x)κ

]= 0,

• The rigidity is adapted to the local sampling density.

• ∇d(x) · n + 1pd(x)κ = 0 ⇒ local sampling condition.

40

Page 8: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

mathematical questions

• if d(x) = dist(x,Γ0), Γ0 is a smooth surface, E(Γ) = 0 when

Γ = Γ0 or Γ = ∅.

• if d(x) = dist(x,S), S is a discrete set, E(Γ) = 0 when Γ = ∅.

Questions:

1. Existence and uniqueness of a local minimum, i.e., a weighted

minimal surface attached to the data set?

2. How to find it?

41

Page 9: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

2D results

If p ≥ 1,

• Lemma1: Polygon with vertices in S is a local minimum.

Proof:

1. dp−1(x)[∇d(x) · n + 1pd(x)κ] = 0 a.e.

2. it is a local minimum by perturbation analysis.

• Lemma2: If a curve passes a data point it will not leave the

point.

Remark: It is more complicated in 3D and depends on the

sampling density in general.

42

Page 10: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

continuous deformation

Deform an initial surface that encloses S following the gradientflow (a weighted mean curvature flow):

dt=−

[∫Γ

dp(x)ds

]1p−1

dp−1(x)

[∇d(x)·n+

1

pd(x)κ

]n,

Numerical Challenges:

1. topological changes during the deformation.

2. convergence and CFL condition ∆t = O(∆x2).

Solutions:

1. the level set method provides a powerful numerical tool forthe deformation and construction of implicit surfaces.

2. Starting with a good initial guess.

43

Page 11: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

local analysis in the continuous limit

If Γ0 be a smooth closed surface, let d(x) be the signed distance

function to Γ0 (d is negative inside Γ0) and Γd = {x|d(x) = d},then

F(d)def= E(Γd) =

[∫Γd

|d|pds

]1p

= |d|[∫

Γd

ds

]1p def

= |d|L1p(d)

and

L′(d) =∫Γd

κds = χ(d).

So

sign(d)F ′(d) = L1p−1

(d)

[L(d) +

d

pχ(d)

]= L

1p−1

(d)∫Γd

(1 − dκ

p

)ds

Remark: |dκ| < 1 until singularity develops. In 2D χ(a) = winding

number.

44

Page 12: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

a convection model

The surface is convected in the potential field defined by the

distance function d(x).

∂Γ

∂t= −∇d(x)

Properties:

1. |vn| = |∇d · n| ≤ 1.

2. Each point on Γ is attracted by its closest data point except

those equal distant points.

3. Linear convection equation, ∆t = O(∆x) in numerical com-

putations.

The final construction is like piecewise linear.

45

Page 13: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

xx

x x

x

x

1

2 3

4

5

6

Page 14: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

the level set method

Two key steps for the level set method:

1. Embed the surface: find a level set function φ s.t.

Γ = {x : φ(x) = 0}. Geometric properties of the surface Γcan be easily computed using φ, e.g. n = ∇φ

|∇φ|, κ = ∇ · ∇φ|∇φ|.

2. Embed the motion: derive the time evolution PDE for φ s.t.Γ(t) = {x : φ(x, t) = 0}.

dφ(Γ(t), t)

dt= φt + v · ∇φ = 0

where v is a velocity field that agrees with the motion of Γ.

Remark: Reinitialization is usually needed to keep φ close to thesigned distance function, i.e., |∇φ| ≈ 1.

47

Page 15: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

advantages of the level set method

• Geometric problem becomes a PDE problem.

• Capture the moving interface on a fixed Cartesian grid.

• Handle topological changes easily.

• Efficient numerical schemes are available.

• Local level set method reduces the computation cost.

Remark: The level set method and implicit surfaces provide ageneral framework for the modeling, analysis and simulation ofsurfaces.

48

Page 16: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

the level set formulation for our problems

• embed the motion:

gradient flow for the minimal surface model:

∂φ

∂t= |∇φ|

[∫dpδ(φ)|∇φ|dx

]1p−1

d1p−1

[∇d· ∇φ

|∇φ| +1

pd∇· ∇φ

|∇φ|

]

the convection model

∂φ

∂t= ∇d(x) · ∇φ

• standard finite difference scheme for the level set method.

• reinitialization.

49

Page 17: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

numerical algorithms

Three most important ingredients:

• Computing the unsigned distance function to an arbitrary

data set.

• Finding a good initial surface.

• Solving the PDEs for the level set method.

50

Page 18: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

finding a good initial surface

1. Start with the outer distance contour d = ε,

2. Push the initial surface even closer to the data set using afast tagging algorithm.

marching boundary

distance contour

data point

Remark: The fast tagging algorithm can be regarded as a crudeupwind scheme for the convection model.

51

Page 19: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

a fast tagging algorithm

the final surface = an appropriate boundary between the exteriorand the interior regions.We start with an exterior region and use the following fast tag-ging algorithm to move the temporary boundary inward.

1. Heapsort the boundary points according to the distance.2. for the furthest boundary point,(a) if it has an interior neighbor that has a larger distance, tagthis boundary point as a final boundary point and remove it fromthe temporary boundary point.(b) otherwise move the point to the exterior and put its neigh-boring interior points to the temporary boundary.

Repeat this process until either the temporary boundary is emptyor all points in the temporary boundary have distance less thatsome tolerance, which are then put in the final boundary.Signed distance function to the final boundary is then computedusing the previous fast sweeping algorithm.

52

Page 20: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

Tagging algorithmTagging algorithm

Hongkai Zhao

Page 21: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

• A good initial surface is important for the efficiency of the PDEg p ybased method.

• On a rectangular grid, we view an implicit surface as ani t f ith l it th t t th t i idinterface with some regularity that separates the exterior gridpoints from the interior grid points.

• In other words, volumetric rendering requires identifying all, g q y gexterior (interior) grid points correctly.

• A novel, extremely efficient tagging algorithm that tries toid if i id i ibl didentify as many correct exterior grid points as possible andhence provide a good initial implicit surface.

Page 22: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

• Start from any initial exterior region that is a subset of thetrue exterior region.

• All grid points that are not in the initial exterior region areAll grid points that are not in the initial exterior region arelabeled as interior points.

• Those interior grid points that have at least one exterior• Those interior grid points that have at least one exteriorneighbor are labeled as temporary boundary points.

N th f ll i d t h th• Now we use the following procedure to march thetemporary boundary inward toward the data set.

Page 23: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

• We put all the temporary boundary points in a heapsort binary treet t ti di t di t lstructure sorting according to distance values.

• Take the temporary boundary point that has the largest distance(which is on the heap top) and check to see if it has an interior(which is on the heap top) and check to see if it has an interiorneighbor that has a larger or equal distance value.

• If it does not have such an interior neighbor turn this temporary• If it does not have such an interior neighbor, turn this temporaryboundary point into an exterior point, take this point out of theheap, add all this point’s interior neighbors into the heap and re‐sort according to distance values.

• If it does have such an interior neighbor, we turn this temporaryboundary point into a final boundary point, take it out of the heapand re sort the heap None of its neighbors are added to the heapand re‐sort the heap. None of its neighbors are added to the heap.

Page 24: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

• We repeat this procedure on the temporary boundary points untilth i di t f th t b d i t i llthe maximum distance of the temporary boundary points is smallerthan some tolerance, e.g. the size of a grid cell, which means all thetemporary boundary points in the heap are close enough to thedata set, which are then put in the final boundary., p y

• or the temporary boundary is empty.

• Finally, we turn these temporary boundary points into the final setof boundary points and our tagging procedure is finished. Now wehave the final sets of interior, exterior and boundary points.

• Signed distance function to the final boundary is then computedusing the previous fast sweeping algorithm.

Page 25: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry
Page 26: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

multi-resolution

There are two resolutions, i.e., the data set and the grid.

The best scenario is when the two resolutions are comparable.

Remark:

• The computation cost depends mainly on the grid resolution.

• Low resolution may be desirable when there are redundan-

cies/noises and speed or memory limit.

• Hierarchical multi-resolution algorithm can be used to im-

prove the efficiency.

53

Page 27: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

Efficient storage and reconstruction

• Storage: Store the values and locations (indices) of those

grid points that are next to the surface. (a thin shell around

the surface) No connections and orderings are needed.

For a reconstruction on a grid of size 290x206x134,

storage of the whole grid: 118 MB, (44 MB compressed),

storage of the thin shell: 15 MB (5 MB compressed).

• Reconstruction: Use the fast sweeping and tagging algorithm

to reconstruct the signed distance function in O(N) opera-

tions.

54

Page 28: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

results

All computations are done on a PentiumIII 600Mhz PC with 1GB

memory. The used data sets are from The Stanford 3D Scanning

Repository, Georgia Institute of Technology’s Large Geometric

Models Archive.

Model Data Grid CPU CPUpoints size (initial) (min)

Rat brain 1506 80x77x79 .12 3Torus 4800 80x80x22 .03 1.5

Buddha 543652 146x350x146 3 68Buddha 543652 63x150x64 .3 7Dragon 437645 300x212x136 4 77Dragon 437645 100x71x46 .2 4Hand 327323 200x141x71 .5 10

55

Page 29: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

(a) data points (b) starting surface (c) final reconstruction

(a) data points (b) front view (c) side view

(a) data curves (b) reconstruction

Page 30: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

(a) high resolution reconstruction (b) low resolution reconstruction

57

Page 31: joint work with (S. Osher, R. Fedkiw and M. Kang) Desired ...faculty.missouri.edu/duanye/course/cs8620-spring... · • has the ability to handle complicated topology and geometry

58