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).

It is possible that noisy lines change n-polygon.It is necessarily that given a value k, my solution is $$ax+b≦f(x) ≦ax+d$$and$$d-b≦k. $$
then choose $f(x)=ax+(b+d)/2$.
$g(x),h(x),・・・$
Surround shape with$ f(x),g(x),・・・$are simplified shape.
expression of edge detection is
$f(x)=(I_r-I_l)/2(erf(x/√2σ)+1))+I_l$
https://en.wikipedia.org/wiki/Edge_detection
Is vector graphics what you find? https://en.wikipedia.org/wiki/Vector_graphics or http://www.graphicmania.net/how-to-simplify-complex-paths-in-illustrator-cs5/