I want to turn digitized polygons into simpler shapes.
More precisely, given a noisy closed polyline, I want to fit a polygon to it with an imposed number of sides, such as a triangle or quadrilateral, assuming that the data can roughly match. The fitted polygons need not be inscribed and/or circumscribed, an average fit is preferred. The number of polyline vertices will range between a few tenths and a few hundredths, and the polygons can be up to octagons. Robustness if preferred over accuracy. If that helps, the polygons can be assumed convex.
There are a few variants of the problem:
- the number of sides is given, and there are no other constraints;
- the number of sides is given and there are constraints such as right angles or parallel sides;
- the number of sides isn't specified and some optimum should be found.
I am looking for resources on how to address these questions. I know the Douglas-Peucker line simplification process pretty well but I don't think it suffices here (because of the constraints).