4. Body model
4.3. Joint state representation
For computing joint angles we have to answer the question how to represent the state of a joint.
Representing the joint state by a rotation matrix
If we place a local coordinate system (LCS) into each landmark of our body model, we can define the joint state by the rotation matrix2 that rotates the LCS in the parent landmark into the LCS in the child landmark.
2A rotation matrix π β Rπ Γπ is an orthogonal matrix with det(π ) = 1. A matrix π is called orthogonal, if it is a square matrix with real entries and its columns and rows are orthogonal unit vectors. An equivalent description is that the transpose of π is equal to its inverse, i.e., π π = π β1, which means that π ππ = π π π= πΌ, where πΌ is the identity matrix. Rotation matrices preserve lengths and angles of vectors, i.e. βπ π£β = βπ£β and π π£ β π π€ = π£ β π€ (π£, π€ β Rπ), where β is the inner product.
4.3. Joint state representation 61
Fig. 4.5 shows the LCS in the hip and the right elbow for some example frames.
Since a LCS is nothing more than three orthonormal vectors, we can represent the LCS by a rotation matrix as well. The relative rotation matrix π ππ that rotates the LCS π π in parent landmark π into the LCS π π in child landmark π β i.e., π π = π π π ππ β can then be computed by (see [Craig, 2005], p. 22): π ππ = β‘ β£ xπβ xπ yπβ xπ zπβ xπ xπβ yπ yπβ yπ zπβ yπ xπβ zπ yπβ zπ zπβ zπ β€ β¦ (4.1)
where the 3x3 rotation matrices π π and π π are denoted here with the help of 3x1 column vectors xπ, yπ, zπ (xπ, yπ, zπ respectively):
π π = [οΈxπ yπ zπ ]οΈ (4.2) π π = [οΈxπ yπ zπ ]οΈ (4.3) This relative rotation matrix π ππ β R3π₯3 is one possible representation for the joint state. Though since it consists of 9 scalar values and a 3D orientation has only 3 independent degrees of freedom, it is a non-minimal representation for the joint state.
Representing the joint state by Euler angles
A minimal representation for a 3D rotation is an Euler angle triplet (πΌ, π½, πΎ) which encodes three successive elementary rotations about the axes of a coordinate system. While Euler angles describe successive rotations of a moving coordinate system (intrinsic rotations), we can in principle also describe rotations about fixed axes, i.e., within a fixed coordinate system (extrinsic rotations). A rotation about the x-,y-, or z-axis by πΌ degrees
can be represented by a corresponding 3x3 rotation matrix:
π π₯(πΌ) = β‘ β£ 1 0 0 0 cos(πΌ) β sin(πΌ) 0 sin(πΌ) cos(πΌ) β€ β¦ (4.4)
Figure 4.5.: Local Coordinate System Examples. Top row: LCS in hip
landmark. Bottom row: LCS in right elbow landmark.
π π¦(πΌ) = β‘ β£ cos(πΌ) 0 β sin(πΌ) 0 1 0 sin(πΌ) 0 cos(πΌ) β€ β¦ (4.5) π π§(πΌ) = β‘ β£ cos(πΌ) β sin(πΌ) 0 sin(πΌ) cos(πΌ) 0 0 0 1 β€ β¦ (4.6)
Since rotations are not commutative, the order is important and must be specified if we talk about Euler angles. In our case, we use the Z-Y-X
4.3. Joint state representation 63
order: i.e., we first rotate around the z-axis of the initial coordinate system by πΌ degrees, then about the resulting new y-axis by π½ degrees, and finally about the new resulting x-axis by πΎ degrees.
Figure 4.6.: Example joint angles for a walking sequence. Selected joint
angles for the person with the T-shirt are plotted. The sequence starts with both arms stretched for some seconds (corresponding to the start interval in the plots where the joint angles are constant), followed by a hand clapping pose sequence, and then the actual walking in a circle sequence.
The overall rotation matrix can be computed by a multiplicative concate- nation of the elementary rotation matrices3
3Note the interesting result mentioned in [Craig, 2005], p.45: βthree rotations taken about fixed axes yield the same final orientation as the same three rotations taken
π π§π¦π₯= π π§(πΌ)π π¦(π½)π π₯(πΎ) (4.7) Given a LCS in a parent landmark and a child landmark, we can compute the relative rotation matrixπ according to 4.1 and then retrieve the Euler angles as a minimal representation of the joint state. For a rotation matrix π π = β‘ β£ π11 π12 π13 π21 π22 π23 π31 π32 π33 β€ β¦ (4.8)
we can compute the Euler angles for the Z-Y-X order by (see [Craig, 2005], p. 43):
π½ = atan2(βπ31, βοΈ
π2
11+ π221) (4.9)
πΌ = atan2(π21/ cos(π½), π11/ cos(π½)) (4.10) πΎ = atan2(π32/ cos(π½), π33/ cos(π½)) (4.11)
Note that the Euler angles are only defined if π½ ΜΈ= Β±π/2. If π½ = Β±π/2, then cos(π½) = 0, i.e., in this case πΌ and πΎ are not defined uniquely. One possible convention is then to define (see [Craig, 2005], p. 43) the Euler angles for π½ = π/2:
π½ = π/2 (4.12)
πΌ = 0.0 (4.13)
πΎ = atan2(π12, π22) (4.14)
and for π½ = βπ/2:
in opposite order about the axes of the moving frameβ, i.e., rotating in the order ZYX with a moving coordinate system results in the same rotation as rotating in the order XYZ within a fixed coordinate system.
4.3. Joint state representation 65
π½ = βπ/2 (4.15)
πΌ = 0.0 (4.16)
πΎ = βatan2(π12, π22) (4.17)
While they are a minimal representation, Euler angles have two disadvan- tages: if one of the rotation axes aligns during the successive rotations with another rotation axis, one degree of freedom for rotating the coor- dinate system is lost. This situation is called βsingularityβ or βgimbal lockβ. Another drawback are possible discontinuities, i.e., an angle near to βπ/2 can βjumpβ to +π/2 and reverse, which has to be regarded when comparing joint angles4.
The 1, 2, and 3 DoF joints are modeled by allowing for 1, 2, or 3 Euler angles to be adjustable. Fig. 4.6 shows examples of joint angles computed for a sequence in which a person walks in a circle. The plots show that the joint angle representation is independent of the orientation of the person to the camera and clearly reflects the periodic nature of the walking movement pattern.
4Quaternions are an alternative representation for rotations which does not suffer from these problems at the cost of a non-minimal representation for 3D rotations: quaternions are 4D vectors. We also experimented with quaternions as joint state representation. Nevertheless, the usage of quaternions did not result in better 3D pose estimation results, which seems to indicate that the gimbal lock and discontinuity problem of Euler angles seems not to play a major role concerning the overall results in our context.