fast_thresholdfast_thresholdFastThresholdFastThresholdfast_threshold (算子)

名称

fast_thresholdfast_thresholdFastThresholdFastThresholdfast_threshold — 使用全局阈值对图像进行快速阈值处理。

签名

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)

void FastThreshold(const HObject& Image, HObject* Region, const HTuple& MinGray, const HTuple& MaxGray, const HTuple& MinSize)

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

HRegion HImage::FastThreshold(double MinGray, double MaxGray, Hlong MinSize) const

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)

def fast_threshold(image: HObject, min_gray: Union[int, float], max_gray: Union[int, float], min_size: int) -> HObject

描述

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

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

注意

On multi-core computers supporting the SSE2 instruction set, thresholdthresholdThresholdThresholdThresholdthreshold is most likely faster than fast_thresholdfast_thresholdFastThresholdFastThresholdFastThresholdfast_threshold. fast_thresholdfast_thresholdFastThresholdFastThresholdFastThresholdfast_threshold may only be preferred to thresholdthresholdThresholdThresholdThresholdthreshold if those features are not available, e.g., on embedded platforms.

执行信息

参数

ImageImageImageImageimageimage (输入对象)  singlechannelimage(-array) objectHImageHObjectHImageHobject (byte / uint2 / direction / cyclic / real)

输入图像。

RegionRegionRegionRegionregionregion (输出对象)  region(-array) objectHRegionHObjectHRegionHobject *

Segmented regions.

MinGrayMinGrayMinGrayMinGrayminGraymin_gray (输入控制)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Lower threshold for the gray values.

默认值: 128

建议值: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0

值范围: 0.0 ≤ MinGray MinGray MinGray MinGray minGray min_gray ≤ 255.0 (lin)

最小增量: 1

建议增量: 5.0

MaxGrayMaxGrayMaxGrayMaxGraymaxGraymax_gray (输入控制)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Upper threshold for the gray values.

默认值: 255.0

建议值: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0

值范围: 0.0 ≤ MaxGray MaxGray MaxGray MaxGray maxGray max_gray ≤ 255.0 (lin)

最小增量: 1

建议增量: 5.0

MinSizeMinSizeMinSizeMinSizeminSizemin_size (输入控制)  number HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimum size of objects to be extracted.

默认值: 20

建议值: 5, 10, 15, 20, 25, 30, 40, 50, 60, 70, 100

值范围: 2 ≤ MinSize MinSize MinSize MinSize minSize min_size ≤ 200 (lin)

最小增量: 1

建议增量: 2

复杂度

Let A be the area of the output region and height the height of ImageImageImageImageimageimage. Then the runtime complexity is O(A + height / MinSizeMinSizeMinSizeMinSizeminSizemin_size).

结果

fast_thresholdfast_thresholdFastThresholdFastThresholdFastThresholdfast_threshold 在所有参数正确时返回 2 ( H_MSG_TRUE )。 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""no_object_result", 'empty_region_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""store_empty_region" with set_systemset_systemSetSystemSetSystemSetSystemset_system。如有必要,则抛出异常。

可能的前趋

histo_to_threshhisto_to_threshHistoToThreshHistoToThreshHistoToThreshhisto_to_thresh, min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray, sobel_ampsobel_ampSobelAmpSobelAmpSobelAmpsobel_amp, binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, fill_interlacefill_interlaceFillInterlaceFillInterlaceFillInterlacefill_interlace

可能的后继

connectionconnectionConnectionConnectionConnectionconnection, dilation1dilation1Dilation1Dilation1Dilation1dilation1, erosion1erosion1Erosion1Erosion1Erosion1erosion1, openingopeningOpeningOpeningOpeningopening, closingclosingClosingClosingClosingclosing, rank_regionrank_regionRankRegionRankRegionRankRegionrank_region, shape_transshape_transShapeTransShapeTransShapeTransshape_trans, skeletonskeletonSkeletonSkeletonSkeletonskeleton

替代

thresholdthresholdThresholdThresholdThresholdthreshold, gen_grid_regiongen_grid_regionGenGridRegionGenGridRegionGenGridRegiongen_grid_region, dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1DilationRectangle1dilation_rectangle1, dyn_thresholddyn_thresholdDynThresholdDynThresholdDynThresholddyn_threshold

另见

class_2dim_supclass_2dim_supClass2dimSupClass2dimSupClass2dimSupclass_2dim_sup, hysteresis_thresholdhysteresis_thresholdHysteresisThresholdHysteresisThresholdHysteresisThresholdhysteresis_threshold

模块

基础