Skip to content

query_calib_data_observ_indicesQueryCalibDataObservIndicesQueryCalibDataObservIndicesquery_calib_data_observ_indicesT_query_calib_data_observ_indicesπŸ”—

Short descriptionπŸ”—

query_calib_data_observ_indicesQueryCalibDataObservIndicesQueryCalibDataObservIndicesquery_calib_data_observ_indicesT_query_calib_data_observ_indices β€” Query information about the relations between cameras, calibration objects, and calibration object poses.

SignatureπŸ”—

query_calib_data_observ_indices( calib_data CalibDataID, string ItemType, number ItemIdx, out number Index1, out number Index2 )void QueryCalibDataObservIndices( const HTuple& CalibDataID, const HTuple& ItemType, const HTuple& ItemIdx, HTuple* Index1, HTuple* Index2 )static void HOperatorSet.QueryCalibDataObservIndices( HTuple calibDataID, HTuple itemType, HTuple itemIdx, out HTuple index1, out HTuple index2 )def query_calib_data_observ_indices( calib_data_id: HHandle, item_type: str, item_idx: int ) -> Tuple[Sequence[int], Sequence[int]]

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

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

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

HTuple HCalibData::QueryCalibDataObservIndices( const wchar_t* ItemType, Hlong ItemIdx, HTuple* Index2 ) const (Windows only)

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

DescriptionπŸ”—

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

For ItemTypeitemTypeitem_type='camera'"camera", you must pass a valid camera index in ItemIdxitemIdxitem_idx. Then, Index1index1index_1 returns a list of calibration object indices and Index2index2index_2 returns a list of pose indices. Each pair [Index1[I],Index2[I]] represents calibration object pose that are β€˜observed’ by camera ItemIdxitemIdxitem_idx.

For ItemTypeitemTypeitem_type='calib_obj'"calib_obj", you must specify a valid calibration object index in ItemIdxitemIdxitem_idx. Then, Index1index1index_1 returns a list of camera indices and Index2index2index_2 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 ItemIdxitemIdxitem_idx.

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).

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πŸ”—

CalibDataIDcalibDataIDcalib_data_id (input_control, state is modified) calib_data β†’ (handle)HTuple (HHandle)HCalibData, HTuple (IntPtr)HHandleHtuple (handle)

Handle of a calibration data model.

ItemTypeitemTypeitem_type (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Kind of referred object.

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

ItemIdxitemIdxitem_idx (input_control) number β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

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

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

Index1index1index_1 (output_control) number-array β†’ (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

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

Index2index2index_2 (output_control) number-array β†’ (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (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', CalibObjPose)
endfor

ModuleπŸ”—

Calibration