HALCON Reference Manual 10.0.2
Table of Contents / XLD / Features ClassesClassesClasses | | | Operators

select_shape_xldselect_shape_xldselect_shape_xldSelectShapeXldSelectShapeXld (Operator)

Name

select_shape_xldselect_shape_xldselect_shape_xldSelectShapeXldSelectShapeXld — Select contours or polygons using shape features.

Signature

select_shape_xld(XLD : SelectedXLD : Features, Operation, Min, Max : )

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)

Herror select_shape_xld(Hobject XLD, Hobject* SelectedXLD, const HTuple& Features, const HTuple& Operation, const HTuple& Min, const HTuple& Max)

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

void HOperatorSetX.SelectShapeXld(
[in] IHUntypedObjectX* XLD, [out] IHUntypedObjectX*SelectedXLD, [in] VARIANT Features, [in] VARIANT Operation, [in] VARIANT Min, [in] VARIANT Max)

IHXLDX* HXLDX.SelectShapeXld(
[in] VARIANT Features, [in] BSTR Operation, [in] VARIANT Min, [in] VARIANT Max)

IHXLDX* HXLDContX.SelectShapeXld(
[in] VARIANT Features, [in] BSTR Operation, [in] VARIANT Min, [in] VARIANT Max)

IHXLDX* HXLDPolyX.SelectShapeXld(
[in] VARIANT Features, [in] BSTR Operation, [in] VARIANT Min, [in] VARIANT Max)

IHXLDX* HXLDParaX.SelectShapeXld(
[in] VARIANT Features, [in] BSTR Operation, [in] VARIANT Min, [in] VARIANT Max)

IHXLDX* HXLDModParaX.SelectShapeXld(
[in] VARIANT Features, [in] BSTR Operation, [in] VARIANT Min, [in] VARIANT Max)

IHXLDX* HXLDExtParaX.SelectShapeXld(
[in] VARIANT Features, [in] BSTR Operation, [in] VARIANT Min, [in] VARIANT Max)

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)

Description

The operator select_shape_xldselect_shape_xldselect_shape_xldSelectShapeXldSelectShapeXld selects contours or polygons according to their shape. For each input contour or polygon in XLDXLDXLDXLDXLD the indicated features (FeaturesFeaturesFeaturesFeaturesfeatures) are calculated. If each (OperationOperationOperationOperationoperation = 'and') or at least one (OperationOperationOperationOperationoperation = 'or') of the calculated features is within the limits (MinMinMinMinmin,MaxMaxMaxMaxmax) the contour respectively polygon is copied into the output.

Condition: MinMinMinMinmin_i <= FeaturesFeaturesFeaturesFeaturesfeatures_i(Object) <= MaxMaxMaxMaxmax_i

Possible values for FeaturesFeaturesFeaturesFeaturesfeatures:

(all features can be used with polygons as well)

'area':

Area of the contour (see area_center_xldarea_center_xldarea_center_xldAreaCenterXldAreaCenterXld)

'area_points':

Area of the contour points (see area_center_points_xldarea_center_points_xldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld)

'row':

Row index of the center of gravity (see area_center_xldarea_center_xldarea_center_xldAreaCenterXldAreaCenterXld)

'column':

Column index of the center of gravity (see area_center_xldarea_center_xldarea_center_xldAreaCenterXldAreaCenterXld)

'row_points':

Row index of the center of gravity of the contour points (see area_center_points_xldarea_center_points_xldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld)

'column_points':

Column index of the center of gravity of the contour points (see area_center_points_xldarea_center_points_xldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld)

'width':

Width of the contour

'height':

Height of the contour

'row1':

Row coordinate of upper left corner (see smallest_rectangle1_xldsmallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xld)

'column1':

Column coordinate of upper left corner (see smallest_rectangle1_xldsmallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xld)

'row2':

Row coordinate of lower right corner (see smallest_rectangle1_xldsmallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xld)

'column2':

Column coordinate of lower right corner (see smallest_rectangle1_xldsmallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xld)

'circularity':

Circularity (see circularity_xldcircularity_xldcircularity_xldCircularityXldCircularityXld)

'compactness':

Compactness (see compactness_xldcompactness_xldcompactness_xldCompactnessXldCompactnessXld)

'contlength':

Total length of contour (see length_xldlength_xldlength_xldLengthXldLengthXld)

'convexity':

Convexity (see convexity_xldconvexity_xldconvexity_xldConvexityXldConvexityXld)

'ra':

Major radius of the equivalent ellipse (see elliptic_axis_xldelliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXld)

'rb':

Minor radius of the equivalent ellipse (see elliptic_axis_xldelliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXld)

'phi':

Orientation of the equivalent ellipse (see elliptic_axis_xldelliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXld)

'ra_points':

Major radius of the equivalent ellipse of the contour points (see elliptic_axis_points_xldelliptic_axis_points_xldelliptic_axis_points_xldEllipticAxisPointsXldEllipticAxisPointsXld)

'rb_points':

Minor radius of the equivalent ellipse of the contour points (see elliptic_axis_points_xldelliptic_axis_points_xldelliptic_axis_points_xldEllipticAxisPointsXldEllipticAxisPointsXld)

'phi_points':

Orientation of the equivalent ellipse of the contour points (see elliptic_axis_points_xldelliptic_axis_points_xldelliptic_axis_points_xldEllipticAxisPointsXldEllipticAxisPointsXld)

'anisometry:'

Anisometry (see eccentricity_xldeccentricity_xldeccentricity_xldEccentricityXldEccentricityXld)

'anisometry_points:'

Anisometry of the contour points (see eccentricity_points_xldeccentricity_points_xldeccentricity_points_xldEccentricityPointsXldEccentricityPointsXld)

'bulkiness:'

Bulkiness (see eccentricity_xldeccentricity_xldeccentricity_xldEccentricityXldEccentricityXld)

'struct_factor:'

Structure factor (see eccentricity_xldeccentricity_xldeccentricity_xldEccentricityXldEccentricityXld)

'outer_radius':

Radius of smallest enclosing circle (see smallest_circle_xldsmallest_circle_xldsmallest_circle_xldSmallestCircleXldSmallestCircleXld)

'max_diameter':

Maximum diameter of the contour (see diameter_xlddiameter_xlddiameter_xldDiameterXldDiameterXld)

'orientation':

Orientation of the contour (see orientation_xldorientation_xldorientation_xldOrientationXldOrientationXld)

'orientation_points':

Orientation of the contour points (see orientation_points_xldorientation_points_xldorientation_points_xldOrientationPointsXldOrientationPointsXld)

'rect2_phi':

Orientation of the smallest surrounding rectangle (see smallest_rectangle2_xldsmallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld)

'rect2_len1':

Half the length of the smallest surrounding rectangle (see smallest_rectangle2_xldsmallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld)

'rect2_len2':

Half the width of the smallest surrounding rectangle (see smallest_rectangle2_xldsmallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld)

'moments_m11', 'moments_m20', 'moments_m02':

Geometric moments of the contour (see moments_region_2ndmoments_region_2ndmoments_region_2ndMomentsRegion2ndMomentsRegion2nd)

'moments_m11_points', 'moments_m20_points', 'moments_m02_points':

Geometric moments of the contour points (see moments_points_xldmoments_points_xldmoments_points_xldMomentsPointsXldMomentsPointsXld)

If only one feature (FeaturesFeaturesFeaturesFeaturesfeatures) is used the value of OperationOperationOperationOperationoperation 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_xldtest_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXld).

Parallelization

Parameters

XLDXLDXLDXLDXLD (input_object)  xld-array objectHXLDHXLDArrayHXLDXHobject

Contours or polygons to be examined.

SelectedXLDSelectedXLDSelectedXLDSelectedXLDselectedXLD (output_object)  xld-array objectHXLDHXLDArrayHXLDXHobject *

Contours or polygons fulfilling the condition(s).

FeaturesFeaturesFeaturesFeaturesfeatures (input_control)  string(-array) HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Shape features to be checked.

Default value: 'area' "area" "area" "area" "area"

List of values: 'area'"area""area""area""area", 'area_points'"area_points""area_points""area_points""area_points", 'row'"row""row""row""row", 'row_points'"row_points""row_points""row_points""row_points", 'column'"column""column""column""column", 'column_points'"column_points""column_points""column_points""column_points", 'width'"width""width""width""width", 'height'"height""height""height""height", 'row1'"row1""row1""row1""row1", 'column1'"column1""column1""column1""column1", 'row2'"row2""row2""row2""row2", 'column2'"column2""column2""column2""column2", 'circularity'"circularity""circularity""circularity""circularity", 'compactness'"compactness""compactness""compactness""compactness", 'contlength'"contlength""contlength""contlength""contlength", 'convexity'"convexity""convexity""convexity""convexity", 'ra'"ra""ra""ra""ra", 'ra_points'"ra_points""ra_points""ra_points""ra_points", 'rb'"rb""rb""rb""rb", 'rb_points'"rb_points""rb_points""rb_points""rb_points", 'phi'"phi""phi""phi""phi", 'phi_points'"phi_points""phi_points""phi_points""phi_points", 'anisometry'"anisometry""anisometry""anisometry""anisometry", 'anisometry_points'"anisometry_points""anisometry_points""anisometry_points""anisometry_points", 'bulkiness'"bulkiness""bulkiness""bulkiness""bulkiness", 'struct_factor'"struct_factor""struct_factor""struct_factor""struct_factor", 'outer_radius'"outer_radius""outer_radius""outer_radius""outer_radius", 'max_diameter'"max_diameter""max_diameter""max_diameter""max_diameter", 'orientation'"orientation""orientation""orientation""orientation", 'orientation_points'"orientation_points""orientation_points""orientation_points""orientation_points", 'rect2_phi'"rect2_phi""rect2_phi""rect2_phi""rect2_phi", 'rect2_len1'"rect2_len1""rect2_len1""rect2_len1""rect2_len1", 'rect2_len2'"rect2_len2""rect2_len2""rect2_len2""rect2_len2", '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", '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"

OperationOperationOperationOperationoperation (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Operation type between the individual features.

Default value: 'and' "and" "and" "and" "and"

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

MinMinMinMinmin (input_control)  real(-array) HTupleHTupleVARIANTHtuple (real / integer / string) (double / int / long / string) (double / Hlong / char*) (double / Hlong / BSTR) (double / Hlong / char*)

Lower limits of the features or 'min'.

Default value: 150.0

Typical range of values: 0.0 ≤ Min Min Min Min min ≤ 99999.0

Minimum increment: 0.001

Recommended increment: 1.0

MaxMaxMaxMaxmax (input_control)  real(-array) HTupleHTupleVARIANTHtuple (real / integer / string) (double / int / long / string) (double / Hlong / char*) (double / Hlong / BSTR) (double / Hlong / char*)

Upper limits of the features or 'max'.

Default value: 99999.0

Typical range of values: 0.0 ≤ Max Max Max Max max ≤ 99999.0

Minimum increment: 0.001

Recommended increment: 1.0

Restriction: Max >= Min

Result

The operator select_shape_xldselect_shape_xldselect_shape_xldSelectShapeXldSelectShapeXld 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>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary an exception is raised.

Possible Predecessors

gen_contours_skeleton_xldgen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld, edges_sub_pixedges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPix, threshold_sub_pixthreshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPix, gen_contour_polygon_xldgen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXld, test_self_intersection_xldtest_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXld

Possible Successors

shape_trans_xldshape_trans_xldshape_trans_xldShapeTransXldShapeTransXld, count_objcount_objcount_objCountObjCountObj

See also

area_center_xldarea_center_xldarea_center_xldAreaCenterXldAreaCenterXld, area_center_points_xldarea_center_points_xldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld, circularity_xldcircularity_xldcircularity_xldCircularityXldCircularityXld, compactness_xldcompactness_xldcompactness_xldCompactnessXldCompactnessXld, convexity_xldconvexity_xldconvexity_xldConvexityXldConvexityXld, elliptic_axis_xldelliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXld, elliptic_axis_points_xldelliptic_axis_points_xldelliptic_axis_points_xldEllipticAxisPointsXldEllipticAxisPointsXld, eccentricity_xldeccentricity_xldeccentricity_xldEccentricityXldEccentricityXld, eccentricity_points_xldeccentricity_points_xldeccentricity_points_xldEccentricityPointsXldEccentricityPointsXld, smallest_circle_xldsmallest_circle_xldsmallest_circle_xldSmallestCircleXldSmallestCircleXld, smallest_rectangle1_xldsmallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xld, smallest_rectangle2_xldsmallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld, diameter_xlddiameter_xlddiameter_xldDiameterXldDiameterXld, orientation_xldorientation_xldorientation_xldOrientationXldOrientationXld, orientation_points_xldorientation_points_xldorientation_points_xldOrientationPointsXldOrientationPointsXld, moments_xldmoments_xldmoments_xldMomentsXldMomentsXld, moments_points_xldmoments_points_xldmoments_points_xldMomentsPointsXldMomentsPointsXld, select_objselect_objselect_objSelectObjSelectObj

Module

Foundation


Table of Contents / XLD / Features ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH