Skip to content

find_calib_objectFindCalibObjectFindCalibObjectfind_calib_objectT_find_calib_object🔗

Short description🔗

find_calib_objectFindCalibObjectFindCalibObjectfind_calib_objectT_find_calib_object — Find the HALCON calibration plate and set the extracted points and contours in a calibration data model.

Signature🔗

find_calib_object( image Image, calib_data CalibDataID, number CameraIdx, number CalibObjIdx, number CalibObjPoseIdx, attribute.name GenParamName, attribute.value GenParamValue )void FindCalibObject( const HObject& Image, const HTuple& CalibDataID, const HTuple& CameraIdx, const HTuple& CalibObjIdx, const HTuple& CalibObjPoseIdx, const HTuple& GenParamName, const HTuple& GenParamValue )static void HOperatorSet.FindCalibObject( HObject image, HTuple calibDataID, HTuple cameraIdx, HTuple calibObjIdx, HTuple calibObjPoseIdx, HTuple genParamName, HTuple genParamValue )def find_calib_object( image: HObject, calib_data_id: HHandle, camera_idx: int, calib_obj_idx: int, calib_obj_pose_idx: int, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, float, int]] ) -> None

Herror T_find_calib_object( const Hobject Image, const Htuple CalibDataID, const Htuple CameraIdx, const Htuple CalibObjIdx, const Htuple CalibObjPoseIdx, const Htuple GenParamName, const Htuple GenParamValue )

void HCalibData::FindCalibObject( const HImage& Image, Hlong CameraIdx, Hlong CalibObjIdx, Hlong CalibObjPoseIdx, const HTuple& GenParamName, const HTuple& GenParamValue ) const

void HCalibData.FindCalibObject( HImage image, int cameraIdx, int calibObjIdx, int calibObjPoseIdx, HTuple genParamName, HTuple genParamValue )

Description🔗

find_calib_objectFindCalibObject searches in Imageimageimage for a HALCON calibration plate corresponding to the description of the calibration object with the index CalibObjIdxcalibObjIdxcalib_obj_idx from the calibration data model CalibDataIDcalibDataIDcalib_data_id. If a calibration plate is found, find_calib_objectFindCalibObject extracts the centers and the contours of its marks and estimates the pose of the plate relative to the observing camera CameraIdxcameraIdxcamera_idx. All collected observation data is stored in the calibration data model for the calibration object pose CalibObjPoseIdxcalibObjPoseIdxcalib_obj_pose_idx. In order to ensure a successful detection of the calibration plate, at least one finder pattern has to be visible in the image. For calibration plates with hexagonally arranged marks this is a special mark hexagon where either four or six marks contain a hole, while for calibration plates with rectangularly arranged marks this is the border of the calibration plate with a triangle in one corner.

Preparation of the input data🔗

Before the operator find_calib_objectFindCalibObject can be called, a calibration data model has to be defined performing the following steps:

  1. Create a calibration data model with the operator create_calib_dataCreateCalibData, specifying the number of cameras in the setup and the number of used calibration objects.

  2. Specify the camera type and the initial internal camera parameters for all cameras with the operator set_calib_data_cam_paramSetCalibDataCamParam. Note that only cameras of the same type can be calibrated in a single setup.

  3. Specify the description of all calibration objects with the operator set_calib_data_calib_objectSetCalibDataCalibObject. Note that for a successful call of find_calib_objectFindCalibObject a valid description file of the calibration plate is necessary. This description file has to be set beforehand via the operator set_calib_data_calib_objectSetCalibDataCalibObject. As a consequence, the usage of a user-defined calibration object can only be made by the operator set_calib_data_observ_pointsSetCalibDataObservPoints.

Collecting observation data🔗

find_calib_objectFindCalibObject is used to collect observations in a calibration data model. Beyond, it stores additional observation data that cannot be added to the model with set_calib_data_observ_pointsSetCalibDataObservPoints and that is dependent on the used calibration plate. While for calibration plates with rectangularly arranged marks (see gen_caltabGenCaltab) the rim of the calibration plate is added to the observations, calibration plates with hexagonal pattern (see create_caltabCreateCaltab) store one of their finder pattern. Additionally and irrespective of the used calibration plate, the contour of each mark is added to the calibration model.

Setting additional parameters🔗

Using calibration plates with hexagonally arranged marks, the following additional parameter can be set via GenParamNamegenParamNamegen_param_name and GenParamValuegenParamValuegen_param_value:

  • 'sigma'"sigma": Smoothing factor for the extraction of the mark contours. For increasing values of 'sigma'"sigma", the filter width and thereby the amount of smoothing increases (see also edges_sub_pixEdgesSubPix for the influence of the filter width on the Canny filter).

    Suggested values: 0.50.5, 0.70.7, 0.90.9, 1.01.0, 1.21.2, 1.51.5

    Default: 1.01.0

For calibration plates with rectangularly arranged marks, find_calib_objectFindCalibObject essentially encapsulates the sequence of three operator calls: find_caltabFindCaltab, find_marks_and_poseFindMarksAndPose and set_calib_data_observ_pointsSetCalibDataObservPoints. For this kind of calibration plates the following parameters can be set using GenParamNamegenParamNamegen_param_name and GenParamValuegenParamValuegen_param_value:

  • 'alpha'"alpha": Smoothing factor for the extraction of the mark contours. For increasing values of 'alpha'"alpha", the filter width and thereby the amount of smoothing decreases (see also edges_sub_pixEdgesSubPix for the influence of the filter width on the Lanser2 filter ).

    Suggested values: 0.50.5, 0.70.7, 0.90.9, 1.01.0, 1.21.2, 1.51.5

    Default: 0.90.9

  • 'gap_tolerance'"gap_tolerance": Tolerance factor for gaps between the marks. If the marks appear closer to each other than expected, you might set 'gap_tolerance'"gap_tolerance" < 1.01.0 to avoid disturbing patterns outside the calibration plate to be associated with the calibration plate. This can typically happen if the plate is strongly tilted and positioned in front of a background that exposes mark-like patterns. If the distances between single marks vary in a wide range, e.g., if the calibration plate appears with strong perspective distortion in the image, you might set 'gap_tolerance'"gap_tolerance" > 1.01.0 to enforce the marks grouping (see also find_caltabFindCaltab).

    Suggested values: 0.750.75, 0.90.9, 1.01.0, 1.11.1, 1.21.2, 1.51.5

    Default: 1.01.0

  • 'max_diam_marks'"max_diam_marks": Maximum expected diameter of the marks (needed internally by find_marks_and_poseFindMarksAndPose). By default, this value is estimated by the preceding internal call to find_caltabFindCaltab. However, if the estimation is erroneous for no obvious reason or the internal call to find_caltabFindCaltab fails or is simply skipped (see 'skip_find_caltab'"skip_find_caltab" below), you might have to adjust this value.

    Suggested values: 50.050.0, 100.0100.0, 150.0150.0, 200.0200.0, 300.0300.0

  • 'skip_find_caltab'"skip_find_caltab": Skip the internal call to find_caltabFindCaltab. If activated, only the domain of Imageimageimage reduces the search area for the internal call of find_marks_and_poseFindMarksAndPose. Thus, a user defined calibration plate region can be incorporated by setting 'skip_find_caltab'"skip_find_caltab"='false'"false" and reducing the Imageimageimage domain to the user region.

    List of values: 'false'"false", 'true'"true"

    Default: 'false'"false"

If using a HALCON calibration plate as calibration object, it is recommended to use find_calib_objectFindCalibObject instead of set_calib_data_observ_pointsSetCalibDataObservPoints where possible, since the contour information, which it stores in the calibration data model, enables a more precise calibration procedure with calibrate_camerasCalibrateCameras.

After a successful call to find_calib_objectFindCalibObject, the extracted points can be queried by get_calib_data_observ_pointsGetCalibDataObservPoints and the extracted contours can be accessed by get_calib_data_observ_contoursGetCalibDataObservContours.

Execution information🔗

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

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

  • Automatically parallelized on internal data level.

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🔗

Imageimageimage (input_object) singlechannelimage → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject (byte / uint2)

Input image.

CalibDataIDcalibDataIDcalib_data_id (input_control, state is modified) calib_data → (handle)HTuple (HHandle)HCalibData, HTuple (IntPtr)HHandleHtuple (handle)

Handle of a calibration data model.

CameraIdxcameraIdxcamera_idx (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Index of the observing camera.

Default: 00
Suggested values: 0, 1, 20, 1, 2

CalibObjIdxcalibObjIdxcalib_obj_idx (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Index of the calibration object.

Default: 00
Suggested values: 0, 1, 20, 1, 2

CalibObjPoseIdxcalibObjPoseIdxcalib_obj_pose_idx (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Index of the observed calibration object.

Default: 00
Suggested values: 0, 1, 20, 1, 2
Restriction: CalibObjPoseIdx >= 0

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

Names of the generic parameters to be set.

Default: [][]
List of values: 'alpha', 'gap_tolerance', 'max_diam_marks', 'sigma', 'skip_find_caltab'"alpha", "gap_tolerance", "max_diam_marks", "sigma", "skip_find_caltab"

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

Values of the generic parameters to be set.

Default: [][]
Suggested values: 0.5, 0.9, 1.0, 1.2, 1.5, 2.0, 'true', 'false'0.5, 0.9, 1.0, 1.2, 1.5, 2.0, "true", "false"

Combinations with other operators🔗

Combinations

Possible predecessors

read_imageReadImage, find_marks_and_poseFindMarksAndPose, set_calib_data_cam_paramSetCalibDataCamParam, set_calib_data_calib_objectSetCalibDataCalibObject

Possible successors

set_calib_dataSetCalibData, calibrate_camerasCalibrateCameras

Alternatives

find_caltabFindCaltab, find_marks_and_poseFindMarksAndPose, set_calib_data_observ_pointsSetCalibDataObservPoints

Module🔗

Calibration