Given a chain of
2d points \left\{ p_i \right\} = \left\{ \begin{bmatrix} x_i \\ y_i \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. Alternatively, the equivalent formula below can be used : A_i = \frac{1}{2} \left| x_{i-1} y_{i} + x_i y_{i+1} + x_{i+1} y_{i-1} - x_{i-1} y_{i+1} - x_i y_{i-1} - x_{i+1} y_i \right| The minimum importance point p_i is located and marked for removal (note that A_{i-1} and A_{i+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 • The algorithm is easy to understand and explain, but is often competitive with much more complex approaches. • With the use of a
priority queue, the algorithm is performant on large inputs, since the importance of each point can be computed using only its neighbors, and removing a point only requires recomputing the importance of two other points. • It is simple to generalize to higher dimensions, since the area of the triangle between points has a consistent meaning.
Disadvantages • The algorithm does not differentiate between sharp spikes and shallow features, meaning that it will clean up sharp spikes that may be important. • The algorithm simplifies the entire length of the curve evenly, meaning that curves with high and low detail areas will likely have their fine details eroded. == See also ==