ClassesClassesClassesClasses | | | | Operators

set_metrology_model_paramset_metrology_model_paramSetMetrologyModelParamset_metrology_model_paramSetMetrologyModelParamSetMetrologyModelParam (Operator)

Name

set_metrology_model_paramset_metrology_model_paramSetMetrologyModelParamset_metrology_model_paramSetMetrologyModelParamSetMetrologyModelParam — Set parameters that are valid for the entire metrology model.

Signature

set_metrology_model_param( : : MetrologyHandle, GenParamName, GenParamValue : )

Herror set_metrology_model_param(const Hlong MetrologyHandle, const char* GenParamName, const char* GenParamValue)

Herror T_set_metrology_model_param(const Htuple MetrologyHandle, const Htuple GenParamName, const Htuple GenParamValue)

Herror set_metrology_model_param(const HTuple& MetrologyHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

void HMetrologyModel::SetMetrologyModelParam(const HTuple& GenParamName, const HTuple& GenParamValue) const

void SetMetrologyModelParam(const HTuple& MetrologyHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

void HMetrologyModel::SetMetrologyModelParam(const HString& GenParamName, const HTuple& GenParamValue) const

void HMetrologyModel::SetMetrologyModelParam(const HString& GenParamName, const HString& GenParamValue) const

void HMetrologyModel::SetMetrologyModelParam(const char* GenParamName, const char* GenParamValue) const

void HOperatorSetX.SetMetrologyModelParam(
[in] VARIANT MetrologyHandle, [in] VARIANT GenParamName, [in] VARIANT GenParamValue)

void HMetrologyModelX.SetMetrologyModelParam(
[in] BSTR GenParamName, [in] VARIANT GenParamValue)

static void HOperatorSet.SetMetrologyModelParam(HTuple metrologyHandle, HTuple genParamName, HTuple genParamValue)

void HMetrologyModel.SetMetrologyModelParam(string genParamName, HTuple genParamValue)

void HMetrologyModel.SetMetrologyModelParam(string genParamName, string genParamValue)

Description

set_metrology_model_paramset_metrology_model_paramSetMetrologyModelParamset_metrology_model_paramSetMetrologyModelParamSetMetrologyModelParam sets or changes parameters that are valid for the entire metrology model MetrologyHandleMetrologyHandleMetrologyHandleMetrologyHandleMetrologyHandlemetrologyHandle.

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

The following values for GenParamNameGenParamNameGenParamNameGenParamNameGenParamNamegenParamName and GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue are possible:

Calibration

If both internal camera parameters and the 3D pose of the measurement plane are set, apply_metrology_modelapply_metrology_modelApplyMetrologyModelapply_metrology_modelApplyMetrologyModelApplyMetrologyModel calculates the results in metric coordinates.

'camera_param'"camera_param""camera_param""camera_param""camera_param""camera_param":

Often the internal camera parameters are the result of calibrating the camera with the operator calibrate_camerascalibrate_camerasCalibrateCamerascalibrate_camerasCalibrateCamerasCalibrateCameras (see calibrate_camerascalibrate_camerasCalibrateCamerascalibrate_camerasCalibrateCamerasCalibrateCameras for the sequence of the parameters and the underlying camera model). It is possible to discard the internal camera parameters by setting 'camera_param'"camera_param""camera_param""camera_param""camera_param""camera_param" to [].

Default value: []

'plane_pose'"plane_pose""plane_pose""plane_pose""plane_pose""plane_pose":

The 3D pose of the measurement plane in camera coordinates. It is possible to discard the pose by setting 'plane_pose'"plane_pose""plane_pose""plane_pose""plane_pose""plane_pose" to [].

Default value: []

Definition of a new reference system

When adding the metrology objects to the metrology model using e.g. add_metrology_object_genericadd_metrology_object_genericAddMetrologyObjectGenericadd_metrology_object_genericAddMetrologyObjectGenericAddMetrologyObjectGeneric, add_metrology_object_circle_measureadd_metrology_object_circle_measureAddMetrologyObjectCircleMeasureadd_metrology_object_circle_measureAddMetrologyObjectCircleMeasureAddMetrologyObjectCircleMeasure etc. the positions and orientations are given with respect to the image coordinate system which has its origin in the upper left corner of the image. In some cases it may be necessary to change the reference system with respect to which the metrology objects are given. This is for instance the case when using a shape model to align the metrology model in a new image. The results from find_shape_modelfind_shape_modelFindShapeModelfind_shape_modelFindShapeModelFindShapeModel can only be directly used in align_metrology_modelalign_metrology_modelAlignMetrologyModelalign_metrology_modelAlignMetrologyModelAlignMetrologyModel if the reference system of the metrology model is the same as the system in which the shape model is given (see align_metrology_modelalign_metrology_modelAlignMetrologyModelalign_metrology_modelAlignMetrologyModelAlignMetrologyModel for more details).

'reference_system'"reference_system""reference_system""reference_system""reference_system""reference_system":

The tuple given in GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue should contain [row, column, angle]. By default the reference system is the image coordinate system which has its origin in the top left corner. A new reference system is defined with respect to the image coordinate system by its translation (row,colum) and its rotation angle (angle). All components of the metrology model are converted into the new reference coordinate system. In the following figure, the reference system of the metrology model is set to the center of the image.

  set_metrology_model_param (MetrologyHandle, 'reference_system', [Height/2,Width/2,0])

(1) (2)
(1) Several metrology objects and their contours are shown in blue. (2) The new reference system for the metrology model is placed in the center of the image. As a consequence, the positions and orientations of the metrology objects are moved into the reverse direction. The resulting contours of the metrology objects are shown in blue.

Default value: [0, 0, 0]

Scaling the results

The results of the measurement queried by get_metrology_object_resultget_metrology_object_resultGetMetrologyObjectResultget_metrology_object_resultGetMetrologyObjectResultGetMetrologyObjectResult can be scaled by setting a scaling factor.

'scale'"scale""scale""scale""scale""scale":

The parameter 'scale'"scale""scale""scale""scale""scale" must be specified as the ratio of the desired unit to the original unit. If no camera parameters are given, the default unit is pixel.

If '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" are set, the original unit is determined by the coordinates of the calibration object. Standard HALCON calibration plates are defined in metric coordinates. If it was used for the calibration, the desired unit can be set directly. The relation of units to scaling factors is given in the following table:

Unit Scaling factor
m 1
dm 10
cm 100
mm 1000
µm, microns 1e6

List of values: 1.0, 0.1, 'm'"m""m""m""m""m", 'cm'"cm""cm""cm""cm""cm", 'mm'"mm""mm""mm""mm""mm", 'microns'"microns""microns""microns""microns""microns", 'um'"um""um""um""um""um"

Default value: 1.0

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

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

Handle of the metrology model.

GenParamNameGenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  attribute.name HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name of the generic parameter.

Default value: 'camera_param' "camera_param" "camera_param" "camera_param" "camera_param" "camera_param"

List of values: 'camera_param'"camera_param""camera_param""camera_param""camera_param""camera_param", 'plane_pose'"plane_pose""plane_pose""plane_pose""plane_pose""plane_pose", 'reference_system'"reference_system""reference_system""reference_system""reference_system""reference_system", 'scale'"scale""scale""scale""scale""scale"

GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  attribute.value(-array) HTupleHTupleHTupleVARIANTHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong) (BSTR / double / Hlong) (char* / double / Hlong)

Value of the generic parameter.

Default value: []

Suggested values: 1.0, 0.1, 'm'"m""m""m""m""m", 'cm'"cm""cm""cm""cm""cm", 'mm'"mm""mm""mm""mm""mm", 'microns'"microns""microns""microns""microns""microns", 'um'"um""um""um""um""um"

Result

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

Possible Predecessors

create_metrology_modelcreate_metrology_modelCreateMetrologyModelcreate_metrology_modelCreateMetrologyModelCreateMetrologyModel, set_metrology_model_image_sizeset_metrology_model_image_sizeSetMetrologyModelImageSizeset_metrology_model_image_sizeSetMetrologyModelImageSizeSetMetrologyModelImageSize

Possible Successors

add_metrology_object_genericadd_metrology_object_genericAddMetrologyObjectGenericadd_metrology_object_genericAddMetrologyObjectGenericAddMetrologyObjectGeneric, get_metrology_object_model_contourget_metrology_object_model_contourGetMetrologyObjectModelContourget_metrology_object_model_contourGetMetrologyObjectModelContourGetMetrologyObjectModelContour

See also

set_metrology_object_paramset_metrology_object_paramSetMetrologyObjectParamset_metrology_object_paramSetMetrologyObjectParamSetMetrologyObjectParam, align_metrology_modelalign_metrology_modelAlignMetrologyModelalign_metrology_modelAlignMetrologyModelAlignMetrologyModel, get_metrology_model_paramget_metrology_model_paramGetMetrologyModelParamget_metrology_model_paramGetMetrologyModelParamGetMetrologyModelParam

Module

2D Metrology


ClassesClassesClassesClasses | | | | Operators