select_contours_xldselect_contours_xldSelectContoursXldSelectContoursXldselect_contours_xld (Operator)

Name

select_contours_xldselect_contours_xldSelectContoursXldSelectContoursXldselect_contours_xld — Select XLD contours according to several features.

Signature

select_contours_xld(Contours : SelectedContours : Feature, Min1, Max1, Min2, Max2 : )

Herror select_contours_xld(const Hobject Contours, Hobject* SelectedContours, const char* Feature, double Min1, double Max1, double Min2, double Max2)

Herror T_select_contours_xld(const Hobject Contours, Hobject* SelectedContours, const Htuple Feature, const Htuple Min1, const Htuple Max1, const Htuple Min2, const Htuple Max2)

void SelectContoursXld(const HObject& Contours, HObject* SelectedContours, const HTuple& Feature, const HTuple& Min1, const HTuple& Max1, const HTuple& Min2, const HTuple& Max2)

HXLDCont HXLDCont::SelectContoursXld(const HString& Feature, double Min1, double Max1, double Min2, double Max2) const

HXLDCont HXLDCont::SelectContoursXld(const char* Feature, double Min1, double Max1, double Min2, double Max2) const

HXLDCont HXLDCont::SelectContoursXld(const wchar_t* Feature, double Min1, double Max1, double Min2, double Max2) const   (Windows only)

static void HOperatorSet.SelectContoursXld(HObject contours, out HObject selectedContours, HTuple feature, HTuple min1, HTuple max1, HTuple min2, HTuple max2)

HXLDCont HXLDCont.SelectContoursXld(string feature, double min1, double max1, double min2, double max2)

def select_contours_xld(contours: HObject, feature: str, min_1: float, max_1: float, min_2: float, max_2: float) -> HObject

Description

select_contours_xldselect_contours_xldSelectContoursXldSelectContoursXldSelectContoursXldselect_contours_xld selects XLD contours from the input contours ContoursContoursContoursContourscontourscontours according to the following features (parameter FeatureFeatureFeatureFeaturefeaturefeature):

'contour_length'"contour_length""contour_length""contour_length""contour_length""contour_length":

all contours whose length is smaller than Min1Min1Min1Min1min1min_1 or larger than Max1Max1Max1Max1max1max_1 are not returned (Min2Min2Min2Min2min2min_2 and Max2Max2Max2Max2max2max_2 have no influence here).

'maximum_extent'"maximum_extent""maximum_extent""maximum_extent""maximum_extent""maximum_extent":

all contours whose maximum extent (as measured by their eight extremal points in row and column direction, according to Haralick and Shapiro: Computer and Robot Vision, Addison-Wesley 1992, chapter 3.2) is smaller than Min1Min1Min1Min1min1min_1 or larger than Max1Max1Max1Max1max1max_1 are not returned (Min2Min2Min2Min2min2min_2 and Max2Max2Max2Max2max2max_2 have no influence here).

'direction'"direction""direction""direction""direction""direction":

only contours for which the direction of the regression line is between Min1Min1Min1Min1min1min_1 and Max1Max1Max1Max1max1max_1 (in radians, counter-clockwise) are returned. Min1Min1Min1Min1min1min_1 and Max1Max1Max1Max1max1max_1 are mapped to the range of [0,2*PI[. (Min2Min2Min2Min2min2min_2 and Max2Max2Max2Max2max2max_2 have no influence here).

'curvature'"curvature""curvature""curvature""curvature""curvature":

only contours for which the mean distance from the regression line lies between Min1Min1Min1Min1min1min_1 and Max1Max1Max1Max1max1max_1, and for which the standard deviation of the distances is between Min2Min2Min2Min2min2min_2 and Max2Max2Max2Max2max2max_2 are returned.

'closed'"closed""closed""closed""closed""closed":

only contours for which the distance between their start point and their end point is less or equal Max1Max1Max1Max1max1max_1 pixels are returned. (Min1Min1Min1Min1min1min_1, Min2Min2Min2Min2min2min_2 and Max2Max2Max2Max2max2max_2 have no influence here.)

'open'"open""open""open""open""open":

only contours for which the distance between their start point and their end point is greater than Min1Min1Min1Min1min1min_1 pixels are returned. (Max1Max1Max1Max1max1max_1, Min2Min2Min2Min2min2min_2 and Max2Max2Max2Max2max2max_2 have no influence here).

If Min1Min1Min1Min1min1min_1 = Max1Max1Max1Max1max1max_1 = 0 or Min2Min2Min2Min2min2min_2 = Max2Max2Max2Max2max2max_2 = 0 is used for the selection according to curvature, the respective feature has no influence on the selection.

Attention

Before contour can be filtered by select_contours_xldselect_contours_xldSelectContoursXldSelectContoursXldSelectContoursXldselect_contours_xld according to 'direction'"direction""direction""direction""direction""direction" or 'curvature'"curvature""curvature""curvature""curvature""curvature", the parameters of the regression lines to the contours must be calculated with regress_contours_xldregress_contours_xldRegressContoursXldRegressContoursXldRegressContoursXldregress_contours_xld. If this has not been done, select_contours_xldselect_contours_xldSelectContoursXldSelectContoursXldSelectContoursXldselect_contours_xld calls regress_contours_xldregress_contours_xldRegressContoursXldRegressContoursXldRegressContoursXldregress_contours_xld internally with the parameters ModeModeModeModemodemode = 'no'"no""no""no""no""no" and IterationsIterationsIterationsIterationsiterationsiterations = 1. If a different mode should be used, regress_contours_xldregress_contours_xldRegressContoursXldRegressContoursXldRegressContoursXldregress_contours_xld must be called explicitly.

Execution Information

Parameters

ContoursContoursContoursContourscontourscontours (input_object)  xld_cont-array objectHXLDContHObjectHXLDContHobject

Input XLD contours.

SelectedContoursSelectedContoursSelectedContoursSelectedContoursselectedContoursselected_contours (output_object)  xld_cont-array objectHXLDContHObjectHXLDContHobject *

Output XLD contours.

FeatureFeatureFeatureFeaturefeaturefeature (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Feature to select contours with.

Default value: 'contour_length' "contour_length" "contour_length" "contour_length" "contour_length" "contour_length"

List of values: 'closed'"closed""closed""closed""closed""closed", 'contour_length'"contour_length""contour_length""contour_length""contour_length""contour_length", 'curvature'"curvature""curvature""curvature""curvature""curvature", 'direction'"direction""direction""direction""direction""direction", 'maximum_extent'"maximum_extent""maximum_extent""maximum_extent""maximum_extent""maximum_extent", 'open'"open""open""open""open""open"

Min1Min1Min1Min1min1min_1 (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Lower threshold.

Default value: 0.5

Max1Max1Max1Max1max1max_1 (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Upper threshold.

Default value: 200.0

Min2Min2Min2Min2min2min_2 (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Lower threshold.

Default value: -0.5

Max2Max2Max2Max2max2max_2 (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Upper threshold.

Default value: 0.5

Possible Predecessors

regress_contours_xldregress_contours_xldRegressContoursXldRegressContoursXldRegressContoursXldregress_contours_xld

See also

get_contour_xldget_contour_xldGetContourXldGetContourXldGetContourXldget_contour_xld, get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld, gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld, lines_gausslines_gaussLinesGaussLinesGaussLinesGausslines_gauss, lines_facetlines_facetLinesFacetLinesFacetLinesFacetlines_facet, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix, get_regress_params_xldget_regress_params_xldGetRegressParamsXldGetRegressParamsXldGetRegressParamsXldget_regress_params_xld, get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldGetContourGlobalAttribXldget_contour_global_attrib_xld, query_contour_global_attribs_xldquery_contour_global_attribs_xldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXldquery_contour_global_attribs_xld

References

R. Haralick, L. Shapiro: “Computer and Robot Vision” Vol. 1; Kapitel 3.2, Addison-Wesley 1992

Module

Foundation