set_calib_dataT_set_calib_dataSetCalibDataSetCalibDataset_calib_data (Operator)

Name

set_calib_dataT_set_calib_dataSetCalibDataSetCalibDataset_calib_data — Set data in a calibration data model.

Signature

set_calib_data( : : CalibDataID, ItemType, ItemIdx, DataName, DataValue : )

Herror T_set_calib_data(const Htuple CalibDataID, const Htuple ItemType, const Htuple ItemIdx, const Htuple DataName, const Htuple DataValue)

void SetCalibData(const HTuple& CalibDataID, const HTuple& ItemType, const HTuple& ItemIdx, const HTuple& DataName, const HTuple& DataValue)

void HCalibData::SetCalibData(const HString& ItemType, const HTuple& ItemIdx, const HString& DataName, const HTuple& DataValue) const

void HCalibData::SetCalibData(const HString& ItemType, Hlong ItemIdx, const HString& DataName, const HString& DataValue) const

void HCalibData::SetCalibData(const char* ItemType, Hlong ItemIdx, const char* DataName, const char* DataValue) const

void HCalibData::SetCalibData(const wchar_t* ItemType, Hlong ItemIdx, const wchar_t* DataName, const wchar_t* DataValue) const   (Windows only)

static void HOperatorSet.SetCalibData(HTuple calibDataID, HTuple itemType, HTuple itemIdx, HTuple dataName, HTuple dataValue)

void HCalibData.SetCalibData(string itemType, HTuple itemIdx, string dataName, HTuple dataValue)

void HCalibData.SetCalibData(string itemType, int itemIdx, string dataName, string dataValue)

def set_calib_data(calib_data_id: HHandle, item_type: str, item_idx: MaybeSequence[Union[int, str]], data_name: str, data_value: MaybeSequence[Union[str, int]]) -> None

Description

With the operator set_calib_dataset_calib_dataSetCalibDataSetCalibDataSetCalibDataset_calib_data, you can set data in the calibration data model CalibDataIDCalibDataIDCalibDataIDCalibDataIDcalibDataIDcalib_data_id.

Note that an overview on how the calibration data model is filled with data during the processes of camera calibration and hand-eye calibration is provided by the description of get_calib_dataget_calib_dataGetCalibDataGetCalibDataGetCalibDataget_calib_data.

The calibration data model can contain various kinds of data. How to set specific data in the calibration data model is described for different categories of data:

The parameter ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx lets you select whether the new value should be set for all items of a type or only for an individual one. The parameters to set are passed in DataNameDataNameDataNameDataNamedataNamedata_name, their values in DataValueDataValueDataValueDataValuedataValuedata_value.

To get detailed information about the calibration process of your camera setup see the chapter reference Calibration.

Model-related data

ItemTypeItemTypeItemTypeItemTypeitemTypeitem_type='model'"model""model""model""model""model":

ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx must be set to 'general'"general""general""general""general""general".

Depending on the selection in DataNameDataNameDataNameDataNamedataNamedata_name, you can set the following model-related parameters to the value passed in DataValueDataValueDataValueDataValuedataValuedata_value:

'reference_camera'"reference_camera""reference_camera""reference_camera""reference_camera""reference_camera":

Set the reference camera for the calibration model to the passed camera index. All poses stored in the calibration data model are specified in the coordinate system of the reference camera (see get_calib_dataget_calib_dataGetCalibDataGetCalibDataGetCalibDataget_calib_data).

'common_motion_vector'"common_motion_vector""common_motion_vector""common_motion_vector""common_motion_vector""common_motion_vector":

For stereo setups with telecentric line scan cameras, a string with a Boolean value (i.e., 'true'"true""true""true""true""true" or 'false'"false""false""false""false""false") that determines whether the cameras have a common motion vector.

'optimization_method'"optimization_method""optimization_method""optimization_method""optimization_method""optimization_method":

Set the optimization method to be used in the hand-eye calibration process. If DataValueDataValueDataValueDataValuedataValuedata_value='linear'"linear""linear""linear""linear""linear" is set, a linear method is used for the hand-eye calibration. If DataValueDataValueDataValueDataValuedataValuedata_value='nonlinear'"nonlinear""nonlinear""nonlinear""nonlinear""nonlinear" is set, a nonlinear method is used for the hand-eye calibration (see calibrate_hand_eyecalibrate_hand_eyeCalibrateHandEyeCalibrateHandEyeCalibrateHandEyecalibrate_hand_eye for more details).

Camera-related data

ItemTypeItemTypeItemTypeItemTypeitemTypeitem_type='camera'"camera""camera""camera""camera""camera":

ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx determines, if data is set for all cameras in general or for a specific camera. With ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx='general'"general""general""general""general""general", the new settings are applied to all cameras in the model. If you pass a valid camera index instead, i.e., a number between 0 and NumCamerasNumCamerasNumCamerasNumCamerasnumCamerasnum_cameras-1 (NumCamerasNumCamerasNumCamerasNumCamerasnumCamerasnum_cameras is specified during model creation with create_calib_datacreate_calib_dataCreateCalibDataCreateCalibDataCreateCalibDatacreate_calib_data), only the specified camera is affected by the changes.

By selecting the following parameters in DataNameDataNameDataNameDataNamedataNamedata_name, you can specify which camera parameters shall be optimized during the calibration performed by calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras:

'calib_settings'"calib_settings""calib_settings""calib_settings""calib_settings""calib_settings":

The camera parameters listed in DataValueDataValueDataValueDataValuedataValuedata_value are marked for optimization for the affected camera(s) (additionally to the camera parameters that were already marked for optimization). Note that by default, all parameters are marked for the optimization. That is, 'calib_settings'"calib_settings""calib_settings""calib_settings""calib_settings""calib_settings" is mainly suited to add previously excluded parameters again.

'excluded_settings'"excluded_settings""excluded_settings""excluded_settings""excluded_settings""excluded_settings":

The camera parameters listed in DataValueDataValueDataValueDataValuedataValuedata_value are excluded from the optimization for the affected camera(s).

The following camera parameters can be passed in DataValueDataValueDataValueDataValuedataValuedata_value:

Internal camera parameters

'focus'"focus""focus""focus""focus""focus":

Focal length of the lens (only for perspective cameras, i.e., cameras of type 'area_scan_division', 'area_scan_polynomial', 'area_scan_tilt_division', 'area_scan_tilt_polynomial', 'area_scan_tilt_image_side_telecentric_division', 'area_scan_tilt_image_side_telecentric_polynomial', 'area_scan_hypercentric_division', 'area_scan_hypercentric_polynomial', 'line_scan_division', and 'line_scan_polynomial').

'magnification'"magnification""magnification""magnification""magnification""magnification":

Magnification of the lens (only for telecentric cameras, i.e., cameras of type 'area_scan_telecentric_division', 'area_scan_telecentric_polynomial', 'area_scan_tilt_bilateral_telecentric_division', 'area_scan_tilt_bilateral_telecentric_polynomial', 'area_scan_tilt_object_side_telecentric_division', 'area_scan_tilt_object_side_telecentric_polynomial', 'line_scan_telecentric_division', and 'line_scan_telecentric_polynomial').

'kappa'"kappa""kappa""kappa""kappa""kappa":

Divisional distortion coefficient kappa (only for cameras of type 'area_scan_division', 'area_scan_telecentric_division', 'area_scan_tilt_division', 'area_scan_tilt_bilateral_telecentric_division', 'area_scan_tilt_object_side_telecentric_division', 'area_scan_hypercentric_division', 'line_scan_division', and 'line_scan_telecentric_division').

'k1'"k1""k1""k1""k1""k1",'k2'"k2""k2""k2""k2""k2",'k3'"k3""k3""k3""k3""k3":

Polynomial radial distortion parameters (only for cameras of type 'area_scan_polynomial', 'area_scan_telecentric_polynomial', 'area_scan_tilt_polynomial', 'area_scan_tilt_bilateral_telecentric_polynomial', 'area_scan_tilt_object_side_telecentric_polynomial', 'area_scan_hypercentric_polynomial', 'line_scan_polynomial', and 'line_scan_telecentric_polynomial').

'poly_tan_2'"poly_tan_2""poly_tan_2""poly_tan_2""poly_tan_2""poly_tan_2":

An alias parameter for all polynomial tangential distortion parameters, i.e., p1 and p2 (only for cameras of type 'area_scan_polynomial', 'area_scan_telecentric_polynomial', 'area_scan_tilt_polynomial', 'area_scan_tilt_bilateral_telecentric_polynomial', 'area_scan_tilt_object_side_telecentric_polynomial', 'area_scan_hypercentric_polynomial', 'line_scan_polynomial', and 'line_scan_telecentric_polynomial').

'poly'"poly""poly""poly""poly""poly":

An alias parameter for all polynomial distortion parameters, i.e., k1, k2, k3, p1 and p2 (only for cameras of type 'area_scan_polynomial', 'area_scan_telecentric_polynomial', 'area_scan_tilt_polynomial', 'area_scan_tilt_bilateral_telecentric_polynomial', 'area_scan_tilt_object_side_telecentric_polynomial', 'area_scan_hypercentric_polynomial', 'line_scan_polynomial', and 'line_scan_telecentric_polynomial').

'image_plane_dist'"image_plane_dist""image_plane_dist""image_plane_dist""image_plane_dist""image_plane_dist":

The distance of the tilted image plane from the perspective projection center (only for cameras with tilt lenses that perform a perspective projection on the image side of the lens, i.e., cameras of type 'area_scan_tilt_division', 'area_scan_tilt_polynomial', 'area_scan_tilt_object_side_telecentric_division', and 'area_scan_tilt_object_side_telecentric_polynomial').

'tilt'"tilt""tilt""tilt""tilt""tilt":

Tilt and rotation of the tilt lens (only for cameras with tilt lenses, i.e., cameras of type 'area_scan_tilt_division', 'area_scan_tilt_polynomial', 'area_scan_tilt_bilateral_telecentric_division', 'area_scan_tilt_bilateral_telecentric_polynomial', 'area_scan_tilt_object_side_telecentric_division', and 'area_scan_tilt_object_side_telecentric_polynomial').

'cx'"cx""cx""cx""cx""cx",'cy'"cy""cy""cy""cy""cy":

Coordinates of the camera's principal point.

'principal_point'"principal_point""principal_point""principal_point""principal_point""principal_point":

An alias parameter for 'cx'"cx""cx""cx""cx""cx" and 'cy'"cy""cy""cy""cy""cy".

'sx'"sx""sx""sx""sx""sx",'sy'"sy""sy""sy""sy""sy":

Sensor element dimensions.

'params'"params""params""params""params""params":

All internal camera parameters.

External camera parameters

'alpha'"alpha""alpha""alpha""alpha""alpha",'beta'"beta""beta""beta""beta""beta",'gamma'"gamma""gamma""gamma""gamma""gamma":

Rotation part of the camera pose.

'transx'"transx""transx""transx""transx""transx",'transy'"transy""transy""transy""transy""transy",'transz'"transz""transz""transz""transz""transz":

Translation part of the camera pose.

'pose'"pose""pose""pose""pose""pose":

All external camera parameters.

Further camera parameters

'vx'"vx""vx""vx""vx""vx",'vy'"vy""vy""vy""vy""vy",'vz'"vz""vz""vz""vz""vz":

Motion vector parameters (for cameras of type 'line_scan_division', 'line_scan_polynomial', 'line_scan_telecentric_division', and 'line_scan_telecentric_polynomial' only). Note that for stereo setups with telecentric line scan cameras with a common motion vector (i.e., 'common_motion_vector'"common_motion_vector""common_motion_vector""common_motion_vector""common_motion_vector""common_motion_vector" = 'true'"true""true""true""true""true", which is the default), the motion vector optimization parameters of the reference camera determine which parameters of the common motion vector are optimized. For this kind of setup, it is recommended not to exclude any motion vector parameters from the optimization.

'all'"all""all""all""all""all":

All camera parameters.

By default, all parameters are marked for calibration. As an exception, the camera pose is excluded from the optimization for calibration setups with only one camera (NumCamerasNumCamerasNumCamerasNumCamerasnumCamerasnum_cameras=1). This setting makes the calibration process equivalent to the one performed by camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration.

Data related to calibration object poses

ItemTypeItemTypeItemTypeItemTypeitemTypeitem_type='calib_obj_pose'"calib_obj_pose""calib_obj_pose""calib_obj_pose""calib_obj_pose""calib_obj_pose":

ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx determines, if data is set for all calibration object poses in general or for a specific calibration object pose. With ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx='general'"general""general""general""general""general" the new settings are applied to all calibration object poses in the model. If you pass a valid calibration object pose index instead, i.e., a tuple containing a valid index pair [CalibObjIdx, CalibObjPoseIdx], you specify a calibration object pose, which is affected by the changes.

By selecting the following parameters in DataNameDataNameDataNameDataNamedataNamedata_name, you can specify which calibration object pose parameters shall be optimized during the calibration performed by calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras:

'calib_settings'"calib_settings""calib_settings""calib_settings""calib_settings""calib_settings":

The calibration object pose settings listed in DataValueDataValueDataValueDataValuedataValuedata_value are marked for optimization for the affected pose(s). Note that by default, all calibration pose parameters are marked for the optimization. That is, 'calib_settings'"calib_settings""calib_settings""calib_settings""calib_settings""calib_settings" is mainly suited to add previously excluded parameters again.

'excluded_settings'"excluded_settings""excluded_settings""excluded_settings""excluded_settings""excluded_settings":

The calibration object pose settings listed in DataValueDataValueDataValueDataValuedataValuedata_value are excluded from the optimization for the affected pose(s).

The following calibration pose parameters can be passed in DataValueDataValueDataValueDataValuedataValuedata_value:

'alpha'"alpha""alpha""alpha""alpha""alpha",'beta'"beta""beta""beta""beta""beta",'gamma'"gamma""gamma""gamma""gamma""gamma":

Rotation part of the calibration object pose.

'transx'"transx""transx""transx""transx""transx",'transy'"transy""transy""transy""transy""transy",'transz'"transz""transz""transz""transz""transz":

Translation part of the calibration object pose.

'pose'"pose""pose""pose""pose""pose":

All calibration object pose parameters.

'all'"all""all""all""all""all":

All calibration objects optimization parameters, i.e., the same as 'pose'"pose""pose""pose""pose""pose".

By default all parameters are marked for calibration.

The current settings for any model item can be queried with the operator get_calib_dataget_calib_dataGetCalibDataGetCalibDataGetCalibDataget_calib_data.

Hand-eye calibration related data

ItemTypeItemTypeItemTypeItemTypeitemTypeitem_type='tool'"tool""tool""tool""tool""tool":

ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx must be set to a valid calibration object pose index.

By selecting the following parameter in DataNameDataNameDataNameDataNamedataNamedata_name, you can set the pose of the robot tool:

'tool_in_base_pose'"tool_in_base_pose""tool_in_base_pose""tool_in_base_pose""tool_in_base_pose""tool_in_base_pose":

Set the pose of the robot tool (in robot base coordinates), which was used to obtain the observation of the pose of the calibration object with the same index ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx (corresponds to the parameter CalibObjPoseIdx of any of the operators find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object, set_calib_data_observ_poseset_calib_data_observ_poseSetCalibDataObservPoseSetCalibDataObservPoseSetCalibDataObservPoseset_calib_data_observ_pose, or set_calib_data_observ_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPointsSetCalibDataObservPointsset_calib_data_observ_points).

Execution Information

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

CalibDataIDCalibDataIDCalibDataIDCalibDataIDcalibDataIDcalib_data_id (input_control, state is modified)  calib_data HCalibData, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of a calibration data model.

ItemTypeItemTypeItemTypeItemTypeitemTypeitem_type (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Type of calibration data item.

Default value: 'model' "model" "model" "model" "model" "model"

List of values: 'calib_obj_pose'"calib_obj_pose""calib_obj_pose""calib_obj_pose""calib_obj_pose""calib_obj_pose", 'camera'"camera""camera""camera""camera""camera", 'model'"model""model""model""model""model", 'tool'"tool""tool""tool""tool""tool"

ItemIdxItemIdxItemIdxItemIdxitemIdxitem_idx (input_control)  number(-array) HTupleMaybeSequence[Union[int, str]]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)

Index of the affected item (depending on the selected ItemTypeItemTypeItemTypeItemTypeitemTypeitem_type).

Default value: 'general' "general" "general" "general" "general" "general"

Suggested values: 0, 1, 2, 'general'"general""general""general""general""general"

DataNameDataNameDataNameDataNamedataNamedata_name (input_control)  attribute.name HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Parameter(s) to set.

Default value: 'reference_camera' "reference_camera" "reference_camera" "reference_camera" "reference_camera" "reference_camera"

List of values: 'calib_settings'"calib_settings""calib_settings""calib_settings""calib_settings""calib_settings", 'common_motion_vector'"common_motion_vector""common_motion_vector""common_motion_vector""common_motion_vector""common_motion_vector", 'excluded_settings'"excluded_settings""excluded_settings""excluded_settings""excluded_settings""excluded_settings", 'optimization_method'"optimization_method""optimization_method""optimization_method""optimization_method""optimization_method", 'reference_camera'"reference_camera""reference_camera""reference_camera""reference_camera""reference_camera", 'tool_in_base_pose'"tool_in_base_pose""tool_in_base_pose""tool_in_base_pose""tool_in_base_pose""tool_in_base_pose"

DataValueDataValueDataValueDataValuedataValuedata_value (input_control)  attribute.value(-array) HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

New value(s).

Default value: 0

Suggested values: 0, 1, 2, 'all'"all""all""all""all""all", 'pose'"pose""pose""pose""pose""pose", 'params'"params""params""params""params""params", 'alpha'"alpha""alpha""alpha""alpha""alpha", 'beta'"beta""beta""beta""beta""beta", 'gamma'"gamma""gamma""gamma""gamma""gamma", 'transx'"transx""transx""transx""transx""transx", 'transy'"transy""transy""transy""transy""transy", 'transz'"transz""transz""transz""transz""transz", 'focus'"focus""focus""focus""focus""focus", 'magnification'"magnification""magnification""magnification""magnification""magnification", 'kappa'"kappa""kappa""kappa""kappa""kappa", 'poly'"poly""poly""poly""poly""poly", 'poly_tan_2'"poly_tan_2""poly_tan_2""poly_tan_2""poly_tan_2""poly_tan_2", 'k1'"k1""k1""k1""k1""k1", 'k2'"k2""k2""k2""k2""k2", 'k3'"k3""k3""k3""k3""k3", 'image_plane_dist'"image_plane_dist""image_plane_dist""image_plane_dist""image_plane_dist""image_plane_dist", 'tilt'"tilt""tilt""tilt""tilt""tilt", 'principal_point'"principal_point""principal_point""principal_point""principal_point""principal_point", 'cx'"cx""cx""cx""cx""cx", 'cy'"cy""cy""cy""cy""cy", 'sx'"sx""sx""sx""sx""sx", 'sy'"sy""sy""sy""sy""sy", 'vx'"vx""vx""vx""vx""vx", 'vy'"vy""vy""vy""vy""vy", 'vz'"vz""vz""vz""vz""vz", 'true'"true""true""true""true""true", 'false'"false""false""false""false""false", 'linear'"linear""linear""linear""linear""linear", 'nonlinear'"nonlinear""nonlinear""nonlinear""nonlinear""nonlinear"

Example (HDevelop)

* Here, the cell size is known exactly, thus it is excluded from
* the optimization.
set_calib_data (CalibDataID, 'camera', 'general', 'excluded_settings', \
                ['sx','sy'])

Possible Predecessors

set_calib_data_observ_pointsset_calib_data_observ_pointsSetCalibDataObservPointsSetCalibDataObservPointsSetCalibDataObservPointsset_calib_data_observ_points, find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObjectfind_calib_object

Possible Successors

calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCamerascalibrate_cameras, calibrate_hand_eyecalibrate_hand_eyeCalibrateHandEyeCalibrateHandEyeCalibrateHandEyecalibrate_hand_eye

Module

Calibration