140 likes | 148 Views
A detailed study on an efficient multi-resolution polygonal approximation algorithm for minimizing segment numbers and controlling deviation within error tolerances. The algorithm is based on a heuristic split method and a weighted shortest path approach in a feasibility graph. The algorithm's complexity is O(RN3). Test results on shape "Britain" with N=10,109 show promising efficiency.
E N D
Alexander Kolesnikov and Pasi Fränti DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF JOENSUU JOENSUU, FINLAND Optimal multiresolution polygonal approximation
Min-# polygonal approximation =0.1 Input curve P Approximation curve Q N=11,000 vertices M=117 vertices
Multi-resolution approximation 3=0.005 2=0.02 1=0.1 Input curve P Q1 Q2 Q3 N M1 M2 M3 1 > 2 > 3 M1 < M2 < M3 < N
Multiresolution: The main principle Vertices of approximation curve Qrfor coarse resolution level rare subset of vertices of curveQr+1for the fine resolution level (r+1): Qr Qr+1 Qr+1 Qr r r+1
Problem formulation Find such Rmultiresolution polygonal curvesQ1,Q2,…,QR so the total number of segments M is minimal, and maximum deviationfor the curves is less than the given error tolerancies r: subject toD(Qr) r , r=1, 2, …, R, here approximation error D(Qr) is maximal deviation of vertices of input curve P from the approximation lines of curve Qr
Heuristic split algorithm(Ramer-Douglas-Peucker) DO Add approximation node to curveQr-1 to split the segment with maximum deviation UNTIL D(Qr)<r,.
Single-resolution min-# algorithm 1. Construct feasibility graphs G=G()on vertices of input curve P for the given tolerance . Edge e(i,j)G() if deviation d(i,j) < . 2. Find the shortest path in the graph G(): M min. • • • • • • • • • • GraphG() Shortest path • •
Proposed algorithm 1. Construct R feasibility graphs G1, G2, …, GR for the given error tolerances 1, 2, ..., R. 2. Find the weighted shortest path in the graph G1. • Weight w(i,j) of edge e(i,j) in graph G1: w(i,j) =1+weight of the Shortest Path in sub-graph H2(i,j)G2embeddedinto the edge e(i,j). • Weights of the edges of sub-graphs H2(i,j) are defind in analogous way.
Embedded sub-graph • Edge e(i,j)}G1defines embedded subgraph H2(i,j) of the graph G2 e(i,j)G1 i j H(i,j,2)G2 i j
Example of weight calculation e(i,j) G1 H2(i,j)G2 H3(i,k1)G3 H2(k2,j)G3 k2 j k1 i 1 > 2 > 3 w(i,j)=1+[(1+2)+(1+3)+(1+3)]
Pseudo-code of recursive algorithm • (M) = MR_min_num( r, n1, n2 : integer) • FOR n = n1 TO n2 DO • C(n) • FOR j = n-i TO n1 DO • IF e(j,n) G(P,r) THEN • IF r = R THEN • Weight1; • ELSE • Weight1+ MR_min_num( r+1, j, n); • ENDIF • IF C(j) + Weight < C(n) THEN • C(n)C(j) + Weight; • A(n)j; • ENDIF • ENDIF • ENDFOR • ENDFOR • MC(n2) • RETURN M
Sequential algorithm • All shortest paths in all graphs are calculated from • high resolution level to low one (bottom-up) • Then the final solution is constructed (top-down). • Complexity of the algorithm: O(RN3)
Efficiency G=100*Mopt/M % Test shape ”Britain”, N=10,109 Error tolerances: =0.1, 0.05, 0.02, 0.01, 0.005, 0.002. R=6 R=6
Conclusions • Optimal algorithm for multiresolution min-# problem is introduced • The algorithm is based on weighted shortestpath algorithm in graph • Time complexity of the algorithm is O(RN3).