Skip to content

align_metrology_modelAlignMetrologyModelAlignMetrologyModelalign_metrology_modelT_align_metrology_model🔗

Short description🔗

align_metrology_modelAlignMetrologyModelAlignMetrologyModelalign_metrology_modelT_align_metrology_model — Alignment of a metrology model.

Signature🔗

align_metrology_model( metrology_model MetrologyHandle, real Row, real Column, angle.rad Angle )void AlignMetrologyModel( const HTuple& MetrologyHandle, const HTuple& Row, const HTuple& Column, const HTuple& Angle )static void HOperatorSet.AlignMetrologyModel( HTuple metrologyHandle, HTuple row, HTuple column, HTuple angle )def align_metrology_model( metrology_handle: HHandle, row: Union[int, float], column: Union[int, float], angle: Union[int, float] ) -> None

Herror T_align_metrology_model( const Htuple MetrologyHandle, const Htuple Row, const Htuple Column, const Htuple Angle )

void HMetrologyModel::AlignMetrologyModel( const HTuple& Row, const HTuple& Column, const HTuple& Angle ) const

void HMetrologyModel::AlignMetrologyModel( double Row, double Column, double Angle ) const

void HMetrologyModel.AlignMetrologyModel( HTuple row, HTuple column, HTuple angle )

void HMetrologyModel.AlignMetrologyModel( double row, double column, double angle )

Description🔗

align_metrology_modelAlignMetrologyModel moves and rotates the whole metrology model MetrologyHandlemetrologyHandlemetrology_handle relative to the image coordinate system which has its origin in the top left corner.

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

An alignment ensures, that the position and orientation of the metrology model is adapted to the objects to be measured in the current image. The alignment is then used by apply_metrology_modelApplyMetrologyModel to perform the measurement. First the metrology model is rotated by Angleangleangle, then the metrology model is translated by Rowrowrow and Columncolumncolumn. The values of the alignment are overwritten by the next call of align_metrology_modelAlignMetrologyModel.

Computation of the parameters of the alignment🔗

The parameters of the alignment can be determined using diverse methods. Here, three possibilities to determine the parameters are listed:

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

MetrologyHandlemetrologyHandlemetrology_handle (input_control, state is modified) metrology_model → (handle)HTuple (HHandle)HMetrologyModel, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the metrology model.

Rowrowrow (input_control) real → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Row coordinate of the alignment.

Default: 00

Columncolumncolumn (input_control) real → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Column coordinate of the alignment.

Default: 00

Angleangleangle (input_control) angle.rad → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Rotation angle of the alignment.

Default: 00

Example🔗

(HDevelop)

read_image (Image, 'metal-parts/circle_plate_01')
create_metrology_model (MetrologyHandle)
get_image_size (Image, Width, Height)
set_metrology_model_image_size (MetrologyHandle, Width, Height)
CircleParam := [354,274,53]
CircleParam := [CircleParam,350,519,53]
add_metrology_object_generic (MetrologyHandle, 'circle', CircleParam, 20,\
                              5, 1, 30, [], [], CircleIndices)
create_generic_shape_model (ModelID)
set_generic_shape_model_param (ModelID, 'metric', 'use_polarity')
set_generic_shape_model_param (ModelID, 'min_contrast', 20)
train_generic_shape_model (Image, ModelID)
* Determine location of shape model origin
area_center (Image, Area, RowOrigin, ColOrigin)
set_metrology_model_param (MetrologyHandle, 'reference_system', \
                           [RowOrigin,ColOrigin,0])
read_image (CurrentImage, 'metal-parts/circle_plate_02')
find_generic_shape_model (CurrentImage, ModelID, MatchResultID, \
                          NumMatchResult)
get_generic_shape_model_result (MatchResultID, 'all', 'row', Row)
get_generic_shape_model_result (MatchResultID, 'all', 'column', Col)
get_generic_shape_model_result (MatchResultID, 'all', 'angle', Angle)
align_metrology_model (MetrologyHandle, Row, Col, Angle)
apply_metrology_model (CurrentImage, MetrologyHandle)
get_metrology_object_result (MetrologyHandle, CircleIndices, 'all', \
                             'result_type', 'all_param', Rectangle)
get_metrology_object_result_contour (Contour, MetrologyHandle, \
                                     CircleIndices, 'all', 1.5)

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

set_metrology_model_paramSetMetrologyModelParam, add_metrology_object_genericAddMetrologyObjectGeneric

Possible successors

apply_metrology_modelApplyMetrologyModel

See also

get_metrology_object_model_contourGetMetrologyObjectModelContour

Module🔗

2D Metrology