- read_image (Image320231113171459, 'C:/Users/Barbie/Desktop/3_20231113171459.bmp')
- rgb1_to_gray (Image320231113171459, GrayImage)
- threshold (GrayImage, Region, 0, 190)
- connection (Region, ConnectedRegions)
- select_shape_std (ConnectedRegions, SelectedRegions, 'max_area', 70)
- closing_rectangle1 (SelectedRegions, RegionClosing, 50, 50)
- difference (RegionClosing, SelectedRegions, RegionDifference)
- opening_circle (RegionDifference, RegionOpening, 5)
- connection (RegionOpening, ConnectedRegions1)
- shape_trans (ConnectedRegions1,RegionTrans,'outer_circle')
- dev_set_draw ('margin')
- dev_display (Image320231113171459)
- dev_display (RegionTrans)
复制代码 |