Skip to content

pose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3dpose_to_hom_mat3dT_pose_to_hom_mat3d🔗

Short description🔗

pose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3dpose_to_hom_mat3dT_pose_to_hom_mat3d — Convert a 3D pose into a homogeneous transformation matrix.

Signature🔗

pose_to_hom_mat3d( pose Pose, out hom_mat3d HomMat3D )void PoseToHomMat3d( const HTuple& Pose, HTuple* HomMat3D )static void HOperatorSet.PoseToHomMat3d( HTuple pose, out HTuple homMat3D )def pose_to_hom_mat3d( pose: Sequence[Union[int, float]] ) -> Sequence[float]

Herror T_pose_to_hom_mat3d( const Htuple Pose, Htuple* HomMat3D )

HHomMat3D HPose::PoseToHomMat3d( ) const

HHomMat3D HPose.PoseToHomMat3d( )

Description🔗

pose_to_hom_mat3dPoseToHomMat3d converts a 3D pose Poseposepose, e.g., the external camera parameters, into the equivalent homogeneous transformation matrix HomMat3DhomMat3Dhom_mat_3d. For details about 3D poses and the corresponding transformation matrices please refer to create_poseCreatePose.

A typical application of pose_to_hom_mat3dPoseToHomMat3d is that you want to further transform the pose, e.g., rotate or translate it using hom_mat3d_rotateHomMat3dRotate or hom_mat3d_translateHomMat3dTranslate. In case of the external camera parameters, this can be necessary if the calibration plate cannot be placed such that its coordinate system coincides with the desired world coordinate system.

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.

Parameters🔗

Poseposepose (input_control) pose → (real / integer)HTuple (double / Hlong)HPose, HTuple (double / int / long)Sequence[Union[int, float]]Htuple (double / Hlong)

3D pose.

Number of elements: 7

HomMat3DhomMat3Dhom_mat_3d (output_control) hom_mat3d → (real)HTuple (double)HHomMat3D, HTuple (double)Sequence[float]Htuple (double)

Equivalent homogeneous transformation matrix.

Example🔗

(HDevelop)


* Calibrate camera.
calibrate_cameras (CalibDataID,Error)
* Get reference pose (pose 2 of calibration object 0).
get_calib_data (CalibDataID, 'calib_obj_pose',\
                [0,2], 'pose', ObjInCameraPose)
*  Convert pose to homogeneous transformation matrix.
pose_to_hom_mat3d(ObjInCameraPose, cam_H_cal)
*  Rotate it 90 degrees around its y-axis to obtain a world coordinate system
*  whose y- and z-axis lie in the plane of the calibration plate while the
*  x-axis point 'upwards': cam_H_w = cam_H_cal * RotY(90).
hom_mat3d_identity(HomMat3DIdent)
hom_mat3d_rotate(HomMat3DIdent, rad(90), 'y', 0, 0, 0, \
                 HomMat3DRotateY)
hom_mat3d_compose(cam_H_cal, HomMat3DRotateY, cam_H_w)
* Convert transformed matrix back to pose.
hom_mat3d_to_pose (cam_H_w, Pose)

Result🔗

pose_to_hom_mat3dPoseToHomMat3d returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception is raised

Combinations with other operators🔗

Combinations

Possible predecessors

camera_calibrationCameraCalibration, read_poseReadPose

Possible successors

affine_trans_point_3dAffineTransPoint3d, hom_mat3d_invertHomMat3dInvert, hom_mat3d_translateHomMat3dTranslate, hom_mat3d_rotateHomMat3dRotate, hom_mat3d_to_poseHomMat3dToPose

Alternatives

pose_to_dual_quatPoseToDualQuat

See also

create_poseCreatePose, camera_calibrationCameraCalibration, write_poseWritePose, read_poseReadPose, hom_mat3d_to_poseHomMat3dToPose, project_3d_pointProject3dPoint, get_line_of_sightGetLineOfSight, hom_mat3d_rotateHomMat3dRotate, hom_mat3d_translateHomMat3dTranslate, hom_mat3d_invertHomMat3dInvert, affine_trans_point_3dAffineTransPoint3d

Module🔗

Foundation