本帖最后由 halcon2016 于 2026-4-28 19:36 编辑
read_image (Image141427wztoyjox01nmtu3x, 'C:/Users/Administrator/Desktop/141427wztoyjox01nmtu3x.png')
binary_threshold (Image141427wztoyjox01nmtu3x, Region, 'max_separability', 'dark', UsedThreshold)
erosion_circle (Region, RegionErosion, 3.5)
dilation_circle (Region, RegionDilation, 3.5)
difference (RegionDilation, RegionErosion, RegionDifference)
reduce_domain (Image141427wztoyjox01nmtu3x, RegionDifference, ImageReduced)
edges_sub_pix (ImageReduced, Edges, 'canny', 1, 20, 40)
segment_contours_xld (Edges, ContoursSplit, 'lines_ellipses', 7, 30, 6)
select_contours_xld (ContoursSplit, SelectedContours, 'contour_length', 300, 200000, -0.5, 0.5)
*方法2
closing_circle (Region, RegionClosing, 83.5)
dilation_circle (RegionClosing, RegionDilation1, 3.5)
erosion_circle (RegionClosing, RegionErosion1, 3.5)
difference (RegionDilation1, RegionErosion1, RegionDifference1)
reduce_domain (Image141427wztoyjox01nmtu3x, RegionDifference1, ImageReduced1)
edges_sub_pix (ImageReduced1, Edges1, 'canny', 1, 20, 40)
|