Operator Reference

select_grayselect_graySelectGraySelectGrayselect_gray (Operator)

select_grayselect_graySelectGraySelectGrayselect_gray — Select regions based on gray value features.

Signature

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)

void SelectGray(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)

static void HOperatorSet.SelectGray(HObject regions, HObject image, out HObject selectedRegions, HTuple features, HTuple operation, HTuple min, HTuple max)

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)

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

Description

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

Restriction:

Possible values for FeaturesFeaturesFeaturesfeaturesfeatures:

Attention

Note that the operator select_grayselect_graySelectGraySelectGrayselect_gray only considers the given RegionsRegionsRegionsregionsregions and ignores any previously set domain of the input image ImageImageImageimageimage. If only one feature is used the value of OperationOperationOperationoperationoperation 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

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Automatically parallelized on tuple level.

Parameters

RegionsRegionsRegionsregionsregions (input_object)  region-array objectHRegionHObjectHObjectHobject

Regions to be examined.

ImageImageImageimageimage (input_object)  singlechannelimage objectHImageHObjectHObjectHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Gray value image.

SelectedRegionsSelectedRegionsSelectedRegionsselectedRegionsselected_regions (output_object)  region-array objectHRegionHObjectHObjectHobject *

Regions having features within the limits.

FeaturesFeaturesFeaturesfeaturesfeatures (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Names of the features.

Default: 'mean' "mean" "mean" "mean" "mean"

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

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

Logical connection of features.

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

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

MinMinMinminmin (input_control)  number(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Lower limit(s) of features or 'min'.

Default: 128.0

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

MaxMaxMaxmaxmax (input_control)  number(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Upper limit(s) of features or 'max'.

Default: 255.0

Suggested values: 0.5, 1.0, 10.0, 20.0, 50.0, 128.0, 255.0, 1000.0, 'max'"max""max""max""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_grayselect_graySelectGraySelectGrayselect_gray 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>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>), the behavior in case of empty region is set via set_system(::'empty_region_result',<Result>:)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

connectionconnectionConnectionConnectionconnection, mean_imagemean_imageMeanImageMeanImagemean_image, entropy_imageentropy_imageEntropyImageEntropyImageentropy_image, sobel_ampsobel_ampSobelAmpSobelAmpsobel_amp, median_separatemedian_separateMedianSeparateMedianSeparatemedian_separate

Possible Successors

select_shapeselect_shapeSelectShapeSelectShapeselect_shape, shape_transshape_transShapeTransShapeTransshape_trans, reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain, count_objcount_objCountObjCountObjcount_obj

See also

deviation_imagedeviation_imageDeviationImageDeviationImagedeviation_image, entropy_grayentropy_grayEntropyGrayEntropyGrayentropy_gray, intensityintensityIntensityIntensityintensity, mean_imagemean_imageMeanImageMeanImagemean_image, min_max_graymin_max_grayMinMaxGrayMinMaxGraymin_max_gray, select_objselect_objSelectObjSelectObjselect_obj

Module

Foundation