• Aucun résultat trouvé

and the spacecomplexity isO(n 2

N/A
N/A
Protected

Academic year: 2022

Partager "and the spacecomplexity isO(n 2"

Copied!
8
0
0

Texte intégral

(1)

CIM Algorithm for Approximating Three-Dimensional

Polygonal Curves

YONGJunhai(),HUShimin()andSUNJiaguang ( )

NationalCADEngineeringCenter,TsinghuaUniversity, Beijing100084, P.R.China

Department ofComputerScienceandTechnology,Tsinghua University,Beijing100084,P.R.China

E-mail: shimin@tsinghua.edu.cn

ReceivedNovember29,1999;revisedJuly17,2000.

Abstract The polygonal approximation problem is a primary problem in computer

graphics, pattern recognition, CAD/CAM,etc. In R 2

, the cone intersectionmethod(CIM)

isoneofthemosteÆcientalgorithmsforapproximatingpolygonalcurves. WithCIMEuand

Toussaint, byimposinganadditionalconstraintandchangingthegivenerror criteria,resolve

thethree-dimensionalweightedminimumnumberpolygonalapproximationproblemwiththe

parallel-striperrorcriterion(PS-WMN)underL2norm. Inthispaper,withoutanyadditional

constraintandchangeofthe errorcriteria,aCIMsolutiontothesameproblemwiththeline

segmenterrorcriterion(LS-WMN)ispresented,whichismorefrequentlyencounteredthanthe

PS-WMNis. Itstime complexity is O(n 3

), and the spacecomplexity isO(n 2

). An approxi-

mationalgorithmisalsopresented,whichtakesO(n 2

)timeand O(n)space. Resultsofsome

examplesaregiventoillustratetheeÆciencyofthesealgorithms.

Keywords polygonalcurve,CIM,LS-WMN,approximation,optimization

1 Introduction

Polygonalcurvesplayanimportantroleinmanyareas. Optimizationandapproximationalgorithms

for polygonal curves are widelyused. In computer graphics andimage processing, these algorithms

canbeusedtoobtainskeletonsoroutlinesofobjects [1 4]

. Inpatternrecognition,thesealgorithmscan

smoothawaynoise andhelp analyzingcharacteristic features [5]

. InCAD (Computer-Aided Design),

the polygonal curve is a basic geometric entity. In CAM (Computer-Aided Manufacturing), these

algorithmsreduce theline segmentsused in CNC(ComputerizedNumerical Control)paths soas to

reduce production cost. In communication, these algorithms can compress data and decrease the

transmission time requirements [4]

. Above all, almost all kinds of curves have to be converted into

polygonal curves before being displayed on screens, and these algorithms can be applied to reduce

computermemoryrequirementsandto speed updisplay [4]

.

An arbitrarypolygonal curve, which can be representedas P =[p

1

;p

2

;:::;p

n

], is made upof a

chain ofline segments[p

1

;p

2 ];[p

2

;p

3

];:::;[p

n 1

;p

n

]. Leteach vertex p

i

ofP havea weight"

i which

indicatestheerrortoleranceofp

i

. Thepolygonalapproximationproblemistondanapproximating

polygonalcurveP 0

=[p 0

1

;p 0

2

;:::;p 0

m

],suchthat:

i)ThesequenceofverticesofP 0

isasubsequenceofthesequenceofverticesofP,andthetwoend

vertices ofP 0

areoftencoincidentwiththoseofP,i.e.,p 0

1

=p

1 and p

0

m

=p

n

;

ii)Anylinesegment[p 0

A

;p 0

A+1 ]ofP

0

,whichsubstitutesasubchain[p

B

;p

B+1

;:::;p

C

]ofP,should

satisfyp 0

A

=p

B

;p 0

A+1

=p

C

,andthegivenerrorcriteriaEC(p

i

; p

0

A p

0

A+1 )"

i

,8i,B <i<C;

iii) misminimumover allapproximatingpolygonalcurves thatsatisfyi)andii).

Here, "

i

can be zero, which means that p

i

is a vertex of P 0

. The formulae p 0

1

= p

1 and p

0

m

= p

n

ensure thatP 0

retainsome properties ofP,e.g., open orclose. Constraint i)isuseful forvertices of

theapproximatingcurveP 0

areexactlyonP. Thispropertycanbe usedtoreducetheaccumulative

Thisresearchwas supportedbytheNationalNaturalScienceFoundationof China(No.69902004)andNKBRSF

(2)

error. The given formula for EC(p

i

;p 0

A p

0

A+1

) determines how the error tolerance is measured, and

leadsto dierentapproximationalgorithms.

Miyaoku and Harada have classied the polygonal approximation problems [6]

. This paper dis-

cussesLS-WMNproblemwithL

2 inR

3

(thethree-dimensionalweightedminimumnumberpolygonal

approximationproblemwiththelinesegmenterrorcriterionunderL

2

norm). Abruteforcealgorithm

ofthisproblemisas follows:

1)BuildthedirectedgraphG(V;E)where V consistsoftheverticesofP,andE consistsofthedirected

edgethat satises EC(pk;pipj)"k, forallk, i<k <j. Thenumberof edgesinG(V;E) is O(n 2

). This

methodforgeneratingG(V;E)requirescheckingtherelationshipamongeverythreeverticesinP,soitrequires

O(n 3

)time.

2) Find the shortest pathfrom p1 to pn inG(V;E), which requiresO(n 2

) timeusingforwarddynamic

programming.

The CIM(Cone Intersection Method) is similar to thebrute forcealgorithm except forthe pro-

cedure of building G(V;E). The basic idea is to check as few vertices as possible. The CIM uses

thetechnique of thecone intersections to check thegiven errorcriteria EC(p

k

;p

i p

j )"

k

, forall k,

i<k<j. ThediÆcultiesare:

(a)howto representandobtain thecones,and

(b)howto representandobtain theintersections ofthesecones.

Euand Toussaint [1]

thoughtthat these two problemsin R 3

weretoo diÆcultwhile dealing with

PS-WMNproblemwithL

2 inR

3

(thethree-dimensionalweightedminimumnumberpolygonalapprox-

imationproblemwithparallel-striperrorcriterionunderL

2

norm). Thustheyimposedanadditional

constraint on the problem, i.e., P should be strictly monotonic along the x-axis, and changed the

errortoleranceregionoftheverticesfrom balls

ER(p

i

;"

i

)=fqjD(p

i

;q)"

i g;

intoplanar discs

ER

1 (p

i

;"

i

)=fqjD(p

i

;q)"

i

andX(q)=X(p

i )g;

whereD(p

i

;q)isthedistance fromp

i

toq,X(p

i

)andX(q)arethex-coordinatesofp

i

and qrespec-

tively. Then, these planar discs are projected to a common plane, and the results are still planar

discs. The intersection ofthese projectiveplanar discs is usedin place of that of thecorresponding

three-dimensioncones. Certainly,theplanar discsaremuchsmaller thantheballs,andtheresulting

polygonal curvein general containsmore vertices than that ofthe optimalresult. Furthermore, the

CIMofEuandToussaintcannotbewidelyusedbecauseoftheadditionalconstraint.

Without increasing the time, space and implementation complexities, the method in the paper

removes the additionalconstraint andthe substitution ofthe errortolerancecriteria. SincetheLS-

WMNproblemismuchmorecommonthanthePS-WMNproblem,wediscusstheLS-WMNproblem

withL

2 in R

3

. Infact the PS-WMNproblem can also be solvedand theanswers tothe above two

questionsarepresentedinthis paper.

InSection5,wealsopresentanapproximationalgorithmwhichtakesO(n 2

)timeandO(n)space.

Inthepenultimatesection,theresultsofsome examplesaregivento illustratetheeÆciency ofthese

algorithms.

2 Denitions and Notations

Theproblemdiscussedinthispaper istheLS-WMNproblemwithL

2 inR

3

. Supposep;q;s;v;st,

edand c

b 2R

3

,randr

b

2R . Somenotationsusedinthispaperaredened asfollows:

X(p),Y(p)andZ(p)arethex-coordinate,y-coordinateandz-coordinateofprespectively.

D(p;q)= p

(X(p) X(q)) 2

+(Y(p) Y(q)) 2

+(Z(p) Z(q)) 2

isthedistancebetweenpandq.

L(p;q)=f(1 t)p+tqjt2R gisalinepassingthroughpandq. Whenpandqarecoincident,L(p;q)is

asetcontainingonlyonepoint.

HL(p;q)=f(1 t)p+tqjt0;t2R gisaraythatstartsfrompandpassesthroughq. Whenpandqare

(3)

[p;q]=f(1 t)p+tqj0t1;t2R gisalinesegmentwithpandqastheendpoints.Whenpandqare

coincident,[p;q]isconstitutedbyonlyonepoint.

D(s;L(p;q))=minfD(s;w)jw2L(p;q)gisthedistancebetweenthepointsandthelineL(p;q).

D(s;HL(p;q))=minfD(s;w)jw2HL(p;q)gisthedistancebetweenthepointsandtherayHL(p;q).

D(s;[p;q])=minfD(s;w)jw2[p;q]gisthedistancebetweensandthelinesegment[p;q]. EC(p

k

;pipj)is

equaltoD(p

k

;[p

i

;p

j

])inthispaper.

B(p;r) =fqj(X(p) X(q)) 2

+(Y(p) Y(q)) 2

+(Z(p) Z(q)) 2

= r 2

g isthe surface ofa ballwith the

centerpointpandtheradiusr.

BS(p;r)=fqj(X(p) X(q)) 2

+(Y(p) Y(q)) 2

+(Z(p) Z(q)) 2

r 2

gisasolidballwiththecenterpoint

pandtheradiusr.

CB(p;r)=fwjD(w;HL(cb;p))=r,w2B(cb;rb),w2R 3

gisacircleontheballB(cb;rb)ifp2B(cb;rb).

ArcB(p;r;st;ed) is an arcon the ball B(c

b

;r

b

), whichlies on the circleCB(p;r), starting from st and

endingatedincounterclockwiseorderaccordingtothedirection(p c

b

),ifCB(p;r)isacircleonB(c

b

;r

b ).

DB(p;r)=fwjD(w;HL(c

b

;p))r,w2B(c

b

;r

b

),w2R 3

gisadiscontheballB(c

b

;r

b

)ifp2B(c

b

;r

b ).

OC(p;q;r)=fsjw2HL(p;s),w2BS(q;r)gis calledanopencone. Notethat OC(p;q;r)isequaltoR 3

ifD(p;q)r.

ER(p

i

;"

i

) =fwjD(p

i

;w) "

i

, w2 R 3

gis the error toleranceregion at p

i

,where p

i

is avertexof the

polygonalcurveP,and"iistheweight(i.e. theerrortolerance)ofpi.

PP(p;q)=fwjq2HL(p;w), w2B(p;1)gisthesetcontainingtheprojectionpoint ofqontheunitball

B(p;1). Notethatifpandqarecoincident,PP(p;q)isthewholeunitballB(p;1).

PR(p;q;r)=OC(p;q;r)\B(p;1)istheprojectionoftheopenconeOC(p;q;r)ontheunitballB(p;1).

3 Theories of the Algorithm

Theorem 1. Let [p

A

;p

B

;p

C

] be a subchain of P. [p

A

;p

B

;p

C

] can be approximatedby [p

A

;p

C ] if

andonlyif p

C

2OC(p

A

;p

B

;"

B )andp

A

2OC(p

C

;p

B

;"

B ).

Proof. Accordingtothedenitionofpolygonalapproximationproblem,[p

A

;p

B

;p

C

]canbeapproxi-

matedby[p

A

;p

C

]ifandonlyifD(p

B

;[p

A

;p

C ])"

B

,i.e.,[p

A

;p

C

]\BS(p

B

;"

B

)6=. Since[p

A

;p

C ]=

HL(p

A

;p

C

)\HL(p

C

;p

A ), [p

A

;p

C

]\BS(p

B

;"

B

)6= ifand onlyifHL(p

A

;p

C

)\BS(p

B

;"

B

)6=and

HL(p

C

;p

A

)\BS(p

B

;"

B

)6=. Accordingto thedenition oftheopencone OC(p;q;r)in Section2,

HL(p

A

;p

C

)\BS(p

B

;"

B

)6=ifandonlyifp

C

2OC(p

A

;p

B

;"

B

),andHL(p

C

;p

A

)\BS(p

B

;"

B )6=if

andonlyifp

A

2OC(p

C

;p

B

;"

B

). Therefore, [p

A

;p

B

;p

C

]canbe approximatedby[p

A

;p

C

]ifandonly

ifp

C

2OC(p

A

;p

B

;"

B )andp

A

2OC(p

C

;p

B

;"

B ). 2

Corollary1. Let[p

A

;p

A+1

;:::;p

B

]beasubchainofP.[p

A

;p

A+1

;:::;p

B

] canbeapproximatedby

[p

A

;p

B

]if andonlyif p

B 2

B 1

\

i=A+1 OC(p

A

;p

i

;"

i )andp

A 2

B 1

\

i=A+1 OC(p

B

;p

i

;"

i ).

Corollary 2. Let [p

A

;p

A+1

;:::;p

B

;p

B+1

;:::;p

C

] be a subchain of P, and A < B < C. If

B

\

i=A+1 OC(p

A

;p

i

;"

i

) = or C 1

\

i=B OC(p

C

;p

i

;"

i

) = , [p

A

;p

A+1

;:::;p

C

] cannot be approximated by

[p

A

;p

C ].

Fromthetwocorollariesabove,itisveryeasytoobtaintheCIMinR 3

. However,asmentionedin

therstsection,thetwodiÆcultiesofCIMinR 3

remainunresolved. Ifweusetheopenconedirectly,

thecomputation willbe very complex. Fortunately, wedonotneedto know theexact intersections

ofthe open cones. Onlythe results of whether theintersections containingthe points arerequired.

Therefore, we can substitute the open cones with some discs on a unit ball or the unit ball itself.

Furthermore, thesediscscan beobtainedeasily,andcomputingtheintersectionsofthesediscsisnot

complex.

Theorem 2. Let [p

A

;p

B

;p

C

] be a subchain of P. [p

A

;p

B

;p

C

] can be approximated by [p

A

;p

C ] if

andonlyif PP(p

A

;p

C

)PR(p

A

;p

B

;"

B

)andPP(p

C

;p

A

)PR(p

C

;p

B

;"

B ).

Proof. PP(p

A

;p

C

) PR(p

A

;p

B

;"

B

) ifand only if HL(p

A

;p

C

) OC(p

A

;p

B

;"

B

). HL(p

A

;p

C )

OC(p

A

;p

B

;"

B

)ifandonlyifp

C

2OC(p

A

;p

B

;"

B

). SoPP(p

A

;p

C

)PR(p

A

;p

B

;"

B

)ifandonlyifp

C 2

OC(p

A

;p

B

;"

B

). Inthesame way, PP(p

C

;p

A

)PR(p

C

;p

B

;"

B

)if andonly ifp

A

2OC(p

C

;p

B

;"

B ).

(4)

Corollary3. Let[p

A

;p

A+1

;:::;p

B

]beasubchainof P.[p

A

;p

A+1

;:::;p

B

]canbeapproximatedby

[p

A

;p

B

]if andonlyif PP(p

A

;p

B )2

B 1

\

i=A+1 PR(p

A

;p

i

;"

i

)andPP(p

B

;p

A )2

B 1

\

i=A+1 PR(p

B

;p

i

;"

i ).

Corollary4. Let[p

A

;p

A+1

;:::;p

C

]beasubchainofP,andA<B <C. If B

\

i=A+1 PR(p

A

;p

i

;"

i )=

or C 1

\

i2B PR(p

C

;p

i

;"

i

)=,then[p

A

;p

A+1

;:::;p

C

] cannotbeapproximatedby [p

A

;p

C ].

ThissolvesthepresentationproblemoftheopenconesusedbyCIMinR 3

. Thefollowingformula

illuminateshowtoobtainthese opencones.

Formula 1. PR(p

A

;p

i

;"

i

), i.e., the projection of the open cone OC(p

A

;p

i

;"

i

) on the unit ball

B(p

A

;1),can becalculated by

PR(p

A

;p

i

;"

i )=

DB(q

i

;e

i

); D(p

A

;p

i )>"

i

;

B(p

A

;1); D(p

A

;p

i )"

i

;

whereq

i

=(p

i p

A )=D(p

i

;p

A )+p

A ,e

i

="

i

=D(p

i

;p

A

),andDB(q

i

;e

i

)isa disconB(p

A

;1).

Theintersectioncanberepresentedbyaclosechainofarcsontheballs,denotedbyArcBdened

in Section 2. Gettingtheintersection oftheprojections ofthese opencones issimilar tothecase of

theplanardiscsin R 2

.

Lemma 1. The intersection of two dierent circles CB(q

i

;e

i

) and CB(q

j

;e

j

), which is on the

same ball B(p

A

;r), has no more than two vertices (i.e., the joining points of theclose chain of the

arcs).

Lemma1canbededucedfromthefactsthatthreenonlinearpointsdetermineonecircle,andthat

threedierentpointsonthesamecirclearenonlinear.

Lemma 2.

n

\

i=1 DB(q

i

;e

i

), i.e., the intersection of n discs on a ball, consists of no more than

2(n 1)vertices(i.e.,thejoiningpointsoftheclose chainofthearcs)ifno discislargerthanahalf

ball.

Themethod usedtoproveLemma 3.2in[1]canalsobe usedtoproveLemma 2in thispaper.

Lemma 1 and Lemma2 will be usedto calculate theintersections oftheprojections oftheopen

cones, i.e., B 1

\

i=A+1 PR(p

A

;p

i

;"

i ) and

B 1

\

i=A+1 PR(p

B

;p

i

;"

i

), and illuminatethe time complexity of the

algorithms.

4 Optimization Algorithm

According to Corollary 3, we can nd all edges of G(V;E); and according to Corollary 4, we

can determinewhento stop working onthesuccessive vertices whilecheckingtheerrorcriteria. We

describethealgorithmasfollows. ThedirectionofeachedgeinG(V;E)isfromthevertexwithsmaller

subscript to that with larger subscript, thus[p

i

;p

j

], which is used to indicate theline segment, can

alsobeusedto representthedirectededgewithoutconfusion.

Algorithm. CIMAlgorithmforApproximatingThree-Dimensional PolygonalCurves

Input: ArbitrarypolygonalcurveP=[p1;p2;:::;pn]inR 3

withassociatederrortolerancesf"1;"2;:::;"ng.

Output: ApproximatingcurveP 0

=[p 0

1

;p 0

2

;:::;p 0

m ].

1. fori=1ton 1dofTobuildgraphG(V;E)g

begin

IPR B(p

i

;1);

forj=i+1tonandwhile IPR6=do

begin

ifPP(pi;pj)2IPRthenG G[[pi;pj]

IPR IPR\PR(p

i

;p

j

;"

j )

endfEndofinnerfor-loopg

(5)

2. fori=nto2dofTocheckedgesingraphG(V;E)g

begin

IPR B(p

i

;1);

k minfhj[ph;pi]2Gg;

forj=i 1to1and whileIPR6=do

begin

if[pj;pi]2GandPP(pi;pj)62IPRthenG G [pj;pi];

ifkjthen

break;fJumpoutofinnerfor-loopg

IPR IPR\PR(p

i

;p

j

;"

j )

ifIPR=thenG G f[ph;pi]jh<jg

endfEndofinnerfor-loopg

endfEndofouterfor-loopg

3. Outputtheshortestpathfromp

1 top

n

accordingtoG(V;E),usingforwarddynamicprogramming.

EndofCIMAlgorithm

SinceIPRconsistsofatmostO(n)discsaccordingtoLemma2,testingPP(p

i

;p

j

)2IPRrequires

O(n)time,andobtainingIPR\PR(p

i

;p

j

;"

j

)alsorequiresO(n)time. Hence, Step1hasO(n 3

)time

complexity. The edges of G(V;E) are obtained from Step 1, so they can be ordered. Therefore,

determiningmin fhj[p

h

;p

i

]2GgrequiresonlyO(n)time,andobtainingf[p

h

;p

i

]jh<jgrequiresO(n)

time. Hence,Step2hasO(n 3

)timecomplexity. SinceG(V;E)hasO(n 2

)edges,thetimecomplexity

ofStep3is O(n 2

).

In practice, the minimization of the vertices is not always mandatory, especially if it is at the

expense of requiring much more time or space. An approximationalgorithm is givenbelow; it only

requiresO(n 2

)timeandO(n)space.

5 Approximation Algorithm

In order to nd a fast algorithm, we substitute Theorem 2, which species the suÆcient and

necessaryconditions,withTheorem3,which speciesthesuÆcientconditions.

Theorem 3. Let [p

A

;p

B

;p

C

] be asubchain of P. [p

A

;p

B

;p

C

] can be approximated by [p

A

;p

C ] if

PP(p

A

;p

C

)PR(p

A

;p

B

;"

B

)andD 2

(p

A

;p

C )D

2

(p

A

;p

B ) "

2

B .

Firstly,accordingtoTheorem3,wecan omitStep2oftheCIMalgorithmin Section4. Secondly,

wedonotneedto searchforeveryapproximatingline segment. Therefore,thegraph G(V;E)is not

neededintheapproximationalgorithm. Theapproximationalgorithmisdescribed asfollows.

Algorithm. ApproximationAlgorithm

Input: ArbitrarypolygonalcurveP=[p

1

;p

2

;:::;p

n ]inR

3

withassociatederrortolerancesf"

1

;"

2

;:::;"

n g.

Output: ApproximatingcurveP 0

=[p 0

1

;p 0

2

;:::;p 0

m ].

i=1;

outputp1;

whilei<ndo

begin

IPR B(pi;1);

forj=i+1ton 1do

begin

rt=(p

j p

i )(p

j p

i ) "

j

"

j

;

ifj=i+1then

rr=rt;fTosettheinitialvalueofrrg

else

begin

if(p

j p

i )(p

j p

i

)<rr orPP(p

i

;p

j

)62IPR,then begin

outputpj 1;

break;fJumpoutoffor-loopg

(6)

ifrr<rt,thenrr=rt;

endfEndofelseg

IPR IPR\PR(p

i

;p

j

;"

j )

endfEndoffor-loopg

i j 1;

endfEndofwhileloopg

outputpn;

EndofApproximationAlgorithm

TheboundaryofIPRconsistsofO(n)ArcBs,sothetimecomplexityofcalculatingIPR\PR(p

i

;p

j ,

"

j

)isO(n). Althoughtheapproximationalgorithmhastwonestedloops,itstimecomplexityisO(n 2

).

BecauseIPRrequiresO(n)space, thespacecomplexityofthealgorithmisO(n).

6 Examples

First, we use the points evenly distributed on some Bezier curves as examples, and the results

can be checked by readers. The rst Bezier curve has eight control points, (0;0;0), (40;240;50),

(100;300;100),(120;40;0),(160;100;0),(220;30;0),(240;300;300)and(300;250;250),andisdenoted

byC1. Thesecondonehasvecontrolpoints,(0;0;350),(100;400;50),(200;350;0),(300;0;400)and

(400;300;100), and is denoted by C2. The third one has nine control points, (0;0;0), (200;0;0),

(400;0;0), (400;200;100), (400;400;200), (200;400;200), (0;400;200), (0;200;100) and (0;0;0), and

is denoted byC3,which cannot be approximatedbythe algorithmof Euand Toussaint. The num-

ber of sampled pointsis denoted by M. All of the associated error tolerances havethe same value,

although theymightbe dierent. Wehaveimplemented fouralgorithms: thebruteforce algorithm,

the algorithm of Eu and Toussaint, the optimization algorithm using CIM and the approximation

algorithmusingCIM.AllthesealgorithmsareimplementedwithVisualC++5.0under Windows98

Table1. TheEÆciencyoftheOptimization

AlgorithmUsingCIM

Curve M "i Result(vertices) Time(ms)

C1 21 10 7 9

C1 101 1 20 130

C1 101 1e 1 78 25

C1 301 1e 2 240 70

C1 10011e 3 772 255

C1 50011e 4 2089 2620

C2 21 10 7 8

C2 101 1 20 125

C2 151 1e 1 68 69

C2 401 1e 2 245 145

C2 10011e 3 777 265

C2 50011e 4 2071 2570

Table2. TheEÆciencyofthe

BruteForceAlgorithm

Curve M "

I

Result(vertices) Time(ms)

C1 21 10 7 2

C1 101 1 20 70

C1 101 1e 1 78 45

C1 301 1e 2 240 385

C1 10011e 3 772 4191

C1 50011e 4 2089 105030

C2 21 10 7 3

C2 101 1 20 70

C2 151 1e 1 68 105

C2 401 1e 2 245 688

C2 10011e 3 777 4089

C2 50011e 4 2071 104980

Table3. TheEÆciencyoftheAlgorithm

ofEuandToussaint

Curve M "

i

Result(vertices) Time(ms)

C1 21 10 10 5

C1 101 1 27 80

C1 101 1e 1 88 15

C1 301 1e 2 267 40

C1 10011e 3 872 151

C1 50011e 4 3030 1525

C2 21 10 10 5

C2 101 1 27 80

C2 151 1e 1 107 45

C2 401 1e 2 322 80

C2 10011e 3 882 155

Table4. TheEÆciencyoftheApproximation

AlgorithmUsingCIM

Curve M "

i

Result(vertices) Time(ms)

C1 21 10 7 0

C1 101 1 20 10

C1 101 1e 1 78 5

C1 301 1e 2 240 15

C1 10011e 3 772 60

C1 5001 1e 4 2089 370

C2 21 10 7 0

C2 101 1 20 10

C2 151 1e 1 68 10

C2 401 1e 2 245 28

C2 1001 1e 3 777 60

(7)

Fig.1. ApproximateC1(M =101;"

i

=10). (a)ResultoftheoptimizationalgorithmusingCIMorthebruteforce

algorithm(5segments). (b)ResultofthealgorithmofEuandToussaint(7segments). (c)Resultoftheapproximation

algorithmusingCIM(6segments).

Fig.2. ApproximateC2 (M =21;"

i

=10). (a)Resultoftheoptimizationalgorithmusing CIMorthebruteforce

algorithm(6segments). (b)ResultofthealgorithmofEuandToussaint(9segments). (c)Resultoftheapproximation

algorithmusingCIM(6segments).

on a personal computer with Pentium II 350

CPUchipand64Mmemory(Tables1{4,Figs.1{

3). Theresults ofthebruteforcealgorithm and

the optimization algorithm using CIM are the

same, butwithdierenteÆciency.

Anotherexampleisfromamilitaryprojectus-

ingtheniteelementanalysisonsomelarge-scale

landingcrafts. Thesampledpointsonthecrafts

arepreprocessedbeforethemodelsofthesecrafts

arereconstructedincomputers. Fig.4showsthe

shape of the boundary curve of the large-scale

landing craft. Table 5 shows the preprocessing

results fortheboundarycurvefrom AtoB.

From theabove tables, wecan nd that the

time required by the brute force algorithm in-

creasessharplywhenthenumberofthesampled

Fig.3. ApproximateC3 (M = 101;"

i

=10). Note that

thiscurvecannotbeapproximatedbythealgorithmofEu

andTousssaint. (a)Resultoftheoptimizationalgorithm

usingCIMorthebruteforcealgorithm(9segments). (b)

ResultoftheapproximationalgorithmusingCIM(9seg-

ments).

Fig.4.Theboundarycurveofalarge-scalelandingcraft.

Table5. ApproximationResultsoftheBoundaryCurve

Optimizationalgorithm Bruteforce Algorithmof Approximationalgorithm

usingCIM algorithm EuandToussaint usingCIM

Result(vertices) 201 201 251 201

Time(ms) 135 300 145 35

(8)

points and the number of the resulting points increase. The results of the algorithm of Eu and

Toussainthavemore pointsthantheotherthree algorithms,sincethediscusedbyEuandToussaint

astheerrortoleranceregionofanyvertexissmallerthantheballusedbytheotherthreealgorithms.

Additionally, C3 cannot be approximated by thealgorithm of Eu and Toussaint. According to the

tablesabove,theresultsoftheapproximationalgorithmareveryclosetotheoptimizationalgorithm,

anditscostismuch lower.

7 Conclusion

Without any additionalconstraint, wepresent thesolution to theLS-WMN problemwith L

2 in

R 3

. If the polygonal curve is used to approximate a G 1

curve, and if the minimization of vertices

is not mandatory, the approximation algorithm may be preferable, for it has much lower cost and

producesonlyafewmorevertices thanthatoftheoptimizationalgorithm.

In thispaper,wehavemadethe CIMfeasiblein R 3

, which meansthat notonlya more eÆcient

algorithm is realized, but also theCIM has been proved to be applicable in both R 2

and R 3

. The

dierencesonlyconsistof:

1. representationsofpoints,vectorsandopencones,

2. methodsofdecidingwhetheravertexliesintheopencone,and

3. methodsofcomputingtheintersectionsoftheopencones(ortheprojectionsoftheopencones).

Thispropertytswellwithobject-orientedsoftware,thusthecodesofCIMcanbesharedinboth

R 2

andR 3

.

Acknowledgements Theauthors thankMr. Zhu Xiang forproviding theoriginal dataof the

last example in thepaper. The authors acknowledgewith thanks thecommentsand suggestions of

thereviewers.

References

[1] David Eu, Godfried T Toussaint. On approximating polygonal curvesin two and three dimensions. CVGIP:

GraphicalModelsandImageProcessing,1994,56: 231{246.

[2] MontanariU.Anoteonminimallengthpolygonalapproximationto adigitizedcontour. Communicationofthe

ACM,1970,13(1): 41{54.

[3] RamerU.Aniterativeprocedureforthepolygonalapproximationofplanarcurves. ComputerGraphicsandImage

Processing,1972,1: 244{256.

[4] WilliamsC M. Note an eÆcient algorithmfor the piecewise linear approximation of planar curves. Computer

GraphicsandImageProcessing,1978,8(2):286{293.

[5] KurozumiY,DavisW.Polygonalapproximationbytheminimaxmethod.ComputerGraphicsandImageProcess-

ing,1982,19(3): 248{264.

[6] KentoMiyaoku, KoichiHarada. Note approximating polygonal curvesintwo and three dimensions. Graphical

ModelsandImageProcessing,1998,60:222{225.

YONG Junhaireceivedhis Ph.D. degree from theDepartment of ComputerScience and Technology,

Tsinghua University, Beijing, P.R. China in 2000. He received the B.S. degree from the Department of

Computer Science and Technology, Tsinghua University, in1996. From Marchto Junein 2000, hewas a

visitingresearcherintheHongKongUniversityofScienceandTechnology. Hisresearchinterestsarecomputer

aideddesign,computergraphicsandstandardizationofproductdata.

HUShiminisanassociateprofessorintheDepartmentofComputerScienceandTechnology,Tsinghua

University,Beijing,P.R.China. HereceivedthePh.D.degreein1996fromZhejiangUniversity,P.R.China,

andnishedpostdoctoralresearchworkin1998atTsinghuaUniversity. Hisresearchinterestsarecomputer

aideddesign,computergraphics,fractalgeometryanditsapplications.

SUN Jiaguangis a professorintheDepartment of ComputerScience andTechnology, TsinghuaUni-

versity,Beijing,P.R.China. Hisresearchinterestsarecomputergraphics,computeraided design,computer

aidedmanufacturing,productdatamanagementandsoftwareengineering.

Références

Documents relatifs

In this paper, we derive error estimates for a finite element based approximation of a semilinear elliptic optimal control problem with control out of a finite-dimensional set

When each threshold is equal to the degree of the vertex, we show that k - Robust Set is fixed-parameter tractable for parameter k and the maxi- mization version is APX-complete..

that the iterations converge to a global minimizer of the Steiner problem; in particular, we can observe the presence of a cycle on the final solution obtained using 100 points,

Diophantine approximation with improvement of the simultaneous control of the error and of the denominator..

However, if the error function (the right-hand side of (1.1)) of the above Diophantine inequalities is replaced by a function decreasing to zero faster than c/n, the sizes of the

Let us recall that, since the pioneering works [12, 18, 19], several parabolic equations have been interpreted as gradient flows for Wasserstein distances, including the

Anisotropic a posteriori error estimation for the mixed discontinuous Galerkin approximation of the Stokes problem... mixed discontinuous Galerkin approximation of the

In fact, it is not difficult to verify that all the estimates given in the previous section for the solutions to the Coulomb problem are still valid for the solution to the