Feature-Based Surface Parameterization and Texture Mapping EUGENEZHANG,KONSTANTINMISCHAIKOW,andGREGTURK GeorgiaInstituteofTechnology Surfaceparameterizationisnecessaryformanygraphicstasks:texture-preservingsimplification,remeshing,surfacepainting, and precomputation of solid textures. The stretch caused by a given parameterization determines the sampling rate on the surface.Inthisarticle,wepresentanautomaticparameterizationmethodforsegmentingasurfaceintopatchesthatarethen flattenedwithlittlestretch. Many objects consist of regions of relatively simple shapes, each of which has a natural parameterization. Based on this observation,wedescribeathree-stagefeature-basedpatchcreationmethodformanifoldsurfaces.Thefirsttwostages,genus reductionandfeatureidentification,areperformedwiththehelpofdistance-basedsurfacefunctions.Inthelaststage,wecreate oneortwopatchesforeachfeatureregionbasedonacovariancematrixofthefeature’ssurfacepoints. Toreducestretchduringpatchunfolding,wenoticethatstretchisa2×2tensor,whichinidealsituationsistheidentity. Therefore, we use the Green-Lagrange tensor to measure and to guide the optimization process. Furthermore, we allow the boundaryverticesofapatchtobeoptimizedbyaddingscaffoldtriangles.Wedemonstrateourfeature-basedpatchcreationand patchunfoldingmethodsforseveraltexturedmodels. Finally,toevaluatethequalityofagivenparameterization,wedescribeanimage-basederrormeasurethattakesintoaccount stretch,seams,smoothness,packingefficiency,andsurfacevisibility. CategoriesandSubjectDescriptors:I.3.5[ComputerGraphics]:ComputationalGeometryandObjectModeling—Geometric algorithms,languages,andsystems GeneralTerms:Algorithms AdditionalKeyWordsandPhrases:Surfaceparameterization,segmentation,texturemapping,topology 1. INTRODUCTION Surfaceparameterizationisawell-studiedproblemincomputergraphics.Ingeneral,surfaceparame- terizationreferstosegmentinga3Dsurfaceintooneormorepatchesandunfoldingthemontoaplane withoutanyoverlap.Borrowingterminologyfrommathematics,thisisoftenreferredtoascreatingan atlas of charts for a given surface. Surface parameterization is necessary for many graphics applica- tionsinwhichpropertiesofa3Dsurface(colors,normal)aresampledandstoredinatexturemap.The qualityoftheparameterizationgreatlyaffectsthequalityofsubsequentapplications.Oneofthemost ThisworkissupportedbyNSFgrantsACI-0083836,DMS-0138420,andDMS-0107396. Authors’addresses:E.Zhang,SchoolofElectricalEngineeringandComputerScience,OregonStateUniversity,102Dearborn Hall, Corvallis, OR 97331-3202; email: [email protected]; K. Mischaikow, Center for Dynamical Systems and Nonlinear Studies,SchoolofMathematics,GeorgiaInstituteofTechnology,Atlanta,GA30332;email:[email protected];G.Turk, CollegeofComputing/GVUCenter,GeorgiaInstituteofTechnology,Atlanta,GA30332;email:[email protected]. Permissiontomakedigitalorhardcopiesofpartorallofthisworkforpersonalorclassroomuseisgrantedwithoutfeeprovided thatcopiesarenotmadeordistributedforprofitordirectcommercialadvantageandthatcopiesshowthisnoticeonthefirst pageorinitialscreenofadisplayalongwiththefullcitation.CopyrightsforcomponentsofthisworkownedbyothersthanACM mustbehonored.Abstractingwithcreditispermitted.Tocopyotherwise,torepublish,topostonservers,toredistributetolists, ortouseanycomponentofthisworkinotherworksrequirespriorspecificpermissionand/orafee.Permissionsmayberequested fromPublicationsDept.,ACM,Inc.,1515Broadway,NewYork,NY10036USA,fax:+1(212)869-0481,[email protected]. (cid:1)c 2005ACM0730-0301/05/0100-0001$5.00 ACMTransactionsonGraphics,Vol.24,No.1,January2005,Pages1–27. 2 • E.Zhangetal. Fig.1. Thefeatureregions(left)andtheunfoldedpatches(right,colorsareusedtoencodesurfacenormal)forthebunnysurface usingouralgorithm. importantqualitymeasurementsisstretch.Whenunfoldingasurfaceontoaplane,stretchingoccursif thesurfacecontainshighlysphericalorhyperbolicregions.Highstretchinaparameterizationresults inanunevensamplingrateacrossthesurface. Weobservethatmanyobjectscanbedecomposedintoasetof“simple”shapesthatroughlyapprox- imate cylinders, cones, flat disks, and spheres. Cylinders, cones, and planes are developable surfaces, which are Euclidean by nature. Unfolding them results in little stretch, without any overlap. In this article,wemakeuseofsomedistance-basedsurfacefunctionstodivideamanifoldsurfaceintofeature regions, each of which is similar to one of the simple shapes. In Figure 1 (left), the bunny surface is decomposedintofourfeatureregions(ears,head,andbody)usingoursegmentationalgorithm.These regions are converted into patches and unfolded with little stretch (right, colors are used to encode surfacenormal). Existing patch unfolding techniques are often carried out in two stages: an initial patch layout to achievesomeobjectivesuchasconformalmapping,followedbyaninteriorvertexoptimizationbasedon somestretchmetric.Weobservethatanidealsurfaceparameterizationbetweenapatchanditstextural imageisanisometry,thatis,abijectivemapthatpreservesdistances.TheGreen-Lagrangedeformation tensor has the property that it measures anisotropic stretch faithfully and penalizes undersampling more severely than oversampling. In addition, it can be seen as a balance between area-preserving mappings and conformal mappings. We use this metric to guide the vertex optimization process for patch unfolding. In addition, we use what we call scaffold triangles to convert the original boundary verticesinto“interior”vertices,whichcanthenbefreelymovedaroundwithinthesameoptimization framework.Thisisanewwayofcreatingnonconvexpatchesthatmayevenhaveholes. Inthisarticle,wepresentanautomaticsurfaceparameterizationtechniquethatconsistsofseveral newideasandimprovesuponexistingtechniquesinthefollowingaspects.Forpatchcreation,instead of relying on local curvature information for feature detection as in the case of most previous param- eterization methods, we extract and segment large protrusions based on the topological analysis of some distance-based surface functions that are global in nature. This results in a small number of largepatchesthatcanbeunfoldedwithrelativelylittlestretch.Forpatchunfolding,weusetheGreen- Lagrangetensortomeasurestretchandtoguidethestretchoptimizationprocess.Inaddition,wecreate a“virtualboundary”toallowthepatchboundariestobeoptimized,withouttheneedtocheckforglobal self-intersections.Finally,wedescribeanovelimage-basedqualitymetricforsurfaceparameterization thatimplicitlytakesintoaccountstretch,seams,packingefficiency,smoothness,andsurfacevisibility. ACMTransactionsonGraphics,Vol.24,No.1,January2005. Feature-BasedSurfaceParameterizationandTextureMapping • 3 The remainder of the article is organized as follows. In Section 2, we review existing surface pa- rameterization techniques. Then, we present our feature-based patch creation method in Section 3, followed by our new balanced stretch metric in Section 4.1, boundary vertex optimization technique in Section 4.2, and our packing algorithm in Section 5. In Section 6, we show the results of applying ourtechniquetovarious3Dmodelsanddescribeourimage-basedqualitymetricforparameterization techniques.Section7providesasummaryofourcontributionsandadiscussionofsomepossiblefuture work. 2. PREVIOUSWORK Therehasbeenaconsiderableamountofrecentworkinthegraphicscommunityonbuildingasurface parameterizationbyunfoldingapolygonalsurfaceintoplanarpatches.Muchofthemotivationforthis isfortexturemapping,themappingofpixelsfromarectangulardomain(thetexturemap)ontoasurface thatisdescribedbyacollectionofpolygons.Thesurfaceparameterizationproblemistosubdividethe given surface into a (hopefully small) number of patches that are then flattened onto a plane and arrangedinatexturemap.Usesforsurfaceparameterizationincludesurfacepainting[Hanrahanand Haeberli1990],fastrenderingofproceduraltextures[Perlin1985;Turk2001;WeiandLevoy2001;Carr and Hart 2002], applying photographed color variations onto digitized surfaces [Cignoni et al. 1998], andcreatingnormalmapsfromdetailedgeometry[Sanderetal.2001].Thesesameparameterization methodsmayalsobeusedforremeshing,thatis,forcreatinganewmeshfromtheoriginalsurface[Alliez etal.2002].Remeshingcanbeusedtoimprovethetriangleshapes,tovarythetrianglesizeaccording tocurvaturedetails,andtoinducesemi-regulartessellations.Recently,octreeshavebeenusedtostore colorsin3Dforsurfacetexturingwithoutanyparameterization[BensonandDavis2002;DeBryetal. 2002]. Although octree techniques are supported with programmable GPU’s, they are not yet directly supportedbygraphicshardware. 2.1 PatchCreation There are two common approaches to the patch creation problem. The first of these is to find a single cut for the surface that makes the modified surface topologically equivalent to a disk [Piponi and Borshukov2000;Guetal.2002;ShefferandHart2002;EricksonandHar-Peled2002;Nietal.2004]. Thisapproachhasthevirtueofcreatingasfewseamsaspossible,butwilloftenintroducelargestretch between the patch and the surface. Such stretching is undesirable because different portions of the surface are represented using quite different amounts of color detail, as measured in pixel resolution inthetexturemap. The other major approach is to divide the surface into a collection of patches that can be unfolded withlittlestretch[Ecketal.1995;Leeetal.1998;Sanderetal.2001;Alliezetal.2002;Le´vyetal.2002; Sorkine et al. 2002]. Though stretch is minimized, this approach creates seams between the patches. Theseseamscauseproblemswhencreatingtexturedimagesofthesurfacebecausethecolorvariation across the seams must be treated with extreme care or the seams will be noticeable. Some methods create small disk-like patches [Eck et al. 1995; Lee et al. 1998; Sander et al. 2001; Alliez et al. 2002], whileothersattempttocreatelargepatchesthatmatchthefeaturescontainedintheobject[Le´vyetal. 2002; Sorkine et al. 2002; Katz and Tal 2003]. Our own work takes this latter approach. We cut the surfaceintomultiplepatches,butaccordingtothelargegeometricfeaturesofthesurface.Forexample, wewouldliketorecognizetheheadandlimbsofananimalasimportantfeaturesandtocreatepatches thatrespectthesefeatures.TheworkofLe´vyetal.[2002]andKatzandTal[2003]havesimilargoals, althoughtheirfeature-basedpatchcreationmethodsarequitedifferentthanourown. Thedefinitionoftheterm“geometricfeature”variesindifferentcontexts.Forsurfacereconstruction and mesh simplification, features are often defined in terms of local curvature. This is reasonable ACMTransactionsonGraphics,Vol.24,No.1,January2005. 4 • E.Zhangetal. becausehighcurvatureregionsareexactlywhattheseapplicationsaretryingtopreserve.Ontheother hand, surface parameterization algorithms incur higher stretch on a smooth surface with long thin protrusionsthananoisysurfacewithsmallprotrusions.Inthiswork,wedefinegeometricfeaturesas largeprotrusions,andouralgorithmsegmentsasurfacebasedonitsfeaturesbyperformingtopological analysisofsomedistance-basedsurfacefunctions. 2.2 PatchUnfolding There have been many patch unfolding techniques. The classical approach treats the patch unfolding problemasfindingtheminimumofsomefunctionalthatmeasuresthedifferencebetweenaparameter- izationwithisometry[Ecketal.1995;Floater1997].First,theboundaryverticesareassignedinitial positions(usuallyonacircleorasquare).Thentheparameterizationfortheinteriorverticesisdeter- minedbysolvingalargelinearsystemorthroughanonlinearoptimizationprocess.Othershaveused stretchmeasuressuchastheGreen-Lagrangedeformationtensor[Maillotetal.1993]andavariantof Dirichlet energy [Hormann and Greiner 1999]. Sander et al. [2001] define a geometric stretch metric thatisbasedontheaverageandmaximalstretchinalldirectionsofatriangle.Sorkineetal.[2002]and Khodakovsky et al. [2003] have devised stretch metrics based on the maximum and minimum eigen- valuesofthestretchtensor.Sanderetal.[2001]alsoproposeapost-processingvertexoptimizationstep thatimprovestheirgeometricstretch.Aswedescribelater,Sander’spatchoptimizationapproachwas aninspirationforourownwork.Toallowtheboundaryverticesofapatchtobefreefromthearbitrary initialassignment,Le´vyetal.[2002]usealeast-squaresconformalmapping,andDesbrunetal.[2002] proposeanequivalentformulation,Discrete,NaturalConformalParameterization.Sanderetal.[2002] allowboundaryverticestomove,whilecheckingforglobalintersections.Leeetal.[2002]addlayersof “virtualboundaries”aspartoftheedgespringstoallowthepatchboundariestohavenaturalshapes. Recently,ShefferanddeSturler[2001;2002]proposetouseanangle-basedflatteningapproachforpatch unfolding.Thisapproachmeasuresstretchintermoftheanglesdeficitsbetweenthetrianglesonthe surfaceandtheirtexturalimages,anditremovestheneedtocheckforglobalself-intersections. 3. FEATURE-BASEDPATCHCREATION Ourfeature-basedpatchcreationmethodiscarriedoutinthreestages: (1) genusreduction:asurfacewithhandles(nonzerogenus)isconvertedintoagenuszerosurface. (2) featureidentification:agenuszerosurfaceisdividedintoanumberofrelativelysimpleshapes. (3) patchcreation:everysimpleshapeiscutintooneortwotopologicaldisks. Forbothgenusreductionandfeatureidentification,webuildasurface-basedReebgraphbasedonthe averagegeodesicdistanceintroducedbyHilagaetal.[2001].Thisgraphconsistsofverticesandedges in the mesh surface, and we call it an embedded Reeb graph. When properly constructed, this graph reveals the location of the handles and protrusions in the surface. Since our goal is to create patches thataretopologicaldisks,weneedtoperformouroperationsinatopologicallyconsistentmanner.For thispurpose,weusesurfaceregiongrowingforallthreestages:genusreduction,featureidentification andpatchcreation.Startingfromaninitialtriangle,wegrowaregionbyaddingonetriangleatatime untilthewholesurfacehasbeencoveredoruntilsomeotherstoppingcriterionhasbeenmet.Wewill nowdescribetheaveragegeodesicdistancefunctionandtheembeddedReebgraphthatitinduces. 3.1 TheAverageGeodesicDistanceFunction TheaveragegeodesicdistancefunctionwasintroducedbyHilagaetal.[2001]forthepurposeofshape matching. This is a function A(p) that takes on a scalar value at each point p on the surface S. Let g(p,q)bethegeodesicdistancebetweentwopointspandqon S.Thentheaveragegeodesicdistance ACMTransactionsonGraphics,Vol.24,No.1,January2005. Feature-BasedSurfaceParameterizationandTextureMapping • 5 Fig.2. Theaveragegeodesicdistancefunction(AGD)onthedinosaurmodeliscolor-codedintheleftofthisfigure.Theglobal minimumislocatedunderneaththebelly,coloredinred.Levelsetsarepaintedinrepeatedpatternsofred,green,andblue. Noticethatthetipsoflargeprotrusions(horns,legs,tail)arelocalmaximaofAGD.Themiddle,figureshowstheembeddedReeb graphcreatedbysurface-growingbasedonAGD.Localmaximaareindicatedbyredspheres,andsaddlepointsarehighlighted bybluespheres.Successivecriticalpointsareconnectedbysurfacepathsshowninsolidyellow(visible)anddashgreen(hidden). Thefinalsurfacesegmentationresultbasedonouralgorithmisshownontheright. Fig.3. ComparisonamongthreeAGDfunctionsforthedragon:AGD1(left),AGD2(middle),andAGD∞(right). ofpisdefinedasfollows: (cid:1) g(p,q)dq A(p)= q∈S . (1) Area(S) A(p)isamemberofthefollowingsetoffunctions: (cid:2)(cid:1) gn(p,q)dq A (p)= n q∈S (2) n Area(S) with n = 1. When n → ∞, A∞(p) := limn→∞ An(p) = maxq∈S g(p,q), which measures the maximal distancebetweenpandanypointon S.Wedefineforn=1,2,...,∞ A (p) AGD (p):= n . (3) n minq∈S An(q) Foranyn≥1, AGD hasseveralusefulproperties.First,itsvaluemeasureshow“isolated”apoint n isfromtherestofthesurface.Second,itslocalmaximacoincidewiththetipsofthegeometricfeatures containedinthemodel.Third,itisscale-invariantandcanbeusedtocomparefeaturesfromdifferent shapes. Figure 2 (left) shows a polygonal model of a dinosaur, color-coded according to AGD . The red 2 regiononthedinosaur’sbellysignifiesthatpointsinthisregionhavelowvaluesofAGD .Highervalues 2 adjacent to this middle region are colored in green and then in blue. The colors then cycle repeatedly throughred,green,andblue.Notethatthetipsofthelargefeaturesofthisobject(legs,horns,tail)are markedbylocalmaximaofAGD .(InsubsequentsectionswewillusethetermlocalmaximaofAGD 2 andtipsinterchangeably.)Inpractice,weuseAGD sinceitseemstoproducesmoothresults.Figure3 2 ACMTransactionsonGraphics,Vol.24,No.1,January2005. 6 • E.Zhangetal. comparesthelevelsetsofthefollowingthreefunctionsonthedragon:AGD (left),AGD (middle),and 1 2 AGD∞ (right).Fromnowon,wewillusethetermAGDtomeanAGD2. For a genus zero surface, we use AGD to identify and measure its geometric features. The tip of a protrusion is a local maximum. Larger values at local maxima signify larger protrusions. Notice thatanoisysurfaceoftencontainsmanysmallbumpsthatcorrespondtolocalmaximawithrelatively smallAGDvalues.Creatingpatchesbasedonthesebumpswillincreasetheamountofseams,without significantlyreducingstretch.Therefore,weonlyconsiderlocalmaximawhoseAGDvaluesareabove athreshold.Inpractice,wefindchoosinganynumberin[1.3,1.5]asthethresholdforminimalfeature sizeproducesreasonableresults,andweuse1.4forallourtestmodels. ComputingAGDexactlywouldbequitecostly.WecloselyfollowthealgorithmofHilagaetal.[2001]to quicklycomputeasatisfactoryapproximationofAGD.Briefly,thegeodesicdistancesarenotcalculated from all the surface points, but rather from a small number of evenly spaced points on the surface. We find the geodesic distances from each of these points to all other points efficiently using the fast- marchingmethodforsurfaces[KimmelandSethian1998]. 3.2 BuildinganEmbeddedReebGraph Tofindhandlesandlargeprotrusionsinamodel,weperformtopologicalanalysisofAGDandconstruct anembeddedReebgraph(cid:1)thatisinducedbyAGD.Theleafnodesof(cid:1)aresituatedatthetipsofprotru- sions,andtheloopsin(cid:1) revealtheexistenceofhandles.Weconstruct(cid:1) byperformingregion-growing in the increasing order of AGD and tracking the topological changes in the wavefront. This is based uponideasfromMorseTheory[Milnor1963]andReebgraphs[Reeb1946],whichwewillreviewhere. Let f beasmoothfunctiondefinedonasmoothsurface S ⊂R3.Foranypointp ∈ S,letµ=(u,v) 0 be a parameterization of some neighborhood of p in S such that µ(0,0) = p . The gradient ∇f and 0 0 theHessian Hf aredefinedasfollows: ∂f/∂u ∂2f/∂u2 ∂2f/∂u∂v ∇f = , Hf = . (4) ∂f/∂v ∂2f/∂u∂v ∂2f/∂v2 p is a critical point of f if ∇f(0,0) = 0. Otherwise, p is regular. A critical point p is said to be 0 0 0 nondegenerate if Hf(0,0) does not have any zero eigenvalues. In this case, p can be classified as a 0 mimimum/saddle/maximum if Hf(0,0) has zero/one/two negative eigenvalues. f is Morse over S if f possesses no degenerate critical points. Morse theory relates the critical points of Morse functions to the topology of the underlying surface. For instance, when S is a closed orientable 2-manifold with Euler characteristic χ(S) (twice the number of handles plus two), the following is true for any Morse function f definedon S withα maxima,β saddles,andγ minima. α−β+γ =χ(S). (5) BanchoffextendsMorsetheorytotriangularmeshes[1970]. Acontinuousfunction f : S →RinducesaReebgraph(cid:1) ,whichcanbeusedtorevealthetopological f andskeletalstructuresofS[Hilagaetal.2001].Formally,wedefineanequivalencerelationship∼ on f S asfollows.Letp,q∈ S betwopoints,thenp∼ qifandonlyif f(p)= f(q)andpandqbelongto f the same connected component of f−1(f(p)). Notice f does not have to be Morse. Figure 4 illustrates anexampleReebgraphthatcorrespondstotheverticalheightfunction,definedona3Dsurface.Many applications make use of Reeb graphs, such as shape-matching [Hilaga et al. 2001] and topological simplification[Woodetal.2004].AGDis,ingeneral,notMorse.Forinstance,itisaconstantfunction on a sphere, in which case every point is a degenerate critical point. Axen and Edelsbrunner [1998] show that a function can be perturbed into a Morse function with surface wave traversal, provided ACMTransactionsonGraphics,Vol.24,No.1,January2005. Feature-BasedSurfaceParameterizationandTextureMapping • 7 Fig.4. AnexampleofaReebgraph(right)foraverticalheightfunction,definedona3Dsurfaceofgenusone(left).Thecritical pointsarehighlightedbycoloredspheres(redformaxima,greenforminima,andblueforsaddles).Thenumberofloopsinthe graphequalsthenumberofhandlesinthesurface. thatthemeshisproperlysubdivided.Weuseasimilarstrategyexceptthatwerecordcriticaltriangles insteadofcriticalvertices. OuralgorithmforbuildinganembeddedReebgraph(cid:1) startswithcomputingAGDforeveryvertex. ForatriangleT ={v ,v ,v },wedefineAGD(T)=min{AGD(v ), AGD(v ), AGD(v )}.Startingwitha 1 2 3 1 2 3 trianglewhoseAGDvalueequalstheglobalminimum,weaddonetriangleatatimeintheincreasing orderoftheAGDuntilthesurfaceiscovered.Theboundaryofthevisitedregionconsistsofanumber ofloops.Welabelatriangle,whenitisadded,accordingtooneofthefollowingfivecriteria: (1) Minimum:whereonenewboundaryloopstarts.Forourapplication,thereisonlyonesuchtriangle, oneoftheglobalminimaoftheAGD. (2) Maximum:whereoneboundaryloopvanishes.Thisisthetipofaprotrusion. (3) Splittingsaddle:whereoneboundaryloopintersectsitselfandsplitsintotwo. (4) Mergingsaddle:wheretwoboundaryloopsintersectandmergeintoone.Thissignifiestheformation ofahandle. (5) Regular:wherethenumberofboundaryloopsdoesnotchange. A triangle that is not regular is a critical triangle. Let n be the genus of the surface, and let N , max N , N , and N be the number of the triangles that are maxima, minima, splitting saddles, and min ss ms mergingsaddles.Thenwehave, N =n (6) ms N −N +N +N =2. (7) max ss ms min Equation 7 corresponds to the handle-body decomposition of a closed and orientable piecewise linear 2-manifold[RourkeandSanderson1972].InterestedreadersmayrefertoLopesetal.[2003]formore details. For our application, N = 1. Furthermore, we mark the center of a critical triangle as the min positionofthecorrespondingcriticalpoint.Theregiononthesurfacesweptoutbetweenapairofcritical triangles(notincludingthesecriticaltriangles)ishomeomorphictoacylinderwithoutcaps.Let Aand Bbeapairofcriticaltriangles,andassumethat Aisvisitedearlierthan B.Wereferto Aastheparent criticaltriangleandBasthechildcriticaltriangle.Foragenuszerosurface,everychildcriticaltriangle hasasingleparent.Forsurfaceswithagenusgreaterthanzero,achildcriticaltrianglemayhaveone or two parents. Let R be the connecting region between Aand B, which consists of a set of regular AB triangles={T1,...,Tk}intheorderofwhichthey(cid:7)arev(cid:7)isited.Thereisashortestpaththatconnects A and B usingtheedgesofthesetoftriangles{A} {B} R .WeconstructtheembeddedReebgraph AB byfindingtheshortestpathsbetweeneverypairofparent/childcriticaltriangles. As mentioned earlier, the embedded Reeb graph (cid:1) is much like a Reeb graph that corresponds to AGD. It reveals the distribution of the geometric features over the surface. The middle of Figure 2 showstheembeddedReebgraphofthedinosaur.Localmaximaarehighlightedwithredspheres,while ACMTransactionsonGraphics,Vol.24,No.1,January2005. 8 • E.Zhangetal. Fig.5. EmbeddedReebgraphsforthebunnysurfacewithdifferentfilteringconstantsα:1.01(left),1.1(middle),and1.5(right). Weuse1.1asthefilteringconstantforallthetestmodels. bluespheresindicatethelocationofsplittingsaddlepoints.Theglobalminimumismarkedwithalight blue sphere on the belly. Successive critical points are connected by paths on the surface, which are drawninsolidyellow(visible)anddashgreen(hidden).Notethatlocalmaximacoincidewiththetips ofthegeometricfeatures(horns,feet,andtail). Since complex surfaces often contain many small protrusions (bumps), the embedded Reeb graph can contain an excessive number of local maxima and saddle points. This increases the subsequent processingtimesincethenumberoffeaturesismuchmorethanwhatweconsiderlarge(or“persistent” as described in Edelsbrunner et al. [2003]). We use the following filtering scheme to weed out extra localmaximaandsplittingsaddlepoints.Duringsurface-growing,wealtertheorderinwhichtriangles areadded.Tobemorespecific,lettbetheunvisitedtrianglewiththesmallestAGDvalue.Ifaddingt causesaboundarytosplit,welookforothertrianglesthatcouldbeaddedwithoutcausingaboundary split.Ifoneofthesetriangles,t(cid:8) satisfies: AGD(t(cid:8))<αAGD(t) (8) where α is a global filtering constant, then we add t(cid:8) instead of t. When there are multiple choices, we choose the triangle with the smallest AGD value. Our filtering process is related to the concept of topological persistence and simplification [Edelsbrunner et al. 2003], but with a different scalar functionandadifferentmeasureforpersistence.Also,thesimplificationprocessisimplicit.Weapply thefilteringschemetothebunnysurface(Figure5)withthreedifferentα’s:1.01(left),1.1(middle),1.5 (right).Noticetheexcessivesaddlepointsandmaximaappearintheheadandthepawswhenα =1.01 (left). When α = 1.1 (middle), the local maxima that reveal large geometric structures are kept (the tips of ears and the center of tail). Excessive filtering may result in a trivial embedded Reeb graph, forexample,α = 1.5(right).Thisbecomesaclassicaltradeoffbetweendenoisingandoverblurring.In practice,wefindα ∈[1.1,1.3]workswell,andweuseα =1.1forallthetestmodelsshowninthearticle. For a genus n > 0 surface, there are n loops in the embedded Reeb graph (cid:1) that are homologically inequivalentandformthebasesofallloopsin(cid:1).InSection3.4,wedescribehowweusetheseloopsfor genusreduction,thatis,convertingagenusnsurfaceintoagenuszerosurface. 3.3 FeatureIdentification Oncethetipofaprotrusionislocated,weconstructaclosedcurveγ onthesurfacethatseparatesthe feature from the remaining body. Using the terminology from Erickson and Har-Peled [2002], γ is a separatingcycle.Wecomputeγ intwosteps.First,wefindaseparatingregion R correspondingtothe tipoftheprotrusion.Next,weconstructγ from R. ACMTransactionsonGraphics,Vol.24,No.1,January2005. Feature-BasedSurfaceParameterizationandTextureMapping • 9 Fig.6. Inthisfigure,wefindaseparatingregionforthebunny’sear.IntheleftwegraphA(x),theareaoftheregionsgivenby evenlyspaceddistancesfromtheear’stip(red),andthesmoothedareas(blue).Wethencalculate A(cid:8)(cid:8)(x),thesecondderivative (middle).Themaximumof A(cid:8)(cid:8)(x)correspondstotheplacewheretheearjoinsthehead(right,thegreenband). To find a separating region for the tip point p of a feature, we first calculate the function f (q) = p g(p,q), the surface geodesic distance function with respect to p. f is normalized to take on values p in [0,1]. We consider the regions bounded by iso-value curves of this function. Specifically, we divide the interval [0,1] into k equal sections. Next, by performing region-growing from p, we partition the surfaceintolevelsetbandsbasedonthevaluesof f intheseintervals: p (cid:8) (cid:9) i−1 i M := q∈ S| ≤ f (q)≤ (9) i p k k A :=Area(M ). (10) i i TheconstructionoflevelsetsinEquation9isinspiredbyMorsetheory.Theareaofthissequenceof bandschangesslowlyalongaprotrusion,butitchangesabruptlywherethefeaturejoinstotherestof the surface.We findthe separatingregion byanalyzing {A},which wetreat asa continuousfunction i A(x). Along a perfect cylindrical feature, A(x) is constant. In the case of a cone, the function grows linearly. At places where a protrusion joins the main body, A(x) will have a sudden increase, and this will be the boundary of the feature. We find these increases by looking for the maxima in A(cid:8)(cid:8)(x), the second derivative of A(x). To eliminate small undulations in A(x), we first low-pass filter A(x) using a Gaussian function for N times. Both k and N affect the efficiency of separating region detection. The larger k is, the more samples are used to discretize A(x), and the more likely small noise will be consideredaspotentialplacesfortheseparatingregion.Similarly,if N istoolarge,thelocationforthe separatingregionmaybeshiftedorevenlost.Inpractice,weusek = 100and N = 30forallourtest models. These choices seem to produce reasonable results. Figure 6 illustrates the process of feature identificationforthebunny’sear. Let m be the location where A(cid:8)(cid:8)(m) takes on its maximum value. We define the separating region R := {q ∈ S | m−(cid:7) ≤ f (q) ≤ m+(cid:7)}, where we typically use (cid:7) = 0.02. By choosing a positive (cid:7), we p intentionallymakeRlargefortworeasons.First,poortriangulationsmaycauseRtobenonseparating, that is, it does not contain a separating cycle. Second, we would like more flexibility to allow the separatingcycle(withinthisregion)tobeshortandsmooth. The topology of the separating region R can be rather complex if there are other features that join the surface in nearby places. The only guarantee R provides is that it indeed separates the feature ACMTransactionsonGraphics,Vol.24,No.1,January2005. 10 • E.Zhangetal. from the rest of the surface. We produce a separating cycle γ from R as follows. First, we reduce R into its skeleton, that is, a collection of edges in the surface that separate the feature from the rest of the surface. Dangling edges are removed as well. Gu et al. [2002] perform a similar operation to producegeometryimagesfrommeshes.Next,wefindaseparatingcycleρ fromthisskeleton.Finally, weconstructanotherseparatingcycleγ thatisbasedonρ,butthatisingeneralshorterandsmoother. Theseoperationsareeasytoimplementonmeshesandwedescribethemindetailnext. (1) Reduce a separating region R into its skeleton and remove dangling edges. This is achieved by treating R as a 2-complex (with boundary edges) and repeatedly performing “elementary col- lapses”[Kaczynskietal.2004],inwhichatrianglewithatleastoneboundaryedgeisremovedfromthe complexalongwithoneoftheboundaryedges.Intheend,all2-cells(triangles)areremoved,andthe 2-complexisreducedtoa1-complex.Whentherearemultiplechoicesofboundaryedgestocollapse,we selecttheedgewiththelargestAGDvalue,whichtendstobeclosertothefeaturetippthantheother edges in the 2-complex. The resulting graph is a skeleton of R with dangling edges. We remove the danglingedgesthroughelementarycollapsesonthe1-complex.Thisresultsinacollectionofloops,one ofwhichmeetsourrequirementastheseparatingcycle.Theothersfallintotwocategories:separating cyclesforsomegeometricfeaturesinsidethefeatureregion,andseparatingcyclesforsomegeometric featuresoutsidethefeatureregion. (2)Eliminatefromthe1-complexseparatingcyclesthatareeitherinsideoroutsidethefeatureregion. Toremovetheloopsoutsidethefeatureregion,weperformregion-growingfromthefeaturetippwith theconstraintthatnotrianglescanbeaddedthatcrossanedgeintheloopscomputedfromthestepsin (1).Thismakestheloopsoutsidethefeatureregionunreachablefromp.Forloopsinsidethefeaturere- gion,theaverageAGDvaluesoftheirverticesare,ingeneral,greaterthanthatontheseparatingcycle. Therefore,theseloopscanbeeasilyidentifiedanddiscarded.Thisstepproducesaseparatingcycleρ. (3) Shorten and smooth the separating cycle ρ. We choose two vertices t and t on ρ that are the 1 2 closesttothefeaturetipp.Wefindtwopathsthatconnectt andt top,respectively.Thetwopaths 1 2 dividethefeatureregionintotwodisjointregions.Withineachregion,thereisashortestpathbetween t and t . Together, they form a separating cycle, which tends to be shorter and smoother than ρ. By 1 2 repeatingthisprocesstwice,weobtainadesiredseparatingcycleγ. Figure 7 illustrates this process. For a feature point p and a separating region R (a, the shaded region),wereduce R toitsskeletonthroughelementarycollapses(b).Next,loopsthatareeitherinside oroutsidethefeatureregionofpareeliminated(c).Inthebottomrow,theseparatingcycleρisshortened andsmoothedtoproduceγ,throughstep3(d-f). A separating cycle divides S into two surfaces with boundaries. We eliminate these boundaries by “filling in” the holes with triangles. Basically, we compute c, the average position of the boundary vertices, and make c a new vertex. We then triangulate the hole by connecting c to the vertices on theboundary.Thefillertrianglesaresubdividedtwice,followedbyLaplaciansmoothingonthenewly created vertices. Some filler triangles can be seen where the head has been separated from the neck of the bunny in Figure 1. These filler triangles are flagged so that they have minimal effect on patch unfolding.Theybecomewhatwecallscaffoldtriangles,tobedescribedlater. We repeat the feature identification process for the resulting surfaces until the original surface is dividedintoasetoffeatureregionsandtherearenomorefeatureregionstobefound.Figure1shows theresultofthisprocessonthebunny,inwhichfourregionswerecreated. Our feature identification algorithm assumes that a single loop always divides the surface into two disjointregions,whichisnotnecessarilytrueforsurfaceswithhandles.Forthesesurfaces,thetopology oftheseparatingregioncanbearbitrarilycomplexwheremanysmallhandlesareclusteredtogether. To avoid dealing with this situation, we perform genus reduction before feature identification. Genus reductionconvertsagenusn>0surfaceintoagenuszerosurface. ACMTransactionsonGraphics,Vol.24,No.1,January2005.