Convert 3d pose parameters into homogeneous transformation matrix.
::pose_to_hom_mat3d is used to convert 3D pose parameters, like external camera parameter (camera pose Pose) into the equivalent homogeneous 4x3 transformation matrix HomMat3D.
This transformation matrix consists of a 3x3 rotation matrix and a translational vector. The values are given as a tupel HomMat3D in the following order: The first four values describe the first row of the rotation matrix and x-value of the translation vector. The next four values describe the second row of the rotation matrix and the y-value of the translation vector. These are followed by the values of the third row of the rotation matrix and the z-value of the translation vector.
The input tupel Pose describes 3D pose parameters which describe a 3D transform, for example the external camera parameter. These are given by the 3D translational vector (in meters), the three rotational angles and the code of the representation type of the 3D transform: E.g., the value '0' is the code of the representation type 1 and says, that the transform of a point is described, hereby the 3D rotation is performed before the 3D translation, that the three rotations are specified as angles (in degrees), 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, which is generated after the second rotation. ::pose_to_hom_mat3d operates with all types of 3D transform. The sense of the other representation types are explained at ::create_pose. The 3D transform with type 1 directly corrensponds to the transformation by homogenous matixes. This can be explained by the following holds:
(1) (1)
P_C = (x,y,z) = R * P_W + T
= H*P_W
|
Pose (input_control) |
pose-array -> HTuple.double / long |
| External camera parameters. | |
| Number of elements: 7 | |
|
HomMat3D (output_control) |
affine3d-array -> HTuple.double * |
| Homogeneous transformation matrix. | |
| Number of elements: 12 | |
HTuple CamParam,StartCamPose,FinalCamPose,Errors,Dummy;
HTuple HomMat3DWorldCam;
HTuple WorldPointsX,WorldPointsY,WorldPointsZ,PixelsRow,PixelsColumn;
// read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ]
// extract correspondent 2D image points [PixelsRow,PixelsColumn]
// read internal camera parameters:
::read_cam_par("campar.dat",&CamParam);
// read initial camera pose
::read_pose(::"campose.initial":StartCamPose);
// calibration of external camera params:
::camera_calibration(WorldPointsX,WorldPointsY,WorldPointsZ,
PixelsRow,PixelsColumn,CamParam,StartCamPose,6,
&Dummy,&FinalCamPose,&Errors);
// transform FinalCamPose to 4x3 transformation matrix
::pose_to_hom_mat3d(FinalCamPose,&HomMat3DWorldCam);
::pose_to_hom_mat3d returns H_MSG_TRUE if all parameter values are correct. If necessary, an exception handling is raised
::camera_calibration, ::read_pose
::affine_trans_point_3d, ::hom_mat3d_invert, ::hom_mat3d_translate, ::hom_mat3d_rotate, ::hom_mat3d_to_pose
::create_pose, ::camera_calibration, ::write_pose, ::read_pose, ::hom_mat3d_to_pose, ::project_3d_point, ::get_line_of_sight, ::hom_mat3d_rotate, ::hom_mat3d_translate, ::hom_mat3d_invert, ::affine_trans_point_3d
Camera calibration