以直线卡尺为例,其他卡尺更改相应参数即可。
set_metrology_model_image_size( : : MetrologyHandle, Width, Height : )
使用 set_metrology_model_image_size 该算子设置测量区域,而且该算子必须在 add_metrology_object_generic 这类添加测量对象的算子之前调用,否则在使用 apply_metrology_model 执行测量时会重新计算测量区域,降低效率。
add_metrology_object_generic( : : MetrologyHandle, Shape, ShapeParam, MeasureLength1, MeasureLength2, MeasureSigma, MeasureThreshold, GenParamName, GenParamValue : Index)
参数 Shape 和 ShapeParam 是联动的:
Shape = circle 时,ShapeParam=[Row, Column, Radius]Shape = rectangle2 时,ShapeParam=[Row, Column, Phi, Length1, Length2]Shape = ellipse 时,ShapeParam=[Row, Column, Phi, Radius1, Radius2]Shape = line 时,ShapeParam=[RowBegin, ColumnBegin, RowEnd, ColumnEnd]set_metrology_object_param( : : MetrologyHandle, Index, GenParamName, GenParamValue : )
创建测量区域的相关参数
measure_length1:The value of this parameter specifies the half length of the measure regions perpendicular to the metrology object boundary.measure_length2:The value of this parameter specifies the half length of the measure regions tangential to the metrology object boundary.measure_distance:The value of this parameter specifies the desired distance between the centers of two measure regions.num_measures:The value of this parameter specifies the desired number of measure regions.提取边缘的相关参数
measure_sigma:The parameter specifies the sigma for the Gaussian smoothing.measure_threshold:The parameter specifies the minimum edge amplitude.measure_select:The parameter specifies the selection of end points of the edges.measure_transition:The parameter specifies the use of dark/light or light/dark edges.measure_interpolation:The parameter specifies the type of interpolation to be used.拟合几何形状的相关参数
min_score: The parameter determines what score a potential instance must at least have to be regarded as a valid instance of the metrology object.num_instances: The parameter specifies the maximum number of successfully fitted instances of each metrology object after which the fitting will stop.distance_threshold: apply_metrology_model uses a randomized search algorithm (RANSAC) to fit the geometric shapes.max_num_iterations: The RANSAC algorithm estimates the number of iterations necessary for fitting the requested geometric shape.rand_seed: The parameter specifies the seed for the random number generator for the RANSAC algorithm that is used by the selection of the edges the in operator apply_metrology_model.instances_outside_measure_regions: The parameter specifies the validation of the results of measurements.转载于:https://www.cnblogs.com/zdfffg/p/11572249.html
相关资源:Halcon12.0 自动拟合圆及圆弧