fit_ellipse_contour_xld fit_ellipse_contour_xld FitEllipseContourXld FitEllipseContourXld fit_ellipse_contour_xld  (Operator) 
Name 
fit_ellipse_contour_xld fit_ellipse_contour_xld FitEllipseContourXld FitEllipseContourXld fit_ellipse_contour_xld 
Signature 
fit_ellipse_contour_xld (Contours Algorithm MaxNumPoints MaxClosureDist ClippingEndPoints VossTabSize Iterations ClippingFactor Row Column Phi Radius1 Radius2 StartPhi EndPhi PointOrder 
 
Herror fit_ellipse_contour_xld (const Hobject Contours Algorithm MaxNumPoints MaxClosureDist ClippingEndPoints VossTabSize Iterations ClippingFactor Row Column Phi Radius1 Radius2 StartPhi EndPhi PointOrder 
Herror T_fit_ellipse_contour_xld (const Hobject Contours Algorithm MaxNumPoints MaxClosureDist ClippingEndPoints VossTabSize Iterations ClippingFactor Row Column Phi Radius1 Radius2 StartPhi EndPhi PointOrder 
 
void FitEllipseContourXld (const HObject& Contours Algorithm MaxNumPoints MaxClosureDist ClippingEndPoints VossTabSize Iterations ClippingFactor Row Column Phi Radius1 Radius2 StartPhi EndPhi PointOrder 
void HXLDCont ::FitEllipseContourXld (const HString& Algorithm MaxNumPoints MaxClosureDist ClippingEndPoints VossTabSize Iterations ClippingFactor Row Column Phi Radius1 Radius2 StartPhi EndPhi PointOrder 
void HXLDCont ::FitEllipseContourXld (const HString& Algorithm MaxNumPoints MaxClosureDist ClippingEndPoints VossTabSize Iterations ClippingFactor Row Column Phi Radius1 Radius2 StartPhi EndPhi PointOrder 
void HXLDCont ::FitEllipseContourXld (const char* Algorithm MaxNumPoints MaxClosureDist ClippingEndPoints VossTabSize Iterations ClippingFactor Row Column Phi Radius1 Radius2 StartPhi EndPhi PointOrder 
void HXLDCont ::FitEllipseContourXld (const wchar_t* Algorithm MaxNumPoints MaxClosureDist ClippingEndPoints VossTabSize Iterations ClippingFactor Row Column Phi Radius1 Radius2 StartPhi EndPhi PointOrder 
            (Windows only)
           
 
static void HOperatorSet .FitEllipseContourXld (HObject  contours HTuple  algorithm HTuple  maxNumPoints HTuple  maxClosureDist HTuple  clippingEndPoints HTuple  vossTabSize HTuple  iterations HTuple  clippingFactor HTuple  row HTuple  column HTuple  phi HTuple  radius1 HTuple  radius2 HTuple  startPhi HTuple  endPhi HTuple  pointOrder 
void HXLDCont .FitEllipseContourXld (string algorithm maxNumPoints maxClosureDist clippingEndPoints vossTabSize iterations clippingFactor HTuple  row HTuple  column HTuple  phi HTuple  radius1 HTuple  radius2 HTuple  startPhi HTuple  endPhi HTuple  pointOrder 
void HXLDCont .FitEllipseContourXld (string algorithm maxNumPoints maxClosureDist clippingEndPoints vossTabSize iterations clippingFactor row column phi radius1 radius2 startPhi endPhi pointOrder 
 
def fit_ellipse_contour_xld (contours algorithm max_num_points max_closure_dist clipping_end_points voss_tab_size iterations clipping_factor 
def fit_ellipse_contour_xld_s (contours algorithm max_num_points max_closure_dist clipping_end_points voss_tab_size iterations clipping_factor 
 
Description 
fit_ellipse_contour_xld fit_ellipse_contour_xld FitEllipseContourXld FitEllipseContourXld FitEllipseContourXld fit_ellipse_contour_xld Contours Contours Contours Contours contours contours Row Row Row Row row row Column Column Column Column column column Phi Phi Phi Phi phi phi Radius1 Radius1 Radius1 Radius1 radius1 radius_1 Radius2 Radius2 Radius2 Radius2 radius2 radius_2 StartPhi StartPhi StartPhi StartPhi startPhi start_phi EndPhi EndPhi EndPhi EndPhi endPhi end_phi PointOrder PointOrder PointOrder PointOrder pointOrder point_order 
  
    
       
    
       
   
  
     
  
     
 Algorithm Algorithm Algorithm Algorithm algorithm algorithm 
'fitzgibbon' "fitzgibbon" "fitzgibbon" "fitzgibbon" "fitzgibbon" "fitzgibbon" 
This approach minimizes the algebraic distance
  
    
       
    
       
    
       
    
       
    
       
    
       
    
       
    
       
    
       
    
       
    
       
   
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
 
  
    
       
    
       
    
       
    
       
    
       
    
       
   
  
     
  
     
  
     
  
     
  
     
  
     
  
     
 
  
    
       
    
       
    
       
    
       
    
       
    
       
    
       
    
       
   
  
     
  
     
  
     
  
     
  
     
  
     
  
     
 
 
'fhuber' "fhuber" "fhuber" "fhuber" "fhuber" "fhuber" 
Similar to 'fitzgibbon' "fitzgibbon" "fitzgibbon" "fitzgibbon" "fitzgibbon" "fitzgibbon" 
 
'ftukey' "ftukey" "ftukey" "ftukey" "ftukey" "ftukey" 
Similar to 'fitzgibbon' "fitzgibbon" "fitzgibbon" "fitzgibbon" "fitzgibbon" "fitzgibbon" 
 
'geometric' "geometric" "geometric" "geometric" "geometric" "geometric" 
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.
 
'geohuber' "geohuber" "geohuber" "geohuber" "geohuber" "geohuber" 
Similar to 'geometric' "geometric" "geometric" "geometric" "geometric" "geometric" 
 
'geotukey' "geotukey" "geotukey" "geotukey" "geotukey" "geotukey" 
Similar to 'geometric' "geometric" "geometric" "geometric" "geometric" "geometric" 
 
'voss' "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.
VossTabSize VossTabSize VossTabSize VossTabSize vossTabSize voss_tab_size VossTabSize VossTabSize VossTabSize VossTabSize vossTabSize voss_tab_size fit_ellipse_contour_xld fit_ellipse_contour_xld FitEllipseContourXld FitEllipseContourXld FitEllipseContourXld fit_ellipse_contour_xld 
 
'focpoints' "focpoints" "focpoints" "focpoints" "focpoints" "focpoints" 
Each point P on an ellipse satisfies the constraint that the sum
of distances to the focal points 
  
    
       
    
       
    
       
    
       
   
  
     
  
     
  
     
  
     
  
     
 
  
    
       
    
       
    
       
    
       
    
       
    
       
    
       
    
       
   
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
  
     
 
 
'fphuber' "fphuber" "fphuber" "fphuber" "fphuber" "fphuber" 
Similar to 'focpoints' "focpoints" "focpoints" "focpoints" "focpoints" "focpoints" 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" "fptukey" 
Similar to 'focpoints' "focpoints" "focpoints" "focpoints" "focpoints" "focpoints" 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
ClippingFactor ClippingFactor ClippingFactor ClippingFactor clippingFactor clipping_factor ClippingFactor ClippingFactor ClippingFactor ClippingFactor clippingFactor clipping_factor Iterations Iterations Iterations Iterations iterations iterations 'geohuber' "geohuber" "geohuber" "geohuber" "geohuber" "geohuber" 'geotukey' "geotukey" "geotukey" "geotukey" "geotukey" "geotukey" Radius2 Radius2 Radius2 Radius2 radius2 radius_2 
To reduce the computational load, the fitting of ellipses can be
restricted to a subset of the contour points: If a value other than
-1  is assigned to MaxNumPoints MaxNumPoints MaxNumPoints MaxNumPoints maxNumPoints max_num_points MaxNumPoints MaxNumPoints MaxNumPoints MaxNumPoints maxNumPoints max_num_points 
For elliptic arcs, the points on the ellipse closest to the
start points and end points of the original contours are chosen
as start and end points. The corresponding angles referring to the
main axis of the ellipse are returned in StartPhi StartPhi StartPhi StartPhi startPhi start_phi EndPhi EndPhi EndPhi EndPhi endPhi end_phi gen_ellipse_contour_xld gen_ellipse_contour_xld GenEllipseContourXld GenEllipseContourXld GenEllipseContourXld gen_ellipse_contour_xld MaxClosureDist MaxClosureDist MaxClosureDist MaxClosureDist maxClosureDist max_closure_dist 'focpoints' "focpoints" "focpoints" "focpoints" "focpoints" "focpoints" Iterations Iterations Iterations Iterations iterations iterations ClippingEndPoints ClippingEndPoints ClippingEndPoints ClippingEndPoints clippingEndPoints clipping_end_points StartPhi StartPhi StartPhi StartPhi startPhi start_phi EndPhi EndPhi EndPhi EndPhi endPhi end_phi 
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). 
  Processed without parallelization. 
 
Parameters 
  
Contours Contours Contours Contours contours contours xld_cont(-array) → object HXLDCont HObject HXLDCont Hobject  
 
Input contours.
 
  
Algorithm Algorithm Algorithm Algorithm algorithm algorithm string → HTuple str HTuple Htuple  (string)  (string )  (HString )  (char* )  
 
Algorithm for the fitting of ellipses.
Default value:  
    'fitzgibbon' 
    "fitzgibbon" 
    "fitzgibbon" 
    "fitzgibbon" 
    "fitzgibbon" 
    "fitzgibbon" 
List of values:  'fhuber' "fhuber" "fhuber" "fhuber" "fhuber" "fhuber" , 'fitzgibbon' "fitzgibbon" "fitzgibbon" "fitzgibbon" "fitzgibbon" "fitzgibbon" , 'focpoints' "focpoints" "focpoints" "focpoints" "focpoints" "focpoints" , 'fphuber' "fphuber" "fphuber" "fphuber" "fphuber" "fphuber" , 'fptukey' "fptukey" "fptukey" "fptukey" "fptukey" "fptukey" , 'ftukey' "ftukey" "ftukey" "ftukey" "ftukey" "ftukey" , 'geohuber' "geohuber" "geohuber" "geohuber" "geohuber" "geohuber" , 'geometric' "geometric" "geometric" "geometric" "geometric" "geometric" , 'geotukey' "geotukey" "geotukey" "geotukey" "geotukey" "geotukey" , 'voss' "voss" "voss" "voss" "voss" "voss" 
 
  
MaxNumPoints MaxNumPoints MaxNumPoints MaxNumPoints maxNumPoints max_num_points integer → HTuple int HTuple Htuple  (integer)  (int  /  long)  (Hlong )  (Hlong )  
 
Maximum number of contour points used for the
computation (-1 for all points).
Default value:  -1
Restriction:  MaxNumPoints >= 5
 
  
MaxClosureDist MaxClosureDist MaxClosureDist MaxClosureDist maxClosureDist max_closure_dist real → HTuple float HTuple Htuple  (real)  (double )  (double )  (double )  
 
Maximum distance between the end points of a
contour to be considered as 'closed'.
Default value:  0.0
Restriction:  MaxClosureDist >= 0.0
 
  
ClippingEndPoints ClippingEndPoints ClippingEndPoints ClippingEndPoints clippingEndPoints clipping_end_points integer → HTuple int HTuple Htuple  (integer)  (int  /  long)  (Hlong )  (Hlong )  
 
Number of points at the beginning and at the end of the
contours to be ignored for the fitting.
Default value:  0
Restriction:  ClippingEndPoints >= 0
 
  
VossTabSize VossTabSize VossTabSize VossTabSize vossTabSize voss_tab_size integer → HTuple int HTuple Htuple  (integer)  (int  /  long)  (Hlong )  (Hlong )  
 
Number of circular segments used for the Voss approach.
Default value:  200
Restriction:  VossTabSize >= 25 && VossTabSize <= 5000
 
  
Iterations Iterations Iterations Iterations iterations iterations integer → HTuple int HTuple Htuple  (integer)  (int  /  long)  (Hlong )  (Hlong )  
 
Maximum number of iterations for the robust weighted
fitting.
Default value:  3
Restriction:  Iterations >= 0
 
  
ClippingFactor ClippingFactor ClippingFactor ClippingFactor clippingFactor clipping_factor real → HTuple float HTuple Htuple  (real)  (double )  (double )  (double )  
 
Clipping factor for the elimination of outliers
(typical: 1.0 for '*huber' and 2.0 for '*tukey').
Default value:  2.0
Suggested values:  1.0, 1.5, 2.0, 2.5, 3.0
Restriction:  ClippingFactor > 0
 
  
Row Row Row Row row row ellipse.center.y(-array) → HTuple Sequence[float] HTuple Htuple  (real)  (double )  (double )  (double )  
 
Row coordinate of the center of the ellipse.
 
  
Column Column Column Column column column ellipse.center.x(-array) → HTuple Sequence[float] HTuple Htuple  (real)  (double )  (double )  (double )  
 
Column coordinate of the center of the ellipse.
 
  
Phi Phi Phi Phi phi phi ellipse.angle.rad(-array) → HTuple Sequence[float] HTuple Htuple  (real)  (double )  (double )  (double )  
 
Orientation of the main axis [rad].
 
  
Radius1 Radius1 Radius1 Radius1 radius1 radius_1 ellipse.radius1(-array) → HTuple Sequence[float] HTuple Htuple  (real)  (double )  (double )  (double )  
 
Length of the larger half axis.
 
  
Radius2 Radius2 Radius2 Radius2 radius2 radius_2 ellipse.radius2(-array) → HTuple Sequence[float] HTuple Htuple  (real)  (double )  (double )  (double )  
 
Length of the smaller half axis.
 
  
StartPhi StartPhi StartPhi StartPhi startPhi start_phi angle.rad(-array) → HTuple Sequence[float] HTuple Htuple  (real)  (double )  (double )  (double )  
 
Angle of the start point [rad].
 
  
EndPhi EndPhi EndPhi EndPhi endPhi end_phi angle.rad(-array) → HTuple Sequence[float] HTuple Htuple  (real)  (double )  (double )  (double )  
 
Angle of the end point [rad].
 
  
PointOrder PointOrder PointOrder PointOrder pointOrder point_order string(-array) → HTuple Sequence[str] HTuple Htuple  (string)  (string )  (HString )  (char* )  
 
point order along the boundary.
List of values:  'negative' "negative" "negative" "negative" "negative" "negative" , 'positive' "positive" "positive" "positive" "positive" "positive" 
 
Example (HDevelop) 
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_800mm.descr', 3, 112, 5)
reduce_domain (Image, CalPlate, ImageReduced)
edges_sub_pix (ImageReduced, Edges, 'lanser2', 0.5, 20, 40)
select_contours_xld (Edges, EdgesClosed, 'closed', 0, 2.0, 0, 0)
select_contours_xld (EdgesClosed, EdgesMarks, 'length', 20, 80, 0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
                         Row, Column, Phi, Radius1, Radius2, StartPhi, \
                         EndPhi, PointOrder)
gen_ellipse_contour_xld (EllMarks, Row, Column, Phi, Radius1, Radius2, \
                         StartPhi, EndPhi, PointOrder, 1.5)
length_xld(EllMarks,Length)
 
 
Example (HDevelop) 
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_800mm.descr', 3, 112, 5)
reduce_domain (Image, CalPlate, ImageReduced)
edges_sub_pix (ImageReduced, Edges, 'lanser2', 0.5, 20, 40)
select_contours_xld (Edges, EdgesClosed, 'closed', 0, 2.0, 0, 0)
select_contours_xld (EdgesClosed, EdgesMarks, 'length', 20, 80, 0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
                         Row, Column, Phi, Radius1, Radius2, StartPhi, \
                         EndPhi, PointOrder)
gen_ellipse_contour_xld (EllMarks, Row, Column, Phi, Radius1, Radius2, \
                         StartPhi, EndPhi, PointOrder, 1.5)
length_xld(EllMarks,Length)
 
 
Example (HDevelop) 
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_800mm.descr', 3, 112, 5)
reduce_domain (Image, CalPlate, ImageReduced)
edges_sub_pix (ImageReduced, Edges, 'lanser2', 0.5, 20, 40)
select_contours_xld (Edges, EdgesClosed, 'closed', 0, 2.0, 0, 0)
select_contours_xld (EdgesClosed, EdgesMarks, 'length', 20, 80, 0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
                         Row, Column, Phi, Radius1, Radius2, StartPhi, \
                         EndPhi, PointOrder)
gen_ellipse_contour_xld (EllMarks, Row, Column, Phi, Radius1, Radius2, \
                         StartPhi, EndPhi, PointOrder, 1.5)
length_xld(EllMarks,Length)
 
 
Example (HDevelop) 
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_800mm.descr', 3, 112, 5)
reduce_domain (Image, CalPlate, ImageReduced)
edges_sub_pix (ImageReduced, Edges, 'lanser2', 0.5, 20, 40)
select_contours_xld (Edges, EdgesClosed, 'closed', 0, 2.0, 0, 0)
select_contours_xld (EdgesClosed, EdgesMarks, 'length', 20, 80, 0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
                         Row, Column, Phi, Radius1, Radius2, StartPhi, \
                         EndPhi, PointOrder)
gen_ellipse_contour_xld (EllMarks, Row, Column, Phi, Radius1, Radius2, \
                         StartPhi, EndPhi, PointOrder, 1.5)
length_xld(EllMarks,Length)
 
 
Example (HDevelop) 
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_800mm.descr', 3, 112, 5)
reduce_domain (Image, CalPlate, ImageReduced)
edges_sub_pix (ImageReduced, Edges, 'lanser2', 0.5, 20, 40)
select_contours_xld (Edges, EdgesClosed, 'closed', 0, 2.0, 0, 0)
select_contours_xld (EdgesClosed, EdgesMarks, 'length', 20, 80, 0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
                         Row, Column, Phi, Radius1, Radius2, StartPhi, \
                         EndPhi, PointOrder)
gen_ellipse_contour_xld (EllMarks, Row, Column, Phi, Radius1, Radius2, \
                         StartPhi, EndPhi, PointOrder, 1.5)
length_xld(EllMarks,Length)
 
 
Result 
fit_ellipse_contour_xld fit_ellipse_contour_xld FitEllipseContourXld FitEllipseContourXld FitEllipseContourXld fit_ellipse_contour_xld 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>) set_system("no_object_result",<Result>) SetSystem("no_object_result",<Result>) SetSystem("no_object_result",<Result>) SetSystem("no_object_result",<Result>) set_system("no_object_result",<Result>) ClippingFactor ClippingFactor ClippingFactor ClippingFactor clippingFactor clipping_factor 
Possible Predecessors 
gen_contours_skeleton_xld gen_contours_skeleton_xld GenContoursSkeletonXld GenContoursSkeletonXld GenContoursSkeletonXld gen_contours_skeleton_xld lines_gauss lines_gauss LinesGauss LinesGauss LinesGauss lines_gauss lines_facet lines_facet LinesFacet LinesFacet LinesFacet lines_facet edges_sub_pix edges_sub_pix EdgesSubPix EdgesSubPix EdgesSubPix edges_sub_pix smooth_contours_xld smooth_contours_xld SmoothContoursXld SmoothContoursXld SmoothContoursXld smooth_contours_xld 
Possible Successors 
gen_ellipse_contour_xld gen_ellipse_contour_xld GenEllipseContourXld GenEllipseContourXld GenEllipseContourXld gen_ellipse_contour_xld disp_ellipse disp_ellipse DispEllipse DispEllipse DispEllipse disp_ellipse get_points_ellipse get_points_ellipse GetPointsEllipse GetPointsEllipse GetPointsEllipse get_points_ellipse 
See also 
fit_line_contour_xld fit_line_contour_xld FitLineContourXld FitLineContourXld FitLineContourXld fit_line_contour_xld fit_circle_contour_xld fit_circle_contour_xld FitCircleContourXld FitCircleContourXld FitCircleContourXld fit_circle_contour_xld fit_rectangle2_contour_xld fit_rectangle2_contour_xld FitRectangle2ContourXld FitRectangle2ContourXld FitRectangle2ContourXld fit_rectangle2_contour_xld 
Module 
Foundation