- read_image (B, 'C:/Users/Administrator/Desktop/00-14-57.953 A035149#03.tif')
- illuminate (B, BB, 101, 101, 1.1)
- threshold (B, Region, 100, 200)
- connection (Region, ConnectedRegions)
- select_shape_std (ConnectedRegions, SelectedRegions, 'max_area', 70)
- fill_up (SelectedRegions, RegionFillUp)
- opening_circle (RegionFillUp, RegionOpening, 163.5)
- erosion_circle (RegionOpening, RegionErosion, 163.5)
- emphasize (BB, ImageEmphasize, 177, 177, 15)
- smooth_image (ImageEmphasize, ImageSmooth, 'gauss',5.)
- reduce_domain (ImageSmooth, RegionErosion, ImageReduced)
- edges_sub_pix (ImageReduced, Edges, 'canny', 12, 15, 25)
- union_adjacent_contours_xld (Edges, UnionContours, 10, 1, 'attr_keep')
- length_xld (UnionContours, Length)
- select_contours_xld (UnionContours, SelectedContours, 'contour_length',max(Length), max(Length), -0.5, 0.5)
复制代码 |