阈值分割主要是基于灰度、对比度等特征,将特定区域提取出来,便于进一步处理。
常用的算子有:threshold,fast_threshold,bin_threshold,binary_threshold,auto_threshold,dyn_threshold,var_threshold等
threshold,原理是筛选出介于最小到最大灰度区间内的区域
基本例子:
read_image (Image, 'particle')
threshold (Image, BrightPixels, 120, 255)
connection (BrightPixels, Particles)
阈值分割使用的一般流程:
*1. 绘制区域,产生ROI
*2. 预处理,滤波
*3. 阈值分割
*4. 区域处理,形态学
*5. 基于特征筛选区域
*读取图片 read_image (Clip, 'clip') *获取图像大小 get_image_size (Clip, Width, Height) *阈值分割 binary_threshold (Clip, Dark, 'max_separability', 'dark', UsedThreshold) *连通域 connection (Dark, Single) *基于面积大小筛选区域 select_shape (Single, Selected, 'area', 'and', 5000, 10000) *显示筛选的区域 dev_display (Selected) *获取区域的方向 orientation_region (Selected, Phi) *获取区域的面积和中心坐标 area_center (Selected, Area, Row, Column)
转载自:https://blog.csdn.net/WING__NG/article/details/135638063