Skip to content

diameter_xldDiameterXldDiameterXlddiameter_xlddiameter_xld🔗

Short description🔗

diameter_xldDiameterXldDiameterXlddiameter_xlddiameter_xld — Maximum distance between two contour or polygon points.

Signature🔗

diameter_xld( xld XLD, out line.begin.y Row1, out line.begin.x Column1, out line.end.y Row2, out line.end.x Column2, out number Diameter )void DiameterXld( const HObject& XLD, HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2, HTuple* Diameter )static void HOperatorSet.DiameterXld( HObject XLD, out HTuple row1, out HTuple column1, out HTuple row2, out HTuple column2, out HTuple 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]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 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

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 )

Description🔗

The operator diameter_xldDiameterXld 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_xldTestSelfIntersectionXld). 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 XLDXLDxld.

Attention🔗

If the contour or polygon is empty, the results of Row1row1row_1, Column1column1column_1, Row2row2row_2 and Column2column2column_2 (all of them = 0) may lead to confusion.

Execution information🔗

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🔗

XLDXLDxld (input_object) xld(-array) → objectHObjectHXLDHObjectHobject

Contours or polygons to be examined.

Row1row1row_1 (output_control) line.begin.y(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinate of the first extreme point of the contours or polygons.

Column1column1column_1 (output_control) line.begin.x(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinate of the first extreme point of the contours or polygons.

Row2row2row_2 (output_control) line.end.y(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinate of the second extreme point of the contour or polygons.

Column2column2column_2 (output_control) line.end.x(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinate of the second extreme point of the contours or polygons.

Diameterdiameterdiameter (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Distance of the two extreme points of the contours or polygons.

Result🔗

The operator diameter_xldDiameterXld 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>). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

gen_contours_skeleton_xldGenContoursSkeletonXld, edges_sub_pixEdgesSubPix, threshold_sub_pixThresholdSubPix, gen_contour_polygon_xldGenContourPolygonXld, test_self_intersection_xldTestSelfIntersectionXld

Alternatives

smallest_rectangle2_xldSmallestRectangle2Xld

See also

area_center_xldAreaCenterXld

Module🔗

Foundation