1 / 13

Softwareprojekt über Anwendungen effizienter Algorithmen, WS 2012/2013 Prof . Dr . Günter Rote

Softwareprojekt über Anwendungen effizienter Algorithmen, WS 2012/2013 Prof . Dr . Günter Rote. Kurvenapproximation. Team 3: Stefan Behrendt, Ralf Öchsner, Ying Wei. SWP Anwendungen von Algorithmen Team 3 . Outline. Our task Technique Technologies Flow of process

ash
Download Presentation

Softwareprojekt über Anwendungen effizienter Algorithmen, WS 2012/2013 Prof . Dr . Günter Rote

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Softwareprojekt über Anwendungen effizienter Algorithmen, WS 2012/2013 Prof. Dr. Günter Rote • Kurvenapproximation Team 3: Stefan Behrendt, Ralf Öchsner, Ying Wei SWP Anwendungen von Algorithmen Team 3

  2. Outline • Our task • Technique • Technologies • Flow of process • Preparations for Greedy approach • Greedy approach • Analysis • Demo …. SWP Anwendungen von Algorithmen Team 3

  3. Our task • Approximation of point sequences by spline • Input : The points with an order • A predefined tolerance error • Output : A Curve, which goes through the selected points from original given points and can sufficiently good approximate the original point sequence SWP Anwendungen von Algorithmen Team 3

  4. Technique • Technologies : • C++, Lua, IPE • QT • Cubic Hermite spline, Cubic Bezier spline, Interpolation • Greedy Algorithm SWP Anwendungen von Algorithmen Team 3

  5. Technique • Flow of process 1) Convert given points and computed Tangents to Bezier control points in order to prepare with Greedy 2) Select points & Tangents using Greedy 1) Convert Selected Hermite Points & Tangents to Bezier control points 2) Then draw curve again by Bezier cubic spline Calculate all Tangents of original given Points Add spline into IPE for display SWP Anwendungen von Algorithmen Team 3

  6. Tangents Calculation • i is index of given points (points[i]), n is the size of given points • for(i=0; i <n; i++) • if (i==0) then • else if (i==n-1) then • else • end if • T(n)=n SWP Anwendungen von Algorithmen Team 3

  7. Preparations for Greedy Approach • n=size of given points; T(n)=n • is defined as maximal error from beginning to the current position : • m=size of cPoints; T(n)=n • , , is defined as minimal distance between points[i] and cubic Bezier interpolating points: • , where • : cubic Bezier Curve. T(n)=1 • Let , interpolating could be realized. SWP Anwendungen von Algorithmen Team 3

  8. Greedy Approach • 1). Add points[0] and its tangent into hermitePoint[0] and tangents[0] • 2). for (i=1 to (size of given points -1), i++) • 2.1) Add points[i] and its tangent into hermitePoint[i] and tangents[i] • 2.2) Convert hermite points and tangents to cubic Bezier control points • i=0; • for(j=1 to (size of hermitePoints -1), j++) • i++; SWP Anwendungen von Algorithmen Team 3

  9. Greedy Approach • 2.3) select points and tangents • 2.3.1) • if the error in the position i ≤tolerance error ε , and i isn’t end position • ( errorUntil(i) < maxError && i != (size of points -1) ) • then a.) Adjust the length of tangent • , where • b.) Remove this point from hermitePoints[end]; • Remove its tangents from tangents[end]; SWP Anwendungen von Algorithmen Team 3

  10. Greedy Approach 2.3.2) else if at the end, and the error >maxError (i==(size of points-1) && (errorUntil(i)>Error)) then insert points[i-1] into hermite[end-1]; insert tangent[i-1] into tangents[end-1]; 2.3.3) else (when the error > maxError), insert points[i-1] into hermitePoints[end-1]; insert tangent[i-1] into tangents[end-1]; 3) Convert the selected hermitePoints to cPoints again. Method is the same with 2.2) T(n)=n 4) add bezier spline to IPE SWP Anwendungen von Algorithmen Team 3

  11. Analysis • Runtime: • n is the size of inputs • Tangents Calculation : O(n) • Greedy approach : O(n*n) • Convert selected hermitePoints to cPoints : O(n) • Memory requirements := • In worse case, memory requirements := SWP Anwendungen von Algorithmen Team 3

  12. Demo DEMO… SWP Anwendungen von Algorithmen Team 3

  13. Thanks For Attention! Questions and Suggestions for improvement?  SWP Anwendungen von Algorithmen Team 3

More Related