Skip to content

add_metrology_object_genericadd_metrology_object_genericAddMetrologyObjectGenericAddMetrologyObjectGenericadd_metrology_object_genericT_add_metrology_object_generic🔗

Short description🔗

add_metrology_object_genericadd_metrology_object_genericAddMetrologyObjectGenericAddMetrologyObjectGenericadd_metrology_object_genericT_add_metrology_object_generic — Add a metrology object to a metrology model.

Signature🔗

add_metrology_object_generic( metrology_model MetrologyHandle, attribute.name Shape, attribute.value ShapeParam, number MeasureLength1, number MeasureLength2, number MeasureSigma, number MeasureThreshold, attribute.name GenParamName, attribute.value GenParamValue, out integer Index )add_metrology_object_generic( : : MetrologyHandle, Shape, ShapeParam, MeasureLength1, MeasureLength2, MeasureSigma, MeasureThreshold, GenParamName, GenParamValue : Index )void AddMetrologyObjectGeneric( const HTuple& MetrologyHandle, const HTuple& Shape, const HTuple& ShapeParam, const HTuple& MeasureLength1, const HTuple& MeasureLength2, const HTuple& MeasureSigma, const HTuple& MeasureThreshold, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Index )static void HOperatorSet.AddMetrologyObjectGeneric( HTuple metrologyHandle, HTuple shape, HTuple shapeParam, HTuple measureLength1, HTuple measureLength2, HTuple measureSigma, HTuple measureThreshold, HTuple genParamName, HTuple genParamValue, out HTuple index )def add_metrology_object_generic( metrology_handle: HHandle, shape: MaybeSequence[str], shape_param: Sequence[Union[int, float]], measure_length_1: Union[int, float], measure_length_2: Union[int, float], measure_sigma: Union[int, float], measure_threshold: Union[int, float], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[float, int, str]] ) -> int

Herror T_add_metrology_object_generic( const Htuple MetrologyHandle, const Htuple Shape, const Htuple ShapeParam, const Htuple MeasureLength1, const Htuple MeasureLength2, const Htuple MeasureSigma, const Htuple MeasureThreshold, const Htuple GenParamName, const Htuple GenParamValue, Htuple* Index )

Hlong HMetrologyModel::AddMetrologyObjectGeneric( const HTuple& Shape, const HTuple& ShapeParam, const HTuple& MeasureLength1, const HTuple& MeasureLength2, const HTuple& MeasureSigma, const HTuple& MeasureThreshold, const HTuple& GenParamName, const HTuple& GenParamValue ) const

Hlong HMetrologyModel::AddMetrologyObjectGeneric( const HString& Shape, const HTuple& ShapeParam, double MeasureLength1, double MeasureLength2, double MeasureSigma, double MeasureThreshold, const HTuple& GenParamName, const HTuple& GenParamValue ) const

Hlong HMetrologyModel::AddMetrologyObjectGeneric( const char* Shape, const HTuple& ShapeParam, double MeasureLength1, double MeasureLength2, double MeasureSigma, double MeasureThreshold, const HTuple& GenParamName, const HTuple& GenParamValue ) const

Hlong HMetrologyModel::AddMetrologyObjectGeneric( const wchar_t* Shape, const HTuple& ShapeParam, double MeasureLength1, double MeasureLength2, double MeasureSigma, double MeasureThreshold, const HTuple& GenParamName, const HTuple& GenParamValue ) const (Windows only)

int HMetrologyModel.AddMetrologyObjectGeneric( HTuple shape, HTuple shapeParam, HTuple measureLength1, HTuple measureLength2, HTuple measureSigma, HTuple measureThreshold, HTuple genParamName, HTuple genParamValue )

int HMetrologyModel.AddMetrologyObjectGeneric( string shape, HTuple shapeParam, double measureLength1, double measureLength2, double measureSigma, double measureThreshold, HTuple genParamName, HTuple genParamValue )

Description🔗

add_metrology_object_genericAddMetrologyObjectGeneric adds a metrology object of type Shapeshapeshape to a metrology model and prepares the rectangular measure regions.

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

The handle of the model is passed in MetrologyHandlemetrologyHandlemetrology_handle.

Shapeshapeshape specifies which type of object is added to the metrology model. The operator add_metrology_object_genericAddMetrologyObjectGeneric returns the index of the added metrology object in the parameter Indexindexindex. Note that add_metrology_object_genericAddMetrologyObjectGeneric provides the functionality of the operators add_metrology_object_circle_measureAddMetrologyObjectCircleMeasure, add_metrology_object_ellipse_measureAddMetrologyObjectEllipseMeasure, add_metrology_object_rectangle2_measureAddMetrologyObjectRectangle2Measure and add_metrology_object_line_measureAddMetrologyObjectLineMeasure in one operator.

Possible shapes🔗

Depending on the object specified in Shapeshapeshape the following values are expected:

  • 'circle'"circle": The geometric shape of the metrology object of type circle is specified by its center (Row, Column) and radius.

    ShapeParamshapeParamshape_param=[Row, Column, Radius][Row, Column, Radius]

  • 'rectangle2'"rectangle2": The geometric shape of the metrology object of type rectangle is specified by its center (Row, Column), the orientation of the main axis Phi, and the half edge lengths Length1 and Length2. The input value for Phi is mapped automatically to the interval \(]-\pi,\pi]\).

    ShapeParamshapeParamshape_param=[Row, Column, Phi, Length1, Length2][Row, Column, Phi, Length1, Length2]

  • 'ellipse'"ellipse": The geometric shape of the metrology object of type ellipse is specified by its center (Row, Column), the orientation of the main axis Phi, the length of the larger half axis Radius1, and the length of the smaller half axis Radius2. The input value for Phi is mapped automatically to the interval \(]-\pi,\pi]\).

    ShapeParamshapeParamshape_param=[Row, Column, Phi, Radius1, Radius2][Row, Column, Phi, Radius1, Radius2]

  • 'line'"line": The geometric shape of the metrology object of type line is described by the coordinates of its start point (RowBegin, ColumnBegin) and the coordinates of its end point (RowEnd, ColumnEnd).

    ShapeParamshapeParamshape_param=[RowBegin, ColumnBegin, RowEnd, ColumnEnd][RowBegin, ColumnBegin, RowEnd, ColumnEnd]

Definition of measure regions🔗

add_metrology_object_genericAddMetrologyObjectGeneric also prepares the rectangular measure regions. The rectangular measure regions lie perpendicular to the boundary of the object. The half edge lengths of the measure regions perpendicular and tangential to the boundary of the object are set in MeasureLength1measureLength1measure_length_1 and MeasureLength2measureLength2measure_length_2. The centers of the measure regions lie on the boundary of the object. The parameter MeasureSigmameasureSigmameasure_sigma specifies a standard deviation that is used by the operator apply_metrology_modelApplyMetrologyModel to smooth the gray values of the image. Salient edges can be selected with the parameter MeasureThresholdmeasureThresholdmeasure_threshold, which constitutes a threshold on the amplitude, i.e., the absolute value of the first derivative of the edge.

Generic parameters🔗

Generic parameters and their values can be specified using GenParamNamegenParamNamegen_param_name and GenParamValuegenParamValuegen_param_value. All generic parameters that are available in the operator set_metrology_object_paramSetMetrologyObjectParam can also be set in add_metrology_object_genericAddMetrologyObjectGeneric. But note that for a lot of applications the default values are sufficient and no adjustment is necessary. Furthermore, the following values for GenParamNamegenParamNamegen_param_name and GenParamValuegenParamValuegen_param_value are available only for Shapeshapeshape = 'circle'"circle" and 'ellipse'"ellipse":

  • 'start_phi'"start_phi": The parameter specifies the angle at the start point of a circular or elliptic arc. For an ellipse, the angle at the start point is measured relative to the positive main axis and corresponds to the smallest surrounding circle of the ellipse. The actual start point of the ellipse is the intersection of the ellipse with the orthogonal projection of the corresponding circle point onto the main axis. To create a closed circle or ellipse the value of the parameter 'start_phi'"start_phi" is set to 0 and the value of the parameter 'end_phi'"end_phi" is set to \(2\pi\) (with positive point order). The input value is mapped automatically to the interval \([0,2\pi]\).

    Suggested values: 0.00.0, 0.780.78, 6.283186.28318

    Default: 0.00.0

  • 'end_phi'"end_phi": The parameter specifies the angle at the end point of a circular or elliptic arc. For an ellipse, the angle at the end point is measured relative to the positive main axis and corresponds to the smallest surrounding circle of the ellipse. The actual end point of the ellipse is the intersection of the ellipse with the orthogonal projection of the corresponding circle point onto the main axis. To create a closed circle or ellipse the value of the parameter 'start_phi'"start_phi" is set to 0 and the value of the parameter 'end_phi'"end_phi" is set to \(2\pi\) (with positive point order). The input value is mapped internally automatically to the interval \([0,2\pi]\).

    Suggested values: 0.00.0, 0.780.78, 6.283186.28318

    Default: 6.283186.28318

  • 'point_order'"point_order": The parameter specifies the direction of the circular or elliptic arc. For the value 'positive'"positive", the arc is defined between 'start_phi'"start_phi" and 'end_phi'"end_phi" in mathematically positive direction (counterclockwise). For the value 'negative'"negative", the arc is defined between 'start_phi'"start_phi" and 'end_phi'"end_phi" in mathematically negative direction (clockwise).

    List of values: 'positive'"positive", 'negative'"negative"

    Default: 'positive'"positive"

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)(handle)HTuple (HHandle)HMetrologyModel, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the metrology model.

Shapeshapeshape (input_control) attribute.name(-array) → (string)(string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Type of the metrology object to be added.

Default: 'circle'"circle"
List of values: 'circle', 'ellipse', 'line', 'rectangle2'"circle", "ellipse", "line", "rectangle2"

ShapeParamshapeParamshape_param (input_control) attribute.value-array → (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[int, float]]Htuple (double / Hlong)

Parameters of the metrology object to be added.

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

Half length of the measure regions perpendicular to the boundary.

Default: 20.020.0
Suggested values: 10.0, 20.0, 30.010.0, 20.0, 30.0
Value range: 1.0 ≤ MeasureLength1 ≤ 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

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

Half length of the measure regions tangential to the boundary.

Default: 5.05.0
Suggested values: 3.0, 5.0, 10.03.0, 5.0, 10.0
Value range: 1.0 ≤ MeasureLength2 ≤ 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

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

Sigma of the Gaussian function for the smoothing.

Default: 1.01.0
Suggested values: 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.00.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.0
Value range: 0.4 ≤ MeasureSigma ≤ 100 (lin)
Minimum increment: 0.01
Recommended increment: 0.1

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

Minimum edge amplitude.

Default: 30.030.0
Suggested values: 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.05.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.0
Value range: 1 ≤ MeasureThreshold ≤ 255 (lin)
Minimum increment: 0.5
Recommended increment: 2

GenParamNamegenParamNamegen_param_name (input_control) attribute.name-array → (string)(string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Names of the generic parameters.

Default: [][]
List of values: 'distance_threshold', 'end_phi', 'instances_outside_measure_regions', 'max_num_iterations', 'measure_distance', 'measure_interpolation', 'measure_select', 'measure_transition', 'min_score', 'num_instances', 'num_measures', 'point_order', 'rand_seed', 'start_phi'"distance_threshold", "end_phi", "instances_outside_measure_regions", "max_num_iterations", "measure_distance", "measure_interpolation", "measure_select", "measure_transition", "min_score", "num_instances", "num_measures", "point_order", "rand_seed", "start_phi"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value-array → (real / integer / string)(real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)Sequence[Union[float, int, str]]Htuple (double / Hlong / char*)

Values of the generic parameters.

Default: [][]
Suggested values: 1, 2, 3, 4, 5, 10, 20, 'all', 'true', 'false', 'first', 'last', 'positive', 'negative', 'uniform', 'nearest_neighbor', 'bilinear', 'bicubic'1, 2, 3, 4, 5, 10, 20, "all", "true", "false", "first", "last", "positive", "negative", "uniform", "nearest_neighbor", "bilinear", "bicubic"

Indexindexindex (output_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Index of the created metrology object.

Example🔗

(HDevelop)


create_metrology_model (MetrologyHandle)
read_image (Image, 'fabrik')
get_image_size (Image, Width, Height)
set_metrology_model_image_size (MetrologyHandle, Width, Height)
LinePar := [45,360,415,360]
RectPar1 := [270,232,rad(0),30,25]
RectPar2 := [360,230,rad(0),30,25]
LinePar := [45,360,415,360]
RectPar3 := [245,320,rad(-90),70,35]
* Add two rectangles
add_metrology_object_generic (MetrologyHandle, 'rectangle2', \
                             [RectPar1,RectPar2], 20, 5, 1, 30, [], [], \
                             Indices)
* Add a rectangle and a line
add_metrology_object_generic (MetrologyHandle, ['rectangle2','line'], \
                             [RectPar3,LinePar], 20, 5, 1, 30, [], [], \
                             Index)
get_metrology_object_model_contour (Contour, MetrologyHandle, 'all', 1.5)
apply_metrology_model (Image, MetrologyHandle)
get_metrology_object_result_contour (Contour1, MetrologyHandle, 'all', \
                                    'all', 1.5)

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

set_metrology_model_image_sizeSetMetrologyModelImageSize, set_metrology_model_paramSetMetrologyModelParam

Possible successors

align_metrology_modelAlignMetrologyModel, apply_metrology_modelApplyMetrologyModel, set_metrology_model_paramSetMetrologyModelParam

See also

get_metrology_object_model_contourGetMetrologyObjectModelContour

Module🔗

2D Metrology