Implicit GeometryImplicit Geometry
OverviewOverview
• Implicit Geometryp c t Geo et y– Implicit functions
• Points• Curves• Surfaces• Geometry toolboxy• Calculus toolbox
– Signed distance functionsDi f i• Distance functions
• Signed distance functions• Geometry and calculus tool box
IntroductionIntroduction
• Tracking boundaries is an important problemTracking boundaries is an important problem– Image Processing– Machine Vision– Biometrics– Human Computer Interactionp– Entertainment– Computational Physics– Computational Fluid Dynamics
IntroductionIntroduction
• Image ProcessingImage Processing– Video, Image and Volume Segmentation
IntroductionIntroduction
• Machine VisionMachine Vision
• Biometrics
IntroductionIntroduction
• Human Computer InteractionHuman Computer Interaction
• Entertainment
IntroductionIntroduction
• Physical Simulations like WaterPhysical Simulations like Water
IntroductionIntroduction
• The ProblemThe Problem– How is it possible to efficiently and accuratelyrepresent the boundary?represent the boundary?
– How do you track the boundary ahead in time?– How do you track the boundary ahead in time?
Explicit RepresentationExplicit Representation
• Marker/String MethodsMarker/String Methods
• A standard approach to modeling a moving boundary(front/contour/interface) is to discretize it into a set( / / )of marker particles whose positions are known at anytime.
• To reconstruct the front the particles are linked byline segments in 2D and triangles in 3D.
Explicit RepresentationExplicit Representation
• Marker/String MethodMarker/String Method– The idea is to advance the particles in the direction of the arrows recalculate the arrowsdirection of the arrows, recalculate the arrows, advance the particles, and repeat
– More particles should mean greater accuracy– More particles should mean greater accuracy
Explicit RepresentationExplicit Representation
• Marker/String MethodMarker/String Method Issues– The markers may potentially– The markers may potentially cross over one another and require untanglingq g g
– The boundary may split orThe boundary may split or merge
Explicit RepresentationExplicit Representation
• Marker/String MethodMarker/String Method Issues– The front may expand or– The front may expand or contract requiring the addition or removal of markers
Implicit Vs. ExplicitImplicit Vs. Explicit
• Tracking the interface through pointsTracking the interface through points(markers) on its surface is a Lagrangianformulationformulation.
• Capturing an interface through the evolutionof the implicit surface is a Eulerianof the implicit surface is a Eulerianformulation.
Explicit FunctionsExplicit Functions• Points
– Explicitly divide a 1 d region Ω into two sub regions with– Explicitly divide a 1‐d region Ω into two sub‐regions with an interface at x = ‐1 and x = 1
Outside Ω+ Outside Ω+Inside Ω‐
‐2 ‐1 0 1 2
Interface
11
1,1
Explicit Representation
1,1
,11,
Implicit FunctionsImplicit Functions• Points
– Implicitly divide a 1 d region Ω into two sub regions with– Implicitly divide a 1‐d region Ω into two sub‐regions with an interface at x = ‐1 and x = 1
Outside Ω+ Outside Ω+Inside Ω‐
‐2 ‐1 0 1 2Implicit Representation
Interface
0:
12
x
xx
Implicit Representation
Interface 0:
0:
xx
Implicit FunctionsImplicit Functions• Points
– An implicit representation provides a simple,numerical method to determine the interior,exterior and interface of a region Ωexterior and interface of a region Ω.
– In the previous case the interior is always negativeand the exterior is always positiveand the exterior is always positive.
– The set of points where φ(x) = 0 is known as thezero level set or zero isocontour and will alwayszero level set or zero isocontour and will alwaysgive the interface of the region.
Implicit FunctionsImplicit Functions
• in Rn subdomains are n‐dimensional whilein R , subdomains are n dimensional, while the interface has dimension n − 1.
• We say that the interface has codimension• We say that the interface has codimensionone.
Implicit FunctionsImplicit Functions
• Curves– In 2 spatial dimensions a closed curve separates Ω into two sub‐
regions. g
Outside Ω+
0φ > 0
Inside Ω‐
φ < 0φ < 0
Interface
0122 yxx
Implicit FunctionsImplicit Functions
Implicit FunctionsImplicit Functions
• Surfaces– In 3+ spatial dimensions higher dimensional surfaces are used to
represent the zero level set of φ.p φ
Outside Ω+
0
Inside Ω‐
φ < 0
φ > 0
φ < 0
Interface
01222 zyxx
Geometric RepresentationGeometric Representation
• For complicated surfaces in 3D the explicit representation canp p pbe quite difficult to discretize. One needs to choose a numberof points on the two‐dimensional surface and record theirconnectivityconnectivity.
• Connectivity can change for dynamic/deformable surfaces,y g y / ,i.e., surfaces that are moving around.
• One of the nicest properties of implicit surfaces is thatconnectivity does not need to be determined.
Geometric RepresentationsGeometric Representations
• Continuous representationContinuous representation– Explicit representation
Implicit representation– Implicit representation
• Discrete representation– Triangle meshes
– Points/Particles
Triangle MeshTriangle Mesh
Explicit vs Implicit RepresentationExplicit vs Implicit Representation
Explicit:Explicit:• Pros: easier display• Cons: maintain connectivity, difficult to handleCons: maintain connectivity, difficult to handletopology change.
Implicit:• Pros: No connectivity, easier to handle topology
hchange.• Cons: need extra step to display.
Discrete Representations of Implicit FunctionsDiscrete Representations of Implicit Functions
• Complicated 2D curves and 3D surfaces do notComplicated 2D curves and 3D surfaces do notalways have analytical descriptions.
• The implicit function φ need to be stored witha discretization, i.e. in the implicita discretization, i.e. in the implicitrepresentation, we will know the values of theimplicit function φ at only a finite number ofdata points and need to use interpolation tofind the values of φ else where.
Discrete Representations of Implicit FunctionsDiscrete Representations of Implicit Functions
• The location of the interface, the φ(x) = 0 zero iso‐, φ( )contour need to be interpolated from the knownvalues of φ at the data points.h b d l l h• This can be done using contour plotting algorithmssuch as Marching Cubes algorithm.
• The set of data points where the implicit function φ• The set of data points where the implicit function φis defined is called a grid.
• Uniform Cartesian grids are mostly used.g y• Other grids include unstructured, adaptive,curvilinear, etc.
Iso‐contour extractionIso contour extraction
φ(x,y)=0φ(x,y) 0
φ(x,y)>0
φ(x y)<0φ(x,y)<0
Iso‐contour extractionIso contour extraction
φ(x,y)=0φ(x,y) 0
φ(x,y)>0
φ(x y)<0φ(x,y)<0
Iso‐contour extractionIso contour extraction
φ(x,y)=0φ(x,y) 0
φ(x,y)>0
φ(x y)<0φ(x,y)<0
Iso‐contour extractionIso contour extraction
φ(x,y)=0φ(x,y) 0
φ(x,y)>0
φ(x y)<0φ(x,y)<0
Marching SquaresMarching Squares
φ(x,y)=0φ(x,y) 0
φ(x,y)>0
φ(x y)<0φ(x,y)<0
Four unique cases (after considering symmetry)
Marching SquaresMarching Squares
Principle of Occam’s razor:Principle of Occam s razor:
If there are multiple possible explanations of aphenomenon that are consistent with the data,p ,choose the simplest one.
Marching SquaresMarching Squares
Linear interpolationLinear interpolation
f(x,y)=0
f(x y)>0f(x,y)>0
f(x,y)<0 fi, j+1 > 0 fi+1, j+1 > 0
fi, j < 0 fi+1, j > 0
Marching SquaresMarching Squares
fi, j = a < 0 fi+1, j = b > 0fi+x, j=0
Marching SquaresMarching Squares
fi, j = a < 0 fi+1, j = b > 0fi+x, j=0
x / h = (‐a) / (b‐a)
h / ( b)x = ah / (a‐b)
Marching SquaresMarching Squares
Marching SquaresMarching Squares
Marching Squares‐ambiguityMarching Squares ambiguity
More information are needed to resolve ambiguity
Iso‐contour extractionIso contour extraction
φ(x,y)=0φ(x,y) 0
φ(x,y)>0
φ(x y)<0φ(x,y)<0
Marching Cubes AlgorithmMarching Cubes Algorithm
Lorensen & Cline: Marching Cubes: A high resolution 3D surface construction algorithm. In SIGGRAPH 1987.
Geometry ToolboxGeometry Toolbox
• Inside/outsideInside/outside
• Boolean operation/CSG
h di f h i li i f i• The gradient of the implicit function
• The normal of the implicit function
• Mean curvature of the implicit function
• Numerical approximationsNumerical approximations
Inside/outside functionInside/outside function
Determine whether a point is inside/outside theDetermine whether a point is inside/outside the interface
• Easier for Implicit function just look at the• Easier for Implicit function, just look at the sign of
0I id:
x
0::Outside0::Inside
x
x
• Difficult for explicit representation:
0::Boundary x
Difficult for explicit representation:
Inside/outside functionInside/outside function
Difficult for explicit representation:cu t o e p c t ep ese tat o :• A standard procedure is to cast a ray from thepoint in question to some far‐off place that isp q pknown to be outside the interface.
• Then if the ray intersects the interface an evennumber of times, the point is outside theinterface.Oth i th i t t th i t f dd• Otherwise, the ray intersects the interface an oddnumber of times, and the point is inside theinterfaceinterface.
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).
Constructive Solid Geometry (CSG)y ( )
Gradient/Normal of Implicit FunctionGradient/Normal of Implicit Function
Mean Curvature of the InterfaceMean Curvature of the Interface
Calculus ToolboxCalculus Toolbox
• Characteristic functionCharacteristic function
• Heaviside function
l f i• Delta function
• Volume integral
• Surface integral
• Numerical approximationNumerical approximation
Signed Distance FunctionsSigned Distance Functions
• Signed distance functions are a subset of implicitSigned distance functions are a subset of implicit function defined to be positive on the exterior, negative on the interior with |1)(| x
Distance FunctionsDistance Functions
• A distance function is defined as:A distance function is defined as:
I
xwherexxxd
min
• so:
Ixwhere
• so:
xxwherexxxd cc toboundary on thepoint closest theis |,|
xwherexd ,0
Distance functionDistance function
Signed Distance FunctionsSigned Distance Functions
• A signed distance function adds the appropriateA signed distance function adds the appropriate signing of the interior vs. exterior.
xxd )(
xxd
xxdx
)(0)(
)()(
• Signed distance function share all the properties of implicit function with new properties such as:
xxd )(
p p p
• Given a point , the closest point on the interface|1)(| x
x x Given a point , the closest point on the interface is
x cx xxc
Nx)(
Signed Distance FunctionsSigned Distance Functions
• 1D Example:1D Example:– Implicit function– Signed distance function
12 xx 1|| xxg
• 2D Example:– Implicit function
||
1, 22 yxyxImplicit function– Signed distance function
• 3D Example:
, yy 1, 22 yxyx
3D Example:– Implicit function– Signed distance function
1,, 222 zyxzyx 1222 zyxzyxSigned distance function 1,, zyxzyx
Signed Distance FunctionsSigned Distance Functions
Boolean Operations of Signed Distance Functionsp g
• φ(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).
Geometry and Calculus Toolboxes of h dthe Signed Distance Functions
Since |1)(| xSince
• The Delta function is:|1)(| x
))(()( • The Surface integral is:
))(()( xx
)())(()( xdxxf
Geometry and Calculus Toolboxes of h dthe Signed Distance Functions
Since |1)(| xSince
• The normal of the signed distance function is:|1)(| x
N
• Mean curvature of the the signed distance N
function is:k
Where is the Laplacian of
zzyyxx
Signed Distance FunctionsSigned Distance Functions
• In two spatial dimensions the signed distance gfunction for a circle with a radius r and a center (x0, ( 0,y0) is given as:
ryyxxx 20
20
OverviewOverview
• Implicit GeometryImplicit Geometry
• Level Set Methods
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
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.