Skip to content

hom_mat3d_to_poseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_poseT_hom_mat3d_to_pose🔗

Short description🔗

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

Signature🔗

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

Herror T_hom_mat3d_to_pose( const Htuple HomMat3D, Htuple* Pose )

HPose HHomMat3D::HomMat3dToPose( ) const

HPose HHomMat3D.HomMat3dToPose( )

Description🔗

hom_mat3d_to_poseHomMat3dToPose converts a homogeneous transformation matrix into the corresponding 3D pose with type code 0. For details about 3D poses and the corresponding transformation matrices please refer to create_poseCreatePose.

A typical application of hom_mat3d_to_poseHomMat3dToPose is that a 3D pose was converted into a homogeneous transformation matrix to further transform it, e.g., with hom_mat3d_rotateHomMat3dRotate or hom_mat3d_translateHomMat3dTranslate, and now must be converted back into a pose to use it as input for operators like image_points_to_world_planeImagePointsToWorldPlane.

Attention🔗

hom_mat3d_to_poseHomMat3dToPose only supports rigid transformations in HomMat3DhomMat3Dhom_mat_3d. For non-rigid transformations, the operator attempts to return a pose that is close to HomMat3DhomMat3Dhom_mat_3d. If HomMat3DhomMat3Dhom_mat_3d deviates significantly from a rigid transformation, the generated pose may also deviate significantly from HomMat3DhomMat3Dhom_mat_3d.

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🔗

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

Homogeneous transformation matrix.

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

Equivalent 3D pose.

Number of elements: 7

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🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

hom_mat3d_rotateHomMat3dRotate, hom_mat3d_translateHomMat3dTranslate, hom_mat3d_invertHomMat3dInvert

Possible successors

camera_calibrationCameraCalibration, write_poseWritePose, disp_caltabDispCaltab, sim_caltabSimCaltab

See also

create_poseCreatePose, camera_calibrationCameraCalibration, disp_caltabDispCaltab, sim_caltabSimCaltab, write_poseWritePose, read_poseReadPose, pose_to_hom_mat3dPoseToHomMat3d, project_3d_pointProject3dPoint, get_line_of_sightGetLineOfSight, hom_mat3d_rotateHomMat3dRotate, hom_mat3d_translateHomMat3dTranslate, hom_mat3d_invertHomMat3dInvert, affine_trans_point_3dAffineTransPoint3d

Module🔗

Foundation