Curve and Polygon Fitting.

Curve fitting: Given a sequence of `n' points, [<x0,y0>, ..., <xn-1,yn-1>], what is the optimal piece-wise linear curve that can be fitted to the points? We want "optimal" to mean "most probable" given the data, i.e. having the largest posterior probability. We must therefore formulate a model for the data and the noise / measurement inaccuracy in the data.

Polygon Fitting: The sequence of points is considered to be closed, circular, i.e. <xn,yn> = <x0,y0>, and we fit a polygon to them.

L
.
A
l
l
i
s
o
n

The data might, for example, come from digitising the boundary of an object in an image. Error can be introduced by original photography, scanning, identification of the boundary, and sampling of points on the boundary.

Noise or measurement error in the data is assumed to be due to some random process, but it can be modelled. e.g. We might assume that if a point "really" comes from a certain line segment then the error perpendicular to the line is modelled by a normal distribution, say.

Hypothesis complexity should clearly be taken into account because as the number of line segments increases towards n-1 it is possible to fit the data with zero error and, without care, this could lead to over-fitting. Minimum message length (MML) inference takes the hypothesis, H, into account with a two-part message: msgLen(H&D) = msgLen(H) + msgLen(D | H). A complex hypothesis with many segments might fit D very well, i.e. P(D | H) is high and msgLen(D | H) is low, but it must also pay for its own cost, i.e. msgLen(H).

Related problems are:

MML / MDL: Patrick (1979) used Fourier components to describe megalithic stone circles. He used MML to come to the conclusion that they really are rough circles rather than more elaborate geometries that had been proposed, and still are proposed regularly. Georgeff and Wallace (1983, 1984) described a minimum message length criterion for fitting one or more (straight) line segments through a set of data points. Banerjee et al (1996) gave an MDL method for polygon fitting and the Java applet below implements their algorithm. They made the simplifying assumptions that (i) the polygon's vertices (knots) are a subset of the given data points, (ii) the first data point is a vertex, and thereby achieved an O(n2)-time algorithm.

- L. Allison

Notes

(NB. Needs Java on)

Draw shapes in the window (hold the left mouse button down). The faster and slower buttons vary the sampling rate. Closed or open curves can be drawn. The MDL button fits a polygon through the last shape drawn using the MDL fitting method.

NEEDS Sun MicroSystem's JAVA ON!

polygon fitting
precomputed example.
© 1996, 1999

[example].