Spatial Representation 01

Download as pdf or txt
Download as pdf or txt
You are on page 1of 149

Robot

This is commonly understood to be a machine which can be programmed


to perform tasks which involve

• manipulative or

2/99        ? i  P
Robot
This is commonly understood to be a machine which can be programmed
to perform tasks which involve

• manipulative or

• locomotive

actions under automatic control.

2/99        ? i  P
• Manipulator
A manipulator is machine whose mechanism usually consists of a
series of segments jointed or sliding relative to one another.

3/99        ? i  P
• Manipulator
A manipulator is machine whose mechanism usually consists of a
series of segments jointed or sliding relative to one another.

• The purpose of the manipulator is to grasp and/or move objects.

3/99        ? i  P
Calculating the Pose of an Object
In order to determine a general expression for the pose of one frame
with respect to another we will make use of the fact that the-
translational and rotational components of the pose are indepen-
dent.

4/99        ? i  P
Calculating the Pose of an Object
In order to determine a general expression for the pose of one frame
with respect to another we will make use of the fact that the-
translational and rotational components of the pose are indepen-
dent.

We shall determine separate expressions for each component and then


combine them to form the general expression.

4/99        ? i  P
Specifying the Translation of One Frame with
Respect to Another
Since we are only considering the translational component of one frame
with respect to another, we can regard the position of the frame as a
point.

5/99        ? i  P
Specifying the Translation of One Frame with
Respect to Another
Since we are only considering the translational component of one frame
with respect to another, we can regard the position of the frame as a
point.

Where this point corresponds to the origin of the frame in question.

5/99        ? i  P
zA {A} A
P

yA

xA

6/99        ? i  P
Given that we are tying to specify the position of a point with respect to
set of axes we can use a 3  1 vector.

A
PBorg = [ px py pz ] T

The expression above specifies the position of the origin of frame {B}
with respect to the principal directions of {A}.

7/99        ? i  P
If we knew

• the position of a point with respect to frame {B} and

• the position of the origin of {B} with respect to {A},

• then the position of the point P with respect to frame {A} is,

A
P = P + PBorg
B A

8/99        ? i  P
zB B
P
A
P

zA yB
{B}

A
P
xB
Borg
yA
{A}

xA

9/99        ? i  P
[·]T indicates the transpose of the vector
{·} Braces indicates the frame of reference
P Capitals indicate a vector

10/99        ? i  P
A
P The leading superscript (i.e A) indicates the comments of
the vector are along the directions indicated by the principal

axes of the frame{A}

11/99        ? i  P
A
P The leading superscript (i.e A) indicates the comments of
the vector are along the directions indicated by the principal

axes of the frame{A}

A
PB The subscript indicates that the vector is used to specify

the point B with respect the frame {A}

11/99        ? i  P
A
P The leading superscript (i.e A) indicates the comments of
the vector are along the directions indicated by the principal

axes of the frame{A}

A
PB The subscript indicates that the vector is used to specify

the point B with respect the frame {A}

ZA The principal axis Z of frame {A}

11/99        ? i  P
Specifying the Orientation of One Frame with
Respect to Another
In order to specify the rotation of one frame with respect to another we
need to specify the direction of each of the principal axes in question in
terms of the principal axes of our reference frame.

12/99        ? i  P
Specifying the Orientation of One Frame with
Respect to Another
In order to specify the rotation of one frame with respect to another we
need to specify the direction of each of the principal axes in question in
terms of the principal axes of our reference frame.

For simplicity we will consider two frames whose origins are coincident
but are rotated with respect to one another.

12/99        ? i  P
The directions of the principal axes of frame {B} with respect to the

axes of frame {A} can be found by taking each of the axes of {B} in

turn and forming a dot product with the axes of frame {A}.

A
ZB = [ ZB · XA, ZB ·YA, ZB · ZA ]T = [ r13, r23, r33 ]T

13/99        ? i  P
zA

ZB
r22
yA
r13
r23
xA

14/99        ? i  P
When calculated for all the principal axes of {B} we obtain a 33 matrix
B R which specifies the rotation of
A {B} with respect to {A}.
⎡ ⎤
r11 r12 r13
⎢ ⎥
⎢ ⎥
A
RB = ⎢ r21 r22 r23 ⎥
⎣ ⎦
r31 r32 r33

15/99        ? i  P
Observations

• Often we only need to specify two of the three principal axes as the

third can found from the cross product e.g

A
ZB × YB = XB
A A

Since p × q = p.q sin(θ) and since each axis is mutually orthogo-


nal sin(θ) will always be 1.

16/99        ? i  P
Observations

• Often we only need to specify two of the three principal axes as the

third can found from the cross product e.g

A
ZB × YB = XB
A A

Since p × q = p.q sin(θ) and since each axis is mutually orthogo-


nal sin(θ) will always be 1.

• A RB = (B RA )−1 = (B RA )T

16/99        ? i  P
Observations

• Often we only need to specify two of the three principal axes as the
third can found from the cross product e.g

A
ZB × YB = XB
A A

Since p × q = p.q sin(θ) and since each axis is mutually orthogo-


nal sin(θ) will always be 1.

• A RB = (B RA )−1 = (B RA )T

• The operation of rotation is not commutative i.e.


A
RB . BRC =B RC ARB

16/99        ? i  P
Specifying the Pose of an Frame with Respect
to Another

We know that the orientation and translation of a frame are indepen-

dent, we also know that we specify the translation component as

A
P = P + PBorg
B A

where B P represents the position of the point P in {B} for the purely
translational case.

17/99        ? i  P
However in the general case, the position of {A} may also be rotated

with respect to {B}

A
P = RB. P + PBorg
A B A

18/99        ? i  P
A T {B}
P= [ px, py, pz ] zB
Borg

{A}
zA A
P yB
Borg
px
xB p
z

yA
py
xA

19/99        ? i  P
Homogeneous Transforms

20/99        ? i  P
• Homogeneous Transforms have a number of advantages when used
as the means of specifying spatial relationships

21/99        ? i  P
• Homogeneous Transforms have a number of advantages when used
as the means of specifying spatial relationships

• They are not the only means to specify pose in robotic systems be
they are the mostly commonly used method.

21/99        ? i  P
• Homogeneous Transforms (HTs) allow us to treat the rotational and
translational components of the pose as a single operation.

22/99        ? i  P
• Homogeneous Transforms (HTs) allow us to treat the rotational and
translational components of the pose as a single operation.

• They allow use to specify the pose of an objects in the previous

examples as
A
P = TB . P
A B

where A TB performs the same function as did our general expres-


sion earlier.

22/99        ? i  P
• There is an efficient method for the calculation of the inverse.

23/99        ? i  P
• There is an efficient method for the calculation of the inverse.

• They also have use in computer graphics and solid modelling since
they also be used to represent shearing and changes in size.However
often such applications use left handed frames

23/99        ? i  P
• There is an efficient method for the calculation of the inverse.

• They also have use in computer graphics and solid modelling since
they also be used to represent shearing and changes in size.However
often such applications use left handed frames

• However, the use of HTs requires us to modify the vector represen-


tation we have been using until now.

23/99        ? i  P
The 3x1 vector

P = [x, y, x]T
becomes a 4x1 vector

24/99        ? i  P
The 3x1 vector

P = [x, y, x]T
becomes a 4x1 vector

P = [abcn] T

where
a b c
x= ,y= ,z=
n n n
24/99        ? i  P
In such a representation

• [ 0 0 0 0 ]T is undefined

25/99        ? i  P
In such a representation

• [ 0 0 0 0 ]T is undefined

• [ i j k 0 ]T is a vector of infinite magnitude which can be used to


indicate direction.

25/99        ? i  P
Commonly used Homogeneous Transforms
We can re-write our general expression for pose in terms of our previous
rotational and translational components using HTs as

⎡ ⎤ ⎡ ⎤
A A A
P RB PBorg
⎣ ⎦=⎣ ⎦
1 000 1

26/99        ? i  P
The HT to perform a translation within the current frame is

⎡ ⎤
1 0 0 qx
⎢ ⎥
⎢ ⎥
⎢ 0 1 0 qy ⎥
Trans[qx , qy, qz] = ⎢


⎥ Trans
⎢ 0 0 1 qz ⎥
⎣ ⎦
0 0 0 1

27/99        ? i  P
⎡ ⎤
sx 0 0 0
⎢ ⎥
⎢ ⎥
⎢ 0 sy 0 0 ⎥
S[sx , sy, sz] = ⎢


⎥ Scaling
⎢ 0 0 sz 0 ⎥
⎣ ⎦
0 0 0 1

28/99        ? i  P
and the rotations of [ψ, θ, φ ]about the respective principal axes of the
current frame are

⎡ ⎤
cos φ − sin φ 0 0
⎢ ⎥
⎢ ⎥
⎢ sin φ cos φ 0 0 ⎥
Rotz(φ) = ⎢


⎥ Roll
⎢ 0 0 1 0⎥
⎣ ⎦
0 0 0 1

29/99        ? i  P
⎡ ⎤
cos θ 0 sin θ 0
⎢ ⎥
⎢ ⎥
⎢ 0 1 0 0⎥
Roty(θ) = ⎢


⎥ Pitch
⎢ − sin θ 0 cos θ 0 ⎥
⎣ ⎦
0 0 0 1

30/99        ? i  P
⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ ⎥
⎢ 0 cos ψ − sin ψ 0 ⎥
Rotx (ψ) = ⎢


⎥ Yaw
⎢ 0 sin ψ cos ψ 0 ⎥
⎣ ⎦
0 0 0 1

31/99        ? i  P
Compound Transforms

By multiplying the HTs together we achieve the "compounded" transfor-

mations i.e given we have the HTs

B
P =B TC .C P A
P =A TB.BP

32/99        ? i  P
Compound Transforms

By multiplying the HTs together we achieve the "compounded" transfor-

mations i.e given we have the HTs

B
P =B TC .C P A
P =A TB.BP

substituting in to the second equation for B P we get

32/99        ? i  P
A
P =A TB.(BTC .C P)

A
P = (ATB.BTC ).C P

and hence

33/99        ? i  P
A
P =A TB.(BTC .C P)

A
P = (ATB.BTC ).C P

and hence

A
TC =A TB.BTC

33/99        ? i  P
In terms of the HT we have

⎡ ⎤
A
RB.BRC A
RB.BPC +A PB
A
TC = ⎣ ⎦
000 1

34/99        ? i  P
Observations
• Although HTs provide a uniform treatment, direct implementation of
the compound operation involves unnecessary multiplications by 0.

35/99        ? i  P
Observations
• Although HTs provide a uniform treatment, direct implementation of
the compound operation involves unnecessary multiplications by 0.

• In some cases the additional computational expensive is not allow-


able and the pose is specified separately in terms of 3x1 Trans and
3x3 Rot operations.

35/99        ? i  P
• The order in which a compound transformation is generated is im-
portant for the efficiency of the operation

36/99        ? i  P
• The order in which a compound transformation is generated is im-
portant for the efficiency of the operation

• e.g. Given the compound operation

A
P =A RB.BRC .C RD.DP
and B RC .C RD is calculated followed by A RB .(B RC .C RD )

36/99        ? i  P
• and finally
(ARB.(BRC .C RD)).DP
this process would take 63 multiplications and 43 additions.

37/99        ? i  P
• and finally
(ARB.(BRC .C RD)).DP
this process would take 63 multiplications and 43 additions.

• However, successive evaluation i.e


C R .D P then B R .(C R .D P) etc)
D C D
will only require 27 multiplications and 18 additions.

37/99        ? i  P
• and finally
(ARB.(BRC .C RD)).DP
this process would take 63 multiplications and 43 additions.

• However, successive evaluation i.e


C R .D P then B R .(C R .D P) etc)
D C D
will only require 27 multiplications and 18 additions.

• The choice of method depends on whether A RD will be required


again.

37/99        ? i  P
Rotation about an arbitrary axis
Rotation about a vector (rx , ry , rz ) by an angle θ passing through the
origin of the reference frame can be achieved by executing the following
steps

38/99        ? i  P
Rotation about an arbitrary axis
Rotation about a vector (rx , ry , rz ) by an angle θ passing through the
origin of the reference frame can be achieved by executing the following
steps

• rotating the reference frame so that the Z axis of the reference


frame is aligned with the vector r

38/99        ? i  P
Rotation about an arbitrary axis
Rotation about a vector (rx , ry , rz ) by an angle θ passing through the
origin of the reference frame can be achieved by executing the following
steps

• rotating the reference frame so that the Z axis of the reference


frame is aligned with the vector r

• rotate about r, which is now equivalent to a rotation about Z

38/99        ? i  P
Rotation about an arbitrary axis
Rotation about a vector (rx , ry , rz ) by an angle θ passing through the
origin of the reference frame can be achieved by executing the following
steps

• rotating the reference frame so that the Z axis of the reference


frame is aligned with the vector r

• rotate about r, which is now equivalent to a rotation about Z

• rotate the reference back so that r is in its original location

38/99        ? i  P
which can be expressed as

Rotr (θ) = Rotx (−α)Roty(β)Rotz(φ)Roty(−β)Rotx (α)

39/99        ? i  P
where

sin α = 2
ry
cos α = √ r2z 2
ry +rz2 ry +rz

sin β = rx cos β = ry2 + rz2

40/99        ? i  P
giving
⎡ ⎤
rx2V θ +Cθ rx ryV θ − rzSθ rx rzV θ + rySθ
⎢ ⎥
⎢ ⎥
Rotr (θ) = ⎢ rx ryV θ + rzSθ ry2V θ +Cθ ryrzV θ − rx Sθ ⎥
⎣ ⎦
rx rzV θ − rySθ ryrzV θ + rx Sθ rz2V θ +Cθ

41/99        ? i  P
Inverting a Homogeneous Transform
We could use standard inversion techniques but it is more efficient to
utilise the structure of the HT and operate on the individual translational
and rotational components.

42/99        ? i  P
Inverting a Homogeneous Transform
We could use standard inversion techniques but it is more efficient to
utilise the structure of the HT and operate on the individual translational
and rotational components.

Given we have an HT of the form

⎡ ⎤
R P
A
TB = ⎣ ⎦
000 1

and we want to calculate B TA = (ATB)−1.

42/99        ? i  P
Let (A TB )−1 have the form
⎡ ⎤
S Q
B
TA = ⎣ ⎦
000 1

43/99        ? i  P
we know that
⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ ⎥
⎢0 1 0 0⎥
A
TB. TA = I = ⎢
B



⎢0 0 1 0⎥
⎣ ⎦
0 0 0 1
where I is the identity.

44/99        ? i  P
Hence if multiply the transform and its inverse each of the translational

and rotational elements of the result must be equal to the corresponding

elements in I .
⎡ ⎤⎡ ⎤ ⎡ ⎤
R P S Q R.S R.Q + P
⎣ ⎦⎣ ⎦=⎣ ⎦
000 1 000 1 000 1

45/99        ? i  P
Equating the result to the identity we have R.S = I and R.Q + P = 0

46/99        ? i  P
Equating the result to the identity we have R.S = I and R.Q + P = 0

this gives us that S = RT and Q = −RT .P.

46/99        ? i  P
Equating the result to the identity we have R.S = I and R.Q + P = 0

this gives us that S = RT and Q = −RT .P.

So B TA can be written in terms of A TB as


⎡ ⎤
RT −RT .P
B
TA = ⎣ ⎦
000 1

46/99        ? i  P
Example 1 Given {B} is rotated relative to {A} about ZA by 30◦ and
then translated 4.0 units in the direction XA and 3.0 units in the direction
YA , findA TB and B TA

B
TA = Trans(4, 3, 0).Rotz(30◦)

47/99        ? i  P
⎡ ⎤⎡ ⎤
1 0 0 4 0.866 −0.5 0 0
⎢ ⎥⎢ ⎥
⎢ ⎥⎢ ⎥
⎢ 0 1 0 3 ⎥ ⎢ 0.5 0.866 0 0 ⎥
B
TA = ⎢ ⎥⎢ ⎥
⎢ ⎥⎢ ⎥
⎢ 0 0 1 0 ⎥⎢ 0 0 0 0⎥
⎣ ⎦⎣ ⎦
0 0 0 1 0 0 1 1

48/99        ? i  P
⎡ ⎤
0.866 −0.500 0.000 4.0
⎢ ⎥
⎢ ⎥
⎢ 0.500 0.866 0.000 3.0 ⎥
B
TA = ⎢



⎢ 0.000 0.000 1.000 0 ⎥
⎣ ⎦
0 0 0 1

49/99        ? i  P
To find A TB we must invert B TA .

50/99        ? i  P
To find A TB we must invert B TA .

Writing B TA again to emphasise the rotational and translation compo-

nents ⎡ ⎤
[R] [P]
B
TA = ⎣ ⎦
000 1

50/99        ? i  P
⎡⎡ ⎤ ⎡ ⎤⎤
0.866 −0.500 0 4
⎢⎢ ⎥ ⎢ ⎥⎥
⎢⎢ ⎥ ⎢ ⎥⎥
⎢ ⎢ 0.500 0.866 0 ⎥ ⎢3⎥⎥
B
TA = ⎢ ⎣ ⎦ ⎣ ⎦⎥
⎢ ⎥
⎢ 0 0 1 0 ⎥
⎣ ⎦
000 1

51/99        ? i  P
Calculating the subparts of the inverse gives us
⎡ ⎤
0.866 0.500 0
⎢ ⎥
−1 ⎢ ⎥
R = R = ⎢ −0.500 0.866 0 ⎥
T
⎣ ⎦
0 0 1

52/99        ? i  P
⎡ ⎤⎡ ⎤ ⎡ ⎤
0.866 0.500 0 4 −4.964
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
−R .P = − ⎢ −0.500 0.866 0 ⎥ ⎢ 3 ⎥ = ⎢ −0.598 ⎥
T
⎣ ⎦⎣ ⎦ ⎣ ⎦
0 0 1 0 0

Substituting the subparts in to our final solution gives

53/99        ? i  P
⎡⎡ ⎤ ⎡ ⎤⎤
0.866 −0.500 0 −4.964
⎢⎢ ⎥ ⎢ ⎥⎥
⎢⎢ ⎥ ⎢ ⎥⎥
⎢ ⎢ −0.500 0.866 0 ⎥ ⎢ −0.598 ⎥ ⎥
(BTA)−1 = ⎢

⎣ ⎦ ⎣ ⎦⎥

⎢ 0 0 1 0 ⎥
⎣ ⎦
000 1

54/99        ? i  P
⎡ ⎤
0.866 0.500 0.000 −4.964
⎢ ⎥
⎢ ⎥
⎢ 0.500 0.866 0.000 −0.598 ⎥
B
TA = ⎢



⎢ 0.000 0.000 1.000 0 ⎥
⎣ ⎦
0 0 0 1

55/99        ? i  P
Example 2 : Manipulator Grasping

{W}

y
{T}

x
x

z
x
{G}

y
y
{B} z
{S} z
y
y
x
x

56/99        ? i  P
We can use the inverse of standard transformations to provide specifi-
cation of movements for the manipulator.

57/99        ? i  P
We can use the inverse of standard transformations to provide specifi-
cation of movements for the manipulator.

Base frame {B}


{B} is a fixed frame located at the base of a manipulator. Later we will
see that it is also called the frame {0} when we discuss the kinematics
of manipulators.

57/99        ? i  P
• Station frame {S}
The station frame is also known as the universe frame, task frame
or the world frame.

58/99        ? i  P
• Station frame {S}
The station frame is also known as the universe frame, task frame
or the world frame.

• It is a convenient arbitrary situated fixed frame used as a reference


to specify the actions of the manipulator.

58/99        ? i  P
• Station frame {S}
The station frame is also known as the universe frame, task frame
or the world frame.

• It is a convenient arbitrary situated fixed frame used as a reference


to specify the actions of the manipulator.

• The station frame is always specified with respect to the base


frame i.e. B TS always exists.

58/99        ? i  P
• Wrist frame {W }
{W } is also affixed to the last link of the manipulator (it is another
name for frame {N} when describing the kinematics of the manip-
ulator).

59/99        ? i  P
• Wrist frame {W }
{W } is also affixed to the last link of the manipulator (it is another
name for frame {N} when describing the kinematics of the manip-
ulator).

• It often described with respect to the base of the robot i.e

{W } =B TW =0 TN

59/99        ? i  P
• Tool frame {T }
The tool frame is affixed to the end of the tool (end effector ) which
the manipulator is using.

60/99        ? i  P
• Tool frame {T }
The tool frame is affixed to the end of the tool (end effector ) which
the manipulator is using.

• When the end effector is empty {T } is located with it origin between


the finger of the gripper.

60/99        ? i  P
• Tool frame {T }
The tool frame is affixed to the end of the tool (end effector ) which
the manipulator is using.

• When the end effector is empty {T } is located with it origin between


the finger of the gripper.

• The tool frame is always specified with respect to the wrist frame
i.e..
{T } =T Tw

60/99        ? i  P
• Goal frame {G}
The goal frame describes the position that the manipulator is to
move the tool.

61/99        ? i  P
• Goal frame {G}
The goal frame describes the position that the manipulator is to
move the tool.

• The function of the manipulators controller is to bring the frame {T }


so that it coincides with {G} at the end of it motion.

61/99        ? i  P
• Goal frame {G}
The goal frame describes the position that the manipulator is to
move the tool.

• The function of the manipulators controller is to bring the frame {T }


so that it coincides with {G} at the end of it motion.

• The goal frame is always specified with respect to the station


frame i.e. .
{G} =S TG

61/99        ? i  P
In order to move the gripper of the manipulator so that it may grasp the
box we require the pose of the box frame {G} with respect to the tool
frame of the manipulator {T }

T
i.e TG

62/99        ? i  P
W
T
{W} T
B
T {T}
W
{G}
S
TG
{B} {S}
B
TS

63/99        ? i  P
Example 3 : Manipulator tool frame Another important
transform is the where transform which is calculated to give the posi-
tion of the tool with respect to the station frame i.e. S TT

S
TT =B TS−1.BTW .W TT

64/99        ? i  P
Perspective Transformations

65/99        ? i  P
• The perspective transformation (or imaging transformation) projects
three dimensional points on to a plane

66/99        ? i  P
• The perspective transformation (or imaging transformation) projects
three dimensional points on to a plane

• It can be used to approximate the behaviour of the imaging process


in a camera.

66/99        ? i  P
• The perspective transformation (or imaging transformation) projects
three dimensional points on to a plane

• It can be used to approximate the behaviour of the imaging process


in a camera.

• It is fundamentally different from previous transformations since it is


non-linear (in the sense that they involve the division by coordinate
values).

66/99        ? i  P
A simple model of the imaging process
Assuming that

• The camera coordinate system (x, y, z) is coincident with image


plane the optical axis (z)

67/99        ? i  P
A simple model of the imaging process
Assuming that

• The camera coordinate system (x, y, z) is coincident with image


plane the optical axis (z)

• The centre of the image plan is at the centre of the camera coordi-
nate system

67/99        ? i  P
A simple model of the imaging process
Assuming that

• The camera coordinate system (x, y, z) is coincident with image


plane the optical axis (z)

• The centre of the image plan is at the centre of the camera coordi-
nate system

• The centre of the lens is at (0, 0, λ).

67/99        ? i  P
image plane x,X
y,Y

(X,Y,Z)

λ
optical centre
of the lens z,Z
(x,y)

68/99        ? i  P
• Let us assume that (X,Y, Z)represents an point in the 3d scene
and that Z > λ.

69/99        ? i  P
• Let us assume that (X,Y, Z)represents an point in the 3d scene
and that Z > λ.

• We can obtain a relationship between this point and the corre-


sponding point on the image plane (x, y) using similar triangles.
From inspection of the figure we obtain,

69/99        ? i  P
x
λ = − Z−λ
X
= X
λ−Z
y
λ = − Z−λ
Y
= Y
λ−Z

and so
λX
x = λ−Z
λY
y = λ−Z

70/99        ? i  P
Perspective Transformation

We can obtain the same expressions by employing the prospective

transformation P ⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ ⎥
⎢0 0 0 0⎥
P=⎢



⎢0 0 0 0⎥
⎣ ⎦
0 0 − λ1 1

71/99        ? i  P
if

• wH represents the point in the world in homogeneous form and

72/99        ? i  P
if

• wH represents the point in the world in homogeneous form and

• cH the corresponding point on the image plane

cH can be found by
cH = PwH

72/99        ? i  P
⎡ ⎤⎡ ⎤ ⎡ ⎤
1 0 0 0 kX kX
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ 0 0 0 0 ⎥ ⎢ kY ⎥ ⎢ kY ⎥
cH = PwH = ⎢ ⎥⎢ ⎥=⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ 0 0 0 0 ⎥ ⎢ kZ ⎥ ⎢ kZ ⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
−kZ
0 0 − λ1 1 k λ +k

73/99        ? i  P
The Cartesian form of the coordinates c is obtained by dividing the re-
sult by the fourth element in the matrix.

74/99        ? i  P
The Cartesian form of the coordinates c is obtained by dividing the re-
sult by the fourth element in the matrix.

⎡ ⎤ ⎡ ⎤
λX
x
⎢ ⎥ ⎢ λ−Z ⎥
⎢ ⎥ ⎢ ⎥
c=⎢ y ⎥=⎢ λY ⎥
⎣ ⎦ ⎣ λ−Z ⎦
λ
z λ−Z

where only the x and y components in c refer to our model.

74/99        ? i  P
Inverse Perspective Transformation

• The inverse perspective transformation P−1 maps an image point


onto the world i.e.

wH = P−1cH

75/99        ? i  P
Inverse Perspective Transformation

• The inverse perspective transformation P−1 maps an image point


onto the world i.e.

wH = P−1cH
• Let us assume we have a given image point (x0 , y0 , 0).This point
can be expressed in homogeneous form as

75/99        ? i  P
⎡ ⎤
kx0
⎢ ⎥
⎢ ⎥
⎢ ky0 ⎥
ch = ⎢



⎢ kz ⎥
⎣ ⎦
k

76/99        ? i  P
• The need for z can be explained by considering that any point on the
line which passes through (x0 , y0 , 0) and (0, 0, λ) could correspond
to the point in the image

77/99        ? i  P
• The need for z can be explained by considering that any point on the
line which passes through (x0 , y0 , 0) and (0, 0, λ) could correspond
to the point in the image

• The imaging process is a many-to-one mapping.

77/99        ? i  P
Thus if we do not have some additional information about the position
of the point in the world which corresponds to the point on the image we
will be unable to recover all of the coordinates of the point in the world.

78/99        ? i  P
Given the inverse of P

⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ ⎥
⎢ 0 0 0 0 ⎥
P−1 = ⎢



⎢0 0 0 0⎥
⎣ ⎦
0 0 λ1 1

79/99        ? i  P
and wh is thus
⎡ ⎤
kx0
⎢ ⎥
⎢ ⎥
⎢ ky0 ⎥
wH = P cH = ⎢
−1



⎢ kz ⎥
⎣ ⎦
λ +k
kz

80/99        ? i  P
and w becomes ⎡ ⎤ ⎡ ⎤
λx0
X
⎢ ⎥ ⎢ λ+z ⎥
⎢ ⎥ ⎢ λy0 ⎥
w=⎢Y ⎥=⎢ ⎥
⎣ ⎦ ⎣ λ+z ⎦
λz
Z λ+z

81/99        ? i  P
Rearranging the third element of the vector above so we have z in terms

of Z and then substituting z in to our expression for X and Y (the first

and second elements) yields

X = λ (λ − Z)
x0

Y = λ (λ − Z)
y0

82/99        ? i  P
• Which shows once again that we require at least knowledge of one
of the world coordinates to determine the exact position of the point
in the world.

83/99        ? i  P
• Which shows once again that we require at least knowledge of one
of the world coordinates to determine the exact position of the point
in the world.

• The acquisition of this additional information using a number of


techniques (i.e. stereo vision).

83/99        ? i  P
Quaternion Representation

84/99        ? i  P
A quaternion is a quadruple of ordered real numbers

s, a, b, c

where each of the numbers is associated with four units.

85/99        ? i  P
• The units i, j, k of a quaternion may be used to represent the three
basis vectors of a Cartesian set of axes (i.e. x, y, z).

86/99        ? i  P
• The units i, j, k of a quaternion may be used to represent the three
basis vectors of a Cartesian set of axes (i.e. x, y, z).

• The s is associated with the real numbers.

86/99        ? i  P
Thus a quaternion Q may be written as a scalar part s and a vector part

v as below,
Q = [s + v] = s + ai + b j + ck

87/99        ? i  P
The three basis vectors i, j, k have the property known as cyclical per-

mutation and thus

i2 = j2 = k2 = −1

ij = k jk = i ki = j
ji = −k k j = −i ik = − j

88/99        ? i  P
The following properties of quaternion algebra hold:

Scalar part of Q s
Vector part of Q ai + b j + ck
Conjugate of Q s − (ai + b j + ck)

89/99        ? i  P
Norm of Q s2 + a2 + b2 + c2
s−(ai+b j+ck)
Reciprocal of Q
s2 +a2 +b2 +c2
Unit quaternion s + ai + b j + ck where s2 + a2 + b2 + c2 = 1

90/99        ? i  P
Thus quaternions include

• real numbers i.e. (s, 0, 0, 0)

91/99        ? i  P
Thus quaternions include

• real numbers i.e. (s, 0, 0, 0)

• complex numbers i.e. (s, a, 0, 0)

91/99        ? i  P
Thus quaternions include

• real numbers i.e. (s, 0, 0, 0)

• complex numbers i.e. (s, a, 0, 0)

• vectors in three dimensional space i.e (0, a, b, c)

91/99        ? i  P
Simple Operations on Quaternions
The addition/subtraction of two quaternions is the pairwise addi-
tion/subtraction of the corresponding elements of the two quadruples

92/99        ? i  P
Simple Operations on Quaternions
The addition/subtraction of two quaternions is the pairwise addi-
tion/subtraction of the corresponding elements of the two quadruples

Q1 + Q2 = (s1 + s2, a1 + a2, b1 + b2, c1 + c2)

92/99        ? i  P
The multiplication of two quaternions can be written as

Q1Q2 = (s1 + v1)(s2 + v2)


= (s1s2 + s2v1 + s1v2 − v1 • v2 + v1 × v2)
(1)

93/99        ? i  P
The product of two vectors as two quaternions is a quaternion. If
Q = [0 + v1 ] and Q2 = [0 + v2 ] then using the previous definition gives

94/99        ? i  P
The product of two vectors as two quaternions is a quaternion. If
Q = [0 + v1 ] and Q2 = [0 + v2 ] then using the previous definition gives

Q1Q2 = −v1 • v2 + v1 × v2

94/99        ? i  P
Quaternion algebra can be employed to efficiently represent rotations
in three dimensional space.

Let us assume

θ
θ

S = sin 2 C = cos 2

95/99        ? i  P
Then Rot(n, θ) representing a rotation of an angle θ about an axis n

can be written as

θ θ
Rot(n, θ) = cos + sin n
2 2

96/99        ? i  P
Example
A rotation of

90◦ about k followed by a rotation of 90◦ about j

can be represented by the quaternion product

◦ ◦ ◦ ◦
(cos 45 + j sin 45 )(cos 45 + k sin 45 )

97/99        ? i  P
= ( 12 + i 12 + j 12 + k 12 )
 √ 
= 1
+ i+√j+k 3
 2 3 2

= cos 60◦ + sin 60◦ i+√j+k
 3

= Rot i+√j+k
3
, 120

Thus the resultant rotation is a rotation of 120◦ about the axis equally
inclined to the i, j, k axes.

98/99        ? i  P
Comparative Costs
Operation Quaternion form 3 × 3 R form
R1R2 9+, 16* 15 +, 24 *
Rv 12 +, 22* 6 +, 9 *

R → Rot(n, θ) 4+, 1 squrt, 1 arctan 8 +, 10*, 2 squrt, 1 arctan

99/99        ? i  P

You might also like