Operator Reference

add_metrology_object_circle_measureT_add_metrology_object_circle_measureAddMetrologyObjectCircleMeasureAddMetrologyObjectCircleMeasureadd_metrology_object_circle_measure (Operator)

add_metrology_object_circle_measureT_add_metrology_object_circle_measureAddMetrologyObjectCircleMeasureAddMetrologyObjectCircleMeasureadd_metrology_object_circle_measure — Add a circle or a circular arc to a metrology model.

Signature

Herror T_add_metrology_object_circle_measure(const Htuple MetrologyHandle, const Htuple Row, const Htuple Column, const Htuple Radius, const Htuple MeasureLength1, const Htuple MeasureLength2, const Htuple MeasureSigma, const Htuple MeasureThreshold, const Htuple GenParamName, const Htuple GenParamValue, Htuple* Index)

void AddMetrologyObjectCircleMeasure(const HTuple& MetrologyHandle, const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& MeasureLength1, const HTuple& MeasureLength2, const HTuple& MeasureSigma, const HTuple& MeasureThreshold, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Index)

Hlong HMetrologyModel::AddMetrologyObjectCircleMeasure(const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& MeasureLength1, const HTuple& MeasureLength2, const HTuple& MeasureSigma, const HTuple& MeasureThreshold, const HTuple& GenParamName, const HTuple& GenParamValue) const

Hlong HMetrologyModel::AddMetrologyObjectCircleMeasure(double Row, double Column, double Radius, double MeasureLength1, double MeasureLength2, double MeasureSigma, double MeasureThreshold, const HTuple& GenParamName, const HTuple& GenParamValue) const

def add_metrology_object_circle_measure(metrology_handle: HHandle, row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], radius: MaybeSequence[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

Description

add_metrology_object_circle_measureadd_metrology_object_circle_measureAddMetrologyObjectCircleMeasureAddMetrologyObjectCircleMeasureadd_metrology_object_circle_measure adds a metrology object of type circle or circular arc to a metrology model and prepares the rectangular measure regions. The handle of the model is passed in MetrologyHandleMetrologyHandleMetrologyHandlemetrologyHandlemetrology_handle.

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

The geometric shape of the metrology object of type circle is specified by its center (RowRowRowrowrow, ColumnColumnColumncolumncolumn) and RadiusRadiusRadiusradiusradius. The rectangular measure regions lie perpendicular to the boundary of the circle. The half edge lengths of the measure regions are set in MeasureLength1MeasureLength1MeasureLength1measureLength1measure_length_1 and MeasureLength2MeasureLength2MeasureLength2measureLength2measure_length_2. The centers of the measure regions lie on the boundary of the circle. The parameter MeasureSigmaMeasureSigmaMeasureSigmameasureSigmameasure_sigma specifies the standard deviation that is used by operator apply_metrology_modelapply_metrology_modelApplyMetrologyModelApplyMetrologyModelapply_metrology_model to smooth the gray values of the image. Salient edges can be selected with the parameter MeasureThresholdMeasureThresholdMeasureThresholdmeasureThresholdmeasure_threshold, which constitutes a threshold on the amplitude, i.e., the absolute value of the first derivative of the edge. The operator add_metrology_object_circle_measureadd_metrology_object_circle_measureAddMetrologyObjectCircleMeasureAddMetrologyObjectCircleMeasureadd_metrology_object_circle_measure returns the index of the added metrology object in parameter IndexIndexIndexindexindex.

Furthermore, you can adjust some generic parameters with GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value. The following values for GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value are available:

'start_phi'"start_phi""start_phi""start_phi""start_phi":

The parameter specifies the angle at the start point of a circular arc. To create a closed circle the value of the parameter 'start_phi'"start_phi""start_phi""start_phi""start_phi" is set to 0 and the value of the parameter 'end_phi'"end_phi""end_phi""end_phi""end_phi" is set to (with positive point order). The input value is mapped automatically to the interval .

Suggested values: 0.0, 0.78, 6.28318

Default: 0.0

'end_phi'"end_phi""end_phi""end_phi""end_phi":

The parameter specifies the angle at the end point of a circular arc. To create a closed circle the value of the parameter 'start_phi'"start_phi""start_phi""start_phi""start_phi" is set to 0 and the value of the parameter 'end_phi'"end_phi""end_phi""end_phi""end_phi" is set to (with positive point order). The input value is mapped internally automatically to the interval .

Suggested values: 0.0, 0.78, 6.28318

Default: 6.28318

'point_order'"point_order""point_order""point_order""point_order":

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

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

Default: 'positive'"positive""positive""positive""positive"

Additionally all generic parameters, that are available for the operator set_metrology_object_paramset_metrology_object_paramSetMetrologyObjectParamSetMetrologyObjectParamset_metrology_object_param can be set. But note that for a lot of applications the default values are sufficient and no adjustment is necessary.

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

MetrologyHandleMetrologyHandleMetrologyHandlemetrologyHandlemetrology_handle (input_control, state is modified)  metrology_model HMetrologyModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the metrology model.

RowRowRowrowrow (input_control)  circle.center.y(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Row coordinate (or Y) of the center of the circle or circular arc.

ColumnColumnColumncolumncolumn (input_control)  circle.center.x(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Column (or X) coordinate of the center of the circle or circular arc.

RadiusRadiusRadiusradiusradius (input_control)  circle.radius(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Radius of the circle or circular arc.

MeasureLength1MeasureLength1MeasureLength1measureLength1measure_length_1 (input_control)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Half length of the measure regions perpendicular to the boundary.

Default: 20.0

Suggested values: 10.0, 20.0, 30.0

Value range: 1.0 ≤ MeasureLength1 MeasureLength1 MeasureLength1 measureLength1 measure_length_1

Minimum increment: 1.0

Recommended increment: 10.0

Restriction: MeasureLength1 < Radius

MeasureLength2MeasureLength2MeasureLength2measureLength2measure_length_2 (input_control)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Half length of the measure regions tangential to the boundary.

Default: 5.0

Suggested values: 3.0, 5.0, 10.0

Value range: 1.0 ≤ MeasureLength2 MeasureLength2 MeasureLength2 measureLength2 measure_length_2

Minimum increment: 1.0

Recommended increment: 10.0

MeasureSigmaMeasureSigmaMeasureSigmameasureSigmameasure_sigma (input_control)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Sigma of the Gaussian function for the smoothing.

Default: 1.0

Suggested values: 0.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 MeasureSigma MeasureSigma measureSigma measure_sigma ≤ 100.0

Minimum increment: 0.01

Recommended increment: 0.1

MeasureThresholdMeasureThresholdMeasureThresholdmeasureThresholdmeasure_threshold (input_control)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Minimum edge amplitude.

Default: 30.0

Suggested values: 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.0

Value range: 1 ≤ MeasureThreshold MeasureThreshold MeasureThreshold measureThreshold measure_threshold ≤ 255 (lin)

Minimum increment: 0.5

Recommended increment: 2

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Names of the generic parameters.

Default: []

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

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value-array HTupleSequence[Union[float, int, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Values of the generic parameters.

Default: []

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

IndexIndexIndexindexindex (output_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index of the created metrology object.

Example (HDevelop)

read_image (Image, 'rings_and_nuts')
create_metrology_model (MetrologyHandle)
get_image_size (Image, Width, Height)
set_metrology_model_image_size (MetrologyHandle, Width, Height)
add_metrology_object_circle_measure (MetrologyHandle, 120, 130, 35, 10, 2, \
                              1, 30, ['measure_distance'], [40], Index)
apply_metrology_model (Image, MetrologyHandle)
get_metrology_object_result (MetrologyHandle, Index, 'all', 'result_type', \
                      'all_param', Circle)
get_metrology_object_result_contour (Contour, MetrologyHandle, Index, \
                                    'all', 1.5)

Result

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

Possible Predecessors

set_metrology_model_image_sizeset_metrology_model_image_sizeSetMetrologyModelImageSizeSetMetrologyModelImageSizeset_metrology_model_image_size

Possible Successors

align_metrology_modelalign_metrology_modelAlignMetrologyModelAlignMetrologyModelalign_metrology_model, apply_metrology_modelapply_metrology_modelApplyMetrologyModelApplyMetrologyModelapply_metrology_model

Alternatives

add_metrology_object_genericadd_metrology_object_genericAddMetrologyObjectGenericAddMetrologyObjectGenericadd_metrology_object_generic

See also

get_metrology_object_model_contourget_metrology_object_model_contourGetMetrologyObjectModelContourGetMetrologyObjectModelContourget_metrology_object_model_contour, set_metrology_model_paramset_metrology_model_paramSetMetrologyModelParamSetMetrologyModelParamset_metrology_model_param, add_metrology_object_ellipse_measureadd_metrology_object_ellipse_measureAddMetrologyObjectEllipseMeasureAddMetrologyObjectEllipseMeasureadd_metrology_object_ellipse_measure, add_metrology_object_line_measureadd_metrology_object_line_measureAddMetrologyObjectLineMeasureAddMetrologyObjectLineMeasureadd_metrology_object_line_measure, add_metrology_object_rectangle2_measureadd_metrology_object_rectangle2_measureAddMetrologyObjectRectangle2MeasureAddMetrologyObjectRectangle2Measureadd_metrology_object_rectangle2_measure

Module

2D Metrology