HALCON Reference Manual 10.0.2
Table of Contents / Segmentation / Threshold ClassesClassesClasses | | | Operators

fast_thresholdfast_thresholdfast_thresholdFastThresholdFastThreshold (Operator)

Name

fast_thresholdfast_thresholdfast_thresholdFastThresholdFastThreshold — Fast thresholding of images using global thresholds.

Signature

fast_threshold(Image : Region : MinGray, MaxGray, MinSize : )

Herror fast_threshold(const Hobject Image, Hobject* Region, double MinGray, double MaxGray, const Hlong MinSize)

Herror T_fast_threshold(const Hobject Image, Hobject* Region, const Htuple MinGray, const Htuple MaxGray, const Htuple MinSize)

Herror fast_threshold(Hobject Image, Hobject* Region, const HTuple& MinGray, const HTuple& MaxGray, const HTuple& MinSize)

HRegion HImage::FastThreshold(const HTuple& MinGray, const HTuple& MaxGray, const HTuple& MinSize) const

HRegionArray HImageArray::FastThreshold(const HTuple& MinGray, const HTuple& MaxGray, const HTuple& MinSize) const

void HOperatorSetX.FastThreshold(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*Region, [in] VARIANT MinGray, [in] VARIANT MaxGray, [in] VARIANT MinSize)

IHRegionX* HImageX.FastThreshold(
[in] VARIANT MinGray, [in] VARIANT MaxGray, [in] Hlong MinSize)

static void HOperatorSet.FastThreshold(HObject image, out HObject region, HTuple minGray, HTuple maxGray, HTuple minSize)

HRegion HImage.FastThreshold(HTuple minGray, HTuple maxGray, int minSize)

HRegion HImage.FastThreshold(double minGray, double maxGray, int minSize)

Description

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

             MinGray <= g <=  MaxGray .

To reduce the procesing time, the selection is done in two steps: At first, all points lying on selected horizontal lines that are specified by their distance MinSizeMinSizeMinSizeMinSizeminSize are processed. In the next step the neighborhood (size (2*MinSize+1) x (2*MinSize+1)) of all previously selected points are processed.

Attention

On multicore computers supporting the SSE2 instruction set, thresholdthresholdthresholdThresholdThreshold is most likely faster than fast_thresholdfast_thresholdfast_thresholdFastThresholdFastThreshold. fast_thresholdfast_thresholdfast_thresholdFastThresholdFastThreshold may only be preferred to thresholdthresholdthresholdThresholdThreshold if those features are not available, e.g. on embedded platforms.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  image(-array) objectHImageHImageHImageXHobject (byte / uint2 / direction / cyclic / real)

Input image.

RegionRegionRegionRegionregion (output_object)  region(-array) objectHRegionHRegionHRegionXHobject *

Segmented regions.

MinGrayMinGrayMinGrayMinGrayminGray (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

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 MinGray MinGray MinGray minGray ≤ 255.0 (lin)

Minimum increment: 1

Recommended increment: 5.0

MaxGrayMaxGrayMaxGrayMaxGraymaxGray (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

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 MaxGray MaxGray MaxGray maxGray ≤ 255.0 (lin)

Minimum increment: 1

Recommended increment: 5.0

MinSizeMinSizeMinSizeMinSizeminSize (input_control)  number HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Minimum size 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 ≤ MinSize MinSize MinSize MinSize minSize ≤ 200 (lin)

Minimum increment: 1

Recommended increment: 2

Complexity

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

Result

fast_thresholdfast_thresholdfast_thresholdFastThresholdFastThreshold returns 2 (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'"no_object_result""no_object_result""no_object_result""no_object_result", 'empty_region_result'"empty_region_result""empty_region_result""empty_region_result""empty_region_result", and 'store_empty_region'"store_empty_region""store_empty_region""store_empty_region""store_empty_region" with set_systemset_systemset_systemSetSystemSetSystem. If necessary, an exception is raised.

Possible Predecessors

histo_to_threshhisto_to_threshhisto_to_threshHistoToThreshHistoToThresh, min_max_graymin_max_graymin_max_grayMinMaxGrayMinMaxGray, sobel_ampsobel_ampsobel_ampSobelAmpSobelAmp, binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter, gauss_imagegauss_imagegauss_imageGaussImageGaussImage, reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, fill_interlacefill_interlacefill_interlaceFillInterlaceFillInterlace

Possible Successors

connectionconnectionconnectionConnectionConnection, dilation1dilation1dilation1Dilation1Dilation1, erosion1erosion1erosion1Erosion1Erosion1, openingopeningopeningOpeningOpening, closingclosingclosingClosingClosing, rank_regionrank_regionrank_regionRankRegionRankRegion, shape_transshape_transshape_transShapeTransShapeTrans, skeletonskeletonskeletonSkeletonSkeleton

Alternatives

thresholdthresholdthresholdThresholdThreshold, gen_grid_regiongen_grid_regiongen_grid_regionGenGridRegionGenGridRegion, dilation_rectangle1dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1, dyn_thresholddyn_thresholddyn_thresholdDynThresholdDynThreshold

See also

class_2dim_supclass_2dim_supclass_2dim_supClass2dimSupClass2dimSup, hysteresis_thresholdhysteresis_thresholdhysteresis_thresholdHysteresisThresholdHysteresisThreshold

Module

Foundation


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