Select contours using shape features.
The operator select_shape_xld chooses regions according to their shape. For each input region in XLD the indicated features (Features) are calculated. If each (Operation = 'and') or at least one (Operation = 'or') of the calculated features is within the limits (Min,Max) the contour is copied into the output.
Condition: Min_i <= Features_i(Object)
<= Max_i
Possible values for Features:
'area' Area of the contour
'row' Row index of the center of gravity
'column' Column index of the center of gravity
'width' Width of the contour
'height' Height of the contour
'row1' Row coordinate of upper left corner
'column1' Column coordinate of upper left corner
'row2' Row coordinate of lower right corner
'column2' Column coordinate of lower right corner
'circularity' Circularity (see circularity_xld)
'compactness' Compactness (see compactness_xld)
'contlength' total length of contour (see length_xld)
'convexity' Convexity (see convexity_xld)
'ra' Major radius of the equivalent ellipse
(see elliptic_axis_xld)
'rb' Minor radius of the equivalent ellipse
(see elliptic_axis_xld)
'phi' Orientation of the equivalent ellipse
(see elliptic_axis_xld)
'anisometry' Anisometry (see eccentricity_xld)
'bulkiness' Bulkiness (see eccentricity_xld)
'struct_factor' Structure factor
(see eccentricity_xld)
'outer_radius' Radius of smallest surrounding circle
(see smallest_circle_xld)
'max_diameter' Maximum diameter of the contour
(see diameter_xld)
'orientation' Orientation of the contour
(see orientation_xld)
'rect2_phi' Orientation of the smallest surrounding rectangle
(see smallest_rectangle2_xld)
'rect2_len1' Half the length of the smallest surrounding rectangle
(see smallest_rectangle2_xld)
'rect2_len2' Half the width of the smallest surrounding rectangle
(see smallest_rectangle2_xld)
'moments_m11', 'moments_m20', 'moments_m02'
Geometric moments of the contour
(see moments_xld)
If only one feature (Features) is used the value of 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 must not intersect itself, otherwise the results are not meaningful.
|
XLD (input_object) |
xld-array -> object |
| Contours to be examined. | |
|
SelectedXLD (output_object) |
xld-array -> object |
| Contours fulfilling the condition(s). | |
|
Features (input_control) |
string(-array) -> string |
| Shape features to be checked. | |
| Default value: 'area' | |
| List of values: 'area', 'row', 'column', 'width', 'height', 'row1', 'column1', 'row2', 'column2', 'circularity', 'compactness', 'contlength', 'convexity', 'ra', 'rb', 'phi', 'anisometry', 'bulkiness', 'struct_factor', 'outer_radius', 'max_diameter', 'orientation', 'rect2_phi', 'rect2_len1', 'rect2_len2', 'moments_m11', 'moments_m20', 'moments_m02' | |
|
Operation (input_control) |
string -> string |
| Operation type between the individual features. | |
| Default value: 'and' | |
| List of values: 'and', 'or' | |
|
Min (input_control) |
real(-array) -> real / integer / string |
| Lower limits of the features or 'min'. | |
| Default value: 150.0 | |
| Typical range of values: 0.0 <= Min <= 99999.0 | |
| Minimum increment: 0.001 | |
|
Recommended increment: 1.0 | |
|
Max (input_control) |
real(-array) -> real / integer / string |
| Upper limits of the features or 'max'. | |
| Default value: 99999.0 | |
| Typical range of values: 0.0 <= Max <= 99999.0 | |
| Minimum increment: 0.001 | |
|
Recommended increment: 1.0 | |
| Restriction: Max >= Min | |
The operator 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.
select_shape_xld is reentrant and processed without parallelization.
gen_contours_skeleton_xld, edges_sub_pix, threshold_sub_pix, gen_contour_polygon_xld
area_center_xld, circularity_xld, compactness_xld, convexity_xld, elliptic_axis_xld, eccentricity_xld, smallest_circle_xld, smallest_rectangle1_xld, smallest_rectangle2_xld, diameter_xld, orientation_xld, moments_xld, select_obj
Sub-pixel operators