使用Halcon 13写的代码,其他版本请把里面的窗口句柄改下就可以了。
- read_image (Image, 'C:/Users/Administrator/Desktop/223123mzv05ooc5r0xmmmc.jpg')
- rgb1_to_gray (Image, Image)
- draw_spoke (Image, Regions, 200000, 30, 60, 15, ROIRows, ROICols, Direct)
- spoke (Image, Regions1, 30, 60, 15, 1, 20, 'negative', 'max', ROIRows, ROICols, Direct, ResultRow, ResultColumn, ArcType)
- pts_to_best_circle (Circle1, ResultRow, ResultColumn, 15, ArcType, RowCenter1, ColCenter1, Radius1)
- gen_cross_contour_xld (Cross1, RowCenter1, ColCenter1, 50, 0)
- draw_spoke (Image, Regions, 200000, 30, 60, 15, ROIRows, ROICols, Direct)
- spoke (Image, Regions1, 30, 60, 15, 1, 20, 'negative', 'max', ROIRows, ROICols, Direct, ResultRow, ResultColumn, ArcType)
- pts_to_best_circle (Circle2, ResultRow, ResultColumn, 15, ArcType, RowCenter2, ColCenter2, Radius2)
- gen_cross_contour_xld (Cross2, RowCenter2, ColCenter2, 50, 0)
复制代码
|