How can I identify and remove those four RED points drawn in image
Those four points make that polygon a concave polygon that’s why I want to remove it.
My goal is to convert concave polygon to convex by removing this kind of point by identifying and removing those points.
Is there any way to identify and remove these kind of points?
Use a convex hull algorithm (such as the Graham scan), and remove all points that are not part of the resulting convex hull.
In your example, the convex hull will consist of P1, P2, P3, P5, P7, P8, P9, P11, P12, P13, P14, P15, P16, P18, which are precisely all points except the red ones.
Note that simply removing those points whose inner angle is greater than 180 will not necessarily result in a convex polygon. Take this polygon for example:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With