auto_thresholdauto_thresholdAutoThresholdAutoThresholdauto_threshold (算子名称)
名称
auto_thresholdauto_thresholdAutoThresholdAutoThresholdauto_threshold
— Segment an image using thresholds determined from its histogram.
参数签名
Herror auto_threshold(const Hobject Image, Hobject* 区域, double Sigma)
Herror T_auto_threshold(const Hobject Image, Hobject* 区域, const Htuple Sigma)
def auto_threshold(image: HObject, sigma: Union[int, float]) -> HObject
描述
auto_thresholdauto_thresholdAutoThresholdAutoThresholdAutoThresholdauto_threshold
segments a single-channel image using
multiple thresholding. First, the absolute histogram of the gray
values is determined. Then, relevant minima are extracted from the
histogram, which are used successively as parameters for a
thresholding operation. The thresholds used for byte images are 0,
255, and all minima extracted from the histogram (after the
histogram has been smoothed with a Gaussian filter with standard
deviation SigmaSigmaSigmaSigmasigmasigma
). For each gray value interval one
region is generated. Thus, the number of regions is the number of
minima + 1. For uint2 images, the above procedure is used
analogously. However, here the highest threshold is 65535.
Furthermore, for uint2 images the value of SigmaSigmaSigmaSigmasigmasigma
(virtually)
refers to a histogram with 256 values, although internally histograms
with a higher resolution are used. This is done to facilitate
switching between image types without having to change the parameter
SigmaSigmaSigmaSigmasigmasigma
. For float images the thresholds are the minimum and
maximum gray value in the image and all minima extracted from the
histogram. Here, the scaling of the parameter SigmaSigmaSigmaSigmasigmasigma
refers
to the original gray values of the image.
The larger the value of SigmaSigmaSigmaSigmasigmasigma
is chosen,
the fewer regions will be extracted. This operator is useful if the
regions to be extracted exhibit similar gray values (homogeneous
regions).
运行信息
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
- Automatically parallelized on internal data level.
参数表
ImageImageImageImageimageimage
(input_object) singlechannelimage(-array) →
objectHImageHObjectHImageHobject (byte / uint2 / real)
Input image.
区域区域区域区域区域区域
(output_object) region-array →
objectHRegionHObjectHRegionHobject *
Regions with gray values within the automatically
determined intervals.
SigmaSigmaSigmaSigmasigmasigma
(input_control) number →
HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Sigma for the Gaussian smoothing of the histogram.
Default:
2.0
Suggested values:
0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0
Value range:
Sigma
Sigma
Sigma
Sigma
sigma
sigma
(lin)
Minimum increment:
0.01
Recommended increment:
0.3
例程 (HDevelop)
read_image (Image, 'fabrik')
median_image (Image, Median, 'circle', 3, 'mirrored')
auto_threshold (Median, Seg, 2.0)
connection (Seg, Connected)
例程 (C)
read_image(&Image,"fabrik");
median_image(Image,&Median,"circle",3,"mirrored");
auto_threshold(Median,&Seg,2.0);
connection(Seg,&Connected);
set_colored(WindowHandle,12);
disp_obj(Connected,WindowHandle);
例程 (HDevelop)
read_image (Image, 'fabrik')
median_image (Image, Median, 'circle', 3, 'mirrored')
auto_threshold (Median, Seg, 2.0)
connection (Seg, Connected)
例程 (HDevelop)
read_image (Image, 'fabrik')
median_image (Image, Median, 'circle', 3, 'mirrored')
auto_threshold (Median, Seg, 2.0)
connection (Seg, Connected)
例程 (HDevelop)
read_image (Image, 'fabrik')
median_image (Image, Median, 'circle', 3, 'mirrored')
auto_threshold (Median, Seg, 2.0)
connection (Seg, Connected)
可能的前置算子
anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusionAnisotropicDiffusionanisotropic_diffusion
,
median_imagemedian_imageMedianImageMedianImageMedianImagemedian_image
,
illuminateilluminateIlluminateIlluminateIlluminateilluminate
可能的后置算子
connectionconnectionConnectionConnectionConnectionconnection
,
select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape
,
select_grayselect_graySelectGraySelectGraySelectGrayselect_gray
可替代算子
binary_thresholdbinary_thresholdBinaryThresholdBinaryThresholdBinaryThresholdbinary_threshold
,
char_thresholdchar_thresholdCharThresholdCharThresholdCharThresholdchar_threshold
参考其它
gray_histogray_histoGrayHistoGrayHistoGrayHistogray_histo
,
gray_histo_absgray_histo_absGrayHistoAbsGrayHistoAbsGrayHistoAbsgray_histo_abs
,
histo_to_threshhisto_to_threshHistoToThreshHistoToThreshHistoToThreshhisto_to_thresh
,
smooth_funct_1d_gausssmooth_funct_1d_gaussSmoothFunct1dGaussSmoothFunct1dGaussSmoothFunct1dGausssmooth_funct_1d_gauss
,
thresholdthresholdThresholdThresholdThresholdthreshold
模块
Foundation