hom_mat_to_pose ( : : HomTransMat : CamPose )

Convert homogeneous transformation matrix into external camera parameters.

hom_mat_to_pose is used to convert a homogeneous transformation matrix into the correspondent representation of the transformation as translational vector and rotational angles. The homogeneous 4x3 transformation matrix is given as a tupel HomTransMat in the following order: The first nine values describe the three columns of the rotation matrix and the last three values describe the translation.

The output tupel CamPose describes the external camera parameter by the 3D translational vector (in meter), the three rotation angles and the representation type of the 3D transform: Hereby the value 0 says, that the 3D rotation is performed before the 3D translation, that the three rotations are specified as angles (in degree), and that the rotation order is Gamma-Beta-Alpha, i.e., the first rotation is around the Z-axis, the second one around the new Y-axis, and the third one around the new X-axis. Other representation types for the 3D transform are not supported yet, see write_cam_pose.

The subsequent program example shows, how to generate a appropriate initial camera pose for camera_calibration, if the camera pose is roughly measured in the world coordinate system. This is especially important, if no planar calibration table (see create_caltab) is used and therefore the operator find_marks_and_pose cannot be applied. Instead of this natural or artificial landmarks with known world position can be used.

Let for example the relative camera position in the world coordinate system be the following: x = 1.08 m, y = 0.25 m, z = 0.62 m. This means, that the origin of the camera coordinate system in world coordinates has the value [1.08, 0.25, 0.62]. The camera coordinate system is oriented that way, that the line of sight of the camera is along the positive Z-axis. The orientation of the camera coordinate system is given by three rotation angles. In the program example the camera coordinate system first is rotated by 100 degree around the Z-axis. Subsequently it is rotated by -120 degree around the new (!!!) X-axis. Note, that the parameter with the rotation angle in hom_mat_rot is negated.


Parameters

HomTransMat (input_control)
affin3d-array -> real
Homogeneous transformation matrix.
Number of elements: 12

CamPose (output_control)
number-array -> real / integer
External camera parameters.
Number of elements: 7


Example
/* read internal camera parameters: */
read_cam_par(::'campar.dat':CamParam) >
/* read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ] */
/* extract correspondent 2D image points [PixelsRow,PixelsColumn] */ 
/* get rough camera pose from relative camera pose: */
hom_mat_ident(:::HomTransMatIdent) >
hom_mat_translate(::HomTransMatIdent,1.08,'x':HomTransMatTransX) >
hom_mat_translate(::HomTransMatTransX,0.25,'y':HomTransMatTransY) >
hom_mat_translate(::HomTransMatTransY,0.62,'z':HomTransMatTransZ) >
hom_mat_rot(::HomTransMatTransZ,-100,'z':HomTransMatRotZ) >
hom_mat_rot(::HomTransMatRotZ,+120,'x':HomTransMatWorldStart) >
/* convert transformation matrix to pose (rotation and translation) */
hom_mat_to_pose(::HomTransMatWorldStart:StartPose) >
/* calibration of external camera params: */
camera_calibration(::WorldPointsX,WorldPointsY,WorldPointsZ,
                   PixelsRow,PixelsColumn,CamParam,StartPose,6:
                   Dummy,FinalPose,Errors).

Result

hom_mat_to_pose returns TRUE if all parameter values are correct. If necessary an exception is raised


Possible Predecessors

hom_mat_rot, hom_mat_translate, hom_mat_invert


Possible Successors

camera_calibration, write_cam_pose, disp_caltab, sim_caltab


See also

camera_calibration, disp_caltab, sim_caltab, write_cam_pose, read_cam_pose, pose_to_hom_mat, project_3d_point, inverse_project_pixel, hom_mat_rot, hom_mat_translate, hom_mat_invert, hom_3d_trans



Copyright © 1996-1997 MVTec Software GmbH