Operators |
set_calib_data — Set data in a calibration data model.
set_calib_data( : : CalibDataID, ItemType, ItemIdx, DataName, DataValue : )
With the operator set_calib_data , you can set data in the calibration data model CalibDataID.
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_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:
Model-related data (ItemType 'model' )
Camera-related data (ItemType 'camera' )
Data related to calibration object poses (ItemType 'calib_obj_pose' )
Hand-eye calibration related data (ItemType 'tool' )
The parameter ItemIdx 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 DataName, their values in DataValue.
ItemIdx must be set to 'general' .
Depending on the selection in DataName, you can set the following model-related parameters to the value passed in DataValue:
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_data).
Set the optimization method to be used in the hand-eye calibration process. If DataValue='linear' is set, a linear method is used for the hand-eye calibration. If DataValue='nonlinear' is set, a nonlinear method is used for the hand-eye calibration (see calibrate_hand_eye for more details).
ItemIdx determines, if data is set for all cameras in general or for a specific camera. With ItemIdx='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 NumCameras-1 (NumCameras is specified during model creation with create_calib_data), only the specified camera is affected by the changes.
By selecting the following parameters in DataName, you can specify which camera parameters shall be optimized during the calibration performed by calibrate_cameras:
The camera parameters listed in DataValue 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' is mainly suited to add previously excluded parameters again.
The camera parameters listed in DataValue are excluded from the optimization for the affected camera(s).
The following camera parameters can be passed in DataValue:
Internal camera parameters
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', and 'line_scan').
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' and 'area_scan_tilt_object_side_telecentric_polynomial').
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', and 'line_scan').
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', and 'area_scan_tilt_object_side_telecentric_polynomial').
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', and 'area_scan_tilt_object_side_telecentric_polynomial').
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', and 'area_scan_tilt_object_side_telecentric_polynomial').
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 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').
Coordinates of the camera's principal point.
An alias parameter for 'cx' and 'cy' .
Sensor element dimensions.
All internal camera parameters.
External camera parameters
Rotation part of the camera pose.
Translation part of the camera pose.
All external camera parameters.
Further camera parameters
Motion vector parameters (for cameras of type 'line_scan' only).
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 (NumCameras=1). This setting makes the calibration process equivalent to the one performed by camera_calibration.
ItemIdx determines, if data is set for all calibration object poses in general or for a specific calibration object pose. With ItemIdx='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 DataName, you can specify which calibration object pose parameters shall be optimized during the calibration performed by calibrate_cameras:
The calibration object pose settings listed in DataValue 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' is mainly suited to add previously excluded parameters again.
The calibration object pose settings listed in DataValue are excluded from the optimization for the affected pose(s).
The following calibration pose parameters can be passed in DataValue:
Rotation part of the calibration object pose.
Translation part of the calibration object pose.
All calibration object pose parameters.
All calibration objects optimization parameters, i.e., the same as 'pose' .
By default all parameters are marked for calibration.
The current settings for any model item can be queried with the operator get_calib_data.
ItemIdx must be set to a valid calibration object pose index.
By selecting the following parameter in DataName, you can set the pose of the robot tool:
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 ItemIdx (corresponds to the parameter CalibObjPoseIdx of any of the operators find_calib_object, set_calib_data_observ_pose, or set_calib_data_observ_points).
This operator modifies the state of the following input parameter:
The value of this parameter may not be shared across multiple threads without external synchronization.Handle of a calibration data model.
Type of calibration data item.
Default value: 'model'
List of values: 'calib_obj_pose' , 'camera' , 'model' , 'tool'
Index of the affected item (depending on the selected ItemType).
Default value: 'general'
Suggested values: 0, 1, 2, 'general'
Parameter(s) to set.
Default value: 'reference_camera'
List of values: 'calib_settings' , 'excluded_settings' , 'optimization_method' , 'reference_camera' , 'tool_in_base_pose'
New value(s).
Default value: 0
Suggested values: 0, 1, 2, 'all' , 'pose' , 'params' , 'alpha' , 'beta' , 'gamma' , 'transx' , 'transy' , 'transz' , 'focus' , 'magnification' , 'kappa' , 'poly' , 'poly_tan_2' , 'k1' , 'k2' , 'k3' , 'image_plane_dist' , 'tilt' , 'principal_point' , 'cx' , 'cy' , 'sx' , 'sy' , 'vx' , 'vy' , 'vz' , 'linear' , 'nonlinear'
* Here, the cell size is known exactly, thus it is excluded from * the optimization. set_calib_data (CalibDataID, 'camera', 'general', 'excluded_settings', \ ['sx','sy'])
set_calib_data_observ_points, find_calib_object
calibrate_cameras, calibrate_hand_eye
Calibration
Operators |