Compute Target Poses
SUMMARY
compute_camera_T_target_list() runs target detection plus planar solvePnP per frame with a fixed K, d, producing the camera_T_target_list you can feed into EyeInHandCalibrator.calibrate()'s strict pass-through mode.
SUPPORTED TARGETS
Works with any target, ChessboardTarget, CharucoTarget, ArucoTarget, or ZividTarget, see All Supported Targets.
UNITS
Input images can be BGR, BGRA or grayscale ndarrays, and intrinsic_matrix is a (3, 3) matrix in pixels. Returned camera_T_target_list holds (4, 4) SE(3) matrices with translation in meters.
The Skill
poses = calibrator.compute_camera_T_target_list(
image_list, robot_T_tcp_list, intrinsic_matrix, distortion_coefficients,
)| Parameter | Type | Description |
|---|---|---|
image_list | list[ndarray] | Per-frame images, aligned with robot_T_tcp_list. |
robot_T_tcp_list | list[(4, 4) ndarray] | Per-frame robot base to TCP transforms. |
intrinsic_matrix | (3, 3) ndarray | Camera matrix (required). |
distortion_coefficients | ndarray | Distortion coefficients. |
Raises ValueError when image_list and robot_T_tcp_list have different lengths or intrinsic_matrix is empty.
Frames where detection fails, where the detected points are degenerate (e.g. nearly collinear), or where no valid board pose in front of the camera is found are dropped from all three returned lists, so they stay aligned one-to-one:
| Field | Type | Description |
|---|---|---|
camera_T_target_list | list[(4, 4) ndarray] | Per-frame board pose in the camera frame. |
valid_image_list | list[ndarray] | The images those poses came from. |
valid_robot_T_tcp_list | list[(4, 4) ndarray] | The matching robot poses. |
The Code
from telekinesis.axon import EyeInHandCalibrator
from telekinesis.axon.targets import CharucoTarget
target = CharucoTarget(squares_x=6, squares_y=9, square_length=0.012, marker_length=0.009)
calibrator = EyeInHandCalibrator(target)
poses = calibrator.compute_camera_T_target_list(
image_list, robot_T_tcp_list, intrinsic_matrix, distortion_coefficients,
)
result = calibrator.calibrate(
robot_T_tcp_list=poses.valid_robot_T_tcp_list,
image_list=poses.valid_image_list,
camera_T_target_list=poses.camera_T_target_list,
intrinsic_matrix=intrinsic_matrix,
distortion_coefficients=distortion_coefficients,
)