Professional Documents
Culture Documents
transformations
^
YA
YˆB P
tY X̂ B
A
PBORG
O
tX X̂ A
Position Description
Once a coordinate system is established, we can locate any
point in the space with a 3 x 1 position vector.
Ẑ A
PX
A
P
A
P PY
PZ
YˆA
X̂ A
Coordinate System A
1-3
Orientation Description
Attach Frame B
• To describe the orientation of a
(Coordinate System
Ẑ B body in space, we will attach a
B)
Ẑ A coordinate system (frame B) to
the body and then give a
description of this coordinate
X̂ B A
P YˆB
system relative to the reference
o YˆA system (frame A).
At least three independent values (angles) are
Coordinate System A needed to describe the orientation of frame B
with respect to frame A.
X̂ A
Ẑ B
• The description of a frame can Ẑ A
be thought of as a position
vector and a rotation matrix. X̂ B
A
PBORG YˆB
Position + orientation
{B} { R, PBORG }
A
B
A
YˆA
X̂ A 1-5
2D Rotation matrix Rotation around the Z-Axis
^
YA
Given: The location of point
YˆB
B
A
PY P P in coordinate frame B: B PX PY
X̂ B A A
B Determine: PX PY
PX
B
PY
O A
PX X̂ A
A
PX OP cos( ) OP cos cos sin sin B PX cos B PY sin
A
PY OP sin( ) OP sin cos sin cos B PX sin B PY cos
A
PX cos sin 0 B PX
PX cos sin PX A
A B
A
A B ; P PY sin cos 0 B PY BA R B P
PY sin cos PY 0 0 0 1 0
1-6
^
2D Rotation matrix Rotation around the Z-Axis
YA
One way to describe the rotation
YˆB P
A
PY matrix, BA R
X̂ B , is to write the unit vectors of
B
PX frame {B} in terms of the
B
PY coordinate frame {A}.
O A
PX X̂ A
OP cos( ) ^ B ^ ^ ^
B ^ ^ ^ ^
PX
A
OP X ( P X B
P Y ) X P X X B
P Y X
A A
X B Y B A
X B A Y B A
PY OP sin( ) OP Y ( B P X B P Y ) Y B P X Y B P Y Y
^ ^ ^ ^ ^ ^ ^ ^
A X B Y B A X B A Y B A
^ ^ ^ ^
B
X X Y X P ^
B PX cos sin B PX
^
^ ^
B A B A X
XA
YB B
A
B
^ ^ B P B PY sin cos PY
X B YA YB YA
1-7
3D-Rotation matrix
Orientation Description
Hence, each component of a matrix
rotation can be written as the dot product
of a pair of unit vectors: Ẑ A
A Ẑ B
P
A
B R A Xˆ B YˆB
A A
Zˆ B
X̂ B
r11 r12 r13 YˆB
r31 Xˆ B Zˆ A
r21 r22 r23 r21 Xˆ B YˆA
r31 r32 r33 YˆA
r11 Xˆ B Xˆ A
Xˆ B Xˆ A YˆB Xˆ A Zˆ B Xˆ A X̂
A
A
R Xˆ Yˆ Yˆ Yˆ Zˆ B YˆA
B B A B A
ˆ ˆ ˆ ˆ ˆ ˆ
X B Z A YB Z A Z B Z A
1-8
3D-Rotation matrix
Directional Cosines
A
B R A Xˆ B A
YˆB A
Zˆ B Directional Cosines
Xˆ B Xˆ A YˆB Xˆ A Zˆ B Xˆ A
B T
X̂ A
ˆ ˆ YˆB YˆA Zˆ B YˆA
B R X B YA
A
ˆ ˆ ˆ Zˆ ˆ ˆ
B A
X Z Y B A Z B Z A
B Xˆ AT
B T B T
A
R Yˆ Xˆ B
YˆA B ˆ
ZA AR
B T
B A A
Bˆ T
Z A
1-9
Rotation matrix
r11 r12 r13
A
R BA R T r r22 r23 r1 r2 r3
B A
B R 21
A
B R BA R I A
B R BA R 1 r31 r32 r33
r1 r2 r3 1
B
A RT B
A R 1
r1 r2 r1 r3 r2 r3 0
• For matrix M,
A
B R 1
1-10
Basic Rotation matrix
Rotation around the X-Axis by an angle
1 0 0 These basic rotation matrices
cos -sin
clearly satisfy the properties:
B R X , 0
A
B R K ,0 I 3 ;
A
1-12
Combine Rotation and Translation
^
YA YˆB P
tY A
PBORG
X̂ B
PBORG t X 0
A T
tY
O
tX X̂ A
A
P R Z , P PBORG
A
B
B A
A PX cos sin 0 B PX t X
A B
A
P PY sin cos 0 PY tY
0 0 0 1 0 0
1-13
Combine Rotation and Translation
^
It consists 2 operations, a multiplication and a addition
P BA R Z , B P A PBORG
YA A
YˆB P
tY X̂ B
cos sin 0 B PX t X
P sin 0 B PY tY
A
PBORG
A
cos
O
0 0 1 0 0
tX X̂ A
A PX cos sin 0 t X B PX
A B
PY sin cos 0 tY PY A B
A
P BT P
0 0 0 1 0 0
Homogeneous coordinates are a way
of representing N-dimensional
coordinates with N+1 numbers. To
X̂ A A Px A
PBORG _ x B Px
A A A B
Py B R PBORG _ y Py
A Pz A
PBORG _ z B Pz
1 0 0 0 1 1
A
B T 1-15
Example
This figure shows a frame {B},
which is rotated relative to
frame {A} about axis XA by 90
degrees, translated 3 units in
YA, and translated 1 units in ZA
Find AP, where BP = [0 1 1]T
1 0 00 0 0
BA R 0 0 1 3 1 2
A
PBorg B
P T P P
A A B
1 0 1 1 2
B
0 1 0
0 0 0 1 1 1
1-16
Inverse Transform
• Given a homogeneous
transformation A
B T
• Compute the inverse
transformation: B
AT
A
R A
PBorg
B
A R BA R T BA R 1
T
A
B
B
B
( A PBorg ) BA R A PBorg B PAorg 0
0 0 0 1
B
PAorg BA R T A PBorg
1
B
R B
PAorg
T T
B
A
A
B
A
0 0 0 1
A
R T
R PBorg
A T A
AT
B B B
0 0 0 1
1-17
Inverse Transform
A
R A
PBorg A
RT BA R T A PBorg
BT AT
A B B B
0 0 0 1 0 0 0 1
A
R A T
R A
R A T A
R P A
PBorg I 0
B B B B Borg
0 0 0 1 0 0 0 1
1-18
MORE ON REPRESENTATION OF ORIENTATION
1. Fixed angles
2. Euler angles
3. Axis angle
4. Quaternions
1-20
MORE ON REPRESENTATION OF ORIENTATION
The 12 fixed angle sets are given by The 12 Euler angle sets are given by
1 R XYZ ( , , ) 1 R X 'Y ' Z ' ( , , )
2 R XZY ( , , ) 2 R X ' Z 'Y ' ( , , )
3 R YXZ ( , , ) 3 R Y ' X ' Z ' ( , , )
4 R YZX ( , , ) 4 R Y ' Z ' X ' ( , , )
5 R ZXY ( , , ) 5 R Z ' X 'Y ' ( , , )
6 R ZYX ( , , ) 6 R Z 'Y ' X ' ( , , )
7 R XYX ( , , ) 7 R X 'Y ' X ' ( , , )
8 R XZX ( , , ) 8 R X ' Z ' X ' ( , , )
9 R YXY ( , , ) 9 R Y ' X 'Y ' ( , , )
10 R YZY ( , , ) 10 R Y ' Z 'Y ' ( , , )
11 R ZXZ ( , , ) 11 R Z ' X ' Z ' ( , , )
12 R Z 'Y ' Z ' ( , , ) 12 R Z 'Y ' Z ' ( , , )
1-21
MORE ON REPRESENTATION OF ORIENTATION
X r k y ; K k y
^
A right-hand rule, with the thumb
pointing along the positive sense of
^
k z k z A
K
k x k x v c k x k y v k z s k x k z v k y s
R K ( ) k x k y v k z s k y k y v c k y k z v k x s
k x k z v k y s k y k z v k x s k z k z v c
with v (1 cos ); c cos ; s sin ;
Note that: R ^ ( ) R ^ ( ) 1-22
K K
MORE ON REPRESENTATION OF ORIENTATION
angle-axis representation r11 r12 r13
r r23
^
Inverse Problem Given:
A
B R 21 r22 Find: (K , )
r31 r32 r31
k x k x v c k x k y v k z s k x k z v k y s
^ T
R K ( ) k x k y v k z s k y k y v c k y k z v k x s ; v (1 cos ); K k x ky k z
k x k z v k y s k y k z v k x s k z k z v c
r11 r22 r33 (k x2 (1 c ) c ) (k y2 (1 c ) c ) (k z2 (1 c ) c )
k x2 k y2 k z2 (k x2 k y2 k z2 )c 3c 1 2c Note that:
r11 r22 r33 1 r r r 1 r11 r22 r33 1
c acos ( 11 22 33 ) 1 acos (
2
)
2 2 r r r 1
If s 0 2 2 acos ( 11 22 33 )
2
~
??? O c ???
m1T Pi Pix
T m11 m12 m13 m14 m
T
ui m3 Pi 1
P
M m21 m22 m24 m Pi iy
pi
T
m23 2
i
v m T
2 Pi
m
31 m32 m33 m34 m
T
P
iz
T
3
1
m3 Pi
m1T Pi
T
ui m3 Pi
pi
i
v m T
2 Pi
T
m3 Pi
m1T Pi
ui T ui ( mT3 Pi ) m1T Pi 0
m3 Pi
mT2 Pi
vi T vi ( mT3 Pi ) mT2 Pi 0
m3 Pi
m1T Pi
ui T ui ( mT3 Pi ) m1T Pi 0
m3 Pi
mT2 Pi
vi T vi ( mT3 Pi ) mT2 Pi 0
m3 Pi
u1 ( mT3 P1 ) m1T P1 0
v (
1 3 1mT
P ) m 2 P1 0
T
...
i 3 i
u ( m T
P ) m1 Pi 0
T
v (
i 3 im T
P ) mT
2 Pi 0
...
n 3 n
u ( m T
P ) m 1 Pn 0
T
v ( mT P ) mT P 0
n 3 n 2 n
P1T u1P1T
(1 x 4 )
0T
T
0 P1T v1P1
T
v
1 ( T
m P ) T
m P 0 m P v1 ( m P ) 0
T T
T
3 1 2 1 2 1 3 1
0 PnT vn PnT 2 n12
... ...
T
i 3 i
u ( m T
P ) m T
P 0 m P u ( m 3 Pi ) 0
T
1 i
T 1 i i
Pm 0
m1
( 4 1 )
vi ( m3 Pi ) m2 Pi 0 m2 Pi vi ( m3 Pi ) 0
T T T
...
...
m m2
un ( m3 Pn ) m1 Pn 0 m1 Pn un ( m3 Pn ) 0
T T T T
v ( mT P ) mT P 0 mT P v ( mT P ) 0 m
n 3 n 2 n 2 n n 3 n 3 121
^
M [ A b ] M K [ R T ]
-
^
M [ A b ] M K [ R T ]
^
M [ A b ] M K [ R T ]
r3 a 3
Computer Vision Toolbox™, User's Guide
Extrinsic Parameters
Intrinsic Parameters
The pixel skew
The intrinsic matrix, K.