Visvalingam–Whyatt algorithm explained

The Visvalingam–Whyatt algorithm, or simply the Visvalingam algorithm, is an algorithm that decimates a curve composed of line segments to a similar curve with fewer points, primarily for usage in cartographic generalisation.

Idea

Given a polygonal chain (often called a polyline), the algorithm attempts to find a similar chain composed of fewer points.

Points are assigned an importance based on local conditions, and points are removed from the least important to most important.

In Visvalingam's algorithm, the importance is related to the triangular area added by each point.

Algorithm

Given a chain of 2d points

\left\{pi\right\}=\left\{\begin{bmatrix}xi\yi\end{bmatrix}\right\}

, the importance of each interior point is computed by finding the area of the triangle formed by it and its immediate neighbors. This can be done quickly using a matrix determinant.[1] Alternatively, the equivalent formula below can be used[2]

Ai=

1
2

\left|xi-1yi+xiyi+1+xi+1yi-1-xi-1yi+1-xiyi-1-xi+1yi\right|

The minimum importance point

pi

is located and marked for removal (note that

Ai-1

and

Ai+1

will need to be recomputed). This process is repeated until either the desired number of points is reached, or the contribution of the least important point is large enough to not neglect.

Advantages

Disadvantages

See also

Alternative algorithms for line simplification include:

References

Notes
  • Bibliography
  • External links

    Notes and References

    1. Web site: 6.5 – Applications of Matrices and Determinants. 2020-07-07. people.richland.edu.
    2. Web site: Untitled Document. 2020-07-07. people.richland.edu.