bin_thresholdbin_thresholdBinThresholdBinThreshold/span>bin_threshold二进制阈值(算子)

名称

bin_thresholdbin_thresholdBinThresholdBinThresholdbin_threshold — 使用自动确定的阈值分割图像。

警告

bin_thresholdbin_thresholdBinThresholdBinThresholdBinThresholdbin_threshold 已过时,仅出于向后兼容性考虑而保留。新应用程序应改用算子 binary_thresholdbinary_thresholdBinaryThresholdBinaryThresholdBinaryThresholdbinary_threshold

签名

bin_threshold(Image : Region : : )

Herror bin_threshold(const Hobject Image, Hobject* Region)

Herror T_bin_threshold(const Hobject Image, Hobject* Region)

void BinThreshold(const HObject& Image, HObject* Region)

HRegion HImage::BinThreshold() const

static void HOperatorSet.BinThreshold(HObject image, out HObject region)

HRegion HImage.BinThreshold()

def bin_threshold(image: HObject) -> HObject

描述

bin_thresholdbin_thresholdBinThresholdBinThresholdBinThresholdbin_threshold 通过自动确定的阈值对单通道灰度图像进行分割。首先确定灰度值的相对直方图。随后从直方图中提取相关最小值(relevant minima)作为阈值操作的参数。为减少最小值(minima)数量,采用高斯平滑处理直方图,类似于 auto_thresholdauto_thresholdAutoThresholdAutoThresholdAutoThresholdauto_threshold。通过逐步扩大掩模尺寸,直至平滑直方图中仅存一个最小值(minima)。所选区域包含灰度值介于 0 至最小值(minimum)之间的像素,对于 real 图像则包含从最小数值(smallest value)至对应最小值(respective minimum)之间的像素。该算子适用于浅色纸张上深色字符的分割等场景。

执行信息

参数

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

输入图像。

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

图像的暗部区域。

示例(HDevelop)

read_image (Image, 'letters')
bin_threshold (Image, Seg)
connection (Seg, Connected)

示例(C)

read_image(&Image,"letters");
bin_threshold(Image,&Seg);
connection(Seg,&Connected);
set_shape(WindowHandle,"rectangle1");
set_colored(WindowHandle,6);
disp_region(Connected,WindowHandle);

示例(HDevelop)

read_image (Image, 'letters')
bin_threshold (Image, Seg)
connection (Seg, Connected)

示例(HDevelop)

read_image (Image, 'letters')
bin_threshold (Image, Seg)
connection (Seg, Connected)

示例(HDevelop)

read_image (Image, 'letters')
bin_threshold (Image, Seg)
connection (Seg, Connected)

模块

基础