dist_ellipse_contour_xld dist_ellipse_contour_xld DistEllipseContourXld DistEllipseContourXld dist_ellipse_contour_xld (算子)
名称
dist_ellipse_contour_xld dist_ellipse_contour_xld DistEllipseContourXld DistEllipseContourXld dist_ellipse_contour_xld — 计算轮廓到椭圆的距离。
签名
dist_ellipse_contour_xld (Contours : : Mode , MaxNumPoints , ClippingEndPoints , Row , Column , Phi , Radius1 , Radius2 : MinDist , MaxDist , AvgDist , SigmaDist )
Herror dist_ellipse_contour_xld (const Hobject Contours , const char* Mode , const Hlong MaxNumPoints , const Hlong ClippingEndPoints , double Row , double Column , double Phi , double Radius1 , double Radius2 , double* MinDist , double* MaxDist , double* AvgDist , double* SigmaDist )
Herror T_dist_ellipse_contour_xld (const Hobject Contours , const Htuple Mode , const Htuple MaxNumPoints , const Htuple ClippingEndPoints , const Htuple Row , const Htuple Column , const Htuple Phi , const Htuple Radius1 , const Htuple Radius2 , Htuple* MinDist , Htuple* MaxDist , Htuple* AvgDist , Htuple* SigmaDist )
void DistEllipseContourXld (const HObject& Contours , const HTuple& Mode , const HTuple& MaxNumPoints , const HTuple& ClippingEndPoints , const HTuple& Row , const HTuple& Column , const HTuple& Phi , const HTuple& Radius1 , const HTuple& Radius2 , HTuple* MinDist , HTuple* MaxDist , HTuple* AvgDist , HTuple* SigmaDist )
void HXLDCont ::DistEllipseContourXld (const HString& Mode , Hlong MaxNumPoints , Hlong ClippingEndPoints , double Row , double Column , double Phi , double Radius1 , double Radius2 , HTuple* MinDist , HTuple* MaxDist , HTuple* AvgDist , HTuple* SigmaDist ) const
void HXLDCont ::DistEllipseContourXld (const HString& Mode , Hlong MaxNumPoints , Hlong ClippingEndPoints , double Row , double Column , double Phi , double Radius1 , double Radius2 , double* MinDist , double* MaxDist , double* AvgDist , double* SigmaDist ) const
void HXLDCont ::DistEllipseContourXld (const char* Mode , Hlong MaxNumPoints , Hlong ClippingEndPoints , double Row , double Column , double Phi , double Radius1 , double Radius2 , double* MinDist , double* MaxDist , double* AvgDist , double* SigmaDist ) const
void HXLDCont ::DistEllipseContourXld (const wchar_t* Mode , Hlong MaxNumPoints , Hlong ClippingEndPoints , double Row , double Column , double Phi , double Radius1 , double Radius2 , double* MinDist , double* MaxDist , double* AvgDist , double* SigmaDist ) const
(
Windows only)
static void HOperatorSet .DistEllipseContourXld (HObject contours , HTuple mode , HTuple maxNumPoints , HTuple clippingEndPoints , HTuple row , HTuple column , HTuple phi , HTuple radius1 , HTuple radius2 , out HTuple minDist , out HTuple maxDist , out HTuple avgDist , out HTuple sigmaDist )
void HXLDCont .DistEllipseContourXld (string mode , int maxNumPoints , int clippingEndPoints , double row , double column , double phi , double radius1 , double radius2 , out HTuple minDist , out HTuple maxDist , out HTuple avgDist , out HTuple sigmaDist )
void HXLDCont .DistEllipseContourXld (string mode , int maxNumPoints , int clippingEndPoints , double row , double column , double phi , double radius1 , double radius2 , out double minDist , out double maxDist , out double avgDist , out double sigmaDist )
def dist_ellipse_contour_xld (contours : HObject, mode : str, max_num_points : int, clipping_end_points : int, row : float, column : float, phi : float, radius_1 : float, radius_2 : float) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float]]
def dist_ellipse_contour_xld_s (contours : HObject, mode : str, max_num_points : int, clipping_end_points : int, row : float, column : float, phi : float, radius_1 : float, radius_2 : float) -> Tuple[float, float, float, float]
描述
dist_ellipse_contour_xld dist_ellipse_contour_xld DistEllipseContourXld DistEllipseContourXld DistEllipseContourXld dist_ellipse_contour_xld determines the distance
between the contours in Contours Contours Contours Contours contours contours and an ellipse
specified by the center (Row Row Row Row row row , Column Column Column Column column column ), the
orientation of the main axis Phi Phi Phi Phi phi phi ,
the length of the larger half axis Radius1 Radius1 Radius1 Radius1 radius1 radius_1 , and the
length of the smaller half axis Radius2 Radius2 Radius2 Radius2 radius2 radius_2 . Different
measures for the distance of a contour point
to the ellipse are
available (Mode Mode Mode Mode mode mode ):
'geometric'
The underlying distance measure is the geometric distance between a point
on the contour and the ellipse. This measure is also called
orthogonal or Euclidean distance.
'algebraic'
The distance is measured by the algebraic distance
, where the
parameters a - f describing the ellipse are normalized in order
to obtain Radius2 Radius2 Radius2 Radius2 radius2 radius_2 as distance of the center of the
ellipse. This measure shows a high curvature bias : Near points of
high curvature on the ellipse (like the poles on the main axis)
the distance is smaller than near points with low curvature.
'focpoints'
The distance is measured by the deviation
,
where
are the focal points and a corresponds to
Radius1 Radius1 Radius1 Radius1 radius1 radius_1 . This measure shows a low curvature bias :
Near points of high curvature on the ellipse (like the poles on the main
axis) the distance is larger than near points with low curvature.
'bisec'
The distance is measured by the distance between X and the
intersection of the angular bisector of the two lines through X and the
focal points with the ellipse. This is a good approximation of
the orthogonal distance from X to the ellipse.
The accuracy of the approximation depends on both the aspect ratio of the
ellipse and the distance.
The operator returns the minimum absolute distance MinDist MinDist MinDist MinDist minDist min_dist ,
the maximum absolute distance MaxDist MaxDist MaxDist MaxDist maxDist max_dist , the average
absolute distance AvgDist AvgDist AvgDist AvgDist avgDist avg_dist , and the standard deviation of
the absolute distances SigmaDist SigmaDist SigmaDist SigmaDist sigmaDist sigma_dist of all contour points.
To reduce the computational load, the computation of the distances
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 , only up to
MaxNumPoints MaxNumPoints MaxNumPoints MaxNumPoints maxNumPoints max_num_points points - uniformly distributed over the
contour - are used.
Due to artifacts in the pre-processing the start and end points
of a contour might be faulty. Therefore, it is possible to
exclude ClippingEndPoints ClippingEndPoints ClippingEndPoints ClippingEndPoints clippingEndPoints clipping_end_points points at the beginning and at
the end of a contour from the computation.
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
未采用并行化处理。
参数
Contours Contours Contours Contours contours contours (输入对象) xld_cont(-array) → object HXLDCont HObject HXLDCont Hobject
Input contours.
Mode Mode Mode Mode mode mode (输入控制) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Method for the determination of the distances.
默认值:
'geometric'
"geometric"
"geometric"
"geometric"
"geometric"
"geometric"
值列表:
'algebraic' "algebraic" "algebraic" "algebraic" "algebraic" "algebraic" , 'bisec' "bisec" "bisec" "bisec" "bisec" "bisec" , 'focpoints' "focpoints" "focpoints" "focpoints" "focpoints" "focpoints" , 'geometric' "geometric" "geometric" "geometric" "geometric" "geometric"
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).
默认值:
-1
限制:
MaxNumPoints >= 3
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 the end of the
contours to be ignored for the computation of
distances.
默认值:
0
限制:
ClippingEndPoints >= 0
Row Row Row Row row row (输入控制) ellipse.center.y → HTuple float HTuple Htuple (real) (double ) (double ) (double )
Row coordinate of the center of the ellipse.
Column Column Column Column column column (输入控制) ellipse.center.x → HTuple float HTuple Htuple (real) (double ) (double ) (double )
Column coordinate of the center of the ellipse.
Phi Phi Phi Phi phi phi (输入控制) ellipse.angle.rad → HTuple float HTuple Htuple (real) (double ) (double ) (double )
Orientation of the main axis in radian.
限制:
Phi >= 0 && Phi <= 6.283185307
Radius1 Radius1 Radius1 Radius1 radius1 radius_1 (输入控制) ellipse.radius1 → HTuple float HTuple Htuple (real) (double ) (double ) (double )
Length of the larger half axis.
限制:
Radius1 > 0
Radius2 Radius2 Radius2 Radius2 radius2 radius_2 (输入控制) ellipse.radius2 → HTuple float HTuple Htuple (real) (double ) (double ) (double )
Length of the smaller half axis.
限制:
Radius2 >= 0 && Radius2 <= Radius1
MinDist MinDist MinDist MinDist minDist min_dist (输出控制) real(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Minimum distance.
MaxDist MaxDist MaxDist MaxDist maxDist max_dist (输出控制) real(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Maximum distance.
AvgDist AvgDist AvgDist AvgDist avgDist avg_dist (输出控制) real(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Mean distance.
SigmaDist SigmaDist SigmaDist SigmaDist sigmaDist sigma_dist (输出控制) real(-array) → HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Standard deviation of the distance.
示例(HDevelop)
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_big.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, 'contour_length', 20, 100, \
0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
Row, Column, Phi, Radius1, Radius2, StartPhi, \
EndPhi, PointOrder)
for i := 0 to |Row|-1 by 1
select_obj (EdgesMarks, ObjectSelected, i+1)
dist_ellipse_contour_xld (ObjectSelected, 'bisec', -1, 0, Row[i], \
Column[i], Phi[i], Radius1[i], Radius2[i], \
MinDist, MaxDist, AvgDist, SigmaDist)
endfor
示例(HDevelop)
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_big.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, 'contour_length', 20, 100, \
0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
Row, Column, Phi, Radius1, Radius2, StartPhi, \
EndPhi, PointOrder)
for i := 0 to |Row|-1 by 1
select_obj (EdgesMarks, ObjectSelected, i+1)
dist_ellipse_contour_xld (ObjectSelected, 'bisec', -1, 0, Row[i], \
Column[i], Phi[i], Radius1[i], Radius2[i], \
MinDist, MaxDist, AvgDist, SigmaDist)
endfor
示例(HDevelop)
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_big.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, 'contour_length', 20, 100, \
0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
Row, Column, Phi, Radius1, Radius2, StartPhi, \
EndPhi, PointOrder)
for i := 0 to |Row|-1 by 1
select_obj (EdgesMarks, ObjectSelected, i+1)
dist_ellipse_contour_xld (ObjectSelected, 'bisec', -1, 0, Row[i], \
Column[i], Phi[i], Radius1[i], Radius2[i], \
MinDist, MaxDist, AvgDist, SigmaDist)
endfor
示例(HDevelop)
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_big.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, 'contour_length', 20, 100, \
0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
Row, Column, Phi, Radius1, Radius2, StartPhi, \
EndPhi, PointOrder)
for i := 0 to |Row|-1 by 1
select_obj (EdgesMarks, ObjectSelected, i+1)
dist_ellipse_contour_xld (ObjectSelected, 'bisec', -1, 0, Row[i], \
Column[i], Phi[i], Radius1[i], Radius2[i], \
MinDist, MaxDist, AvgDist, SigmaDist)
endfor
示例(HDevelop)
read_image (Image, 'caltab')
find_caltab (Image, CalPlate, 'caltab_big.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, 'contour_length', 20, 100, \
0, 0)
fit_ellipse_contour_xld (EdgesMarks, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
Row, Column, Phi, Radius1, Radius2, StartPhi, \
EndPhi, PointOrder)
for i := 0 to |Row|-1 by 1
select_obj (EdgesMarks, ObjectSelected, i+1)
dist_ellipse_contour_xld (ObjectSelected, 'bisec', -1, 0, Row[i], \
Column[i], Phi[i], Radius1[i], Radius2[i], \
MinDist, MaxDist, AvgDist, SigmaDist)
endfor
结果
dist_ellipse_contour_xld dist_ellipse_contour_xld DistEllipseContourXld DistEllipseContourXld DistEllipseContourXld dist_ellipse_contour_xld returns 2 (
H_MSG_TRUE )
if all parameter
values are correct。如有必要,则抛出异常。
可能的前趋
fit_ellipse_contour_xld fit_ellipse_contour_xld FitEllipseContourXld FitEllipseContourXld FitEllipseContourXld fit_ellipse_contour_xld
替代
dist_ellipse_contour_points_xld dist_ellipse_contour_points_xld DistEllipseContourPointsXld DistEllipseContourPointsXld DistEllipseContourPointsXld dist_ellipse_contour_points_xld
模块
基础