Skip to content

select_shape_xldSelectShapeXldSelectShapeXldselect_shape_xldselect_shape_xld🔗

Short description🔗

select_shape_xldSelectShapeXldSelectShapeXldselect_shape_xldselect_shape_xld — Select contours or polygons using shape features.

Signature🔗

select_shape_xld( xld XLD, out xld SelectedXLD, string Features, string Operation, real Min, real Max )void SelectShapeXld( const HObject& XLD, HObject* SelectedXLD, const HTuple& Features, const HTuple& Operation, const HTuple& Min, const HTuple& Max )static void HOperatorSet.SelectShapeXld( HObject XLD, out HObject selectedXLD, HTuple features, HTuple operation, HTuple min, HTuple max )def select_shape_xld( xld: HObject, features: MaybeSequence[str], operation: str, min: MaybeSequence[Union[int, float, str]], max: MaybeSequence[Union[int, float, str]] ) -> HObject

Herror select_shape_xld( const Hobject XLD, Hobject* SelectedXLD, const char* Features, const char* Operation, double Min, double Max )

Herror T_select_shape_xld( const Hobject XLD, Hobject* SelectedXLD, const Htuple Features, const Htuple Operation, const Htuple Min, const Htuple Max )

HXLD HXLD::SelectShapeXld( const HTuple& Features, const HString& Operation, const HTuple& Min, const HTuple& Max ) const

HXLD HXLD::SelectShapeXld( const HString& Features, const HString& Operation, double Min, double Max ) const

HXLD HXLD::SelectShapeXld( const char* Features, const char* Operation, double Min, double Max ) const

HXLD HXLD::SelectShapeXld( const wchar_t* Features, const wchar_t* Operation, double Min, double Max ) const (Windows only)

HXLDCont HXLDCont::SelectShapeXld( const HTuple& Features, const HString& Operation, const HTuple& Min, const HTuple& Max ) const

HXLDCont HXLDCont::SelectShapeXld( const HString& Features, const HString& Operation, double Min, double Max ) const

HXLDCont HXLDCont::SelectShapeXld( const char* Features, const char* Operation, double Min, double Max ) const

HXLDCont HXLDCont::SelectShapeXld( const wchar_t* Features, const wchar_t* Operation, double Min, double Max ) const (Windows only)

HXLDPoly HXLDPoly::SelectShapeXld( const HTuple& Features, const HString& Operation, const HTuple& Min, const HTuple& Max ) const

HXLDPoly HXLDPoly::SelectShapeXld( const HString& Features, const HString& Operation, double Min, double Max ) const

HXLDPoly HXLDPoly::SelectShapeXld( const char* Features, const char* Operation, double Min, double Max ) const

HXLDPoly HXLDPoly::SelectShapeXld( const wchar_t* Features, const wchar_t* Operation, double Min, double Max ) const (Windows only)

HXLDPara HXLDPara::SelectShapeXld( const HTuple& Features, const HString& Operation, const HTuple& Min, const HTuple& Max ) const

HXLDPara HXLDPara::SelectShapeXld( const HString& Features, const HString& Operation, double Min, double Max ) const

HXLDPara HXLDPara::SelectShapeXld( const char* Features, const char* Operation, double Min, double Max ) const

HXLDPara HXLDPara::SelectShapeXld( const wchar_t* Features, const wchar_t* Operation, double Min, double Max ) const (Windows only)

HXLDModPara HXLDModPara::SelectShapeXld( const HTuple& Features, const HString& Operation, const HTuple& Min, const HTuple& Max ) const

HXLDModPara HXLDModPara::SelectShapeXld( const HString& Features, const HString& Operation, double Min, double Max ) const

HXLDModPara HXLDModPara::SelectShapeXld( const char* Features, const char* Operation, double Min, double Max ) const

HXLDModPara HXLDModPara::SelectShapeXld( const wchar_t* Features, const wchar_t* Operation, double Min, double Max ) const (Windows only)

HXLDExtPara HXLDExtPara::SelectShapeXld( const HTuple& Features, const HString& Operation, const HTuple& Min, const HTuple& Max ) const

HXLDExtPara HXLDExtPara::SelectShapeXld( const HString& Features, const HString& Operation, double Min, double Max ) const

HXLDExtPara HXLDExtPara::SelectShapeXld( const char* Features, const char* Operation, double Min, double Max ) const

HXLDExtPara HXLDExtPara::SelectShapeXld( const wchar_t* Features, const wchar_t* Operation, double Min, double Max ) const (Windows only)

HXLD HXLD.SelectShapeXld( HTuple features, string operation, HTuple min, HTuple max )

HXLD HXLD.SelectShapeXld( string features, string operation, double min, double max )

HXLDCont HXLDCont.SelectShapeXld( HTuple features, string operation, HTuple min, HTuple max )

HXLDCont HXLDCont.SelectShapeXld( string features, string operation, double min, double max )

HXLDPoly HXLDPoly.SelectShapeXld( HTuple features, string operation, HTuple min, HTuple max )

HXLDPoly HXLDPoly.SelectShapeXld( string features, string operation, double min, double max )

HXLDPara HXLDPara.SelectShapeXld( HTuple features, string operation, HTuple min, HTuple max )

HXLDPara HXLDPara.SelectShapeXld( string features, string operation, double min, double max )

HXLDModPara HXLDModPara.SelectShapeXld( HTuple features, string operation, HTuple min, HTuple max )

HXLDModPara HXLDModPara.SelectShapeXld( string features, string operation, double min, double max )

HXLDExtPara HXLDExtPara.SelectShapeXld( HTuple features, string operation, HTuple min, HTuple max )

HXLDExtPara HXLDExtPara.SelectShapeXld( string features, string operation, double min, double max )

Description🔗

The operator select_shape_xldSelectShapeXld selects contours or polygons according to their shape. For each input contour or polygon in XLDXLDxld the indicated features (Featuresfeaturesfeatures) are calculated. If each (Operationoperationoperation = 'and'"and") or at least one (Operationoperationoperation = 'or'"or") of the calculated features is within the limits (Minminmin,Maxmaxmax) the contour respectively polygon is copied into the output. The parameters Minminmin and Maxmaxmax can be set to 'min'"min" or 'max'"max" in order to leave bottom and top limits, respectively, open.

Condition:

\[\begin{eqnarray*} \textrm{Min}_{i} \leq \textrm{Features}_{i}(Object) \leq \textrm{Max}_{i} \end{eqnarray*}\]

Possible values for Featuresfeaturesfeatures:

(all features can be used with polygons as well)

If only one feature (Featuresfeaturesfeatures) is used the value of Operationoperationoperation is meaningless. Several features are processed in the sequence in which they are entered.The use of some features requires that the input contour respectively polygon must not intersect itself, otherwise the results are not meaningful (Whether the input contour or polygon intersects itself or not can be determined with test_self_intersection_xldTestSelfIntersectionXld).

Execution information🔗

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🔗

XLDXLDxld (input_object) xld-array → objectHObjectHXLDHObjectHobject

Contours or polygons to be examined.

SelectedXLDselectedXLDselected_xld (output_object) xld-array → objectHObjectHXLDHObjectHobject *

Contours or polygons fulfilling the condition(s).

Featuresfeaturesfeatures (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Shape features to be checked.

Default: 'area'"area"
List of values: 'anisometry', 'anisometry_points', 'area', 'area_points', 'bulkiness', 'circularity', 'column', 'column1', 'column2', 'column_points', 'compactness', 'contlength', 'convexity', 'height', 'max_diameter', 'moments_m02', 'moments_m02_points', 'moments_m11', 'moments_m11_points', 'moments_m20', 'moments_m20_points', 'orientation', 'orientation_points', 'outer_radius', 'phi', 'phi_points', 'ra', 'ra_points', 'ratio', 'rb', 'rb_points', 'rect2_len1', 'rect2_len2', 'rect2_phi', 'rectangularity', 'row', 'row1', 'row2', 'row_points', 'struct_factor', 'width'"anisometry", "anisometry_points", "area", "area_points", "bulkiness", "circularity", "column", "column1", "column2", "column_points", "compactness", "contlength", "convexity", "height", "max_diameter", "moments_m02", "moments_m02_points", "moments_m11", "moments_m11_points", "moments_m20", "moments_m20_points", "orientation", "orientation_points", "outer_radius", "phi", "phi_points", "ra", "ra_points", "ratio", "rb", "rb_points", "rect2_len1", "rect2_len2", "rect2_phi", "rectangularity", "row", "row1", "row2", "row_points", "struct_factor", "width"

Operationoperationoperation (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Operation type between the individual features.

Default: 'and'"and"
List of values: 'and', 'or'"and", "or"

Minminmin (input_control) real(-array) → (real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)MaybeSequence[Union[int, float, str]]Htuple (double / Hlong / char*)

Lower limits of the features or ‘min’.

Default: 150.0150.0
Minimum increment: 0.001
Recommended increment: 1.0

Maxmaxmax (input_control) real(-array) → (real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)MaybeSequence[Union[int, float, str]]Htuple (double / Hlong / char*)

Upper limits of the features or ‘max’.

Default: 99999.099999.0
Minimum increment: 0.001
Recommended increment: 1.0
Restriction: Max >= Min

Result🔗

The operator select_shape_xldSelectShapeXld returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input objects available) is set via 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

Possible successors

shape_trans_xldShapeTransXld, count_objCountObj

See also

area_center_xldAreaCenterXld, area_center_points_xldAreaCenterPointsXld, circularity_xldCircularityXld, compactness_xldCompactnessXld, convexity_xldConvexityXld, elliptic_axis_xldEllipticAxisXld, elliptic_axis_points_xldEllipticAxisPointsXld, eccentricity_xldEccentricityXld, eccentricity_points_xldEccentricityPointsXld, rectangularity_xldRectangularityXld, smallest_circle_xldSmallestCircleXld, smallest_rectangle1_xldSmallestRectangle1Xld, smallest_rectangle2_xldSmallestRectangle2Xld, diameter_xldDiameterXld, orientation_xldOrientationXld, orientation_points_xldOrientationPointsXld, moments_xldMomentsXld, moments_points_xldMomentsPointsXld, select_objSelectObj

Module🔗

Foundation