read_image (Tim20180528230437, 'C:/Users/popdes/Desktop/TIM图片20180528230437.jpg')
*转化为灰度图
rgb3_to_gray (Tim20180528230437, Tim20180528230437, Tim20180528230437, ImageGray)
*模糊图像
mean_image (ImageGray, ImageMean, 9, 9)
*动态阈值处理
auto_threshold (ImageMean, Regions, 2)
*排除其他干扰小面积
select_shape (Regions, SelectedRegions, 'area', 'and', 688.44, 16727.9)
*分割图像区域
connection (SelectedRegions, ConnectedRegions)
*再次筛选
select_shape (ConnectedRegions, SelectedRegions1, 'area', 'and', 199.64, 20000)
*填充所选区域
fill_up_shape (SelectedRegions1, RegionFillUp, 'area', 1, 1000000)
*计算每个区域的面积(我只需要面积一项)
area_center (RegionFillUp, Area, Row, Column)
*对面积进行排序,后面的Indices保存的是面积对应的区域编号
tuple_sort_index (Area, Indices)
*计算区域数量
count_obj (RegionFillUp,