*读取图片
read_image (Image, 'rings_and_nuts')
dev_get_window (WindowHandle)
dev_set_draw ('margin')
*创建ROI
draw_circle (WindowHandle, roiRow, roiColumn, roiRadius)
*创建测量模型
create_metrology_model (MetrologyHandle)
*设置测量对象的图像大小
get_image_size (Image, Width, Height)
set_metrology_model_image_size (MetrologyHandle, Width, Height)
*对象参数
genParamName:=['start_phi','end_phi','measure_transition','measure_select','num_measures','min_score']
genParamValue:=[0,110,'negative','first',10,0.4]
*创建测量ROI
add_metrology_object_circle_measure (MetrologyHandle, roiRow, roiColumn, roiRadius, 6, 2, 1, 30, genParamName, genParamValue, Index)
*应用测量
apply_metrology_model (Image, MetrologyHandle)
*获取测量结果
get_metrology_object_result (MetrologyHandle, 0, 'all', 'result_type', 'all_param', Parameter)
get_metrology_object_measures (Contours, MetrologyHandle, 'all', 'all', Row2, Column2)
get_metrology_object_result_contour (Contour, MetrologyHandle, 0, 'all', 1.5)
*清除/销毁测量对象
clear_metrology_model (MetrologyHandle)
*添加圆型测量对象到模型*(主要算子说明)
*add_metrology_object_circle_measure()*
*MetrologyHandle:测量模型句柄*
*Row:测量区域的圆心行坐标*
*Column:测量区域的圆行列坐标*
*Radius:测量区域的半径*
*MeasureLength1:垂直于边界的测量区域的一半长度*
*MeasureLength2:相切于边界的测量区域的一半长度*
*MeasureSigma:用于平滑的高斯函数的 Sigma*
*MeasureThreshold:最小边缘幅度阈值*
*GenParamName:通用参数的名称*
*GenParamValue:通用参数值*
*Index:所创建的计量对象的索引
结果(可以复制源码,直接运行)