1.threshold(Image : Region : MinGray, MaxGray : ):通过给定的阈值区间对图像进行分割
效果图:
read_image (Audi2, 'audi2')
fill_interlace (Audi2, ImageFilled, 'odd')
threshold (ImageFilled, Region, 0, 90)
2.binary_threshold(Image : Region : Method, LightDark : UsedThreshold):自动阈值分割,可以自动选择出'light' 区域或'dark' 区域,使用自动确定的全局阈值分割单通道图像,使用阈值方法Method有'max_separability' 和'smooth_histo'两个值,这两个值都是只应用在具有双峰直方图的图像(bin_threshold是过去时,新的应用程序应该使用binary_threshold)
reduce_domain (Image, RegionROI, ImageReduced)
binary_threshold (ImageReduced, RegionBackground, 'max_separability', 'dark', UsedThreshold)
3.dyn_threshold(OrigImage, ThresholdImage : RegionDynThresh : Offset, LightDark : ):使用局部阈值分割图像,首先需要对图像进行平滑处理(例如 mean_image, binomial_filter, gauss_filter等等),然后用原图与平滑后的图逐个像素作比较,可以根据参数分割出原图比平滑后的图灰度高(或者低)Offset个灰度值的区域。(Offset的值最好是在5到40之间)