• Ei tuloksia

Evolutionary operator

Let us rstly introduce quaternions in order to use them for specifying the evolu-tionary operator. Quaternion is a number system that extends complex numbers.

They were rst introduced by William Rowan Hamilton. Unlike complex numbers, quaternions have three imaginary terms. Thereby, multiplication of two quaternions is a noncommutative operation. Since quaternions are an extension of complex num-bers, they inherit some properties of complex numnum-bers, such as norm, conjugation, unit norm and inversion. A quaternion q is dened as

q =ix+jy+kz+w, x, y, z, w ∈R,

(1)

with Hamilton's rules

i2 =j2 =k2 =ijk =−1

ij =k, jk =i, ki=j, (2)

ji=−k, kj =−i, ik=−j.

Hamilton's rules (2) state that the occurrence of ij is replaced by k, jk by i, kiby j, and etc. The rules are very similar to the cross product of Cartesian vectors. For more information regarding quaternions see "Quaternions for computer graphics"

by John Vince [13].

To dene a dynamical state estimation problem, it is necessary to choose the state vector space and specify its state-transition model. As it was mentioned earlier, the goal of this research is to analyze the position of a body in space. We decided to adopt transform as spatial variables of the body.

Transform in PhysX is a vector which contains seven values. The rst three compo-nents represent a displacement from the initial position and the last 4 compocompo-nents represent a rotation, which is dened as a unit quaternion. It is worth mentioning that the rotation can also be expressed as a rotation matrix. The matrixP is called rotation matrix if it is a square matrix with real entries whose columns and rows are orthogonal unit vectors i.e.

PτP =P Pτ =I,

where I is the identity matrix. In other words,P should be an orthogonal matrix.

For a number of reasons, a quaternion is a better way to represent the orientation of a rigid body than using a classical 3x3 rotation matrix [14]. The rst reason is that usage of the rotation matrix in rigid body dynamics is subject to numerical error. Therefore, a numerical rotation matrix will no longer be precisely a rotation matrix, i.e. orthogonal, which will result in a skewing eect. The next reason is that a quaternion represents a rotation by 4 points, whereas a rotation matrix contains 9 points. Therefore, the degree of redundancy is noticeably lower for quaternions than for rotation matrix. Quaternions are subject to numerical error too, so it is preferable to use normalized quaternions. A quaternion is called normalized if it satises equation (3). Therefore, numerical errors in quaternion could be easily correctable by renormalization.

x2+y2 +z2+w2 = 1 (3) It is worth mentioning that a rotation matrix can be calculated from a quaternion.

If a quaternion has the form (1) and is normalized by (3), it can be easily translated into a left-handed rotation matrix:

P =

The resulting matrixP will be always a rotation matrix, i.e. orthogonal. A compos-ite rotation is specied by quaternion multiplication. Therefore, using quaternions is as simple as using rotation matrixes. It means that two consecutive rotations P1

and P2 can be combined as P3 = P2P1. In the quaternion representation it has a

4 STATE TRANSITION MODEL 20 form q3 =q2q1, where q1 and q2 are quaternions which are associated with rotation matrixes P1 and P2 respectively.

In addition, quaternions can be represented as matrices. It means representing quaternions as matrices in such a way that quaternion addition and multiplication correspond to matrix addition and matrix multiplication. 4×4real matrices can be used for such representation:

In this representation, conjugation of quaternion corresponds to transposition of matrix. When a quaternion is normalized then matrix Q is a rotation matrix in 4-dimensional space. It means Q is an orthogonal matrix and Q−1 =Qτ.

As was mentioned before, state vector has a form of the transform. First three numbers represents displacement from the origin and last 4 numbers represent ro-tation which is dened as a unit quaternion:

~

In current research we construct evolutionary operator from 2 operators: one for a position of the body and one for a rotation of the body. Its Jacobian will have a form

where A and B are the Jacobians of evolutionary operators for position and orien-tation, respectively.

As it was mentioned earlier, the extended Kalman lter denes the state transi-tion model as a functransi-tion which is applied to the previous state to calculate the current one. Therefore, we want to express the position of the object at time tk+1 from the position of the object at time tk. Clearly, the evolution of a position can be written asxk+1 =P xk+D, where P is a rotation andDis a displacement. That kind of evolution is nonlinear because of the displacement, and its Jacobian is equal toP. Now we are going to nd A, which equals to P: PhysX is able to provide the position of a body at time tk as a rotation of initial position of the body and its displacement. Hence, we can dene the position of the body at time tk as:

xk+1=Pk+1x0+Dk+1. (5) Similarly, we can dene xk:

xk =Pkx0 +Dk⇒x0 =Pkτ(xk−Dk). (6) Now we can derive equation for xk+1 by substituting (6) into (5):

xk+1 =Pk+1(Pkτ(xk−Dk)) +Dk+1 =Pk+1Pkτxk−Pk+1PkτDk+Dk+1 (7) Thus, the evolutionary operator has the form (7) and its Jacobian A equals to Pk+1Pkτ. In the same manner we are able to calculate evolutionary operator for

5 OBSERVATION MODEL 22 quaternion. The rotation of object at time tk+1 can be dened as a rotation of its initial state, which is provided by PhysX. As it was mentioned before, a quaternion can be represented as a 4×4 matrix. Therefore, we can express the evolutionary operator in matrix form:

qk+1=Qk+1q0 qk=Qkq0

⇒qk+1 =Qk+1Qτkqk. (8)

Here Qk is a matrix form of a quaternion. Hence, the evolutionary operator for quaternion B is linear and equals to Qk+1Qτk.

Combining (7) and (8), we can obtain nal form of Jacobian of evolutionary op-erator:

F =

Pk+1Pkτ 03×4

04×3 Qk+1Qτk

.

5 Observation model

5.1 Computed tomography

Computed tomography is a procedure that combines a series of X-ray images taken from dierent angles into a cross-sectional image of a specic area of the scanned object. It is used to reveal inner properties of an object without destroying it.

Application of computed tomography takes places commonly in medicine and non-destructive material testing. When X-ray beam comes through the sample, its in-tensity attenuates because of absorption. The nal inin-tensity is measured with a detector at the other side. Attenuation depends on the particular paths of beams, so it is necessary to scan the object from all directions in order to determine the inner structure. The process of reconstructing the image from sensors' data relies on knowledge from physics, mathematics and image processing.