Herror ::fast_threshold (
    Hobject Image,
    Hobject *Region,
    const HTuple &MinGray,
    const HTuple &MaxGray,
    const HTuple &MinHeight
)
HRegion HImage::FastThreshold (
    const HTuple &MinGray,
    const HTuple &MaxGray,
    const HTuple &MinHeight
) const
HRegionArray HImageArray::FastThreshold (
    const HTuple &MinGray,
    const HTuple &MaxGray,
    const HTuple &MinHeight
) const

Fast selection of grayvalues within a given gray intervall.

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

             MinGray <= g <=  MaxGray .

To reduce procesing time, the selection is done in two steps: At first all pixels along rows with distances MinHeight are processed. In the next step the neighborhood (size MinHeight x MinHeight) of all previously selected points are processed.


Parameters

Image (input_object)
image(-array) -> Hobject: HImage(Array) ( byte / direction / cyclic )
Image to be thresholded.

Region (output_object)
region(-array) -> Hobject * : HRegion(Array)
Regions with gray values lying in the specified interval.

MinGray (input_control)
number -> HTuple.double / long
Lower threshold for the gray values.
Default value: 128
Suggested values: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0
Typical range of values: 0.0 <= MinGray <= 255.0 (lin)
Minimum increment: 1
Recommended increment: 5.0

MaxGray (input_control)
number -> HTuple.double / long
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
Typical range of values: 0.0 <= MaxGray <= 255.0 (lin)
Minimum increment: 1
Recommended increment: 5.0

MinHeight (input_control)
number -> HTuple.long
Minimum height of objects to be extracted.
Default value: 20
Suggested values: 5, 10, 15, 20, 25, 30, 40, 50, 60, 70, 100
Typical range of values: 2 <= MinHeight <= 200 (lin)
Minimum increment: 1
Recommended increment: 2


Complexity

Let A be the area of the ouput region and height the height of Image. Then the runtime complexity is O(A + height / MinHeight).


Result

::fast_threshold returns H_MSG_TRUE if all parameters are correct. The behavior 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_gray, ::sobel_amp, ::gauss_image, ::reduce_domain, ::fill_interlace


Possible Successors

::connection, ::dilation1, ::erosion1, ::opening, ::closing, ::rank_region, ::shape_trans, ::skeleton


Alternatives

::threshold


See also

::class_2dim_sup, ::hysteresis_threshold, ::dyn_threshold


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH