fit_ellipse_contour_xldfit_ellipse_contour_xldFitEllipseContourXldFitEllipseContourXldfit_ellipse_contour_xld — Approximate XLD contours by ellipses or elliptic arcs.
This approach minimizes the algebraic distance
between the contour points and the resulting
ellipse. The constraint guarantees that the
resulting polynomial characterizes an ellipse (instead of a hyperbola or a
parabola).
'fhuber'"fhuber""fhuber""fhuber""fhuber"
Similar to 'fitzgibbon'"fitzgibbon""fitzgibbon""fitzgibbon""fitzgibbon". Here the contour points are weighted
to decrease the impact of outliers based on
the approach of Huber (see below).
'ftukey'"ftukey""ftukey""ftukey""ftukey"
Similar to 'fitzgibbon'"fitzgibbon""fitzgibbon""fitzgibbon""fitzgibbon". Here the contour points are weighted
and outliers are ignored based on
the approach of Tukey (see below).
This approach minimizes the geometric distance
between the contour points and the resulting ellipse.
The distance measure is statistically optimal, but takes more
computational time, because the computation is an iterative process.
This option is recommended if the contour
points are considerably distorted by noise.
Similar to 'geometric'"geometric""geometric""geometric""geometric". Here the contour points are weighted
to decrease the impact of outliers based on
the approach of Huber (see below).
Similar to 'geometric'"geometric""geometric""geometric""geometric". Here the contour points are weighted
and outliers are ignored based on
the approach of Tukey (see below).
'voss'"voss""voss""voss""voss"
Each input contour is transformed in an affine standard position.
Based on the moments of the transformed contour (that is of the
enclosed image region) the standard circular segment is chosen
whose standard position matches best with the standard position
of the contour. The ellipse corresponding to the standard
position of the selected circular segment is re-transformed
based on the affine transformation which produced the standard position
of the contour resulting in the ellipse matching the original contour.
VossTabSizeVossTabSizeVossTabSizevossTabSizevoss_tab_size standard circular segments are used for
this computation. To speed up the process the corresponding moments
and other data is stored in a table which is created during the
first call (with a specific value for VossTabSizeVossTabSizeVossTabSizevossTabSizevoss_tab_size) to
fit_ellipse_contour_xldfit_ellipse_contour_xldFitEllipseContourXldFitEllipseContourXldfit_ellipse_contour_xld.
Each point P on an ellipse satisfies the constraint that the sum
of distances to the focal points equals twice the
length of the larger half axis a. In this approach, the deviation
is minimized for all contour
points by a least squares optimization.
'fphuber'"fphuber""fphuber""fphuber""fphuber"
Similar to 'focpoints'"focpoints""focpoints""focpoints""focpoints". Here a weighted least squares
optimization is done to decrease the impact of outliers based on
the approach of Huber (see below).
'fptukey'"fptukey""fptukey""fptukey""fptukey"
Similar to 'focpoints'"focpoints""focpoints""focpoints""focpoints". Here a weighted least squares
optimization is done and outliers are ignored based on
the approach of Tukey (see below).
For '*huber' and '*tukey' a robust error statistics is used
to estimate the standard deviation of the distances from the contour points
without outliers from the approximating ellipse. The parameter
ClippingFactorClippingFactorClippingFactorclippingFactorclipping_factor (a scaling factor for the standard deviation)
controls the amount of outliers: the smaller the value chosen for
ClippingFactorClippingFactorClippingFactorclippingFactorclipping_factor the more points are classified as outliers.
Every contour point is individually weighted and contributes according to
its weight in the fitting process. The bundle of robust weighting and
fitting can be iterated. The overall number of iterations is
given by IterationsIterationsIterationsiterationsiterations. This parameter is of relevance for all
algorithms except the two based on the geometric distance,
i.e., 'geohuber'"geohuber""geohuber""geohuber""geohuber" and 'geotukey'"geotukey""geotukey""geotukey""geotukey", where this parameter
is ignored. If the algorithm does
not find a fitting ellipse within this number of iterations, it fits a line;
in this case Radius2Radius2Radius2radius2radius_2 is zero.
In the Tukey algorithm outliers are removed, whereas in the Huber algorithm
outliers are only damped, or more precisely they are weighted linearly.
Without any robust weighting the squares of the distances are taken as
error values in the optimization, i.e., a least square formulation.
In practice, the approach of Tukey is recommended.
The minimum necessary number of contour points for fitting an ellipse
is five.
Therefore, it is required that the number of contour points is at least
.
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
fit_ellipse_contour_xldfit_ellipse_contour_xldFitEllipseContourXldFitEllipseContourXldfit_ellipse_contour_xld returns 2 (
H_MSG_TRUE)
if all parameter values
are correct, and ellipses could be fitted to the input contours.
If the input is empty the behavior can be set via
set_system('no_object_result',<Result>).
If necessary, an exception is raised.
If the parameter ClippingFactorClippingFactorClippingFactorclippingFactorclipping_factor is chosen too small, i.e.,
all points are classified as outliers, the error 3264 is raised.