level set methods - university of missouriweb.missouri.edu/.../lecture-notes/3b-level-set.pdf ·...

Post on 07-Jun-2020

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Level‐Set MethodsLevel Set Methods

OverviewOverview

• Level set methods– Formulation of Interface Propagation

• Boundary Value PDE• Initial Value PDE• Initial Value PDE

– Motion in an externally generated velocity field• ConvectionU i d diff i• Upwind differencing

• Hamilton‐Jacobi ENO/WENO, TVD Runge‐Kutta– Motion involves mean curvature

• Equations of motion• Numerical discretization• Convection‐diffusion equations

OverviewOverview

– Hamilton‐Jacobi EquationHamilton Jacobi Equation• Connection with Conservation Laws• Numerical discretization

–Motion in the Normal Direction• The Basic Equation• Numerical discretization

• Adding a Curvature‐Dependent Term• Adding an External Velocity Field

ReferencesReferences

• S. Osher and R. Fedkiw, Level Set Methods and Dynamic I li it S f S i 2003Implicit 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 Partial Differential Equations and ImageGeometric Partial Differential Equations and Image Analysis, Guillermo Sapiro, Cambridge University Press, 2001.J A S thi “L l S t M th d A A t f Vi l ”• J. A. Sethian, “Level Set Methods: An Act of Violence”, American Scientist, May‐June, 1997.

• N. Foster and R. Fedkiw, "Practical Animation of Liquids", SIGGRAPH 2001 pp 15 22 2001SIGGRAPH 2001, pp.15‐22, 2001. 

OverviewOverview

• Level set methodsLevel set methods–Motion in an externally generated velocity field• ConvectionConvection

• Upwind differencing• Hamilton‐Jacobi ENO/WENO, TVD Runge‐Kutta/ , g

–Motion involves mean curvature• Equations of motion

• Numerical discretization

• Convection‐diffusion equations

3. Motion in an Externally Generated Velocity Field3. Motion in an Externally Generated Velocity Field

1 Convection1. Convection

• Assume the velocity of each point on the implicit surface is given as )(V implicit surface is given as        , 

• i.e.          is known for every point    with

)(xV

)(xV 0)( xx

• Given this velocity field   )(xV

Motion in an Externally Generated Velocity i ldField

• Level set methods add dynamics to implicitLevel set methods add dynamics to implicit surfaces

• Stanley Osher and James Sethiani l d h fi h i llimplemented the first approach to numerically solving a time‐dependent equation for a 

i i li i fmoving implicit surface

Motion in an Externally Generated Velocity i ldField

• In the Eulerian approach the implicit functionIn the Eulerian approach the implicit function φ is used to both represent the interface and evolve the interfaceevolve the interface.

• Given an external velocity field the level set equation is given asequation is given as

0 V

0 Vt

Temporal partial derivative Advection term

Motion in an Externally Generated Velocity i ldField

• Using the forward difference approach for theUsing the forward difference approach for the partial derivative with respect to time 

1 nn 0 nnVt

Motion in an Externally Generated Velocity i ldField

• At this point it looks like the next step wouldAt this point it looks like the next step would be to take the gradient of φ by using central differencesdifferences.

• But first we should expand the equation and look at it one dimension at a timelook at it one dimension at a time

1 nn 0 n

znn

ynn

xn wvu

t

Motion in an Externally Generated Velocity i ldField

• If we look at the u component of the vector field we might see something like to the right

● ● ● ● ●

● ● ● ● ●

see something like to the right for direction.

• If ui j is pointing to the right we

● ● ● ● ●

● ● ● ● ●If ui,j is pointing to the right we need to look to the cell to the right of φi,j the same applies to l t th l ft

● ● ● ● ●

values to the left.xx

ii

1

xxii

1

Forward BackwardForwardDifference

BackwardDifference

Motion in an Externally Generated Velocity i ldField

• For a 1‐d case the level set equation would beFor a 1 d case the level set equation would be of the form

01

nnnn 0

nx

niu

t

Motion in an Externally Generated Velocity i ldField

• The update equation would beThe update equation would be

nx

nnn tu 1

• where

x

01

ii ui

01ii

i

x

ux

0iux

OverviewOverview

• Level set methodsLevel set methods–Motion in an externally generated velocity field• ConvectionConvection

• Upwind differencing• Hamilton‐Jacobi ENO/WENO, TVD Runge‐Kutta/ , g

–Motion involves mean curvature• Equations of motion

• Numerical discretization

• Convection‐diffusion equations

4. Motion involves mean curvature4. Motion involves mean curvature

• Equations of motion• Equations of motion

• Numerical discretization

• Convection‐diffusion equations

OverviewOverview

– Hamilton‐Jacobi EquationHamilton Jacobi Equation• Connection with Conservation Laws• Numerical discretization

–Motion in the Normal Direction• The Basic Equation• Numerical discretization

• Adding a Curvature‐Dependent Term• Adding an External Velocity Field

Hamilton‐Jacobi EquationHamilton Jacobi Equation

• Connection with Conservation Laws• Connection with Conservation Laws• Numerical discretization

OverviewOverview

– Hamilton‐Jacobi EquationHamilton Jacobi Equation• Connection with Conservation Laws• Numerical discretization

–Motion in the Normal Direction• The Basic Equation• Numerical discretization

• Adding a Curvature‐Dependent Term• Adding an External Velocity Field

Motion in the Normal DirectionMotion in the Normal Direction

• The Basic EquationThe Basic Equation

• Numerical discretization

ddi C d• Adding a Curvature‐Dependent Term

• Adding an External Velocity Field

Practical Animation of LiquidsPractical Animation of Liquids

• Foster and Fedkiw wanted to create a goodFoster and Fedkiw wanted to create a good animation tool that captured the essence of a good fluid simulator for animators

• Most engineering methods available were based around setting initial and boundary conditions and letting the fluid go with minimal ability for an animator to change anything dynamically  

Practical Animation of LiquidsPractical Animation of Liquids

• Method OutlineSetup1. Model static environment as a voxel grid2. Model the liquid volume as a combination of particles 

and an implicit surfaceRepeat each iterationp1. Update the velocity field2. Apply velocity constraints due to moving objects

f bl3. Enforce incompressiblity4. Update the position of the liquid volume using the 

velocity fieldy

Practical Animation of LiquidsPractical Animation of Liquids

• Model static environment as a voxel grid– The “staggered” grid shares velocity components between adjacent cells at the faces– Each cell is marked as either empty or full

● ● ● ● ●● ● ● ● ●

● ● ● ● ●

● ● ● ● ●

● ● ● ● ●

● ● ● ● ●

Practical Animation of LiquidsPractical Animation of Liquids● ● ● ● ●

● ● ● ● ●• Model the liquid volume as a combination of particles and an implicit surface– Randomly generate particles with 

surfaces represented as implicit surfaces

● ● ● ● ●

● ● ● ● ●

surfaces represented as implicit surfaces.– Generate an initial isocontour of the 

liquid by taking the minimum signed distance for each grid cell and smoothing it out

● ● ● ● ●

● ● ● ● ●

Practical Animation of LiquidsPractical Animation of Liquids

• Hybrid Surface ModelHybrid Surface Model– The Level Set method alone tends to have problems preserving fine feature details like thinproblems preserving fine feature details like thin splashing

– A layer of particles are maintained just inside theA layer of particles are maintained just inside the isocontour surface and are evolved forward in time using Lagrangian methods.

Practical Animation of LiquidsPractical Animation of Liquids

• Hybrid Surface ModelHybrid Surface Model– For each particle the local curvature of φ is tested by

– For areas of low curvature the particle is ignored but for f hi h h i l i ll d dif

k

areas of high curvature the particle is allowed to modify φ

– Particles that escape to the exterior region can be visualized as water droplets or mistvisualized as water droplets or mist

Practical Animation of LiquidsPractical Animation of Liquids

• Update the velocity fieldp y– Performed using Stam’s formulation of Navier‐Stokes– Enough said.

Practical Animation of LiquidsPractical Animation of Liquids

• Apply velocity constraints due to moving objects

1. Any cell within a solid object has i l i i h d h fits velocities changed to that of the moving object

2. Apply the velocity update3 Each cell that intersects the3. Each cell that intersects the 

surface of the object gets its velocity set to be tangent to the surface of the object

4 Cells inside the object have their4. Cells inside the object have their velocities put back to the object veclocity

Practical Animation of LiquidsPractical Animation of Liquids

• Enforce incompressiblityp y– Last step of Navier‐Stokes update

• Update the position of the liquid volume using the velocity field

Apply the level set equation to the liquid field– Apply the level set equation to the liquid field

0 u 0 ut

ResultsResults

Implicit FunctionsImplicit Functions

• A discrete approximation of the implicit function can be achieved via a Cartesian grid.

Outside Ω+

0

3.24 2.61 2.16 2.00 2.16 2.61 3.24

2 61 1 83 1 24 1 00 1 24 1 83 2 61 φ > 02.61 1.83 1.24 1.00 1.24 1.83 2.61

2.16 1.24 0.41 0.00 0.41 1.24 2.16

-1

Inside Ω‐

φ < 0Interface

2.00 1.00 0.00 .00

0.00 1.00 2.00

2.16 1.24 0.41 0.00 0.41 1.24 2.16 0122 yxx2.61 1.83 1.24 1.00 1.24 1.83 2.61

3.24 2.61 2.16 2.00 2.16 2.61 3.24

Implicit FunctionsImplicit Functions

• The finer the resolution of the grid the moreThe finer the resolution of the grid the more numerically accurate the model will be.

Outside Ω+

0φ > 0

Interface Inside Ω‐

φ < 0 0122 yxx

Implicit Vs. ExplicitImplicit Vs. Explicit

• Splitting and MergingSplitting and Merging

The merge of two implicit functions is the union operation– The merge of two implicit functions is the union operation

Implicit Vs. ExplicitImplicit Vs. Explicit

• Expansion and Contraction

– Although there is no need to resample the region there are prescribed limits of expansion and contractions based on initial grid sizelimits of expansion and contractions based on initial grid size.

Implicit FunctionsImplicit Functions

• Important RealizationsImportant Realizations– The Cartesian grid represents the evolving implicit function φ(x)function φ(x).

– It may begin as the reflection of the form of a circle or sphere or any shape but will sooncircle or sphere or any shape but will soon represent something else entirely.

– The only relation to its original form it must y gmaintain is φ(x) = 0 represents the interface.

Implicit FunctionsImplicit Functions

• Important RealizationsImportant Realizations– The interface evolves as elements of the grid become less positive or negativebecome less positive or negative.   

– It is best not to think in terms of the interface itself moving but that the grid cells around it areitself moving but that the grid cells around it are getting values closer to 0.  

Implicit FunctionsImplicit Functions

• ExampleExample– Using an active contour to segment an image

Implicit Functions: Discrete RepresentationsImplicit Functions: Discrete Representations

• Points– Another way to represent φ(x) is to discretize Ωinto grid cells and put the value of φ(x) in each cell.

12 xx

… 8 3 0 -1 0 3 8 …

0 1 2 3‐1‐2‐3

Implicit FunctionsImplicit Functions• Points– Or define φ(x) as a height.  φ( ) g

12 xx

0

0 1 2 3‐1‐2‐3

Implicit Surface & IsosurfaceImplicit Surface & Isosurface

• When c is 0, we say that f implicitly defines a locus, called animplicit surface, .

• The implicit surface is sometimes called the zero set (or zero

})(|{ 3 cfR pp

The implicit surface is sometimes called the zero set (or zerosurface) of f.

h i f ( l ll d l l l l f ) i• The isosurface (also called a level set or level surface) is, , where c is the iso‐value of the surface.}0)(|{ 3 pp fR

Boolean Operations of Implicit Functionsp p

• φ(x) = min (φ (x) φ (x)) is the union of the interior regions of φ (x)• φ(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 intersection 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 subtraction of the interior regions of φ1(x) by the interior regions of φ2(x). 

top related