Skip to content

select_graySelectGraySelectGrayselect_grayselect_grayπŸ”—

Short descriptionπŸ”—

select_graySelectGraySelectGrayselect_grayselect_gray β€” Select regions based on gray value features.

SignatureπŸ”—

select_gray( region Regions, image Image, out region SelectedRegions, string Features, string Operation, number Min, number Max )void SelectGray( const HObject& Regions, const HObject& Image, HObject* SelectedRegions, const HTuple& Features, const HTuple& Operation, const HTuple& Min, const HTuple& Max )static void HOperatorSet.SelectGray( HObject regions, HObject image, out HObject selectedRegions, HTuple features, HTuple operation, HTuple min, HTuple max )def select_gray( regions: HObject, image: HObject, features: MaybeSequence[str], operation: str, min: MaybeSequence[Union[int, float, str]], max: MaybeSequence[Union[int, float, str]] ) -> HObject

Herror select_gray( const Hobject Regions, const Hobject Image, Hobject* SelectedRegions, const char* Features, const char* Operation, double Min, double Max )

Herror T_select_gray( const Hobject Regions, const Hobject Image, Hobject* SelectedRegions, const Htuple Features, const Htuple Operation, const Htuple Min, const Htuple Max )

HRegion HRegion::SelectGray( const HImage& Image, const HTuple& Features, const HString& Operation, const HTuple& Min, const HTuple& Max ) const

HRegion HRegion::SelectGray( const HImage& Image, const HString& Features, const HString& Operation, double Min, double Max ) const

HRegion HRegion::SelectGray( const HImage& Image, const char* Features, const char* Operation, double Min, double Max ) const

HRegion HRegion::SelectGray( const HImage& Image, const wchar_t* Features, const wchar_t* Operation, double Min, double Max ) const (Windows only)

HRegion HRegion.SelectGray( HImage image, HTuple features, string operation, HTuple min, HTuple max )

HRegion HRegion.SelectGray( HImage image, string features, string operation, double min, double max )

DescriptionπŸ”—

The operator select_graySelectGray has a number of regions (Regionsregionsregions) as input. For each of these regions the (Featuresfeaturesfeatures) are calculated. The region is transferred (duplicated) into the output SelectedRegionsselectedRegionsselected_regions, if each (Operationoperationoperation = 'and'"and") or at least one (Operationoperationoperation = 'or'"or") of the calculated features is within the limits. The limits are defined by the parameters Minminmin and Maxmaxmax. Thereby, Minminmin and Maxmaxmax can also be set to 'min'"min" or 'max'"max", respectively, corresponding to setting the smallest or largest value possible for this feature. The parameter Imageimageimage contains an image which returns the gray values for calculating the features.

Restriction:

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

Possible values for Featuresfeaturesfeatures:

AttentionπŸ”—

Note that the operator select_graySelectGray only considers the given Regionsregionsregions and ignores any previously set domain of the input image Imageimageimage. If only one feature is used the value of Operationoperationoperation is meaningless. Several features are processed in the order in which they are entered. The maximum number of features is limited to 100.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

ParametersπŸ”—

Regionsregionsregions (input_object) region-array β†’ objectHObjectHRegionHObjectHobject

Regions to be examined.

Imageimageimage (input_object) singlechannelimage β†’ object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Gray value image.

SelectedRegionsselectedRegionsselected_regions (output_object) region-array β†’ objectHObjectHRegionHObjectHobject *

Regions having features within the limits.

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

Names of the features.

Default: 'mean'"mean"
List of values: 'alpha', 'anisotropy', 'area', 'beta', 'column', 'deviation', 'entropy', 'fuzzy_entropy', 'fuzzy_perimeter', 'max', 'mean', 'median', 'min', 'moments_column', 'moments_row', 'phi', 'plane_deviation', 'ra', 'rb', 'row'"alpha", "anisotropy", "area", "beta", "column", "deviation", "entropy", "fuzzy_entropy", "fuzzy_perimeter", "max", "mean", "median", "min", "moments_column", "moments_row", "phi", "plane_deviation", "ra", "rb", "row"

Operationoperationoperation (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Logical connection of features.

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

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

Lower limit(s) of features or β€˜min’.

Default: 128.0128.0
Suggested values: 0.5, 1.0, 10.0, 20.0, 50.0, 128.0, 255.0, 1000.0, 'min'0.5, 1.0, 10.0, 20.0, 50.0, 128.0, 255.0, 1000.0, "min"

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

Upper limit(s) of features or β€˜max’.

Default: 255.0255.0
Suggested values: 0.5, 1.0, 10.0, 20.0, 50.0, 128.0, 255.0, 1000.0, 'max'0.5, 1.0, 10.0, 20.0, 50.0, 128.0, 255.0, 1000.0, "max"

ComplexityπŸ”—

If \(F\) is the area of the region and \(N\) the number of features the runtime complexity is \(O(F * N)\).

ResultπŸ”—

The operator select_graySelectGray returns the value 2 (H_MSG_TRUE) if the input image has the defined gray values and the parameters are correct. The behavior in case of empty input (no input images available) is set via the operator set_system(::'no_object_result',<Result>:), the behavior in case of empty region is set via set_system(::'empty_region_result',<Result>:). If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

connectionConnection, mean_imageMeanImage, entropy_imageEntropyImage, sobel_ampSobelAmp, median_separateMedianSeparate

Possible successors

select_shapeSelectShape, shape_transShapeTrans, reduce_domainReduceDomain, count_objCountObj

See also

deviation_imageDeviationImage, entropy_grayEntropyGray, intensityIntensity, mean_imageMeanImage, min_max_grayMinMaxGray, select_objSelectObj

ModuleπŸ”—

Foundation