HALCON Reference Manual 10.0.2
Table of Contents / Transformations / 3D Transformations ClassesClassesClasses | | | Operators

pose_to_hom_mat3dT_pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3d (Operator)

Name

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

Signature

pose_to_hom_mat3d( : : Pose : HomMat3D)

Herror T_pose_to_hom_mat3d(const Htuple Pose, Htuple* HomMat3D)

Herror pose_to_hom_mat3d(const HTuple& Pose, HTuple* HomMat3D)

void HOperatorSetX.PoseToHomMat3d(
[in] VARIANT Pose, [out] VARIANT* HomMat3d)

IHHomMat3DX* HPoseX.PoseToHomMat3d([in] VARIANT Pose)

static void HOperatorSet.PoseToHomMat3d(HTuple pose, out HTuple homMat3D)

HHomMat3D HPose.PoseToHomMat3d()

Description

pose_to_hom_mat3dpose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3d converts a 3D pose PosePosePosePosepose, e.g., the external camera parameters, into the equivalent homogeneous transformation matrix HomMat3DHomMat3DHomMat3DHomMat3DhomMat3D. For details about 3D poses and the corresponding transformation matrices please refer to create_posecreate_posecreate_poseCreatePoseCreatePose.

A typical application of pose_to_hom_mat3dpose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3d is that you want to further transform the pose, e.g., rotate or translate it using hom_mat3d_rotatehom_mat3d_rotatehom_mat3d_rotateHomMat3dRotateHomMat3dRotate or hom_mat3d_translatehom_mat3d_translatehom_mat3d_translateHomMat3dTranslateHomMat3dTranslate. 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.

Parallelization

Parameters

PosePosePosePosepose (input_control)  pose-array HPose, HTupleHTupleHPoseX, VARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

3D pose.

Number of elements: 7

HomMat3DHomMat3DHomMat3DHomMat3DhomMat3D (output_control)  hom_mat3d-array HHomMat3D, HTupleHTupleHHomMat3DX, VARIANTHtuple (real) (double) (double) (double) (double)

Equivalent homogeneous transformation matrix.

Example (HDevelop)

*  read internal camera parameters
read_cam_par('campar.dat', CameraParam)
*  read external camera parameters
read_pose('startpose.dat', StartPose)
*  (read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
*   extract corresponding 2D image points [PixelsRow,PixelsColumn])
*  calibration of external camera parameters:
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose, 'pose', \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree 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)

Example (HDevelop)

*  read internal camera parameters
read_cam_par('campar.dat', CameraParam)
*  read external camera parameters
read_pose('startpose.dat', StartPose)
*  (read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
*   extract corresponding 2D image points [PixelsRow,PixelsColumn])
*  calibration of external camera parameters:
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose, 'pose', \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree 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)

Example (C++)

HTuple CameraParam, StartPose, FinalPose, Errors, FinalCamParam;
HTuple HomMat3DIdent, HomMat3DRotateY, cam_H_cal, cam_H_w;
HTuple WorldPointsX, WorldPointsY, WorldPointsZ, PixelsRow, PixelsColumn;
// (read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
//  extract corresponding 2D image points [PixelsRow,PixelsColumn])
// read internal camera parameters:
read_cam_par("campar.dat", &CameraParam);
// read initial camera pose
read_pose("startpose.dat", &StartPose);
// calibration of external camera params:
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ,
                   PixelsRow, PixelsColumn, CameraParam, StartPose, 'pose',
                   &FinalCamParam, &FinalPose, &Errors);
// transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, &cam_H_cal);
//  rotate it 90 degree around the 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);

Example (HDevelop)

*  read internal camera parameters
read_cam_par('campar.dat', CameraParam)
*  read external camera parameters
read_pose('startpose.dat', StartPose)
*  (read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
*   extract corresponding 2D image points [PixelsRow,PixelsColumn])
*  calibration of external camera parameters:
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose, 'pose', \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree 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)

Example (HDevelop)

*  read internal camera parameters
read_cam_par('campar.dat', CameraParam)
*  read external camera parameters
read_pose('startpose.dat', StartPose)
*  (read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
*   extract corresponding 2D image points [PixelsRow,PixelsColumn])
*  calibration of external camera parameters:
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
                   PixelsRow, PixelsColumn, CameraParam, StartPose, 'pose', \
                   FinalCamParam, FinalPose, Errors)
*  transform FinalPose to homogeneous transformation matrix
pose_to_hom_mat3d(FinalPose, cam_H_cal)
*  rotate it 90 degree 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)

Result

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

Possible Predecessors

camera_calibrationcamera_calibrationcamera_calibrationCameraCalibrationCameraCalibration, read_poseread_poseread_poseReadPoseReadPose

Possible Successors

affine_trans_point_3daffine_trans_point_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d, hom_mat3d_inverthom_mat3d_inverthom_mat3d_invertHomMat3dInvertHomMat3dInvert, hom_mat3d_translatehom_mat3d_translatehom_mat3d_translateHomMat3dTranslateHomMat3dTranslate, hom_mat3d_rotatehom_mat3d_rotatehom_mat3d_rotateHomMat3dRotateHomMat3dRotate, hom_mat3d_to_posehom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose

See also

create_posecreate_posecreate_poseCreatePoseCreatePose, camera_calibrationcamera_calibrationcamera_calibrationCameraCalibrationCameraCalibration, write_posewrite_posewrite_poseWritePoseWritePose, read_poseread_poseread_poseReadPoseReadPose, hom_mat3d_to_posehom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose, project_3d_pointproject_3d_pointproject_3d_pointProject3dPointProject3dPoint, get_line_of_sightget_line_of_sightget_line_of_sightGetLineOfSightGetLineOfSight, hom_mat3d_rotatehom_mat3d_rotatehom_mat3d_rotateHomMat3dRotateHomMat3dRotate, hom_mat3d_translatehom_mat3d_translatehom_mat3d_translateHomMat3dTranslateHomMat3dTranslate, hom_mat3d_inverthom_mat3d_inverthom_mat3d_invertHomMat3dInvertHomMat3dInvert, affine_trans_point_3daffine_trans_point_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d

Module

Foundation


Table of Contents / Transformations / 3D Transformations ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH