Skip to Main Content
Two error functions used for nonlinear least squares (LS) fitting of spheres to range data from 3-D imaging systems are discussed: the orthogonal error function and the directional error function. Both functions allow unrestricted gradient-based minimization and were tested on more than 40 data sets collected under different experimental conditions (e.g., different sphere diameters, instruments, data density, and data noise). It was found that the orthogonal error function results in two local minima and that the outcome of the optimization depends on the choice of starting point. The centroid of the data points is commonly used as the starting point for the nonlinear LS solution, but the choice of starting point is sensitive to data segmentation and, for some sparse and noisy data sets, can lead to a spurious minimum that does not correspond to the center of a real sphere. The directional error function has only one minimum; therefore, it is not sensitive to the starting point and is more suitable for applications that require fully automated sphere fitting.