threshold__ ( Image : Region : MinGrey, MaxGrey : )

Select gray values lying within an interval.

threshold__ selects the pixels from the input image whose gray values g fulfill the following condition:

             MinGrey <= g <=  MaxGrey .

All points of an image fulfilling the condition are returned as one region. If more than one gray value interval is passed (tuples for MinGrey and MaxGrey), one separate region is returned for each interval.


Parameters

Image (input_object)
image(-array) -> object : byte / direction / cyclic / int2 / int4 / real
Image to be thresholded.

Region (output_object)
region(-array) -> object
Regions with gray values lying in the specified interval.

MinGrey (input_control)
number(-array) -> real / integer
Lower threshold for the gray values.
Default value: 128.0
Suggested values: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0
Range of values: 0.0 <= MinGrey <= 255.0 (lin)
Minimum increment: 0.01
Recommended increment: 5.0

MaxGrey (input_control)
number(-array) -> real / integer
Upper threshold for the gray values.
Default value: 255.0
Suggested values: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0
Range of values: 0.0 <= MaxGrey <= 255.0 (lin)
Minimum increment: 0.01
Recommended increment: 5.0
Restriction: MaxGrey >= MinGrey


Example
read_image(:Image:'fabrik':) >
sobel_dir(Image:EdgeAmp,EdgeDir:'sum_abs',3:) >
threshold__(EdgeAmp:Seg:50,255,2) >
skeleton(Seg:Rand::) >
connection(Rand:Lines::) >
select_shape(Lines:Edges:'area','and',10,1000000:).

Complexity

Let F be the area of the input region. Then the runtime complexity is O(F).


Result

threshold__ returns TRUE if all parameters are correct. The behaviour with respect to the input images and output regions can be determined by setting the values of the flags 'no_object_result', 'empty_region_result', and 'store_empty_region' with set_system. If necessary, an exception is raised.


Possible Predecessors

histo_to_thresh, min_max__, sobel_amp, gauss__, reduce_domain, fill_interlace__


Possible Successors

connection, dilation1, erosion1, opening, closing, count, shape_trans, skeleton


Alternatives

class_2dim__, hysteresis_threshold__, dyn_threshold__


See also

zero_crossing1, zero_crossing2, background_seg, regiongrowing__



Copyright © 1996-1997 MVTec Software GmbH