- 这个例子展示了如何使用计量模型在具有挑战性的条件下轻松地以亚像素精度测量圆和矩形。
*显示初始化
dev_update_off ()
read_image (Image , ‘C:/Users/29540/Desktop/circleRectangle.png’)
*read_image (Image, ‘pads’)
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
set_display_font (WindowHandle, 14, ‘mono’, ‘true’, ‘false’)
*
*定义圆的近似位置和测量公差
RowCircle := [52:89:500]
CircleInitRow := [RowCircle,RowCircle]
CircleInitColumn := [gen_tuple_const(6,348),gen_tuple_const(6,438)]
gen_cross_contour_xld (Cross1, CircleInitRow, CircleInitColumn, 6, 0.785398)
CircleInitRadius := [gen_tuple_const(6,23),gen_tuple_const(6,23)]
CircleRadiusTolerance := 12
*定义矩形的近似位置和测量公差
RectangleInitRow := [410,410]
RectangleInitColumn := [215,562]
RectangleInitPhi := [0,0]
RectangleInitLength1 := [85,85]
Rectan