get_metrology_object_result — Get the results of the measurements applied for a metrology model.
get_metrology_object_result allows to access the results of a measurement applied by apply_metrology_model for the metrology objects (see create_metrology_model for the basic principle of 2D metrology). The metrology model is defined by the handle MetrologyHandle. The parameter Indices specifies for which metrology objects the results are queried. For Indices set to 'all', the results of all metrology objects are returned. With the parameter Instance it can be specified, which instances of the results are returned in Parameter. The results for all instances are returned by setting Instance to 'all'. Different generic parameters can be used to control the returned values in Parameter. The generic parameter names are passed in GenParamName. The correspondig values are passed in GenParamValue. The following parameters and values are possible:
This parameter determines the type of the result. By setting the parameter 'result_type' to 'param' the measurement results of the metrology objects are returned (as obtained from the operator apply_metrology_model). In particular, if the type of the metrology object is a circle, the return values are the 'row' and the 'column' coordinates of the center and the 'radius' of the circle. The order is ['row', 'column', 'radius']. If the type of the metrology object is an ellipse, the return values are the 'row' and the 'column' coordinates of the center, the orientation of the main axis 'phi', the length of the larger half axis 'radius1', and the length of the smaler half axis 'radius2' of the ellipse. The order is ['row', 'column','phi','radius1', 'radius2']. If the type of the metrology object is a line, the 3 parameters of the hessian normal form are returned, i.e., the unit normal vector [row, column] and the orthogonal distance [d] of the line from the origin of the coordinate system. The order is [row, column, d]. The sign of the distance determines the side of the line on which the origin is located. If the type of the metrology object is a rectangle, the return values are the 'row' and the 'column' coordinates of the center, the orientation of the main axis 'phi', the length of the larger half edge 'length1', and the length of the smaler half edge 'length2' of the rectangle. The order is ['row', 'column','phi','length1', 'length2'].
If the parameter 'result_type' is set to the value 'score', the fitting scores are returned. The score is the number of measurements that is used for the calculation of the results divided by the maximum number of measure regions.
List of values: 'param', 'score'
Default value: 'param'
The parameter determines the scaling or unit of the results of the measurement. The parameter 'scale' must be specified as the ratio of the desired unit to the original unit. Setting the parameter 'scale' to a float value, the results are scaled by this float value. For uncalibrated metrology objects the original unit is a pixel. For calibrated metrology objects (see also the parameters 'camera_param' and 'world_pose' of the operator set_metrology_object_param), the original unit is determined by the coordinates of the calibration metrology object. If the original unit is the metric system (which is the case if you use one of the standard calibration plates), the desired unit can be set directly by selecting 'm', 'cm', 'mm', 'microns', or 'um'.
List of values: 1.0, 0.1, 'm', 'cm', 'mm', 'microns', 'um'
Default value: 1.0
The parameter determines the rotation direction for angles that result from the fitting. Setting the parameter 'angle_direction' to 'positive' the angle is specified between the main axis of the object and the horizontal axis of the coordinate system in the mathematically positive direction (counterclockwise). Setting the parameter 'angle_direction' to 'negative' the angle is specified between the main axis of the object and the horizontal axis of the coordinate system in the mathematically negative direction (clockwise). The results of the angles are returned in radians.
List of values: 'positive', 'negative'
Default value: 'positive'
It is possible to query the results of several metrology objects (see the parameter Indices) and several instances (see the parameter Instance) of the metrology objects simulaneously. The results are returned in the following order in Parameter: 1st instance of 1st metrology object, 2nd instance of 1st metrology object, etc., 1st instance of 2nd metrology object, 2nd instance of 2nd metrology object, etc.
A metrology model 'MetrologyHandle' cannot be shared between two or more user's threads. Different metrology models can be used independently and safely in different threads.
Handle of the metrology model.
Indices of the metrology objects.
Default value: 0
Suggested values: 'all', 0, 1, 2
Instance of the metrology object.
Default value: 'all'
Suggested values: 0, 1, 2, 'all'
Names of the generic parameters.
Default value: 'result_type'
List of values: 'angle_direction', 'result_type', 'scale'
Values of the generic parameters.
Default value: 'param'
Suggested values: 'param', 'score', 1.0, 0.1, 'm', 'mm', 'microns', 'um', 'true', 'false'
If the parameters are valid, the operator get_metrology_object_result returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.