I have a set of points that represent an approximate shape of a contour. For example, let's say that the contour has a following shape. My points are approximate representations of this shape. Since I can identify the corner point as well as edge point, I am in a situation where I have to find a way to fit these points into the shape:
In case of our shape, I can call two points to represent a valid reference if the line formed by connecting these points align with either the vertical axis or the horizontal axis of the shape. So far I have thought of few ideas to work through it but my solution will be valid only if there is a presence of points that represent the true reference of the shape.
I want to make sure the algorithm work when there is no true reference. Therefore I would like to know the way to parameterize this problem such that
Given a point (b) along with it's neighbors(a and c), find the shift required that can be applied to the points such that it preserves the property of b. i.e, if "b" is a corner, the shift should make "b" a corner. If "b" is edge, the shift should make it an edge

