HALCON Reference Manual 10.0.2
Table of Contents / Calibration / Multi-View ClassesClassesClasses | | | Operators

query_calib_data_observ_indicesT_query_calib_data_observ_indicesquery_calib_data_observ_indicesQueryCalibDataObservIndicesQueryCalibDataObservIndices (Operator)

Name

query_calib_data_observ_indicesT_query_calib_data_observ_indicesquery_calib_data_observ_indicesQueryCalibDataObservIndicesQueryCalibDataObservIndices — Query information about the relations between cameras, calibration objects, and calibration object poses.

Signature

query_calib_data_observ_indices( : : CalibDataID, ItemType, ItemIdx : Index1, Index2)

Herror T_query_calib_data_observ_indices(const Htuple CalibDataID, const Htuple ItemType, const Htuple ItemIdx, Htuple* Index1, Htuple* Index2)

Herror query_calib_data_observ_indices(const HTuple& CalibDataID, const HTuple& ItemType, const HTuple& ItemIdx, HTuple* Index1, HTuple* Index2)

HTuple HCalibData::QueryCalibDataObservIndices(const HTuple& ItemType, const HTuple& ItemIdx, HTuple* Index2) const

void HOperatorSetX.QueryCalibDataObservIndices(
[in] VARIANT CalibDataID, [in] VARIANT ItemType, [in] VARIANT ItemIdx, [out] VARIANT* Index1, [out] VARIANT* Index2)

VARIANT HCalibDataX.QueryCalibDataObservIndices(
[in] BSTR ItemType, [in] Hlong ItemIdx, [out] VARIANT* Index2)

static void HOperatorSet.QueryCalibDataObservIndices(HTuple calibDataID, HTuple itemType, HTuple itemIdx, out HTuple index1, out HTuple index2)

HTuple HCalibData.QueryCalibDataObservIndices(string itemType, int itemIdx, out HTuple index2)

Description

A calibration data model (CalibDataIDCalibDataIDCalibDataIDCalibDataIDcalibDataID) contains a collection of observations, which are added to the model by set_calib_data_observ_pointsset_calib_data_observ_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPoints. Each observation is associated to an observing camera, an observed calibration object, and a calibration object pose. With the operator query_calib_data_observ_indicesquery_calib_data_observ_indicesquery_calib_data_observ_indicesQueryCalibDataObservIndicesQueryCalibDataObservIndices, you can query observation indices associated to a camera or an calibration object, depending on the parameter ItemTypeItemTypeItemTypeItemTypeitemType.

For ItemTypeItemTypeItemTypeItemTypeitemType='camera'"camera""camera""camera""camera", you must a valid camera index in ItemIdxItemIdxItemIdxItemIdxitemIdx. Then, Index1Index1Index1Index1index1 returns a list of calibration object indices and Index2Index2Index2Index2index2 returns a list of pose indices. Each pair [Index1[I],Index2[I]] represents calibration object pose that are 'observed' by camera ItemIdxItemIdxItemIdxItemIdxitemIdx.

For ItemTypeItemTypeItemTypeItemTypeitemType='calib_obj'"calib_obj""calib_obj""calib_obj""calib_obj", you must specify a valid calibration object index in ItemIdxItemIdxItemIdxItemIdxitemIdx. Then, Index1Index1Index1Index1index1 returns a list of camera indices and Index2Index2Index2Index2index2 returns a list of corresponding calibration object pose indices. Each pair [Index1[I],Index2[I]] denotes that camera Index1[I] is observing the Index2[I]th pose of calibration object ItemIdxItemIdxItemIdxItemIdxitemIdx.

This operator is particularly suitable for accessing observation data of a calibration data model whose configuration is unknown at the moment of its usage (e.g., if it was just read from a file). As a special case, this operator can be used to get the precise list of poses of one calibration object (see the example).

Attention

A camera calibration data model CalibDataID cannot be shared between two or more user's threads. Different camera calibration data models can be used independently and safely in different threads.

Parallelization

Parameters

CalibDataIDCalibDataIDCalibDataIDCalibDataIDcalibDataID (input_control)  calib_data HCalibData, HTupleHCalibData, HTupleHCalibDataX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Handle of a calibration data model.

ItemTypeItemTypeItemTypeItemTypeitemType (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Kind of refered object.

Default value: 'camera' "camera" "camera" "camera" "camera"

List of values: 'camera'"camera""camera""camera""camera", 'calib_obj'"calib_obj""calib_obj""calib_obj""calib_obj"

ItemIdxItemIdxItemIdxItemIdxitemIdx (input_control)  number HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Camera index or calibration object index (depending on the selected ItemTypeItemTypeItemTypeItemTypeitemType).

Default value: 0

Suggested values: 0, 1, 2

Index1Index1Index1Index1index1 (output_control)  number-array HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

List of calibration object indices or list of camera indices (depending on ItemTypeItemTypeItemTypeItemTypeitemType).

Index2Index2Index2Index2index2 (output_control)  number-array HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Calibration object numbers.

Example (HDevelop)

* read a calibration model from a file
read_calib_data ('calib_data.ccd',CalibDataID)

* get calibration object indices assigned to calibration object 0
query_calib_data_observ_indices (CalibDataID, 'calib_obj', 0, _, \
                                 CalibObjPoseIndices)
* CalibObjPoseIndices contains the list of pose indices of calibration
* object 0. In order to be stored in the model, each calibration object
* needs to be observed by at least one camera in the setup (a calibration
* object pose that is not observed by any camera cannot be stored in
* the model). Typically, a calibration object pose can be observed by more
* than one camera. Hence, some calibration object pose indices might appear
* repeatedly in CalibObjPoseIndices. We use tuple_sort and tuple_uniq to
* extract a unique list of calibration object pose indices for calibration
* object 0.
tuple_sort (CalibObjPoseIndices, CalibObjPoseIndices)
tuple_uniq (CalibObjPoseIndices, CalibObjPoseIndices)

* get poses of calibration objects observed by camera 2
calibrate_cameras (CalibDataID, Error)
query_calib_data_observ_indices (CalibDataID, 'camera', 2, CalibObjIndices,\
                                 CalibObjPoseIndices)
for I := 0 to |CalibObjIndices|-1 by 1
  get_calib_data (CalibDataID, 'calib_obj_pose', \
                  [CalibObjIndices[I], CalibObjPoseIndices[I]], \
                  'pose', CalobjPose)
endfor

Module

Calibration


Table of Contents / Calibration / Multi-View ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH