find_calib_objectT_find_calib_objectFindCalibObjectFindCalibObjectfind_calib_object (算子)
名称
find_calib_objectT_find_calib_objectFindCalibObjectFindCalibObjectfind_calib_object — 找到 HALCON 标定板,并在标定数据模型中设置提取的点和轮廓。
签名
void FindCalibObject(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
static void HOperatorSet.FindCalibObject(HObject image, HTuple calibDataID, HTuple cameraIdx, HTuple calibObjIdx, HTuple calibObjPoseIdx, HTuple genParamName, HTuple genParamValue)
void HCalibData.FindCalibObject(HImage image, int cameraIdx, int calibObjIdx, int calibObjPoseIdx, HTuple genParamName, HTuple genParamValue)
描述
find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object searches in ImageImageImageImageimageimage for a HALCON
calibration plate corresponding to the description of the calibration object
with the index CalibObjIdxCalibObjIdxCalibObjIdxCalibObjIdxcalibObjIdxcalib_obj_idx from the calibration data model
CalibDataIDCalibDataIDCalibDataIDCalibDataIDcalibDataIDcalib_data_id. If a calibration plate is found,
find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object extracts the centers and the contours of its marks
and estimates the pose of the plate relative to the observing camera
CameraIdxCameraIdxCameraIdxCameraIdxcameraIdxcamera_idx. All collected observation data is stored in the
calibration data model for the calibration object pose
CalibObjPoseIdxCalibObjPoseIdxCalibObjPoseIdxCalibObjPoseIdxcalibObjPoseIdxcalib_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_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object can be called, a calibration
data model has to be defined performing the following steps:
-
Create a calibration data model with the operator
create_calib_datacreate_calib_dataCreateCalibDataCreateCalibDataCreateCalibDatacreate_calib_data, specifying the number of cameras in the setup
and the number of used calibration objects.
-
Specify the camera type and the initial internal camera
parameters for all cameras with the operator
set_calib_data_cam_paramset_calib_data_cam_paramSetCalibDataCamParamSetCalibDataCamParamSetCalibDataCamParamset_calib_data_cam_param。Note that only cameras of the same
type can be calibrated in a single setup.
-
Specify the description of all calibration objects with the
operator set_calib_data_calib_objectset_calib_data_calib_objectSetCalibDataCalibObjectSetCalibDataCalibObjectSetCalibDataCalibObjectset_calib_data_calib_object。Note that for a successful call of find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object 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_objectset_calib_data_calib_objectSetCalibDataCalibObjectSetCalibDataCalibObjectSetCalibDataCalibObjectset_calib_data_calib_object。As a consequence, the usage of a user-defined calibration object can only
be made by the operator set_calib_data_observ_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPointsSetCalibDataObservPointsset_calib_data_observ_points。
Collecting observation data
find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object 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_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPointsSetCalibDataObservPointsset_calib_data_observ_points and that is dependent on the used
calibration plate. While for calibration plates with rectangularly arranged
marks (see gen_caltabgen_caltabGenCaltabGenCaltabGenCaltabgen_caltab) the rim of the calibration plate is added to
the observations, calibration plates with hexagonal pattern (see
create_caltabcreate_caltabCreateCaltabCreateCaltabCreateCaltabcreate_caltab) 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 GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value:
- 'sigma'"sigma""sigma""sigma""sigma""sigma":
-
Smoothing factor for the extraction of the mark contours. For increasing
values of 'sigma'"sigma""sigma""sigma""sigma""sigma", the filter width and thereby the amount of
smoothing increases (see also edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix for the influence of
the filter width on the Canny filter).
建议值: 0.5, 0.7,
0.9, 1.0,
1.2, 1.5
Default: 1.0
For calibration plates with rectangularly arranged marks,
find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object essentially encapsulates the sequence of three
operator calls: find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab, find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose and
set_calib_data_observ_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPointsSetCalibDataObservPointsset_calib_data_observ_points。For this kind of calibration plates
the following parameters can be set using GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value:
- 'alpha'"alpha""alpha""alpha""alpha""alpha":
-
Smoothing factor for the extraction of the mark contours. For increasing
values of 'alpha'"alpha""alpha""alpha""alpha""alpha", the filter width and thereby the amount of
smoothing decreases (see also edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix for the influence of
the filter width on the Lanser2 filter ).
建议值: 0.5, 0.7,
0.9,
1.0, 1.2, 1.5
Default: 0.9
- 'gap_tolerance'"gap_tolerance""gap_tolerance""gap_tolerance""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""gap_tolerance""gap_tolerance""gap_tolerance""gap_tolerance" < 1.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""gap_tolerance""gap_tolerance""gap_tolerance""gap_tolerance" > 1.0 to
enforce the marks grouping (see also find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab).
建议值: 0.75, 0.9, 1.0,
1.1, 1.2, 1.5
Default: 1.0
- 'max_diam_marks'"max_diam_marks""max_diam_marks""max_diam_marks""max_diam_marks""max_diam_marks":
-
Maximum expected diameter of the marks (needed internally by
find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose). By default, this value is estimated
by the preceding internal call to find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab。However, if
the estimation is erroneous for no obvious reason or the internal call to
find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab fails or is simply skipped (see
'skip_find_caltab'"skip_find_caltab""skip_find_caltab""skip_find_caltab""skip_find_caltab""skip_find_caltab" below), you might have to adjust this
value.
建议值: 50.0, 100.0,
150.0, 200.0,
300.0
- 'skip_find_caltab'"skip_find_caltab""skip_find_caltab""skip_find_caltab""skip_find_caltab""skip_find_caltab":
-
Skip the internal call to find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab。If activated, only the
domain of ImageImageImageImageimageimage reduces the search area for the internal call
of find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose。Thus, a user defined calibration plate
region can be incorporated by setting
'skip_find_caltab'"skip_find_caltab""skip_find_caltab""skip_find_caltab""skip_find_caltab""skip_find_caltab"='false'"false""false""false""false""false" and reducing
the ImageImageImageImageimageimage domain to the user region.
List of values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"
Default: 'false'"false""false""false""false""false"
If using a HALCON calibration plate as calibration object, it is recommended
to use find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object instead of
set_calib_data_observ_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPointsSetCalibDataObservPointsset_calib_data_observ_points where possible, since the contour
information, which it stores in the calibration data model, enables a more
precise calibration procedure with calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras。
After a successful call to find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object, the extracted
points can be queried by get_calib_data_observ_pointsget_calib_data_observ_pointsGetCalibDataObservPointsGetCalibDataObservPointsGetCalibDataObservPointsget_calib_data_observ_points and the
extracted contours can be accessed by get_calib_data_observ_contoursget_calib_data_observ_contoursGetCalibDataObservContoursGetCalibDataObservContoursGetCalibDataObservContoursget_calib_data_observ_contours。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在内部数据级别上自动并行化。
此算子修改后续输入参数的状态:
在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。
参数
ImageImageImageImageimageimage (输入对象) singlechannelimage → objectHImageHObjectHImageHobject (byte / uint2)
输入图像。
CalibDataIDCalibDataIDCalibDataIDCalibDataIDcalibDataIDcalib_data_id (输入控制,状态被修改) calib_data → HCalibData, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of a calibration data model.
CameraIdxCameraIdxCameraIdxCameraIdxcameraIdxcamera_idx (输入控制) number → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the observing camera.
默认值:
0
建议值:
0, 1, 2
CalibObjIdxCalibObjIdxCalibObjIdxCalibObjIdxcalibObjIdxcalib_obj_idx (输入控制) number → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the calibration object.
默认值:
0
建议值:
0, 1, 2
CalibObjPoseIdxCalibObjPoseIdxCalibObjPoseIdxCalibObjPoseIdxcalibObjPoseIdxcalib_obj_pose_idx (输入控制) number → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the observed calibration object.
默认值:
0
建议值:
0, 1, 2
限制:
CalibObjPoseIdx >= 0
GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制) attribute.name-array → HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Names of the generic parameters to be set.
默认值:
[]
值列表:
'alpha'"alpha""alpha""alpha""alpha""alpha", 'gap_tolerance'"gap_tolerance""gap_tolerance""gap_tolerance""gap_tolerance""gap_tolerance", 'max_diam_marks'"max_diam_marks""max_diam_marks""max_diam_marks""max_diam_marks""max_diam_marks", 'sigma'"sigma""sigma""sigma""sigma""sigma", 'skip_find_caltab'"skip_find_caltab""skip_find_caltab""skip_find_caltab""skip_find_caltab""skip_find_caltab"
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (输入控制) attribute.value-array → HTupleSequence[Union[str, float, int]]HTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)
Values of the generic parameters to be set.
默认值:
[]
建议值:
0.5, 0.9, 1.0, 1.2, 1.5, 2.0, 'true'"true""true""true""true""true", 'false'"false""false""false""false""false"
可能的前趋
read_imageread_imageReadImageReadImageReadImageread_image,
find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose,
set_calib_data_cam_paramset_calib_data_cam_paramSetCalibDataCamParamSetCalibDataCamParamSetCalibDataCamParamset_calib_data_cam_param,
set_calib_data_calib_objectset_calib_data_calib_objectSetCalibDataCalibObjectSetCalibDataCalibObjectSetCalibDataCalibObjectset_calib_data_calib_object
可能的后继
set_calib_dataset_calib_dataSetCalibDataSetCalibDataSetCalibDataset_calib_data,
calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras
替代
find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab,
find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose,
set_calib_data_observ_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPointsSetCalibDataObservPointsset_calib_data_observ_points
模块
标定