Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Level-‐Set Methods & Dynamic Implicit Surfaces
Overview
• Implicit Surfaces • Level Set Methods
Overview
• Implicit Surfaces • Level Set Methods
Overview
• Implicit Surfaces – Implicit func=ons
• Points • Curves • Surfaces • Geometry toolbox • Calculus toolbox
– Signed distance func=ons • Distance func=ons • Signed distance func=ons • Geometry and calculus tool box
Introduc=on
• Tracking boundaries is an important problem in many areas of computer science – Image Processing – Machine Vision – Biometrics – Human Computer Interac=on – Entertainment
Introduc=on
• The Problem – How is it possible to efficiently and accurately represent the boundary?
– How do you track the boundary ahead in =me?
Explicit Representa=on
• Marker/String Methods • A standard approach to modeling a moving boundary (front/contour/interface) is to discre=ze it into a set of marker par=cles whose posi=ons are known at any =me.
• To reconstruct the front the par=cles are linked by line segments in 2D and triangles in 3D.
Explicit Representa=on
• Marker/String Method – The idea is to advance the par=cles in the direc=on of the arrows, recalculate the arrows, advance the par=cles, and repeat
– More par=cles should mean greater accuracy
Explicit Representa=on
• Marker/String Method Issues – The markers may poten=ally cross over one another and require untangling
– The boundary may split or merge
Explicit Representa=on
• Marker/String Method Issues – The front may expand or contract requiring the addi=on or removal of markers
Implicit Vs. Explicit
• Tracking the interface through points (markers) on its surface is a Lagrangian formula=on.
• Capturing an interface through the evolu=on of the implicit surface is a Eulerian formula=on.
Implicit Vs. Explicit
• Implicit representa=ons overcome the previous problems at the cost of memory efficiency, some new limita=ons.
• In the case of the water simula=on Foster and Fedkiw found a hybrid approach combining Eulerian and Lagranian formula=ons works the best.
!!!
Implicit Func=ons • Points
– Explicitly divide a 1-‐d region Ω into two sub-‐regions with an interface at x = -‐1 and x = 1
-‐2 -‐1 0 1 2
Outside Ω+ Outside Ω+ Inside Ω-‐
Ω∂Interface ( )( ) ( ){ }1,1
,11,1,1
−=Ω∂
∞−∞−=Ω
−=Ω+
−
∪
Explicit Representa=on
Implicit Func=ons • Points
– Implicitly divide a 1-‐d region Ω into two sub-‐regions with an interface at x = -‐1 and x = 1
-‐2 -‐1 0 1 2
Outside Ω+ Outside Ω+ Inside Ω-‐
Ω∂Interface
( )( )( )( ) 0:
0:0:12
=Ω∂
>Ω
<Ω
−=
+
−
xxxxx
ϕ
ϕ
ϕ
ϕImplicit Representa=on
Implicit Func=ons • Points
– An implicit representa=on provides a simple, numerical method to determine the interior, exterior and interface of a region Ω.
– In the previous case the interior is always nega=ve and the exterior is always posi=ve.
– The set of points where φ(x) = 0 is known as the zero level set or zero isocontour and will always give the interface of the region.
Implicit Func=ons
• Curves – In 2 spa=al dimensions a closed curve separates Ω into two sub-‐
regions.
Outside Ω+
φ > 0
Inside Ω-‐
φ < 0
Ω∂Interface ( ) 0122 =−+= yxx!ϕ
Inside Ω-‐
φ < 0
Implicit Func=ons
• Surfaces – In 3+ spa=al dimensions higher dimensional surfaces are used to
represent the zero level set of φ.
Outside Ω+
φ > 0
Ω∂Interface ( ) 01222 =−++= zyxx!ϕ
Discrete Representa=ons of Implicit Func=ons
• Complicated 2D curves and 3D surfaces do not always have analy=cal descrip=ons.
• The implicit func=on φ need to be stored with a discre=za=on, i .e. in the impl ic it representa=on, we will know the values of the implicit func=on φ at only a finite number of data points and need to use interpola=on to find the values of φ else where.
Discrete Representa=ons of Implicit Func=ons
• The loca=on of the interface, the φ(x) = 0 zero iso-‐contour need to be interpolated from the known values of φ at the data points.
• This can be done using contour plo`ng algorithms such as Marching Cubes algorithm.
• The set of data points where the implicit func=on φ is defined is called a grid.
• Uniform Cartesian grids are mostly used. • Other grids include unstructured, adap=ve, curvilinear, etc.
Iso-‐contour extrac=on
φ(x,y)=0 φ(x,y)>0 φ(x,y)<0
Iso-‐contour extrac=on
φ(x,y)=0 φ(x,y)>0 φ(x,y)<0
Iso-‐contour extrac=on
φ(x,y)=0 φ(x,y)>0 φ(x,y)<0
Iso-‐contour extrac=on
φ(x,y)=0 φ(x,y)>0 φ(x,y)<0
Marching Squares
φ(x,y)=0 φ(x,y)>0 φ(x,y)<0
Four unique cases (a7er considering symmetry)
Marching Squares
Principle of Occam’s razor: If there are mul@ple possible explana@ons of a phenomenon that are consistent with the data, choose the simplest one.
Marching Squares
Linear interpola=on f(x,y)=0 f(x,y)>0 f(x,y)<0 fi, j+1 > 0
fi, j < 0
fi+1, j+1 > 0
fi+1, j > 0
Marching Squares
fi, j = a < 0 fi+1, j = b > 0 fi+Δx, j=0
Marching Squares
fi, j = a < 0 fi+1, j = b > 0 fi+Δx, j=0
Δx / h = (-‐a) / (b-‐a)
Δx = ah / (a-‐b)
Marching Squares
Marching Squares
Marching Squares-‐ambiguity
More informa@on are needed to resolve ambiguity
Iso-‐contour extrac=on
φ(x,y)=0 φ(x,y)>0 φ(x,y)<0
Marching Cubes Algorithm
Lorensen & Cline: Marching Cubes: A high resolu@on 3D surface construc@on algorithm. In SIGGRAPH 1987.
Implicit Func=ons: Discrete Representa=ons
• Points – Another way to represent φ(x) is to discre=ze Ω into grid cells and put the value of φ(x) in each cell.
… 8 3 0 -1 0 3 8 …
0 1 2 3 -‐1 -‐2 -‐3
( ) 12 −= xxϕ
Implicit Func=ons • Points
– Or define φ(x) as a height.
0 1 2 3 -‐1 -‐2 -‐3
( ) 12 −= xxϕ
0
Implicit Surface & Isosurface • When c is 0, we say that f implicitly defines a locus, called an
implicit surface, .
• The implicit surface is some=mes called the zero set (or zero surface) of f.
• The isosurface (also called a level set or level surface) is , , where c is the iso-‐value of the surface. }0)(|{ 3 =∈ pp fR
})(|{ 3 cfR =∈ pp
Boolean Opera=ons of Implicit Func=ons
• φ(x) = min (φ1(x), φ2(x)) is the union of the interior regions of φ1(x) and φ2(x).
• φ(x) = max (φ1(x), φ2(x)) is the intersec=on of the interior regions of φ1(x) and φ2(x).
• φ(x) = -‐φ1(x) is the complement of φ1(x) .
• φ(x) = max (φ1(x), -‐φ2(x)) represents the subtrac=on of the interior regions of φ1(x) by the interior regions of φ2(x).
Construc=ve Solid Geometry
Geometry Toolbox
• The gradient of the implicit func=on • The normal of the implicit func=on • Mean curvature of the implicit func=on • Numerical approxima=ons
Gradient/Normal
Gradient/Normal
Curvature
Curvature
Calculus Toolbox
• Characteris=c func=on • Heaviside func=on • Delta func=on • Volume integral • Surface integral • Numerical approxima=on
Signed Distance Func=ons
• Signed distance func=ons are a subset of implicit func=on defined to be posi=ve on the exterior, nega=ve on the interior with
• A distance func@on is defined as:
( ) ( )Ω∂∈
−=
I
I
xwherexxxd
!
!!! min
|1)(| =∇ x!φ
Signed Distance Func=ons
• A signed distance func@on adds the appropriate signing of the interior vs. exterior.
⎪⎩
⎪⎨
⎧
Ω∈−
Ω∂∈=
Ω∈
=−
+
xxdxxd
xxdx
!!
!!!!
!
)(0)(
)()(φ
|1)(| =∇ x!φ
Signed Distance Func=ons
• 1D Example: – Implicit func=on – Signed distance func=on
• 2D Example: – Implicit func=on – Signed distance func=on
• 3D Example: – Implicit func=on – Signed distance func=on
( ) 12 −= xxϕ( ) 1|| −= xxϕ
( ) 1, 22 −+= yxyxϕ( ) 1, 22 −+= yxyxϕ
( ) 1,, 222 −++= zyxzyxϕ
( ) 1,, 222 −++= zyxzyxϕ
Boolean Opera=ons of Signed Distance Func=ons
• φ(x) = min (φ1(x), φ2(x)) is the union of the interior regions of φ1(x) and φ2(x).
• φ(x) = max (φ1(x), φ2(x)) is the intersec=on of the interior regions of φ1(x) and φ2(x).
• φ(x) = -‐φ1(x) is the complement of φ1(x) .
• φ(x) = max (φ1(x), -‐φ2(x)) represents the subtrac=on of the interior regions of φ1(x) by the interior regions of φ2(x).
Geometry and Calculus Toolboxes of the Signed Distance Func=ons
Since • The Delta func=on is: • The Surface integral is:
|1)(| =∇ x!φ
))(()( xx !!φδδ =
)())(()( xdxxf !!!φδ∫Ω
Geometry and Calculus Toolboxes of the Signed Distance Func=ons
Since • The normal of the signed distance func=on is:
• Mean curvature of the the signed distance func=on is:
Where is the Laplacian of
|1)(| =∇ x!φ
φ∇=N!
φΔ=k
zzyyxx φφφφ ++=ΔφΔ φ
Signed Distance Func=ons
• In two spa=al dimensions the signed distance func=on for a circle with a radius r and a center (x0, y0) is given as:
( ) ( ) ( ) ryyxxx −−+−= 20
20
!φ
Overview
• Implicit Surfaces • Level Set Methods
Overview
• Level set methods – Mo=on in an externally generated velocity field
• Convec=on • Upwind differencing • Hamilton-‐Jacobi ENO/WENO, TVD Runge-‐Kula
– Mo=on involves mean curvature • Equa=ons of mo=on • Numerical discre=za=on • Convec=on-‐diffusion equa=ons
Overview
– Hamilton-‐Jacobi Equa=on • Connec=on with Conserva=on Laws • Numerical discre=za=on
– Mo=on in the Normal Direc=on • The Basic Equa=on • Numerical discre=za=on • Adding a Curvature-‐Dependent Term • Adding an External Velocity Field
Overview
• Level set methods – Mo=on in an externally generated velocity field
• Convec=on • Upwind differencing • Hamilton-‐Jacobi ENO/WENO, TVD Runge-‐Kula
– Mo=on involves mean curvature • Equa=ons of mo=on • Numerical discre=za=on • Convec=on-‐diffusion equa=ons
3. Mo=on in an Externally Generated Velocity Field
1. Convec=on • Assume the velocity of each point on the implicit surface is given as ,
• i.e. is known for every point with • Given this velocity field
)(xV !!
)(xV !!
0)( =x!φx!
)(xV !!
Mo=on in an Externally Generated Velocity Field
• Level set methods add dynamics to implicit surfaces
• Stanley Osher and James Sethian implemented the first approach to numerically solving a =me-‐dependent equa=on for a moving implicit surface
Mo=on in an Externally Generated Velocity Field
• In the Eulerian approach the implicit func=on φ is used to both represent the interface and evolve the interface.
• Given an external velocity field the level set equa=on is given as
0=∇⋅+ ϕϕ Vt
!
Temporal par=al deriva=ve Advec=on term
Mo=on in an Externally Generated Velocity Field
• Using the forward difference approach for the par=al deriva=ve with respect to =me
01
=∇⋅+Δ
−+nn
nn
Vt
ϕϕφ !
Mo=on in an Externally Generated Velocity Field
• At this point it looks like the next step would be to take the gradient of φ by using central differences.
• But first we should expand the equa=on and look at it one dimension at a =me
01
=+++Δ
−+nz
nny
nnx
nnn
wvut
ϕϕϕϕφ
Mo=on in an Externally Generated Velocity Field
• If we look at the u component of the vector field we might see something like to the right for direc=on.
• If ui,j is poin=ng to the right we need to look to the cell to the right of φi,j the same applies to values to the lem.
● ● ● ● ●
● ● ● ● ●
● ● ● ● ●
● ● ● ● ●
● ● ● ● ●
xxii
Δ
−=
∂
∂ + ϕϕϕ 1
xxii
Δ
−=
∂
∂ −1ϕϕϕ
Forward Difference
Backward Difference
Mo=on in an Externally Generated Velocity Field
• For a 1-‐d case the level set equa=on would be of the form
01
=+Δ
−+nx
ni
nn
ut
ϕϕφ
Mo=on in an Externally Generated Velocity Field
• The update equa=on would be
• where
nx
nnn tu φϕφ Δ+=+1
⎪⎪⎩
⎪⎪⎨
⎧
<Δ
−
>Δ
−
=−
+
0
0
1
1
iii
ii
x
ux
ux
i
ϕϕ
ϕϕ
φ
Overview
• Level set methods – Mo=on in an externally generated velocity field
• Convec=on • Upwind differencing • Hamilton-‐Jacobi ENO/WENO, TVD Runge-‐Kula
– Mo=on involves mean curvature • Equa=ons of mo=on • Numerical discre=za=on • Convec=on-‐diffusion equa=ons
4. Mo=on involves mean curvature
• Equa=ons of mo=on • Numerical discre=za=on • Convec=on-‐diffusion equa=ons
Overview
– Hamilton-‐Jacobi Equa=on • Connec=on with Conserva=on Laws • Numerical discre=za=on
– Mo=on in the Normal Direc=on • The Basic Equa=on • Numerical discre=za=on • Adding a Curvature-‐Dependent Term • Adding an External Velocity Field
Hamilton-‐Jacobi Equa=on
• Connec=on with Conserva=on Laws • Numerical discre=za=on
Overview
– Hamilton-‐Jacobi Equa=on • Connec=on with Conserva=on Laws • Numerical discre=za=on
– Mo=on in the Normal Direc=on • The Basic Equa=on • Numerical discre=za=on • Adding a Curvature-‐Dependent Term • Adding an External Velocity Field
Mo=on in the Normal Direc=on
• The Basic Equa=on • Numerical discre=za=on • Adding a Curvature-‐Dependent Term • Adding an External Velocity Field
References • S. Osher and R. Fedkiw, Level Set Methods and Dynamic
Implicit Surfaces, Springer, 2003. • J.A. Sethian, Level Set Methods and Fast Marching
Methods, Cambridge, 1996. • Geometric Level Set Methods in Imaging, Vision, and
Graphics, Stanley Osher, Nikos Paragios, Springer, 2003. • Geometric Par=al Differen=al Equa=ons and Image
Analysis, Guillermo Sapiro, Cambridge University Press, 2001.
• J. A. Sethian, “Level Set Methods: An Act of Violence”, American Scien=st, May-‐June, 1997.
• N. Foster and R. Fedkiw, "Prac=cal Anima=on of Liquids", SIGGRAPH 2001, pp.15-‐22, 2001.