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

select_grayselect_grayselect_graySelectGraySelectGray (Operator)

Name

select_grayselect_grayselect_graySelectGraySelectGray — Select regions based on gray value features.

Signature

select_gray(Regions, Image : SelectedRegions : Features, Operation, Min, Max : )

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)

Herror select_gray(Hobject Regions, Hobject Image, Hobject* SelectedRegions, const HTuple& Features, const HTuple& Operation, const HTuple& Min, const HTuple& Max)

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

void HOperatorSetX.SelectGray(
[in] IHUntypedObjectX* Regions, [in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*SelectedRegions, [in] VARIANT Features, [in] VARIANT Operation, [in] VARIANT Min, [in] VARIANT Max)

IHRegionX* HRegionX.SelectGray(
[in] IHImageX* Image, [in] VARIANT Features, [in] BSTR Operation, [in] VARIANT Min, [in] VARIANT Max)

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)

Description

The operator select_grayselect_grayselect_graySelectGraySelectGray has a number of regions (RegionsRegionsRegionsRegionsregions) as input. For each of these regions the features (FeaturesFeaturesFeaturesFeaturesfeatures) are calculated. If each (OperationOperationOperationOperationoperation = 'and') or at least one (OperationOperationOperationOperationoperation = 'or') of the calculated features is within the limits determined by the parameter, the region is transferred (duplicated) into the output. The parameter ImageImageImageImageimage contains an image which returns the gray values for calculating the features.

Condition:

   Min[i] <= Features[i](Regions,Image) <= Max[i]

Possble values for FeaturesFeaturesFeaturesFeaturesfeatures:

  'area'            Gray value volume of region
                    (see area_center_grayarea_center_grayarea_center_grayAreaCenterGrayAreaCenterGray)
  'row'             Row index of the center of gravity
                    (see area_center_grayarea_center_grayarea_center_grayAreaCenterGrayAreaCenterGray)
  'column'          Column index of the center of gravity
                    (see area_center_grayarea_center_grayarea_center_grayAreaCenterGrayAreaCenterGray)
  'ra'              Major axis of equivallent ellipse
                    (see elliptic_axis_grayelliptic_axis_grayelliptic_axis_grayEllipticAxisGrayEllipticAxisGray)
  'rb'              Minor axis of equivallent ellipse
                    (see elliptic_axis_grayelliptic_axis_grayelliptic_axis_grayEllipticAxisGrayEllipticAxisGray)
  'phi'             Orientation of equivallent ellipse
                    (see elliptic_axis_grayelliptic_axis_grayelliptic_axis_grayEllipticAxisGrayEllipticAxisGray)
  'min'             Minimum gray value (see min_max_graymin_max_graymin_max_grayMinMaxGrayMinMaxGray)
  'max'             Maximum gray value (see min_max_graymin_max_graymin_max_grayMinMaxGrayMinMaxGray)
  'mean'            Mean gray value (see intensityintensityintensityIntensityIntensity)
  'deviation'       Deviation of gray values (see intensityintensityintensityIntensityIntensity)
  'plane_deviation' Deviation from the approximating plane
                    (see plane_deviationplane_deviationplane_deviationPlaneDeviationPlaneDeviation)
  'anisotropy'      Anisotropy (see entropy_grayentropy_grayentropy_grayEntropyGrayEntropyGray)
  'entropy'         Entropy (see entropy_grayentropy_grayentropy_grayEntropyGrayEntropyGray)
  'fuzzy_entropy'   Fuzzy entropie of region (see fuzzy_entropyfuzzy_entropyfuzzy_entropyFuzzyEntropyFuzzyEntropy,
                    with a fuzzy function from Apar=0 to Cpar=255)
  'fuzzy_perimeter' Fuzzy perimeter of region (see fuzzy_perimeterfuzzy_perimeterfuzzy_perimeterFuzzyPerimeterFuzzyPerimeter,
                    with a fuzzy function from Apar=0 to Cpar=255)
  'moments_row'     Mixed moments along a row
                    (see moments_gray_planemoments_gray_planemoments_gray_planeMomentsGrayPlaneMomentsGrayPlane)
  'moments_column'  Mixed moments along a column
                    (see moments_gray_planemoments_gray_planemoments_gray_planeMomentsGrayPlaneMomentsGrayPlane)
  'alpha'           Approximating plane, parameter Alpha
                    (see moments_gray_planemoments_gray_planemoments_gray_planeMomentsGrayPlaneMomentsGrayPlane)
  'beta'            Approximating plane, parameter Beta
                    (see moments_gray_planemoments_gray_planemoments_gray_planeMomentsGrayPlaneMomentsGrayPlane)

Attention

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.

Parallelization

Parameters

RegionsRegionsRegionsRegionsregions (input_object)  region-array objectHRegionHRegionArrayHRegionXHobject

Regions to be examined.

ImageImageImageImageimage (input_object)  image objectHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Gray value image.

SelectedRegionsSelectedRegionsSelectedRegionsSelectedRegionsselectedRegions (output_object)  region-array objectHRegionHRegionArrayHRegionXHobject *

Regions having features within the limits.

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

Names of the features.

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

List of values: 'area'"area""area""area""area", 'row'"row""row""row""row", 'column'"column""column""column""column", 'ra'"ra""ra""ra""ra", 'rb'"rb""rb""rb""rb", 'phi'"phi""phi""phi""phi", 'min'"min""min""min""min", 'max'"max""max""max""max", 'mean'"mean""mean""mean""mean", 'deviation'"deviation""deviation""deviation""deviation", 'plane_deviation'"plane_deviation""plane_deviation""plane_deviation""plane_deviation", 'anisotropy'"anisotropy""anisotropy""anisotropy""anisotropy", '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", 'moments_row'"moments_row""moments_row""moments_row""moments_row", 'moments_column'"moments_column""moments_column""moments_column""moments_column", 'alpha'"alpha""alpha""alpha""alpha", 'beta'"beta""beta""beta""beta"

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

Logical connection of features.

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

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

MinMinMinMinmin (input_control)  number(-array) HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Lower limit(s) of features.

Default value: 128.0

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

MaxMaxMaxMaxmax (input_control)  number(-array) HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Upper limit(s) of features.

Default value: 255.0

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

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

Possible Predecessors

connectionconnectionconnectionConnectionConnection, mean_imagemean_imagemean_imageMeanImageMeanImage, entropy_imageentropy_imageentropy_imageEntropyImageEntropyImage, sobel_ampsobel_ampsobel_ampSobelAmpSobelAmp, median_separatemedian_separatemedian_separateMedianSeparateMedianSeparate

Possible Successors

select_shapeselect_shapeselect_shapeSelectShapeSelectShape, select_grayselect_grayselect_graySelectGraySelectGray, shape_transshape_transshape_transShapeTransShapeTrans, reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, count_objcount_objcount_objCountObjCountObj

See also

deviation_imagedeviation_imagedeviation_imageDeviationImageDeviationImage, entropy_grayentropy_grayentropy_grayEntropyGrayEntropyGray, intensityintensityintensityIntensityIntensity, mean_imagemean_imagemean_imageMeanImageMeanImage, min_max_graymin_max_graymin_max_grayMinMaxGrayMinMaxGray, select_objselect_objselect_objSelectObjSelectObj

Module

Foundation


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