diameter_xlddiameter_xldDiameterXldDiameterXlddiameter_xld (Operator)
Name
diameter_xlddiameter_xldDiameterXldDiameterXlddiameter_xld
— Maximum distance between two contour or polygon points.
Signature
Herror diameter_xld(const Hobject XLD, double* Row1, double* Column1, double* Row2, double* Column2, double* Diameter)
Herror T_diameter_xld(const Hobject XLD, Htuple* Row1, Htuple* Column1, Htuple* Row2, Htuple* Column2, Htuple* Diameter)
void DiameterXld(const HObject& XLD, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2, HTuple* Diameter)
void HXLD::DiameterXld(HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2, HTuple* Diameter) const
void HXLD::DiameterXld(double* Row1, double* Column1, double* Row2, double* Column2, double* Diameter) const
static void HOperatorSet.DiameterXld(HObject XLD, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2, out HTuple diameter)
void HXLD.DiameterXld(out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2, out HTuple diameter)
void HXLD.DiameterXld(out double row1, out double column1, out double row2, out double column2, out double diameter)
def diameter_xld(xld: HObject) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]
def diameter_xld_s(xld: HObject) -> Tuple[float, float, float, float, float]
Description
The operator diameter_xlddiameter_xldDiameterXldDiameterXldDiameterXlddiameter_xld
calculates the
maximum distance between two points of each input contour or polygon.
The coordinates of these two extremes
and the distance between them will be returned. The input contour or polygon
must not intersect itself, otherwise the resulting parameters are not
meaningful (Whether the input contour or polygon intersects itself or not
can be determined with test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXldTestSelfIntersectionXldtest_self_intersection_xld
). If
the input contour or polygon is not closed it will be closed automatically.
If more than one contour or polygon is passed, the results are stored
in tuples in the same order as the respective contours or polygons in
XLDXLDXLDXLDXLDxld
.
Attention
If the contour or polygon is empty, the results of Row1Row1Row1Row1row1row_1
,
Column1Column1Column1Column1column1column_1
, Row2Row2Row2Row2row2row_2
and Column2Column2Column2Column2column2column_2
(all of them = 0) may
lead to confusion.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Parameters
XLDXLDXLDXLDXLDxld
(input_object) xld(-array) →
objectHXLDHObjectHXLDHobject
Contours or polygons to be examined.
Row1Row1Row1Row1row1row_1
(output_control) line.begin.y(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Row coordinate of the first extreme point of the
contours or polygons.
Column1Column1Column1Column1column1column_1
(output_control) line.begin.x(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Column coordinate of the first extreme point of the
contours or polygons.
Row2Row2Row2Row2row2row_2
(output_control) line.end.y(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Row coordinate of the second extreme point of the
contour or polygons.
Column2Column2Column2Column2column2column_2
(output_control) line.end.x(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Column coordinate of the second extreme point of the
contours or polygons.
DiameterDiameterDiameterDiameterdiameterdiameter
(output_control) number(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Distance of the two extreme points of the contours or
polygons.
Result
The operator diameter_xlddiameter_xldDiameterXldDiameterXldDiameterXlddiameter_xld
returns the value 2 (H_MSG_TRUE), if the input
is not empty. The reaction to empty input (no input contours are
available) may be determined with the help of the operator
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>)
.
If necessary an exception is raised.
Possible Predecessors
gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld
,
edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix
,
threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPixthreshold_sub_pix
,
gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXldGenContourPolygonXldgen_contour_polygon_xld
,
test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXldTestSelfIntersectionXldtest_self_intersection_xld
Alternatives
smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld
See also
area_center_xldarea_center_xldAreaCenterXldAreaCenterXldAreaCenterXldarea_center_xld
Module
Foundation