select_shape_xld select_shape_xld SelectShapeXld SelectShapeXld select_shape_xld (Operator)
Name
select_shape_xld select_shape_xld SelectShapeXld SelectShapeXld select_shape_xld — Select contours or polygons using shape features.
Signature
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 )
void SelectShapeXld (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)
static void HOperatorSet .SelectShapeXld (HObject XLD , out HObject selectedXLD , HTuple features , HTuple operation , HTuple min , HTuple max )
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 )
def select_shape_xld (xld : HObject, features : MaybeSequence[str], operation : str, min : MaybeSequence[Union[int, float, str]], max : MaybeSequence[Union[int, float, str]]) -> HObject
Description
The operator select_shape_xld select_shape_xld SelectShapeXld SelectShapeXld select_shape_xld selects contours or polygons
according to their shape. For each input contour or polygon in
XLD XLD XLD XLD xld the indicated features (Features Features Features features features ) are
calculated. If each (Operation Operation Operation operation operation = 'and' "and" "and" "and" "and" ) or at least one
(Operation Operation Operation operation operation = 'or' "or" "or" "or" "or" ) of the calculated features is within the
limits (Min Min Min min min ,Max Max Max max max ) the contour respectively polygon
is copied into the output.
The parameters Min Min Min min min and Max Max Max max max can be set to
'min' "min" "min" "min" "min" or 'max' "max" "max" "max" "max" in order to leave bottom and top limits,
respectively, open.
Condition:
Possible values for Features Features Features features features :
(all features can be used with polygons as well)
'area':
Area of the contour
(see area_center_xld area_center_xld AreaCenterXld AreaCenterXld area_center_xld )
'area_points':
Area of the contour points
(see area_center_points_xld area_center_points_xld AreaCenterPointsXld AreaCenterPointsXld area_center_points_xld )
'row':
Row index of the center of gravity
(see area_center_xld area_center_xld AreaCenterXld AreaCenterXld area_center_xld )
'column':
Column index of the center of gravity
(see area_center_xld area_center_xld AreaCenterXld AreaCenterXld area_center_xld )
'row_points':
Row index of the center of gravity of the contour
points (see area_center_points_xld area_center_points_xld AreaCenterPointsXld AreaCenterPointsXld area_center_points_xld )
'column_points':
Column index of the center of gravity of the contour
points (see area_center_points_xld area_center_points_xld AreaCenterPointsXld AreaCenterPointsXld area_center_points_xld )
'width':
Width of the contour (see
height_width_ratio_xld height_width_ratio_xld HeightWidthRatioXld HeightWidthRatioXld height_width_ratio_xld )
'height':
Height of the contour (see
height_width_ratio_xld height_width_ratio_xld HeightWidthRatioXld HeightWidthRatioXld height_width_ratio_xld )
'ratio':
Ratio of the height and the width of the
contour (see height_width_ratio_xld height_width_ratio_xld HeightWidthRatioXld HeightWidthRatioXld height_width_ratio_xld )
'row1':
Row coordinate of upper left corner
(see smallest_rectangle1_xld smallest_rectangle1_xld SmallestRectangle1Xld SmallestRectangle1Xld smallest_rectangle1_xld )
'column1':
Column coordinate of upper left corner
(see smallest_rectangle1_xld smallest_rectangle1_xld SmallestRectangle1Xld SmallestRectangle1Xld smallest_rectangle1_xld )
'row2':
Row coordinate of lower right corner
(see smallest_rectangle1_xld smallest_rectangle1_xld SmallestRectangle1Xld SmallestRectangle1Xld smallest_rectangle1_xld )
'column2':
Column coordinate of lower right corner
(see smallest_rectangle1_xld smallest_rectangle1_xld SmallestRectangle1Xld SmallestRectangle1Xld smallest_rectangle1_xld )
'circularity':
Circularity (see circularity_xld circularity_xld CircularityXld CircularityXld circularity_xld )
'compactness':
Compactness (see compactness_xld compactness_xld CompactnessXld CompactnessXld compactness_xld )
'rectangularity':
Rectangularity (see rectangularity_xld rectangularity_xld RectangularityXld RectangularityXld rectangularity_xld )
'contlength':
Total length of contour
(see length_xld length_xld LengthXld LengthXld length_xld )
'convexity':
Convexity (see convexity_xld convexity_xld ConvexityXld ConvexityXld convexity_xld )
'ra':
Major radius of the equivalent ellipse
(see elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld elliptic_axis_xld )
'rb':
Minor radius of the equivalent ellipse
(see elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld elliptic_axis_xld )
'phi':
Orientation of the equivalent ellipse
(see elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld elliptic_axis_xld )
'ra_points':
Major radius of the equivalent ellipse of the
contour points (see elliptic_axis_points_xld elliptic_axis_points_xld EllipticAxisPointsXld EllipticAxisPointsXld elliptic_axis_points_xld )
'rb_points':
Minor radius of the equivalent ellipse of the
contour points (see elliptic_axis_points_xld elliptic_axis_points_xld EllipticAxisPointsXld EllipticAxisPointsXld elliptic_axis_points_xld )
'phi_points':
Orientation of the equivalent ellipse of the
contour points (see elliptic_axis_points_xld elliptic_axis_points_xld EllipticAxisPointsXld EllipticAxisPointsXld elliptic_axis_points_xld )
'anisometry:'
Anisometry (see eccentricity_xld eccentricity_xld EccentricityXld EccentricityXld eccentricity_xld )
'anisometry_points:'
Anisometry of the contour points
(see eccentricity_points_xld eccentricity_points_xld EccentricityPointsXld EccentricityPointsXld eccentricity_points_xld )
'bulkiness:'
Bulkiness (see eccentricity_xld eccentricity_xld EccentricityXld EccentricityXld eccentricity_xld )
'struct_factor:'
Structure factor
(see eccentricity_xld eccentricity_xld EccentricityXld EccentricityXld eccentricity_xld )
'outer_radius':
Radius of smallest enclosing circle
(see smallest_circle_xld smallest_circle_xld SmallestCircleXld SmallestCircleXld smallest_circle_xld )
'max_diameter':
Maximum diameter of the contour
(see diameter_xld diameter_xld DiameterXld DiameterXld diameter_xld )
'orientation':
Orientation of the contour
(see orientation_xld orientation_xld OrientationXld OrientationXld orientation_xld )
'orientation_points':
Orientation of the contour points
(see orientation_points_xld orientation_points_xld OrientationPointsXld OrientationPointsXld orientation_points_xld )
'rect2_phi':
Orientation of the smallest surrounding rectangle
(see smallest_rectangle2_xld smallest_rectangle2_xld SmallestRectangle2Xld SmallestRectangle2Xld smallest_rectangle2_xld )
'rect2_len1':
Half the length of the smallest surrounding
rectangle
(see smallest_rectangle2_xld smallest_rectangle2_xld SmallestRectangle2Xld SmallestRectangle2Xld smallest_rectangle2_xld )
'rect2_len2':
Half the width of the smallest surrounding
rectangle
(see smallest_rectangle2_xld smallest_rectangle2_xld SmallestRectangle2Xld SmallestRectangle2Xld smallest_rectangle2_xld )
'moments_m11', 'moments_m20', 'moments_m02':
Geometric moments of the contour
(see moments_region_2nd moments_region_2nd MomentsRegion2nd MomentsRegion2nd moments_region_2nd )
'moments_m11_points', 'moments_m20_points', 'moments_m02_points':
Geometric moments of the contour points
(see moments_points_xld moments_points_xld MomentsPointsXld MomentsPointsXld moments_points_xld )
If only one feature (Features Features Features features features ) is used the value of
Operation Operation Operation operation operation 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_xld test_self_intersection_xld TestSelfIntersectionXld TestSelfIntersectionXld test_self_intersection_xld ).
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
XLD XLD XLD XLD xld (input_object) xld-array → object HXLD HObject HObject Hobject
Contours or polygons to be examined.
SelectedXLD SelectedXLD SelectedXLD selectedXLD selected_xld (output_object) xld-array → object HXLD HObject HObject Hobject *
Contours or polygons fulfilling the condition(s).
Features Features Features features features (input_control) string(-array) → HTuple MaybeSequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Shape features to be checked.
Default:
'area'
"area"
"area"
"area"
"area"
List of values:
'anisometry' "anisometry" "anisometry" "anisometry" "anisometry" , 'anisometry_points' "anisometry_points" "anisometry_points" "anisometry_points" "anisometry_points" , 'area' "area" "area" "area" "area" , 'area_points' "area_points" "area_points" "area_points" "area_points" , 'bulkiness' "bulkiness" "bulkiness" "bulkiness" "bulkiness" , 'circularity' "circularity" "circularity" "circularity" "circularity" , 'column' "column" "column" "column" "column" , 'column1' "column1" "column1" "column1" "column1" , 'column2' "column2" "column2" "column2" "column2" , 'column_points' "column_points" "column_points" "column_points" "column_points" , 'compactness' "compactness" "compactness" "compactness" "compactness" , 'contlength' "contlength" "contlength" "contlength" "contlength" , 'convexity' "convexity" "convexity" "convexity" "convexity" , 'height' "height" "height" "height" "height" , 'max_diameter' "max_diameter" "max_diameter" "max_diameter" "max_diameter" , 'moments_m02' "moments_m02" "moments_m02" "moments_m02" "moments_m02" , 'moments_m02_points' "moments_m02_points" "moments_m02_points" "moments_m02_points" "moments_m02_points" , 'moments_m11' "moments_m11" "moments_m11" "moments_m11" "moments_m11" , 'moments_m11_points' "moments_m11_points" "moments_m11_points" "moments_m11_points" "moments_m11_points" , 'moments_m20' "moments_m20" "moments_m20" "moments_m20" "moments_m20" , 'moments_m20_points' "moments_m20_points" "moments_m20_points" "moments_m20_points" "moments_m20_points" , 'orientation' "orientation" "orientation" "orientation" "orientation" , 'orientation_points' "orientation_points" "orientation_points" "orientation_points" "orientation_points" , 'outer_radius' "outer_radius" "outer_radius" "outer_radius" "outer_radius" , 'phi' "phi" "phi" "phi" "phi" , 'phi_points' "phi_points" "phi_points" "phi_points" "phi_points" , 'ra' "ra" "ra" "ra" "ra" , 'ra_points' "ra_points" "ra_points" "ra_points" "ra_points" , 'ratio' "ratio" "ratio" "ratio" "ratio" , 'rb' "rb" "rb" "rb" "rb" , 'rb_points' "rb_points" "rb_points" "rb_points" "rb_points" , 'rect2_len1' "rect2_len1" "rect2_len1" "rect2_len1" "rect2_len1" , 'rect2_len2' "rect2_len2" "rect2_len2" "rect2_len2" "rect2_len2" , 'rect2_phi' "rect2_phi" "rect2_phi" "rect2_phi" "rect2_phi" , 'rectangularity' "rectangularity" "rectangularity" "rectangularity" "rectangularity" , 'row' "row" "row" "row" "row" , 'row1' "row1" "row1" "row1" "row1" , 'row2' "row2" "row2" "row2" "row2" , 'row_points' "row_points" "row_points" "row_points" "row_points" , 'struct_factor' "struct_factor" "struct_factor" "struct_factor" "struct_factor" , 'width' "width" "width" "width" "width"
Operation Operation Operation operation operation (input_control) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Operation type between the individual features.
Default:
'and'
"and"
"and"
"and"
"and"
List of values:
'and' "and" "and" "and" "and" , 'or' "or" "or" "or" "or"
Min Min Min min min (input_control) real(-array) → HTuple MaybeSequence[Union[int, float, str]] HTuple Htuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Lower limits of the features or 'min'.
Default:
150.0
Minimum increment:
0.001
Recommended increment:
1.0
Max Max Max max max (input_control) real(-array) → HTuple MaybeSequence[Union[int, float, str]] HTuple Htuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Upper limits of the features or 'max'.
Default:
99999.0
Minimum increment:
0.001
Recommended increment:
1.0
Restriction:
Max >= Min
Result
The operator select_shape_xld select_shape_xld SelectShapeXld SelectShapeXld select_shape_xld 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.
Possible Predecessors
gen_contours_skeleton_xld gen_contours_skeleton_xld GenContoursSkeletonXld GenContoursSkeletonXld gen_contours_skeleton_xld ,
edges_sub_pix edges_sub_pix EdgesSubPix EdgesSubPix edges_sub_pix ,
threshold_sub_pix threshold_sub_pix ThresholdSubPix ThresholdSubPix threshold_sub_pix ,
gen_contour_polygon_xld gen_contour_polygon_xld GenContourPolygonXld GenContourPolygonXld gen_contour_polygon_xld ,
test_self_intersection_xld test_self_intersection_xld TestSelfIntersectionXld TestSelfIntersectionXld test_self_intersection_xld
Possible Successors
shape_trans_xld shape_trans_xld ShapeTransXld ShapeTransXld shape_trans_xld ,
count_obj count_obj CountObj CountObj count_obj
See also
area_center_xld area_center_xld AreaCenterXld AreaCenterXld area_center_xld ,
area_center_points_xld area_center_points_xld AreaCenterPointsXld AreaCenterPointsXld area_center_points_xld ,
circularity_xld circularity_xld CircularityXld CircularityXld circularity_xld ,
compactness_xld compactness_xld CompactnessXld CompactnessXld compactness_xld ,
convexity_xld convexity_xld ConvexityXld ConvexityXld convexity_xld ,
elliptic_axis_xld elliptic_axis_xld EllipticAxisXld EllipticAxisXld elliptic_axis_xld ,
elliptic_axis_points_xld elliptic_axis_points_xld EllipticAxisPointsXld EllipticAxisPointsXld elliptic_axis_points_xld ,
eccentricity_xld eccentricity_xld EccentricityXld EccentricityXld eccentricity_xld ,
eccentricity_points_xld eccentricity_points_xld EccentricityPointsXld EccentricityPointsXld eccentricity_points_xld ,
rectangularity_xld rectangularity_xld RectangularityXld RectangularityXld rectangularity_xld ,
smallest_circle_xld smallest_circle_xld SmallestCircleXld SmallestCircleXld smallest_circle_xld ,
smallest_rectangle1_xld smallest_rectangle1_xld SmallestRectangle1Xld SmallestRectangle1Xld smallest_rectangle1_xld ,
smallest_rectangle2_xld smallest_rectangle2_xld SmallestRectangle2Xld SmallestRectangle2Xld smallest_rectangle2_xld ,
diameter_xld diameter_xld DiameterXld DiameterXld diameter_xld ,
orientation_xld orientation_xld OrientationXld OrientationXld orientation_xld ,
orientation_points_xld orientation_points_xld OrientationPointsXld OrientationPointsXld orientation_points_xld ,
moments_xld moments_xld MomentsXld MomentsXld moments_xld ,
moments_points_xld moments_points_xld MomentsPointsXld MomentsPointsXld moments_points_xld ,
select_obj select_obj SelectObj SelectObj select_obj
Module
Foundation