The following code presents the implementation of the "Direct Least Square Fitting of Ellipses" (Fitzgibbon et al., 1999) manuscript and the calculation of the minimal distance from a set of arbitrary points to the fitted ellipse.
This implementation was done in the context of the manuscript "Semi-autonomous Prosthesis Control Using Minimal Depth Information and Vibrotactile Feedback" by Miguel Nobre Castro and Strahinja Dosen, which is available on arXiv:2210.00541.
Eigen 3.0.0
PCL 1.11.1*
- Generate a set of elliptically placed and noisy target points.
- Perform ellipse fitting [1] to obtain the respective ellipse parametric equation values.
- Given an arbitrary point P, which shortest distance is to be evaluated, infer the ellipse quadrant it belongs to.
- From that quadrant range, use a golden section line search [2] to find the ellipse point at the minimum distance from P.
Fig. 1: Shortest distances from arbitrary points (white) to an ellipse (yellow) fitted from 6 points (purple).
* Please see the following Point Cloud Library links for more details:
PointCloudLibrary/pcl#5431
PointCloudLibrary/pcl#5430