I have some contours for example the three colored shapes in this image.
I would like to approximate the boundary of each with a polygon WITH the constraint that the interior angles of the polygon are some fixed values. So the angle should snap to say {45 or 90} degrees and also ensure no edge is less that a certain number of pixels .e.g 50 - so there aren't many tiny edges. So the result for the green contour would be:
Is this possible in OpenCV?

