3D poses are typically used in two ways: First, to describe the position and
orientation of one coordinate system relative to another (e.g., the pose of a
part's coordinate system relative to the camera coordinate system - in short:
the pose of the part relative to the camera) and secondly, to describe how
coordinates can be transformed between two coordinate systems (e.g., to
transform points from part coordinates into camera coordinates).
is referred to
as the Yaw-Pitch-Roll convention in the literature.
Please note that you can “read” this chain in two ways: If you start from
the right, the rotations are always performed relative to the global (i.e.,
fixed or “old”) coordinate system. Thus,
can be read as follows:
First rotate around the z-axis, then around the “old” y-axis, and finally
around the “old” x-axis. In contrast, if you read from the left to the
right, the rotations are performed relative to the local (i.e., “new”)
coordinate system. Then,
corresponds to the following: First rotate around the x-axis, the around the
“new” y-axis, and finally around the “new(est)” z-axis.
Reading from right to
left corresponds to the following sequence of operator calls:
is referred to
as the Roll-Pitch-Yaw convention in the literature.
If you pass 'rodriguez'"rodriguez""rodriguez""rodriguez""rodriguez""rodriguez" in OrderOfRotationOrderOfRotationOrderOfRotationOrderOfRotationOrderOfRotationorderOfRotation, the rotation
parameters RotXRotXRotXRotXRotXrotX, RotYRotYRotYRotYRotYrotY, and RotZRotZRotZRotZRotZrotZ are interpreted as
the x-, y-, and z-component of the so-called Rodriguez rotation vector. The
direction of the vector defines the (arbitrary) axis of rotation. The length
of the vector usually defines the rotation angle with positive orientation.
Here, a variation of the Rodriguez vector is used, where the length of the
vector defines the tangent of half the rotation angle:
Please note that these 3D poses can be ambiguous, meaning a homogeneous
transformation matrix can have several pose representations.
For example, for
with
the following poses correspond to the same homogeneous transformation
matrix:
You can obtain the homogeneous transformation matrix corresponding to a pose
with the operator pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3d. In the standard definition, this
is the following homogeneous transformation matrix which can be split into
two separate matrices, one for the translation
(H(t)) and one for the rotation
(H(R)):
Transformation of coordinates
The following equation describes how a point can be transformed from
coordinate system 1 into coordinate system 2 with a pose, or more
exactly, with the corresponding homogeneous transformation matrix
(input and output points as
homogeneous vectors, see also affine_trans_point_3daffine_trans_point_3dAffineTransPoint3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d). Note that to
transform points from coordinate system 1 into system 2, you use the
transformation matrix that describes the pose of coordinate system 1
relative to system 2.
If you select 'coordinate_system'"coordinate_system""coordinate_system""coordinate_system""coordinate_system""coordinate_system" for ViewOfTransformViewOfTransformViewOfTransformViewOfTransformViewOfTransformviewOfTransform, the
sequence of transformations remains constant, but the rotation angles are
negated. Please note that, contrary to its name, this is not equivalent to
transforming a coordinate system!
* Goal: Calibration with non-standard calibration object
* Read start values for internal camera parameters
read_cam_par('campar.dat', CameraParam)
* (Read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
* extract corresponding 2D image points [PixelsRow,PixelsColumn])
* Task: Create starting value for the external camera parameters, i.e., the
* pose of the calibration object in the calibration images
* First image: Calibration object placed at a distance of 0.5 and 0.1
* 'below' the camera coordinate system
* orientation 'read from left to right': rotated 30 degrees
* around the optical axis of the camera (z-axis),
* then tilted 10 degrees around the new y-axis
create_pose(0.1, 0.0, 0.5, 30, 10, 0, 'Rp+T', 'abg', 'point', StartPose1)
* (Accumulate all poses in StartPoses = [StartPose1, StartPose2, ...])
* perform the calibration
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
PixelsRow, PixelsColumn, CameraParam, StartPoses, \
'pose', FinalCamParam, FinalPoses, Errors)
* Goal: Calibration with non-standard calibration object
* Read start values for internal camera parameters
read_cam_par('campar.dat', CameraParam)
* (Read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
* extract corresponding 2D image points [PixelsRow,PixelsColumn])
* Task: Create starting value for the external camera parameters, i.e., the
* pose of the calibration object in the calibration images
* First image: Calibration object placed at a distance of 0.5 and 0.1
* 'below' the camera coordinate system
* orientation 'read from left to right': rotated 30 degrees
* around the optical axis of the camera (z-axis),
* then tilted 10 degrees around the new y-axis
create_pose(0.1, 0.0, 0.5, 30, 10, 0, 'Rp+T', 'abg', 'point', StartPose1)
* (Accumulate all poses in StartPoses = [StartPose1, StartPose2, ...])
* perform the calibration
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
PixelsRow, PixelsColumn, CameraParam, StartPoses, \
'pose', FinalCamParam, FinalPoses, Errors)
* Goal: Calibration with non-standard calibration object
* Read start values for internal camera parameters
read_cam_par('campar.dat', CameraParam)
* (Read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
* extract corresponding 2D image points [PixelsRow,PixelsColumn])
* Task: Create starting value for the external camera parameters, i.e., the
* pose of the calibration object in the calibration images
* First image: Calibration object placed at a distance of 0.5 and 0.1
* 'below' the camera coordinate system
* orientation 'read from left to right': rotated 30 degrees
* around the optical axis of the camera (z-axis),
* then tilted 10 degrees around the new y-axis
create_pose(0.1, 0.0, 0.5, 30, 10, 0, 'Rp+T', 'abg', 'point', StartPose1)
* (Accumulate all poses in StartPoses = [StartPose1, StartPose2, ...])
* perform the calibration
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
PixelsRow, PixelsColumn, CameraParam, StartPoses, \
'pose', FinalCamParam, FinalPoses, Errors)
// goal: calibration with non-standard calibration object
HTuple CameraParam, StartPose1, StartPoses, FinalPoses;
HTuple Errors, FinalCamParam;
HTuple WorldPointsX, WorldPointsY, WorldPointsZ, PixelsRow, PixelsColumn;
// read start values for internal camera parameters
read_cam_par("campar.dat", &CameraParam);
// (read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
// extract corresponding 2D image points [PixelsRow,PixelsColumn])
// task: create starting value for the external camera parameters, i.e., the
// pose of the calibration object in the calibration images
// first image: calibration object placed at a distance of 0.5 and 0.1
// 'below' the camera coordinate system
// orientation 'read from left to right': rotated 30 degrees
// around the optical axis of the camera (z-axis),
// then tilted 10 degrees around the new y-axis
create_pose(0.1, 0.0, 0.5, 30, 10, 0, 'Rp+T', 'abg', 'point', &StartPose1);
// (accumulate all poses in StartPoses = [StartPose1, StartPose2, ...])
// perform the calibration
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ,
PixelsRow, PixelsColumn, CameraParam, StartPoses, "pose",
&FinalCamParam, &FinalPoses, &Errors);
* Goal: Calibration with non-standard calibration object
* Read start values for internal camera parameters
read_cam_par('campar.dat', CameraParam)
* (Read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
* extract corresponding 2D image points [PixelsRow,PixelsColumn])
* Task: Create starting value for the external camera parameters, i.e., the
* pose of the calibration object in the calibration images
* First image: Calibration object placed at a distance of 0.5 and 0.1
* 'below' the camera coordinate system
* orientation 'read from left to right': rotated 30 degrees
* around the optical axis of the camera (z-axis),
* then tilted 10 degrees around the new y-axis
create_pose(0.1, 0.0, 0.5, 30, 10, 0, 'Rp+T', 'abg', 'point', StartPose1)
* (Accumulate all poses in StartPoses = [StartPose1, StartPose2, ...])
* perform the calibration
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
PixelsRow, PixelsColumn, CameraParam, StartPoses, \
'pose', FinalCamParam, FinalPoses, Errors)
* Goal: Calibration with non-standard calibration object
* Read start values for internal camera parameters
read_cam_par('campar.dat', CameraParam)
* (Read 3D world points [WorldPointsX,WorldPointsY,WorldPointsZ],
* extract corresponding 2D image points [PixelsRow,PixelsColumn])
* Task: Create starting value for the external camera parameters, i.e., the
* pose of the calibration object in the calibration images
* First image: Calibration object placed at a distance of 0.5 and 0.1
* 'below' the camera coordinate system
* orientation 'read from left to right': rotated 30 degrees
* around the optical axis of the camera (z-axis),
* then tilted 10 degrees around the new y-axis
create_pose(0.1, 0.0, 0.5, 30, 10, 0, 'Rp+T', 'abg', 'point', StartPose1)
* (Accumulate all poses in StartPoses = [StartPose1, StartPose2, ...])
* perform the calibration
camera_calibration(WorldPointsX, WorldPointsY, WorldPointsZ, \
PixelsRow, PixelsColumn, CameraParam, StartPoses, \
'pose', FinalCamParam, FinalPoses, Errors)
create_posecreate_poseCreatePosecreate_poseCreatePoseCreatePose returns 2 (H_MSG_TRUE) if all parameter values are
correct. If necessary, an exception is raised.