read_image (Image, 'F:surface_scratch.png')
mean_image (Image, ImageMean,7, 7)//均值滤波
dyn_threshold (Image, ImageMean, DarkPixels, 3, 'dark')//动态阈值分割,对原图进行线性滤波,使用原图和滤波后的图像相减的。对得到的图像进行阈值分割
connection (DarkPixels, ConnectedRegions)//连通性分析
select_shape (ConnectedRegions, SelectedRegions, 'ra', 'and', 16.72, 500)//长度分割
union1 (SelectedRegions, RegionUnion)//合并显示
dev_display (Image)
dev_display (RegionUnion)