看了一下图 位置比较固定 直接用比较粗暴的方式进行识别了
- read_image (Image, 'Tessst/963(黑色轮毂)/16-22-57-88.tiff')
- get_image_size (Image, Width, Height)
- dev_open_window (0, 0, Width/5, Height/5, 'black', WindowHandle)
- dev_display (Image)
- decompose3 (Image, Image1, Image2, Image3)
- RowCenter:=980
- ColumnCenter:=1280
- gen_circle (Circle, RowCenter, ColumnCenter, 850)
- gen_circle (Circle1, RowCenter, ColumnCenter, 750)
- difference (Circle, Circle1, RegionDifference)
- reduce_domain (Image3, RegionDifference, ImageReduced)
- emphasize (ImageReduced, ImageEmphasize, 91, 91, 3)
- threshold (ImageEmphasize, Region, 80, 255)
- fill_up (Region, RegionFillUp)
- opening_circle (RegionFillUp, RegionOpening, 15)
- select_shape (RegionOpening, SelectedRegions, 'area', 'and', 1000, 3000)
- select_shape (SelectedRegions, SelectedRegions1, 'circularity', 'and', 0.88, 1)
- dev_display (Image)
- dev_display (SelectedRegions1)
复制代码 |