halcon 寻找圆 半径和圆心

dev_close_window ()
dev_update_window ('off')
read_image (Image2, 'C:/Users/pei/Pictures/Saved Pictures/2.png')
rgb1_to_gray (Image2, GrayImage)
gauss_filter (GrayImage, ImageGauss, 7)
gen_rectangle1 (ROI_0, 61.5, 61.5, 270.5, 581.5)
reduce_domain (ImageGauss, ROI_0, ImageReduced)
roberts (ImageReduced, ImageRoberts, 'gradient_sum')
threshold (ImageRoberts, Regions, 0, 32)
connection (Regions, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 0, 90185.2)
shape_trans (SelectedRegions, RegionTrans, 'outer_circle')
* 可以将缺损的圆补全
area_center (RegionTrans, Area, Row, Column)
*计算半径  

Radius:=sqrt(Area/3.1415926)

halcon 寻找圆 半径和圆心_第1张图片

你可能感兴趣的:(halcon 寻找圆 半径和圆心)