This is a demo of the Ramer-Douglas-Peucker algorithm.
RDP_GUI.m Draw lines on the first figure with your mouse, then a simplified curve will be plotted in the second figure.
DouglasPeucker.m Reduce density of points in vector data using the Ramer-Douglas-Peucker algorithm.
Ligong Han (2020). Ramer-Douglas-Peucker algorithm demo (https://www.mathworks.com/matlabcentral/fileexchange/41986-ramer-douglas-peucker-algorithm-demo), MATLAB Central File Exchange. Retrieved .
thanks for the code. It's useful to my research.
Thanks for your comment. The current version does not include the 'line break' feature. I think for practical purpose, such consideration is very useful, but for demonstration purpose, rather, you can see how would the RDP algorithm behave under this circumstance.
Does this code include 'line break' i.e breaking a line when the distance between two points is greater than a certain threshold ?
Cool! Very nice interactive visualization of the algorithm. Thanks for this!
- added instructions