- read_image (Egg, 'C:/Users/86131/Desktop/egg.jpg')
- scale_image_max (Egg, ImageScaleMax)
- threshold (ImageScaleMax, Region, 70, 255)
- opening_circle (Region, RegionOpening, 100)
- opening_circle (Region, RegionOpening1, 30)
- get_image_size (ImageScaleMax, Width, Height)
- gen_rectangle1 (Rectangle, Height/2, 0, Height, Width)
- intersection (Rectangle, RegionOpening1, RegionIntersection)
- union2 (RegionIntersection, RegionOpening, RegionUnion)
- reduce_domain (ImageScaleMax, RegionUnion, ImageReduced)
- edges_sub_pix (ImageReduced, Edges, 'canny', 1, 20, 40)
- select_shape_xld (Edges, SelectedXLD, 'contlength', 'and', 150, 99999)
- union_adjacent_contours_xld (SelectedXLD, UnionContours, 500, 1, 'attr_keep')
- gen_region_contour_xld (UnionContours, Region1, 'filled')
- difference (RegionUnion, Region1, RegionDifference)
- connection (RegionDifference, ConnectedRegions)
- select_shape_std (ConnectedRegions, SelectedRegions, 'max_area', 70)
- union2 (SelectedRegions, Region1, RegionUnion1)
- gen_contour_region_xld (RegionUnion1, Contours, 'border')
复制代码 |