【Halcon图像拟合圆】

文章目录


在半导体行业,如PCB集成电路板,提供了Mark点,辅助视觉定位。而Mark点一般为圆形。视觉系统,需要抓取圆,进行精准定位。

算子:
fit_circle_contour_xld () 拟合圆
gen_circle () 生成圆

在这里插入图片描述

*关闭窗口
dev_close_window ()
*打开窗口
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
*读取图像
read_image (Image, 'printer_chip/printer_chip_01') 
*画圆
draw_circle (WindowHandle, Row, Column, Radius)
*生成圆
gen_circle (Circle, Row, Column, Radius)
*裁剪圆
reduce_domain (Image, Circle, ImageReduced) 
*提取亚像素轮廓
edges_sub_pix (ImageReduced, Edges, 'canny', 1, 20, 40) 
*选择目标圆
select_shape_xld (Edges, SelectedXLD, 'area', 'and', 200, 300) 
*拟合圆
fit_circle_contour_xld (SelectedXLD, 'algebraic', -1, 0, 0, 3, 2, Row1, Column1, Radius1, StartPhi, EndPhi, PointOrder) 
*生成结果圆
gen_circle (ResultCircle1, Row1, Column1, Radius1) 
*显示结果圆
dev_display (ResultCircle1)
 
 

猜你喜欢

转载自blog.csdn.net/weixin_42483745/article/details/126953558