Smoothing Digitized Contours

We give a fast linear-time algorithm for finding a smooth polygonal approximation to a digitized contour such that the digitization of the polygonal contour matches the original input. The polygonal contour has the minimum possible number of inflections and obeys a localized best-fit property. Most of the vertices lie on a grid whose resolution is only twice that of the pixel grid, and the algorithm can be modified to force all vertices to obey this restriction.