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

Select regions based on gray value features.

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

Condition:

   Min[i] <= Features[i](Regions,Image) <= Max[i]
Possible values for Features:
  'mean'            mean gray value (see: intensity)
  'deviation'       standard deviation of gray values (see: intensity)
  'min'             minimum gray value (see: min_max_gray)
  'max'             maximum gray value (see: min_max_gray)
  'entropy'         entropy (see: entropy_gray)
  'anisotropy'      anisotropy (see: entropy_gray)


Attention

If only one feature is used the value of Operation is meaningless. Several features are processed in the order in which they are entered.


Parameters

Regions (input_object)
region-array -> Hobject: HRegionArray
Regions to be examined.

Image (input_object)
image -> Hobject: HImage ( byte / int2 / int4 / real )
Gray value image.

SelectedRegions (output_object)
region-array -> Hobject * : HRegionArray
Regions having features within the limits.

Features (input_control)
string(-array) -> HTuple.char *
Names of the features.
Default value: 'mean'
List of values: 'mean', 'min', 'max', 'deviation', 'entropy', 'anisotropy'

Operation (input_control)
string -> HTuple.char *
Logical connection of features.
Default value: 'and'
List of values: 'and', 'or'

Min (input_control)
number(-array) -> HTuple.double / long
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

Max (input_control)
number(-array) -> HTuple.double / long
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_gray returns the value 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 handling is raised.


Possible Predecessors

::connection, ::mean_image, ::entropy_image, ::sobel_amp, ::median_separate


Possible Successors

::select_shape, ::select_gray, ::shape_trans, ::reduce_domain, ::count_obj


See also

::deviation_image, ::entropy_gray, ::intensity, ::mean_image, ::min_max_gray, ::select_obj


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH