Direction-weighted line fitting to edge data

Abstract Straight line fitting to sets of edge pixels is a commonly used technique in computer vision. This note suggests that if the edge pixels are characterized by gradient magnitudes and directions, the fitting process can be refined to give weight to the directions of the edge pixels as well as to their magnitudes. Specifically, we first fit a line L 0 to the set of edge pixels, weighted by their magnitudes. We now weight each edge pixel by the cosine of the angle between its (tangential) direction and that of L 0 , and recompute the fit, obtaining a new line L 1 . This process can be iterated to yield a sequence of fits L 2 , L 3 ,…. When fitting a line to a non-noisy edge that has wiggles, this process converges rapidly and yields a better fit than the original one ( L 0 ). In a noisy image, however, the iteration process is often unstable; thus this method is best used after noise cleaning has been performed on the edge data.