This is an alternative method for fitting a curve which incrementally simplifies the curve, then re-fits. Generally gives better results, also improves corner detection.