赞
踩
测量的流程及其用的算子如下:
*************测量两个引脚突出部分的距离*********** *创建计量模型 create_metrology_model(MetrologyHandle) *设置计量图像的大小 set_metrology_model_image_size(MetrologyHandle, Width, Height) *在计量模型中添加直线 add_metrology_object_line_measure(MetrologyHandle, 360, 163, 355, 428, 20, 5, 1, 30, [], [], Index) add_metrology_object_line_measure(MetrologyHandle, 806, 168, 797, 438, 20, 5, 1, 30, [], [], Index1) *测量 apply_metrology_model(Image, MetrologyHandle) *显示测量的范围 get_metrology_object_measures(Contours, MetrologyHandle, 'all', 'all', Row1, Column1) *为每个输入点生成一个十字形的XLD轮廓 gen_cross_contour_xld(Cross, Row1, Column1, 6, 0.785398) *生成直线 get_metrology_object_result_contour(Contour, MetrologyHandle, 'all', 'all', 1.5) *获取结果 get_metrology_object_result (MetrologyHandle, 'all', 'all', 'result_type', 'all_param', Parameter) *清除模型 clear_metrology_model(MetrologyHandle) lineUp:=Parameter[0:3] lineDown:=Parameter[4:7] *求两直线的距离 distance_ss(lineUp[0], lineUp[1],lineUp[2], lineUp[3], lineDown[0],lineDown[1], lineDown[2],lineDown[3],DistanceMin, DistanceMax) distance:=(DistanceMax+DistanceMin)/2
结果如下:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。