Line Simplification Algorithm: Visvalingam vs Douglas-Peucker

I am trying to implement a line simplification algorithm. The main two algorithms that I found are:

I am currently conducting some of their modeling on Matlab to determine which ones are best suited to my needs.

The main goal of the algorithm is to simplicate polygons on the map. My input is a polygon \ polyline and a threshold for mistake- epsilon.

I need the simplified polyangular box to be as close to the original as possible, and I have no requirement for the number of points to save.

I am having difficulty comparing the two algorithms because: epsilon for RDP is the distance, and epsilon for VW is the zone. I need help understanding how to compare two algorithms. What can give me less points to stay within the threshold?

+7
source share
1 answer

  I need the simplified polyangular box to be as close to the original as possible, and I have no requirement for the number of points to save.

The DP method will give you a better perception with fewer points - as its control parameter, that is, the distance tolerance is determined by your requirement "as close as possible".

, angular . , .

, Visvalingam-Whyatt Ramer-Douglas-Peucker , 100x100. 10- .

( , )

Visvalingam-Whyatt: Zach github opencv. VSV simplification - with 0.1 (white), 0.5 (red), 1 (magenta), 2 (cyan) distance tolerances

VSV - 0,55 (), 0,4 (), 0,25 (), 0,15 ()

VSV - t:% . n = t * orig/100. n -

orig 88: [n=47 for t=0.55], [n=34 for t=0.4], [n=20 for t=0.25], [n=12 for t=0.15]
orig 133: [n=72 for t=0.55], [n=52 for t=0.4], [n=32 for t=0.25], [n=18 for t=0.15]
orig 118: [n=63 for t=0.55], [n=46 for t=0.4], [n=28 for t=0.25], [n=16 for t=0.15]
orig 107: [n=57 for t=0.55], [n=41 for t=0.4], [n=25 for t=0.25], [n=15 for t=0.15]
orig 107: [n=57 for t=0.55], [n=41 for t=0.4], [n=25 for t=0.25], [n=15 for t=0.15]
orig 268: [n=146 for t=0.55], [n=106 for t=0.4], [n=65 for t=0.25], [n=39 for t=0.15]
orig 158: [n=85 for t=0.55], [n=62 for t=0.4], [n=38 for t=0.25], [n=22 for t=0.15]
orig 158: [n=85 for t=0.55], [n=62 for t=0.4], [n=38 for t=0.25], [n=22 for t=0.15]
orig 109: [n=58 for t=0.55], [n=42 for t=0.4], [n=26 for t=0.25], [n=15 for t=0.15]
orig 192: [n=104 for t=0.55], [n=75 for t=0.4], [n=46 for t=0.25], [n=27 for t=0.15]
orig 132: [n=71 for t=0.55], [n=51 for t=0.4], [n=31 for t=0.25], [n=18 for t=0.15]
orig 89: [n=47 for t=0.55], [n=34 for t=0.4], [n=21 for t=0.25], [n=12 for t=0.15]
orig 110: [n=59 for t=0.55], [n=42 for t=0.4], [n=26 for t=0.25], [n=15 for t=0.15]
orig 40: [n=20 for t=0.55], [n=14 for t=0.4], [n=8 for t=0.25], [n=4 for t=0.15]


DP openCV polyDP

DP simplification - with 0.1 (white), 0.5 (red), 1 (magenta), 2 (cyan) distance tolerances

- - t: => n -

orig 88: [n=33 for t=0.1], [n=29 for t=0.5], [n=8 for t=1], [n=6 for t=2]
orig 133: [n=57 for t=0.1], [n=45 for t=0.5], [n=12 for t=1], [n=7 for t=2]
orig 118: [n=50 for t=0.1], [n=40 for t=0.5], [n=15 for t=1], [n=8 for t=2]
orig 107: [n=47 for t=0.1], [n=35 for t=0.5], [n=11 for t=1], [n=6 for t=2]
orig 107: [n=30 for t=0.1], [n=24 for t=0.5], [n=8 for t=1], [n=6 for t=2]
orig 268: [n=126 for t=0.1], [n=110 for t=0.5], [n=32 for t=1], [n=23 for t=2]
orig 158: [n=80 for t=0.1], [n=62 for t=0.5], [n=17 for t=1], [n=11 for t=2]
orig 158: [n=66 for t=0.1], [n=52 for t=0.5], [n=16 for t=1], [n=9 for t=2]
orig 109: [n=50 for t=0.1], [n=38 for t=0.5], [n=12 for t=1], [n=9 for t=2]
orig 192: [n=74 for t=0.1], [n=64 for t=0.5], [n=18 for t=1], [n=15 for t=2]
orig 132: [n=58 for t=0.1], [n=45 for t=0.5], [n=14 for t=1], [n=11 for t=2]
orig 89: [n=37 for t=0.1], [n=31 for t=0.5], [n=7 for t=1], [n=6 for t=2]
orig 110: [n=42 for t=0.1], [n=36 for t=0.5], [n=9 for t=1], [n=7 for t=2]
orig 40: [n=18 for t=0.1], [n=15 for t=0.5], [n=9 for t=1], [n=3 for t=2]


:

  • .
  • VSV ( )
  • VSV .
  • VSV - .
  • DP , "".
  • DP ,
  • DP , .

, VWV , DP.

, openCVs DP .

VSV Zach, , .

[1] . DP .

enter image description here

+8

Source: https://habr.com/ru/post/1627949/


All Articles