fast surface reconstruction using the level set methodmisha/fall13b/papers/zhao01.pdf · fast...

8
Fast Surface Reconstruction Using the Level Set Method Hong-Kai Zhao Stanley Osher Ronald Fedkiw Abstract In this paper we describe new formulations and develop fast algo- rithms for implicit surface reconstruction based on variational and partial differential equation (PDE) methods. In particular we use the level set method and fast sweeping and tagging methods to re- construct surfaces from scattered data set. The data set might con- sist of points, curves and/or surface patches. A weighted minimal surface-like model is constructed and its variational level set formu- lation is implemented with optimal efficiency. The reconstructed surface is smoother than piecewise linear and has a natural scaling in the regularization that allows varying flexibility according to the local sampling density. As is usual with the level set method we can handle complicated topology and deformations, as well as noisy or highly non-uniform data sets easily. The method is based on a sim- ple rectangular grid, although adaptive and triangular grids are also possible. Some consequences, such as hole filling capability, are demonstrated, as well as the viability and convergence of our new fast tagging algorithm. Keywords: implicit surface, partial differential equations, vari- ational formulation, convection, minimal surface. 1 Introduction Surface reconstruction from unorganized data set is very challeng- ing in three and higher dimensions. The problem is ill-posed, i.e, there is no unique solution. Furthermore the ordering or connec- tivity of data set and the topology of the real surface can be very complicated in three and higher dimensions. A desirable recon- struction procedure should be able to deal with complicated topol- ogy and geometry as well as noise and non-uniformity of the data to construct a surface that is a good approximation of the data set and has some smoothness (regularity). Moreover, the reconstructed surface should have a representation and data structure that is not only good for static rendering but also good for deformation, anima- tion and other dynamic operation on surfaces. None of the present approaches possess all of these properties. In general there are two kinds of surface representations, explicit or implicit. Explicit surfaces prescribe the precise location of a surface while implicit surfaces represent a surface as a particular isocontour of a scalar function. Popular explicit representations include parametric sur- faces and triangulated surfaces. For examples, for parametric sur- faces such as NURBS [26, 27], the reconstructed surface is smooth and the data set can be non-uniform. However this requires one to parametrize the data set in a nice way such that the reconstructed surface is a graph in the parameter space. The parametrization and patching can be very difficult for surface reconstruction from an Department of Mathematics, University of California, Irvine, CA 92697-3875, Research supported by NSF DMS 9706566. [email protected] Department of Mathematics, University of California, Los Angeles, CA 90095-1555, Research supported by ONR N00014-97-1-0027 and NSF DMS 9706827. [email protected] Stanford University, Gates Computer Science Bldg., Stanford, CA 94305-9020, Research supported by ONR N00014-97-1-0027. [email protected] arbitrary data set in three and higher dimensions. Also noise in the data set is difficult to deal with. Another popular approach in computer graphics is to reconstruct a triangulated surfaces using Delaunay triangulations and Voronoi diagrams. The reconstructed surface is typically a subset of the faces of the Delaunay triangula- tions. A lot of work has been done along these lines [3, 4, 7, 16, 17] and efficient algorithms are available to compute Delaunay trian- gulations and Voronoi diagrams. Although this approach is more versatile in that it can deal with more general data sets, the con- structed surface is only piecewise linear and it is difficult to handle non-uniform and noisy data. Furthermore the tracking of large de- formations and topological changes is usually quite difficult using explicit surfaces. Recently, implicit surfaces or volumetric representations have at- tracted a lot of attention. The traditional approach [6, 20, 30] uses a combination of smooth basis functions (primitives), such as blobs, to find a scalar function such that all data points are close to an iso- contour of that scalar function. This isocontour represents the con- structed implicit surface. However computation costs are very high for large data sets, since the construction is global which results in solving a large linear system, i.e. the basis functions are cou- pled together and a single data point change can result in globally different coefficients. This makes human interaction, incremental updates and deformation difficult. The second approach uses the data set to define a signed distance function on rectangular grids and denotes the zero isocontour of the signed distance function as the reconstructed implicit surface [5, 8, 19]. The construction of the signed distance function uses a discrete approach and needs an estimation of local tangent planes or normals for the orientation, i.e. a distinction needs to be made between inside and outside. Simi- lar ideas have been applied to shape reconstruction from range data and image fusion [13, 18] where partial connections are available on each piece of data. Special “fusion” or “tiling” algorithm is need on overlapping patches. In [28] an interesting volume spline is used for reconstruction of implicit surfaces. But the construction depends on the choice of a “carrier” solid and can deal with data sets of moder- ate size. The main advantages of implicit surfaces include topolog- ical flexibility, a simple data structure, depth/volumetric informa- tion and memory storage efficiency. Using the signed distance rep- resentation, many surface operations such as Boolean operations, ray tracing and offset become quite simple [24, 31]. Efficient al- gorithms, see e.g. [21, 32], are available to turn an implicit surface into a triangulated surface. In [15] implicit surfaces are used for an- imation and the level set method is used for surface reconstruction from range data in [10]. In fact the level set method [23] provides a general framework for the deformation of implicit surfaces accord- ing to arbitrary physical and/or geometric rules. We approach the fundamental problem of surface reconstruction on the continuous level by constructing continuous models using differential geometry and partial differential equations. We also de- velop efficient and robust numerical algorithms for our continuous formulations. Moreover we combine the level set method and im- plicit surfaces to provide a general framework for surface modeling, analysis, deformation and many other applications. In our previous work [34] we proposed a new “weighted” minimal surface model based on variational formulations and PDE methods. Only the un- signed distance function to the data set was used in our formulation. Our reconstructed surface is smoother than piecewise linear. In ad-

Upload: others

Post on 18-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fast Surface Reconstruction Using the Level Set Methodmisha/Fall13b/Papers/Zhao01.pdf · Fast Surface Reconstruction Using the Level Set Method Hong-KaiZhao Stanley Osher Ronald Fedkiw

Fast Surface Reconstruction Using the Level Set Method

Hong-KaiZhao�

Stanley Osher�

RonaldFedkiw�

Abstract

In this paperwe describenew formulationsanddevelop fastalgo-rithmsfor implicit surfacereconstructionbasedon variationalandpartial differentialequation(PDE) methods.In particularwe usethe level setmethodandfastsweepingandtaggingmethodsto re-constructsurfacesfrom scattereddataset.Thedatasetmight con-sistof points,curvesand/orsurfacepatches.A weightedminimalsurface-likemodelis constructedandits variationallevel setformu-lation is implementedwith optimal efficiency. The reconstructedsurfaceis smootherthanpiecewiselinearandhasa naturalscalingin theregularizationthatallowsvaryingflexibility accordingto thelocalsamplingdensity. As is usualwith thelevel setmethodwecanhandlecomplicatedtopologyanddeformations,aswell asnoisyorhighly non-uniformdatasetseasily. Themethodis basedonasim-plerectangulargrid, althoughadaptive andtriangulargridsarealsopossible. Someconsequences,suchashole filling capability, aredemonstrated,aswell astheviability andconvergenceof our newfasttaggingalgorithm.

Keywords: implicit surface,partialdifferentialequations,vari-ationalformulation,convection,minimalsurface.

1 Intr oduction

Surfacereconstructionfrom unorganizeddatasetis very challeng-ing in threeandhigherdimensions.The problemis ill-posed,i.e,thereis no uniquesolution. Furthermorethe orderingor connec-tivity of datasetandthe topologyof the real surfacecanbe verycomplicatedin threeand higher dimensions. A desirablerecon-structionprocedureshouldbeableto dealwith complicatedtopol-ogy andgeometryaswell asnoiseandnon-uniformityof thedatato constructa surfacethat is a goodapproximationof the datasetandhassomesmoothness(regularity). Moreover, thereconstructedsurfaceshouldhave a representationanddatastructurethat is notonlygoodfor staticrenderingbut alsogoodfor deformation,anima-tion andotherdynamicoperationon surfaces.Noneof thepresentapproachespossessall of theseproperties. In generaltherearetwo kinds of surfacerepresentations,explicit or implicit. Explicitsurfacesprescribethe preciselocationof a surfacewhile implicitsurfacesrepresenta surfaceasa particularisocontourof a scalarfunction. Popularexplicit representationsincludeparametricsur-facesandtriangulatedsurfaces.For examples,for parametricsur-facessuchasNURBS[26, 27], thereconstructedsurfaceis smoothandthedatasetcanbenon-uniform.However this requiresonetoparametrizethe datasetin a nice way suchthat the reconstructedsurfaceis a graphin theparameterspace.Theparametrizationandpatchingcan be very difficult for surfacereconstructionfrom an�

Department of Mathematics, University of California, Irvine,CA 92697-3875, Research supported by NSF DMS [email protected]

Departmentof Mathematics,University of California, Los Angeles,CA 90095-1555,Researchsupportedby ONRN00014-97-1-0027andNSFDMS [email protected]

Stanford University, Gates Computer Science Bldg., Stanford,CA 94305-9020, Research supported by ONR [email protected]

arbitrary dataset in threeand higher dimensions. Also noiseinthe datasetis difficult to dealwith. Anotherpopularapproachincomputergraphicsis to reconstructa triangulatedsurfacesusingDelaunaytriangulationsandVoronoidiagrams.Thereconstructedsurfaceis typically a subsetof thefacesof theDelaunaytriangula-tions.A lot of work hasbeendonealongtheselines[3, 4, 7,16, 17]andefficient algorithmsareavailableto computeDelaunaytrian-gulationsandVoronoi diagrams.Although this approachis moreversatilein that it candealwith moregeneraldatasets,the con-structedsurfaceis only piecewiselinearandit is difficult to handlenon-uniformandnoisydata.Furthermorethetrackingof largede-formationsandtopologicalchangesis usuallyquitedifficult usingexplicit surfaces.

Recently, implicit surfacesorvolumetricrepresentationshaveat-tractedalot of attention.Thetraditionalapproach[6, 20, 30] usesacombinationof smoothbasisfunctions(primitives),suchasblobs,to find ascalarfunctionsuchthatall datapointsarecloseto aniso-contourof thatscalarfunction.This isocontourrepresentsthecon-structedimplicit surface.Howevercomputationcostsareveryhighfor large datasets,sincethe constructionis global which resultsin solving a large linear system,i.e. the basisfunctionsarecou-pled togetheranda singledatapoint changecanresultin globallydifferentcoefficients. This makeshumaninteraction,incrementalupdatesanddeformationdifficult. The secondapproachusesthedataset to definea signeddistancefunction on rectangulargridsanddenotesthezeroisocontourof thesigneddistancefunctionasthe reconstructedimplicit surface[5, 8, 19]. The constructionofthesigneddistancefunctionusesa discreteapproachandneedsanestimationof localtangentplanesor normalsfor theorientation,i.e.a distinctionneedsto be madebetweeninsideandoutside. Simi-lar ideashavebeenappliedto shapereconstructionfrom rangedataandimagefusion[13,18] wherepartialconnectionsareavailableoneachpieceof data.Special“fusion” or “tiling” algorithmis needonoverlappingpatches.In [28] aninterestingvolumesplineis usedforreconstructionof implicit surfaces.But theconstructiondependsonthechoiceof a “carrier” solidandcandealwith datasetsof moder-atesize.Themainadvantagesof implicit surfacesincludetopolog-ical flexibility, a simpledatastructure,depth/volumetric informa-tion andmemorystorageefficiency. Usingthesigneddistancerep-resentation,many surfaceoperationssuchasBooleanoperations,ray tracingandoffset becomequite simple[24, 31]. Efficient al-gorithms,seee.g. [21, 32], areavailableto turn animplicit surfaceinto atriangulatedsurface.In [15] implicit surfacesareusedfor an-imationandthelevel setmethodis usedfor surfacereconstructionfrom rangedatain [10]. In factthelevel setmethod[23] providesageneralframework for thedeformationof implicit surfacesaccord-ing to arbitraryphysicaland/orgeometricrules.

Weapproachthefundamentalproblemof surfacereconstructionon the continuouslevel by constructingcontinuousmodelsusingdifferentialgeometryandpartialdifferentialequations.Wealsode-velopefficient androbustnumericalalgorithmsfor our continuousformulations.Moreover we combinethe level setmethodandim-plicit surfacesto provideageneralframework for surfacemodeling,analysis,deformationandmany otherapplications.In our previouswork [34] we proposeda new “weighted” minimal surfacemodelbasedon variationalformulationsandPDEmethods.Only theun-signeddistancefunctionto thedatasetwasusedin ourformulation.Our reconstructedsurfaceis smootherthanpiecewiselinear. In ad-

Page 2: Fast Surface Reconstruction Using the Level Set Methodmisha/Fall13b/Papers/Zhao01.pdf · Fast Surface Reconstruction Using the Level Set Method Hong-KaiZhao Stanley Osher Ronald Fedkiw

dition, in our formulationthereis a regularizationthat is adaptiveto the� local samplingdensitywhichcankeepsharpfeaturesif a lo-cal samplingconditionis satisfied.Theformulationhandlesnoisyaswell asnon-uniformdataandworks in any numberof dimen-sions. We usethe level setmethodasthe numericaltechniquetodeformtheimplicit surfacecontinuouslyfollowing thegradientde-scentof theenergy functionalfor thefinal reconstruction.Insteadoftrackinga parametrizedexplicit surfacewe solve a PDEon a sim-ple rectangulargrid andhandletopologicalchangeseasily. In thispaperwe developa simplephysicallymotivatedconvectionmodelanda fasttaggingalgorithmto constructa goodinitial approxima-tion for our minimalsurfacereconstruction.Thiswill speedup ourpreviousreconstructionby anorderof magnitude.

In thenext sectionwe briefly review thevariationalformulationfor the weightedminimal surfacemodel in introducedin [34]. Aphysicallymotivatedsimpleconvectionmodelis developedin sec-tion 3. In section4 we introducethelevel setmethodfor our prob-lems.Weexplain thedetailsof thenumericalalgorithmsin section5 andshow resultsin section6.

2 A Weighted Minimal Surface Model

Let � denotea generaldata set which can include data points,curvesor piecesof surfaces.Define ���� ������������������ to be thedistancefunction to � . (We shall usebold facedcharactersto de-notevectors.) In [34] the following surfaceenergy is definedforthevariationalformulation:� ��� �� �! � �#"$��� %�&��')(*,+.-0/213/.4 � (1)

where � is an arbitrary surfaceand �&� is the surfacearea. Theenergy functionalis independentof parametrizationandis invariantunderrotationandtranslation.When

1 � 4 ,� ��� is thevalueof

the distanceof the point � on � furthestfrom � . For16574

,Thesurfaceenergy

� ��8 is equivalentto 9 � � " ��� %�&� , thesurfaceareaweightedby somepowerof thedistancefunction.Wetake thelocalminimizerof ourenergy functional,whichmimicsaweightedminimal surfaceor anelasticmembraneattachedto thedataset,tobethereconstructedsurface.

As derivedin [34] thegradientflow of theenergy functional(1)is �:��;� �2< � � � " ��= %�&��'>(*@?BA � " ?BA ��8 �DC ���= FEHG,I

-1 ���� �J$'G��(2)

andtheminimizeror steadystatesolutionof thegradientflow sat-isfiestheEuler-Lagrangeequation

� " ?KA ��= ��C ���� LE�GMI -1 ���= �J$'N�PO&� (3)

where G is the unit outward normaland J is the meancurvature.We seea balancebetweenthe attraction

C ���= �E:G and the sur-facetension���= �J in theequationsabove. Moreover thenonlinearregularizationdueto surfacetensionhasa desirablescaling ���= .Thusthereconstructedsurfaceis moreflexible in theregionwheresamplingdensityis high andis morerigid in theregion wherethesamplingdensityis low. In thesteadystateequation(3)above,sinceC �,EQG /R- , we have a local samplingdensityconditionsimilar tothe oneproposedin [3], which sayssamplingdensitiesshouldre-solve fine featureslocally. To constructthe minimal surfaceweuseda continuousdeformationin [34]. Westartwith aninitial sur-facethat enclosesall dataand follow the gradientflow (2). Theparameter

1affectstheflexibility of themembraneto someextent.

When1 � - , thesurfaceenergy definedin (1) hasthedimensionof

volumeandthegradientflow (2) is scaleinvarianti.e., dimension-less.In practicewe find that

1 � - or S (similar to a leastsquaresformulation)aregoodchoices.Somemoredetailscanbefoundin[34].

In two dimensions,it wasshown in [34] that a polygonwhichconnectsadjacentpointsby straightlinesis a localminimum.Thisresultshows a connectionbetweenthevariationalformulationandpreviousapproaches.On theotherhandthis resultis notsurprisingsinceaminimalsurfacepassingthroughtwo pointsis astraightlinein two dimensions.However in threedimensionsthesituationbe-comesmuchmoreinteresting.Thereconstructedminimal surfacehasnoedgesandis smootherthanapolyhedron.

Remark: Theformulationhereis similarto activecontourmod-els for imagesegmentationin [12, 11] andminimal surfacemodelin [33]. However theapplication,motivationandworking mecha-nismarequitedifferent.In imagesegmentation,thefinal curvesorsurfacesarewrappedalongsomeedges,i.e.,somecontinuoushighcontrastcontourson the grid and the contrastis alreadydefinedon every grid point. In our application,we have arbitrarydiscretepointsandnoneof the distancecontoursto the datapoints is thefinal surface.

3 The Convection Model

Theevolution equation(2) involvesthemeancurvatureof thesur-faceandis a nonlinearparabolicequation.A time implicit schemeis not currentlyavailable.A stabletime explicit schemerequiresarestrictive time stepsize, TU�V�XWY�Z[Q , where Z is thespatialgridcell size.Thusit is very desirableto have anefficient algorithmtofind a goodapproximationbeforewe startthegradientflow for theminimal surface. We proposethe following physicallymotivatedconvectionmodelfor thispurpose.

Theconvectionof aflexible surface� in avelocityfield \���= isdescribedby thedifferentialequation�:�V]�^ �;� �_\8��V]�^ ` +If the velocity field is createdby a potentialfield a , then \b�< C a . In our convectionmodelthe potentialfield is the distancefunction ���� to thedataset � . This leadsto theconvectionequa-tion �:�>]�` �;� �X< C ���� + (4)

For example,if thedatasetcontainsasinglepoint ��c , thepotentialfield is ���� ���d ��<V� c d andthevelocityfield is \���8 ��R< C ���� ��< � ? �=ef � ? �=e f , a unit vectorpointing towards ��c . Any particlein thispotentialfield will beattractedtoward � c alongastraightline withunit speed.For a generaldataset � , a particlewill beattractedtoits closestpoint in � unlesstheparticleis locatedanequaldistancefrom two or moredatapoints.Thesetof equaldistancepointshasmeasurezero.Similarly, pointsonacurveorasurface,exceptthoseequaldistancepoints,areattractedby theirclosestpointsin thedataset(seeFig. 1(a)). Theambiguityat thoseequaldistancepointsisresolved by addinga small surfacetensionforce which automati-cally existsasnumericalviscosityin our finite differenceschemes.Thoseequaldistancepointson thecurve or surfacearedraggedbytheir neighborsandthe whole curve or surfaceis attractedto thedatasetuntil it reachesa local equilibrium,which is a polygonorpolyhedronwhoseverticesbelongto the datasetas the viscositytendsto zero(seeFig.1(b)).

Herearesomepropertiesof this simpleconvectionmodel: (1)thenormalvelocityof thecurve or thesurfaceis lessthanor equalto 1, (2) eachpointof thecurveor surfaceis attractedby its closestpoint in thedataset.

Page 3: Fast Surface Reconstruction Using the Level Set Methodmisha/Fall13b/Papers/Zhao01.pdf · Fast Surface Reconstruction Using the Level Set Method Hong-KaiZhao Stanley Osher Ronald Fedkiw

xx

x x

x

x

1

2 3

4

5

6

(a) (b)

(a) theattractionof apieceof curve by two points,(b) dottedlineis theinitial curve,solid line is thefinal curve,dashedline is the

Voronoidiagram.

Figure1:

Figure 1(b) is an illustration of the convection of a curve.The initial curve (the dotted rectangle)feels the attraction of� A �^� [ �^�Lg#�^��h andclosesin. Then it begins to feel �8i . The fi-nal shapeis a pentagonthat goesthrough � A �^� [ �^� g �^� h and � iwhile �Lj is screenedout.

Since the convection equationis a first order linear differen-tial equation,we can solve it using a time step T,�k�lWY�Z leadingto significantcomputationalsavingsover typical parabolicT,�m�nWY�Z [ time steprestrictions.The convectionmodelby it-self very oftenresultsin a goodsurfacereconstruction.In section5 we will constructa very fasttaggingalgorithmthatfindsa crudeapproximationof thelocal equilibriumsolutionfor our convectionmodel.

4 The Level Set Form ulation

In generalwe do not have any a priori knowledgeaboutthetopol-ogyof theshapeto bereconstructed.Topologicalchangesmayoc-curduringthecontinuousdeformationprocess.Thismakesexplicittracking,which requiresconsistentparametrization,almostimpos-sibleto implement.Hereweusethelevel setmethodasapowerfulnumericaltechniquefor the deformationof implicit surfaces.Al-thoughimplicit surfaceshave beenusedin computergraphicsforquitea while, they weremostlyusedfor staticmodelingandwerebasedon discreteformulations[6]. The level set method is basedon a continuousformulationusingPDEsandallows oneto deformanimplicit surface,which is usuallythezeroisocontourof ascalar(level set) function, accordingto variouslaws of motion depend-ing ongeometry, externalforces,or adesiredenergy minimization.In numericalcomputations,insteadof explicitly trackinga mov-ing surfacewe implicitly captureit by solvinga PDEfor the levelset function on rectangulargrids. The datastructureis extremelysimpleandtopologicalchangesarehandledeasily. The level setformulationworks in any numberof dimensionsandthecomputa-tion caneasilyberestrictedto anarrow bandnearthezerolevel set,seee.g. [1, 25]. We canlocateor renderthemoving surfaceeasilyby interpolatingthe zeroisosurfaceof the level setfunction. Thelevel setmethodwasoriginally introducedby OsherandSethianin[23] to capturemoving interfacesandhasbeenusedquitesuccess-fully in moving interfaceandfreeboundaryproblemsaswell asinimageprocessing,imagesegmentationandelsewhere.See[22] foracomprehensive review.

Two key stepsfor the level setmethodare: (1) Embedthe sur-face: we representa surface � asthe zero isocontourof a scalar(level set)function oL��� , i.e. �X�npF�XqLoL��� U�rO�s . Geometric

propertiesof the surface � canbe easily computedusing o . (2)Embedthemotion: we derive thetime evolution PDEfor thelevelsetfunctionsuchthatthezerolevel sethasthesamemotionlaw asthemoving surface,i.e., �>]�^ L�tpu�vq�oL������` ��wO;s ,�:o���V]�^ x���^ �;� �Pozy@I �:�>]�` �;� E C oN�wO:� (5)

wherewe replace { ��| yD}{ y with the velocity of � on �~��pF��qoL������^ ��PO�s .For geometricmotions,i.e. wherethemotionlaw (velocity) de-

pendsonly onthegeometryof themoving surface,themostnaturalway to define \ is to apply the samemotion law for all level setsof thelevel setfunction,whichwill resultin a morphologicalPDE[2]. For example,thegradientflow (2) is a geometricmotionandweuse

1 � - for simplicity. After weextendthegeometricmotionto all level sets,thegradientflow in level setformulationbecomes� o� � ��d C o�d C E � �

C od C o�d '���d C o�d �!C �UEC od C o�d I�� C E

C od C o�d ',�(6)

For theconvectionmodel(4), sincethevelocityfield < C ���� isdefinedeverywhere,we cannaturallyextendthe convectionto alllevel setsof o�������` to obtain� o� � � C ���� �E C o + (7)

Although all level set functionsareequallygoodtheoretically,in practicethe signeddistancefunction is preferredto avoid stiff-nessandinaccuracy in numericalcomputations.However even ifwe startwith a signeddistancefunction the level setfunctionwillgenerallynot remainasigneddistancefunction.As anexample,inthe convectionmodelall level setsareattractedto the datasetsi-multaneouslyandthey becomemoreandmorepackedtogether. Weneeda procedureto force themapartwhile keepingthezerolevelsetintact.Weuseanumericalprocedurecalledreinitialization,seee.g. [25, 29], to redistancethe level set function locally withoutinterferingwith the motion of the zero level set. As a result theimplicit surfaceis a signeddistancefunctionafter thedeformationprocedurestops.

5 Numerical Implementation

Thereare threekey numericalingredientsin our implicit surfacereconstruction.First,we needa fastalgorithmto computethedis-tancefunctionto anarbitrarydataseton rectangulargrids.Second,we needto find a goodinitial surfacefor our gradientflow. Third,wehave to solve timedependentPDEsfor thelevel setfunction.

5.1 Computing the distance function

The distancefunction ���= to an arbitrary dataset � solves thefollowing Eikonalequation:d C ���8 �d�� - � ���� ��wO:�����N� + (8)

From the PDE point of view, the characteristicsof this Eikonalequationare straightlines which radiatefrom the dataset. Thisrevealsthecausalitypropertyfor thesolutionof thePDE,i.e., theinformationpropagatesalongstraightlines from the dataset,andthesolutionat agrid point shouldbedeterminedonly by its neigh-boring grid points that have smallerdistancevalues. We useanalgorithm[9, 34] that combinesupwind differencingwith Gauss-Seideliterationsof differentsweepingorderto solve (8) on rectan-gulargrids.

Page 4: Fast Surface Reconstruction Using the Level Set Methodmisha/Fall13b/Papers/Zhao01.pdf · Fast Surface Reconstruction Using the Level Set Method Hong-KaiZhao Stanley Osher Ronald Fedkiw

From numericalexperimentsit seemsthat the total numberofiterations� is independentof meshsize,i.e. thecomplexity is WY!�RI� for

�grid pointsand � datapoints.Thedifferencesbetween

our algorithm and Danielsson’s distancemappingalgorithm [14]are(1) ourdatapointsarenotgrid pointsandthatis why wehaveacomplexity WY!�~I � , (2) our algorithmcanbeappliedto moregeneralequationswhere���8 is not a distance,e.g.,theright handsideof 8 canbe an arbitraryfunction in � . Our fastalgorithmisversatile,efficient and will be usedin later stagesof the surfacereconstruction.

5.2 Finding a good initial guess

Wecanuseanarbitraryinitial surfacethatcontainsthedatasetsuchasarectangularboundingbox,sincewedonothave to assumeanya priori knowledgefor the topologyof the reconstructedsurface.However, agoodinitial surfaceis importantfor theefficiency of ourPDEbasedmethod.Onarectangulargrid, weview animplicit sur-faceasaninterfacewith someregularity thatseparatestheexteriorgrid pointsfrom theinteriorgrid points.In otherwords,volumetricrenderingrequiresidentifyingall exterior (interior)grid pointscor-rectly. Basedon this idea,we proposea novel, extremelyefficienttaggingalgorithmthattriesto identify asmany correctexteriorgridpointsaspossibleandhenceprovideagoodinitial implicit surface.As always,we startfrom any initial exterior region thatis a subsetof thetrueexterior region.

All grid points that are not in the initial exterior region arelabeledas interior points. Thoseinterior grid points that haveat leastoneexterior neighborare labeledas temporaryboundarypoints. Now we usethe following procedureto marchthe tem-poraryboundaryinward toward the dataset. We put all the tem-poraryboundarypoints in a heapsortbinary treestructuresortingaccordingto distancevalues. Take the temporaryboundarypointthat hasthe largestdistance(which is on the heaptop) andcheckto seeif it hasan interior neighborthat hasa larger or equaldis-tancevalue. If it doesnot have suchaninterior neighbor, turn thistemporaryboundarypoint into anexteriorpoint, take thispointoutof theheap,addall thispoint’s interiorneighborsinto theheapandre-sortaccordingto distancevalues. If it doeshave suchan inte-rior neighbor, we turn this temporaryboundarypoint into a finalboundarypoint, take it out of theheapandre-sorttheheap.Noneof its neighborsareaddedto the heap. We repeatthis procedureon thetemporaryboundarypointsuntil the themaximumdistanceof the temporaryboundarypoints is smallerthansometolerance,e.g. thesizeof a grid cell, which meansall the temporarybound-ary pointsin theheaparecloseenoughto thedataset.Finally, weturn thesetemporaryboundarypointsinto thefinal setof boundarypointsandourtaggingprocedureis finished.Now wehave thefinalsetsof interior, exterior andboundarypoints. Sincewe visit eachinterior grid point at mostonce,the procedurewill be completedin no morethan WY ���H�#��� operations,where

�H�#���comesfrom

theheapsortalgorithm.Moreover, sincethemaximumdistanceforthe boundaryheapis strictly decreasing,we canprove that thoseinteriorpointswhichhaveadistancenosmallerthanthemaximumdistanceof thetemporaryboundaryheapatany timewill remainasinterior points, i.e. thereis a non-emptyinterior region whenthetaggingalgorithmis finished. We canalsoshow that at leastoneof thefinal boundarypointsis within the tolerancedistanceto thedataset. Similar taggingalgorithmscanalsobeappliedto findinginterior regionsanddisconnectedcomponentsof thefinal shape.

Figure2 illustrateshow our fasttaggingalgorithmworks.Start-ing from anarbitraryexteriorregionthatis asubsetof thefinalexte-rior region, thefurthestpointon thetemporaryboundaryis tangentto adistancecontouranddoesnothaveaninteriorpoint thatis far-theraway. Thefurthestpointwill betaggedasanexteriorpointandtheboundarywill move inwardat thatpoint. Now anotherpointon

the temporaryboundarybecomesthe furthestpoint andhencethewholetemporaryboundarymovesinward.After awhile thetempo-rary boundaryis closeto a distancecontourandmovescloserandcloserto thedatasetfollowing thedistancecontoursuntil thedis-tancecontoursbegin to breakinto spheres(circlesin the2D figure)arounddatapoints.We now seethatthetemporaryboundarypointat thebreakingpoint of thedistancecontour, which is equallydis-tantfrom distinctdatapoints,will have neighboringinteriorpointsthathave a largerdistance.Sothis temporaryboundarypoint willbetaggedasafinalboundarypointby ourprocedureandthetempo-rary boundarywill stopmoving inwardat this breakingpoint. Thetemporaryboundarystartsdeviatingfrom thedistancecontoursandcontinuesmoving closerto thedatasetuntil all temporarybound-ary pointseitherhave beentaggedasfinal boundarypointsor arecloseto the datapoints. The final boundaryis approximatelya apolyhedron(polygonin 2D) with verticesbelongingto thedataset.

This generaltaggingalgorithmcanincorporatehumaninterac-tion easilyby puttingany new exteriorpoint(s)or region(s)into ourtaggedexterior region at any stagein our taggingalgorithm.Afterthetaggingalgorithmis finishedwe againusethefastdistanceal-gorithmto computeasigneddistanceto thetaggedfinal boundary.

Themarchingmethod(outlinedabove) requiresan initial guessfor theexterior region. This caneitherbetheboundingbox of ourcomputationalrectangulardomainor an outercontourof the dis-tancefunction, ���� ��P� . An outercontourof thedistancefunctioncanbefoundby startingwith theouterboundaryof our rectangularbox,andexpandingtheexterior regionby repeatedlytaggingthosegrid pointswhich areneighborsof the expandingexterior bound-ary and have a distancelarger than � as exterior points. All re-maininguntaggedgrid pointsareinteriorpoints.Whenthetaggingalgorithmis finishedtheboundaryof theexterior region is approx-imately the outercontourof ���� ��7� or roughly an � offset ofthe real shape.Whenusingthis ���� U��� method,first proposedin [34], oneneedsto exercisecautionin choosing� . For example,if � is too small, we will have isolatedspheressurroundingdatapoints.If thesamplingdensityof thedatapointsdoesnot vary toomuchandis fineenoughto resolveall features,thenwecanfind anappropriate� andgeta very goodinitial surfacewith WY � IP�t operations.Fornon-uniformdatapointstheintersectionof abound-ing box anda distancecontourwith moderate� , which is a simpleBooleanoperation,oftengivesagoodinitial surface.

marching boundary

distance contour

data point

Figure2:

5.3 Solving the par tial diff erential equation.

After wefind thedistancefunction ���� andagoodinitial implicitsurfaceusing the above algorithms,we can start the continuous

Page 5: Fast Surface Reconstruction Using the Level Set Methodmisha/Fall13b/Papers/Zhao01.pdf · Fast Surface Reconstruction Using the Level Set Method Hong-KaiZhao Stanley Osher Ronald Fedkiw

deformationfollowing either the gradientflow (2) or the convec-tion (4)� using the correspondinglevel set formulation (6) or (7).Our numericalimplementationsarebasedon standardalgorithmsfor the level set method. Details can be found in, for example,[25, 33, 34]. Theconvectionmodelis simplebut thereconstructedsurfaceis closeto a piecewise linear approximation. In contrast,the energy minimizing gradientflow, which containsa weightedcurvatureregularizationeffect, is morecomputationallyexpensivebut reconstructsa smoothweightedminimal surface.In particular,the gradientflow canbe usedasa smoothingprocessfor implicitsurfaces.In mostof ourapplications,aboutonehundredtimestepsin total areenoughfor our continuousdeformation.Sinceweuseareinitializationprocedureduringthedeformation,we finish with asigneddistancefunctionfor thereconstructedimplicit surface.

5.4 Multiresolution

Therearetwo scalesin our surfacereconstruction.Oneis theres-olution of thedataset.Theotheris theresolutionof thegrid. Thecomputationalcostgenerallydependsmainly on the grid size. Toachievethebestresultsthosetwo resolutionsshouldbecomparable.However our grid resolutioncanbe independentof the samplingdensity. For example,we canusea low resolutiongrid whenthereis noiseandredundancy in thedatasetor whenmemoryandspeedareimportant.Fromour numericalresults,seee.g.,figure9(c) ourreconstructionis quitesmootheven on a very low resolutiongrid.We canalsousea multiresolutionalgorithm, i.e., reconstructthesurfacefirst on coarsergrids and interpolatethe result to a finerresolutiongrid for furtherrefinementin anhierarchicalway.

5.5 Efficient stora ge

To storeor renderan implicit surface,we only needto recordthevaluesandlocations(indices)of thosegrid pointsthat arenext tothe surface,i.e., thosegrid points that have a differentsign fromat leastoneof their neighbors.Thesegrid pointsform a thin gridshell surroundingthe implicit surface. No connectivity or otherinformationneedsto bestored.We reducethefile sizeby at leastan order of magnitudeby using this method. Moreover we caneasilyreconstructthesigneddistancefunctionin WY � operationsfor the implicit surfaceusingthefollowing procedure.(1) Usethefastdistancefinding algorithmto find the distancefunction usingthe absolutevalueof the storedgrid shell asan initial condition.(2) Usea taggingalgorithm,similar to the oneusedabove to findexterior pointsoutsidea distancecontour, to identify all exteriorpointsandinteriorpointsseparatedby thestoredgrid shellandturnthe computeddistanceinto the signeddistance. For example, ifwe storethesigneddistancefunctionfor our reconstructedHappyBuddhafrom almosthalf a million pointson a

-��#�3���#� O ��-��#�grid in binaryform, thefile sizeis about30MB. If weusetheaboveefficient way of storagethe file sizeis reducedto 2.5MB withoutusingany compressionprocedureandwecanreconstructthesigneddistancefunctionin 1 minuteusingtheabove algorithm.

6 Results

In thissectionwepresentnumericalexamplesthatillustratetheef-ficiency andquality of our surfaceconstruction.In particularweshow (1) thelevel setmethodhandlessurfacedeformationandtopo-logical changeeasily, (2) our fast taggingalgorithmconstructsagoodinitial guessvery quickly, (3) how smooththe reconstructedsurfacesare, (4) our algorithm works with non-uniform, noisyor damageddata,and (5) multiresolutionworks in our formula-tion. All calculationswere donewith dual PentiumIII, 600Mhzprocessors. Data points for the drill, dragon and the Buddha

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

Ratbrain 1506 80x77x79 .12 3Hand 327323 200x141x71 .5 10Drill 1961 24x250x32 0.1 2

Dragon 437645 300x212x136 4 77Dragon 100250 300x212x136 3 66Buddha 543652 146x350x146 3 68Buddha 543652 63x150x64 .3 7

Figure3: timing table

were obtained from www-graphics.stanford.edu/data/3Dscanrepand data points for the hand skeleton was obtained fromwww.cc.gatech.edu/projects/large models. Only locationsof thedatapointsareusedin ourreconstructions.Timings,numberof datapointsandgrid sizeareshown in table3. CPUtime is measuredinminutes.CPU(initial) is thetime for the initial reconstructionus-ing thedistancecontourandthefasttaggingalgorithm.CPU(total)is thetotal time usedfor the reconstruction.Sinceour PDEbasedalgorithmsareiterativeprocedures,differentconvergencecriterionwill givedifferentconvergencetimes.

Figure4 shows datapointsfor a torus,a few curves(longitudesand latitudes)on a sphere,datapoints from MRI slicesfor a ratbrain. Figure 5 shows the final surface reconstructionfrom theabove data. We seethat the hole in the torusis filled nicely witha minimal surface. For the spherespherereconstructionwe onlyprovide theunsigneddistancefunctionto thecurveswhich canbeviewedasanextremecaseof non-uniformdata.Sincethedatasetsin thesethreecasesarequitenon-uniform,we useeithera bound-ing boxastheinitial surface(in thecaseof torusandsphere)or theintersectionof a boundingbox andanouterdistancecontourwithrelatively large � . ( ��� - SFZ in thecaseof therat brain.)

For datasetsthatarefairly uniform,suchasthedrill, handskele-ton, the dragonand the Buddha,we start with an outer distancecontourandusethe fasttaggingalgorithmto get an initial recon-struction. The initial reconstructionis extremely fast, as we canseefrom table3. After the initial reconstruction,we first usetheconvectionmodelandthenusethegradientflow to finish thefinalreconstruction.In our reconstruction,the grid resolutionis muchlower than the datasamplesand yet we get final resultsthat arecomparableto thereconstructionsshown at thosewebsitesabove.

Figure6 shows the reconstructionof a handskeleton. Figure7is thereconstructionof adrill. It is aquitechallengingexampleformostmethodsfor surfacereconstructionasis shown in [13]. Nextweshow thereconstructionof adragonona

� O�O � S - S ��-Q��� gridusingahighresolutiondatain fig.8(a)andamuchlower resolutiondatain fig.8(b). We canbarelyseethedifference.Figure9 showsthe reconstructionof the Happy Buddha. Figure 9(a) shows theinitial reconstruction.We startwith anouterdistancecontour, ���� Z , initially andusethefasttaggingalgorithm. It takes3 minutesfor half amillion pointson a

-��#�����;� O �2-��#� grid. Figure9(b) isthefinal reconstruction.Figure9(c) is thereconstructionon a verycoarse

���U��-u� O ���F� grid usingthesameamountof datapoints.Ittakesonly 7 minutesandtheresultis quitegood.

7 Conc lusions

WepresentavariationalandPDEbasedformulationfor surfacere-constructionfrom unorganizeddata.Ourformulationonly dependson the(unsigned)distancefunctionto thedataandthefinal recon-structionis smootherthanpiecewise linear. We usethe level setmethodasa numericaltool to deformandconstructimplicit sur-faceson fixedrectangulargrids. We usefastsweepingalgorithms

Page 6: Fast Surface Reconstruction Using the Level Set Methodmisha/Fall13b/Papers/Zhao01.pdf · Fast Surface Reconstruction Using the Level Set Method Hong-KaiZhao Stanley Osher Ronald Fedkiw

for computingthedistancefunctionandfasttaggingalgorithmsforinitial� construction.Our methodworks for complicatedtopologyandnonuniformor noisydata.

References

[1] D. AdalsteinssonandJ.A. Sethian. A fast level setmethodfor propagatinginterfaces.J. Comp. Phys., 118(2):269–277,1995.

[2] L. Alvarez,F. Guichard,P.-L. Lions, andJ.-M. Morel. Ax-iomsandfundamentalequationsof imageprocessing.Arch.Rat. Mechanics, 123:199–257,1993.

[3] N. Amenta,M. Bern, and D. Eppstein. The crust and the�-skeleton: combinatorialcurve reconstruction. Graphical

Models and Image Processing, 60/2(2):125–135,1998.

[4] N. Amenta, M. Bern, and M. Kamvysselis. A newVoronoi-basedsurfacereconstructionalgorithm. Proc. SIG-GRAPH’98, pages415–421,1998.

[5] C. Bajaj,F. Bernardini,andG. Xu. Automaticreconstructionof surfacesandscalarfields from 3d scans. SIGGRAPH’95Proceedings, pages193–198,July1995.

[6] J. Bloomenthal, C. Bajaj, J. Blinn, M.-P Cani-Gascuel,A. Rockwood,B. Wyvill, andG. Wyvill. Introduction to im-plicit surfaces. MorganKaufman,Inc.,SanFrancisco,1997.

[7] J.D.Boissonnat.Geometricstructuresfor threedimensionalshapereconstruction.ACM Trans. Graphics 3, pages266–286,1984.

[8] J.D.BoissonnatandF. Cazals.Smoothshapereconstructionvia naturalneighborinterpolationof distancefunctions.ACMSymposium on Computational Geometry, 2000.

[9] M. Boue and P. Dupuis. Markov chain approximationsfor deterministic control problems with affine dynamicsand quadraticcost in the control. SIAM J. Numer. Anal.,36(3):667–695,1999.

[10] D.E. Breen,S. Mauch,andR.T. Whitaker. 3d scanconver-sionof csgmodelsinto distance.1998 Volume VisualizationSymposium, pages7–14,October1998.

[11] V. Caselles,R.Kimmel,G.Sapiro,andC.Sbert.Minimal sur-facesbasedobjectsegmentation.IEEE Trans. Pattern Analy-sis Machine Intelligence, 19:4:394–398,1997.

[12] L.D. CohenandI. Cohen.Finite-elementmethodsfor activecontourmodelsand ballonsfor 2-d and 3-d images. IEEETransactions on Pattern Analysis and Machine Intelligence,15(11):1131–1147,November1993.

[13] B. CurlessandM. Levoy. A volumetricmethodfor buildingcomplex modelsfromrangeimages.SIGGRAPH’96 Proceed-ings, pages303–312,1996.

[14] P. Danielsson. Euclideandistancemapping. ComputerGraphics and Image Processing, 14:227–248,1980.

[15] M. DesbrunandM.P. Cani-Gasceul.Active implicit surfaces.Graphics Interface, 1998.

[16] H. Edelsbrunner. Shapereconstructionwith Delaunaycom-plex. In Proc. of LATIN’98: Theoretical Informatics, volume1380of Lecture Notes in Computer Science, pages119–132.Springer-Verlag,1998.

[17] H. Edelsbrunnerand E. P. Mucke. Three dimensional �shapes.ACM Trans. Graphics 13, pages43–72,1994.

[18] A. Hilton, A.J. Stoddart,J. Illingworth,andT. Windeatt. Im-plicit surface- basedgeometricfusion. Comput. Vision andImage Understanding, 69:273–291,1998.

[19] H. Hoppe, T. DeRose, T. Duchamp, J. McDonald, andW. Stuetzle.Surfacereconstructionfrom unorganizedpoints.SIGGRAPH’92 Proceedings, pages71–78,1992.

[20] S. Muraki. Volumetricshapedescriptionof rangedatausing”blobby model”. In Computer Graphics (Proc. SIGGRAPH),volume25,pages227–235,July1991.

[21] P. Ning andJ.Bloomenthal.An evaluationof implicit surfacetilers. IEEE Computer Graphics and Applications, 13(6):33–41,November1993.

[22] S.OsherandR. Fedkiw. Level setmethods:anoverview andsomerecentresults.J. Comp. Phys., 169(2),2001.

[23] S. OsherandJ. Sethian. Frontspropagatingwith curvaturedependentspeed,algorithmsbasedona Hamilton-Jacobifor-mulation.J. Comp. Phys., 79:12–49,1988.

[24] A. Pasko, V. Adzhiev, A. Sourin,andV. Savchenko. Functionrepresentationin geometricmodeling:concepts,implementa-tion andapplications.The Visual Computer, 11(8):429–446,1995.

[25] D. Peng,B. Merriman,S. Osher, H.K. Zhao,andM. Kang.A PDE basedfast local level set method. J. Comp. Phys.,155:410–438,1999.

[26] L. Piegl andW. Tiller. The NURBS book. Berlin, Germany:Springer-Verlag,2ndeditionedition,1996.

[27] D.F. Rogers.An Introduction to NURBS. MorganKaufmann,2000.

[28] V.V. Savchenko, A.A. Pasko, O.G. Okunev, andT.L. Kunii.Functionrepresentationof solidsreconstructedfrom volume.Computer Graphics Forum, 14(4):181–188,October1995.

[29] M. Sussman,P. Smereka,andS.Osher. A level setapproachfor computingsolutionsto incompressibletwo-phaseflows.J.Comp. Phys., 119:146–159,1994.

[30] G.TurkandJ.OBrien.Shapetransformationusingvariationalimplicit functions. SIGGRAPH99, pages335–342,August1999.

[31] B. Wyvill, A. Guy, and E. Galin. Extending the CSGtree, warping, blending and booleanoperationsin an im-plicit surfacemodelingsystem. Computer Graphics Forum,18(2):149–158,June1999.

[32] B. Wyvill, C. McPheeters,andG. Wyvill. Datastructureforsoftobjects.The Visual Computer, 2(4):227–234,1986.

[33] H.K. Zhao,T.F. Chan,B. Merriman, and S.Osher. A vari-ational level set approachto multiphasemotion. J. Comp.Phys., 127:179–195,1996.

[34] H.K. Zhao,S.Osher, B. Merriman,andM. Kang.Implicit andnon-parametricshapereconstructionfrom unorganizedpointsusingvariationallevel setmethod.Computer Vision and Im-age Understanding, 80(3):295–319,2000.

Page 7: Fast Surface Reconstruction Using the Level Set Methodmisha/Fall13b/Papers/Zhao01.pdf · Fast Surface Reconstruction Using the Level Set Method Hong-KaiZhao Stanley Osher Ronald Fedkiw

Figure4: initial data

holefilling of a torus reconstructionof a spherefrom curves reconstructionof a ratbrainfrom MRI slices

Figure5: final reconstruction

(a) initial reconstruction (b) final reconstruction

Figure6: reconstructionof ahandskeleton

Figure7: reconstructionof adrill

Page 8: Fast Surface Reconstruction Using the Level Set Methodmisha/Fall13b/Papers/Zhao01.pdf · Fast Surface Reconstruction Using the Level Set Method Hong-KaiZhao Stanley Osher Ronald Fedkiw

(c) final reconstruction (d) low resolutionreconstruction

Figure8: reconstructionof thedragon

(a) initial reconstruction (b) final reconstruction (c) reconstructionona coarsegrid

Figure9: reconstructionof theHappy Buddha