ClassesClassesClassesClasses | | | | Operators

apply_metrology_modelapply_metrology_modelApplyMetrologyModelapply_metrology_modelApplyMetrologyModelApplyMetrologyModel (Operator)

Name

apply_metrology_modelapply_metrology_modelApplyMetrologyModelapply_metrology_modelApplyMetrologyModelApplyMetrologyModel — Measure and fit the geometric shapes of all metrology objects of a metrology model.

Signature

apply_metrology_model(Image : : MetrologyHandle : )

Herror apply_metrology_model(const Hobject Image, const Hlong MetrologyHandle)

Herror T_apply_metrology_model(const Hobject Image, const Htuple MetrologyHandle)

Herror apply_metrology_model(Hobject Image, const HTuple& MetrologyHandle)

void HMetrologyModel::ApplyMetrologyModel(const HImage& Image) const

void ApplyMetrologyModel(const HObject& Image, const HTuple& MetrologyHandle)

void HMetrologyModel::ApplyMetrologyModel(const HImage& Image) const

void HOperatorSetX.ApplyMetrologyModel(
[in] IHUntypedObjectX* Image, [in] VARIANT MetrologyHandle)

void HMetrologyModelX.ApplyMetrologyModel([in] IHImageX* Image)

static void HOperatorSet.ApplyMetrologyModel(HObject image, HTuple metrologyHandle)

void HMetrologyModel.ApplyMetrologyModel(HImage image)

Description

apply_metrology_modelapply_metrology_modelApplyMetrologyModelapply_metrology_modelApplyMetrologyModelApplyMetrologyModel locates the edges inside the measure regions of the metrology objects of the metrology model MetrologyHandleMetrologyHandleMetrologyHandleMetrologyHandleMetrologyHandlemetrologyHandle within ImageImageImageImageImageimage and fits the corresponding geometric shapes to the resulting edge positions.

For an explanation of the concept of 2D metrology see the introduction of chapter 2D Metrology.

The measurements are performed as follows:

Determining the edge positions

Within the measure regions of the metrology objects, the positions of the edges are determined. The edge location is calculated internally with the operator measure_posmeasure_posMeasurePosmeasure_posMeasurePosMeasurePos or fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePos. The latter is used if at least one fuzzy function was set for the metrology objects with set_metrology_object_fuzzy_paramset_metrology_object_fuzzy_paramSetMetrologyObjectFuzzyParamset_metrology_object_fuzzy_paramSetMetrologyObjectFuzzyParamSetMetrologyObjectFuzzyParam.

Fitting geometric shapes to the edge positions

The geometric shapes of the metrology objects are adapted to fit optimally to the resulting edge positions. In particular, a RANSAC algorithm is used to select a set of initial edge positions that is necessary to create an instance of the specific geometric shape, e.g., three edge positions are selected for a metrology object of type circle. Then, those edge positions that are near the corresponding instance of the geometric shape are determined and, if the number of suitable edge positions is sufficient (see the generic parameter 'min_score'"min_score""min_score""min_score""min_score""min_score" of set_metrology_object_paramset_metrology_object_paramSetMetrologyObjectParamset_metrology_object_paramSetMetrologyObjectParamSetMetrologyObjectParam), are selected for the final fitting of the geometric shape. If the number of suitable edge positions is not sufficient, another set of initial edge positions is tested until a suitable selection of edge positions is found. Into the edge positions that are selected for the final fitting, the geometric shape is fitted and its parameters are stored in the metrology model. Note that more than one instance for each metrology object is returned if the generic parameter 'num_instances'"num_instances""num_instances""num_instances""num_instances""num_instances" is set to value larger than 1. This and other parameters can be set when adding the metrology objects to the metrology model or separately with the operator set_metrology_object_paramset_metrology_object_paramSetMetrologyObjectParamset_metrology_object_paramSetMetrologyObjectParamSetMetrologyObjectParam. Note that for each instance of the metrology object different initial edge positions are used, i.e., a second instance is based on edge positions that were not already used for the fitting of the first instance. The algorithm stops either when 'num_instances'"num_instances""num_instances""num_instances""num_instances""num_instances" instances were found or if the remaining number of suitable initial edge positions is too low for a further fitting of the geometric shape.

Accessing the results

The results of the measurements can be accessed from the metrology model using get_metrology_object_resultget_metrology_object_resultGetMetrologyObjectResultget_metrology_object_resultGetMetrologyObjectResultGetMetrologyObjectResult. Note that if more than one instance of an object is returned, the order of the returned instances is arbitrary and therefore no measure for the quality of the fitting. Note further that if the parameters 'camera_param'"camera_param""camera_param""camera_param""camera_param""camera_param" and 'plane_pose'"plane_pose""plane_pose""plane_pose""plane_pose""plane_pose" were set for the metrology model using set_metrology_model_paramset_metrology_model_paramSetMetrologyModelParamset_metrology_model_paramSetMetrologyModelParamSetMetrologyModelParam, world coordinates are used for the fitting. Otherwise, image coordinates are used. The XLD contours for the measured objects can be obtained using get_metrology_object_result_contourget_metrology_object_result_contourGetMetrologyObjectResultContourget_metrology_object_result_contourGetMetrologyObjectResultContourGetMetrologyObjectResultContour.

Attention

Note that all measure regions of all metrology objects must be recomputed if the width or the height of the input ImageImageImageImageImageimage is not equal to the width and height stored in the metrology object (e.g. set with set_metrology_model_image_sizeset_metrology_model_image_sizeSetMetrologyModelImageSizeset_metrology_model_image_sizeSetMetrologyModelImageSizeSetMetrologyModelImageSize). This leads to longer execution times of the operator.

Note further that apply_metrology_modelapply_metrology_modelApplyMetrologyModelapply_metrology_modelApplyMetrologyModelApplyMetrologyModel ignores the domain of ImageImageImageImageImageimage for efficiency reasons (see also measure_posmeasure_posMeasurePosmeasure_posMeasurePosMeasurePos).

Parallelization

This operator modifies the state of the following input parameter:

The value of this parameter may not be shared across multiple threads without external synchronization.

Parameters

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / uint2 / real)

Input image.

MetrologyHandleMetrologyHandleMetrologyHandleMetrologyHandleMetrologyHandlemetrologyHandle (input_control, state is modified)  metrology_model HMetrologyModel, HTupleHTupleHMetrologyModel, HTupleHMetrologyModelX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the metrology model.

Result

If the parameters are valid, the operator apply_metrology_modelapply_metrology_modelApplyMetrologyModelapply_metrology_modelApplyMetrologyModelApplyMetrologyModel returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

add_metrology_object_genericadd_metrology_object_genericAddMetrologyObjectGenericadd_metrology_object_genericAddMetrologyObjectGenericAddMetrologyObjectGeneric, add_metrology_object_circle_measureadd_metrology_object_circle_measureAddMetrologyObjectCircleMeasureadd_metrology_object_circle_measureAddMetrologyObjectCircleMeasureAddMetrologyObjectCircleMeasure, add_metrology_object_ellipse_measureadd_metrology_object_ellipse_measureAddMetrologyObjectEllipseMeasureadd_metrology_object_ellipse_measureAddMetrologyObjectEllipseMeasureAddMetrologyObjectEllipseMeasure, add_metrology_object_line_measureadd_metrology_object_line_measureAddMetrologyObjectLineMeasureadd_metrology_object_line_measureAddMetrologyObjectLineMeasureAddMetrologyObjectLineMeasure, add_metrology_object_rectangle2_measureadd_metrology_object_rectangle2_measureAddMetrologyObjectRectangle2Measureadd_metrology_object_rectangle2_measureAddMetrologyObjectRectangle2MeasureAddMetrologyObjectRectangle2Measure, align_metrology_modelalign_metrology_modelAlignMetrologyModelalign_metrology_modelAlignMetrologyModelAlignMetrologyModel, set_metrology_model_paramset_metrology_model_paramSetMetrologyModelParamset_metrology_model_paramSetMetrologyModelParamSetMetrologyModelParam, set_metrology_object_paramset_metrology_object_paramSetMetrologyObjectParamset_metrology_object_paramSetMetrologyObjectParamSetMetrologyObjectParam

Possible Successors

get_metrology_object_resultget_metrology_object_resultGetMetrologyObjectResultget_metrology_object_resultGetMetrologyObjectResultGetMetrologyObjectResult, get_metrology_object_result_contourget_metrology_object_result_contourGetMetrologyObjectResultContourget_metrology_object_result_contourGetMetrologyObjectResultContourGetMetrologyObjectResultContour, get_metrology_object_measuresget_metrology_object_measuresGetMetrologyObjectMeasuresget_metrology_object_measuresGetMetrologyObjectMeasuresGetMetrologyObjectMeasures

See also

set_metrology_object_fuzzy_paramset_metrology_object_fuzzy_paramSetMetrologyObjectFuzzyParamset_metrology_object_fuzzy_paramSetMetrologyObjectFuzzyParamSetMetrologyObjectFuzzyParam, read_metrology_modelread_metrology_modelReadMetrologyModelread_metrology_modelReadMetrologyModelReadMetrologyModel, write_metrology_modelwrite_metrology_modelWriteMetrologyModelwrite_metrology_modelWriteMetrologyModelWriteMetrologyModel

Module

2D Metrology


ClassesClassesClassesClasses | | | | Operators