I have an image of handwritten Arabic text and I want to get the polygonal approximation of the skeleton. I used the polygonal approximation code from: https://drive.google.com/file/d/0B10RxHxW3I92dG9SU0pNMV84alk/view
The code uses the boundary points (using 'bwboundaries' function) to estimate the polygon. I faced a problem when I firstly extracted the skeleton of the image then applied the polygonal approximation code. The problem is that when applying the 'bwboundaries' function on the skeleton image, some points are repeated so the polygon is not correct because of the repeated points.
How can I get the polygonal approximated skeleton like the last image in the following link? https://www.researchgate.net/figure/14-a-Binary-scanned-image-b-contour-c-skeleton-d-polygonally-approximated_fig1_278699524