Sie sind auf Seite 1von 37

•  Linear Algebra Review


Rigid Body Motion in 2D



Rigid Body Motion in 3D 





Jana Kosecka, CS 685 #
Why do we need Linear Algebra?#

•  We will associate coordinates to#


–  3D points in the scene#
–  2D points in the CCD array#
–  2D points in the image#
•  Coordinates will be used to#
–  Perform geometrical transformations#
–  Associate 3D with 2D points#
•  Images are matrices of numbers#
–  We will find properties of these numbers#
Matrices#

Matrix Sum:# Cn×m = An×m + Bn×m

cij = aij + bij A and B must have the same


dimensions#

Example:#
&2 5# &6 2# &8 7 #
$3 1! + $1 5! = $4 6!
% " % " % "
Matrices#

Product:#
A and B must have
Cn× p = An×m Bm× p compatible dimensions#

m
cij = ∑ aik bkj An×n Bn×n ≠ Bn×n An×n
k =1

Examples:#

&2 5# &6 2# &17 29# &6 2# &2 5# &18 32#


$3 1!.$1 5! = $19 11 ! $1 5!.$3 1! = $17 10 !
% "% " % " % "% " % "
Matrices#

Transpose:#
T T T T
Cm×n = A n×m ( A + B) = A + B
cij = a ji ( AB)T = B T AT

T
If # A =A A is symmetric#

Examples:# T
T &6 2 #
&6 2 # & 6 1# $1 5! = &6 1 3#
$1 5! = $2 5! $ ! $2 5 8!
% " % " $%3 8 !" % "
Matrices#

Determinant:# A must be square#

' a11 a12 $ a11 a12


det % " = = a11a22 − a21a12
&a21 a22 # a21 a22

' a11 a12 a13 $


a22 a23 a21 a23 a21 a22
det %%a21 a22 "
a23 " = a11 − a12 + a13
a32 a33 a31 a33 a31 a32
%& a31 a32 a33 "#

' 2 5$
Example:# det % " = 2 − 15 = −13
& 3 1#
Matrices#

Inverse:# A must be square#


−1 −1
An×n A n×n =A n×n An×n = I
−1
& a11 a12 # 1 & a22 − a12 #
$a ! = $− a
% 21 a22 " a11a22 − a21a12 % 21 a11 !"

−1
&6 2 # 1 & 5 − 2#
Example:# $1 5! = 28 $− 1 6 !
% " % "
−1
&6 2# &6 2# 1 & 5 − 2# &6 2# 1 &28 0 # &1 0#
$1 5! .$1 5! = 28 $− 1 6 !.$1 5! = 28 $ 0 28! = $0 1!
% " % " % "% " % " % "
2D,3D Vectors#
P#
x2#
v#
θ#

2 2 x1#
Magnitude:# || v ||= x1 + x2

If # || v ||= 1 , # v is a UNIT vector#


v & x x #
= $$ 1 , 2 !! Is a unit vector#
|| v || % || v || || v || "
& x2 #
−1
Orientation:# θ = tan $$ !!
% x1 "
Vector Addition, Subtraction, Scalar Product#

u+v#
v#
u#

u-v#
u#
v# av#
v#
Inner (dot) Product#

The inner product is a SCALAR!#


v# α#
u#

norm of a vector#
Vector (cross) Product#

u# w# α# u = v× w
v#
The cross product is a VECTOR!#

Magnitude:# || u || = || v × w ||=|| v ||| w || sin α

Orientation:#


Orthonormal Basis in 3D#
Standard base vectors:#

Coordinates of a point in space:#


Vector (Cross) Product Computation#

u# w# α#

v#

Skew symmetric matrix associated with vector#


2D Geometrical Transformations#
2D Translation Equation#

Y!

x’#
t#
ty# x#

tx# X!
Homogeneous Coordinates#

Homogeneous coordinates:

Translation using matrices:


Coordinate frames#
•  In order to specify a position of a rigid body #
In 2D space, we need to attach a coordinate #
frame to it #
#
•  Frame defines a coordinate system#
•  Coordinates of any point on the body can be #
expressed in that coordinate system#

P = [x,y]’#
Rotation Matrix#
Counter-clockwise rotation of a coordinate#
frame by an angle θ#

{A}#

{B}# & x'# &cosθ − sin θ # & x #


x’#
$ y '! = $ sin θ ! $
cosθ " % y " !
% " %
Y’#
y# P#
θ# x#

Counter-clockwise rotation of a coordinate frame#


attached to a rigid body by an angle θ#
#
#
Rotation Matrix#

Interpretations of the rotation matrix RAB#


#
{B}# ⇥
cos sin
RAB =
sin cos
{A}#

Columns of RAB are the unit vectors of the axes of


frame B expressed in coordinate frame A. Such
rotation matrix transforms coordinates of points in
frame B to points in frame A#
#

Use of the rotation matrix as transformation RAB #


#

XA = RAB XB
Rigid Body Transform#
Translation only, tABis the origin of the frame B expressed in the #
Frame A #

XA = XB + tAB
Composite transformation: #
XA = RAB XB + tAB
{B}#
XB
Transformation: # T = (RAB , tAB )
XA
Homogeneous coordinates #

RAB tAB
XA = XB tAB
0 1
The points from frame A to frame B are {A}#
transformed by the inverse of# T = (RAB , tAB )
(see example next slide) #
#
Example#

cos sin tx
XA = ⇤ sin cos ty ⌅ XB
0 0 1
In homogeneous coordinates: #

0 1 0
XA = ⇤ 1 0 3 ⌅ XB for# = 90o , tAB = [0, 3]T
0 0 1 ⇥ ⇥
2 0
XA = ⇤ 3 ⌅ XB = ⇤ 2 ⌅
XB 1 1
{B}#
tAB XA

{A}#
Verify that the inverse of the above transform #
Transforms coordinates in frame {A} to frame {B} #
Degrees of Freedom#

& x'# &cosθ − sin θ # & x #


$ y '! = $ sin θ cosθ !" $% y !"
% " %
R is 2x2 # 4 elements#

BUT! There is only 1 degree of freedom: θ#

The 4 elements must satisfy the following constraints:#

Rows and columns are orthogonal and of unit


length#
Matrix is orientation preserving#
Next transformations in 3D.#
3-D Euclidean Space - Vectors #

A “free” vector is defined by a pair


of points :

Coordinates of the vector :


3D Rotation of Points – Euler angles#
Rotation around the coordinate axes, counter-clockwise:#

P
Y’# ’# γ#
y# P#

X’# x#

z#
Rotation Matrix#
•  Euler theorem – any rotation can be expressed as a sequence of
rotations around different coordinate axes #
•  Different order of rotations yields different final rotation#
•  Rotation multiplication is not commutative#

•  Different ways how to obtain final rotation – rotation around 3 axes


no successive rotations around same axes#
•  XYX, XZX, YXY, YZX, ZXZ, ZYZ – Eulerian involves repetition#
•  Cardanian – no repetitions XYZ, XZY, YZX, YXZ, ZXY, ZYX. #
•  Another widely used convention roll-pitch-yaw#

R = Rx (θ r )Ry (θ p )Rz (θ y )
#
Rotation Matrices in 3D#

•  3 by 3 matrices#
•  9 parameters – only three degrees of freedom#
•  Representations – either three Euler angles#
•  or axis and angle representation #

•  Properties of rotation matrices (constraints between the #


elements)#
Rotation Matrices in 3D#
•  3 by 3 matrices#
•  9 parameters – only three degrees of freedom#
•  Representations – either three Euler angles#
•  or axis and angle representation #

#
•  Properties of rotation matrices (constraints between the #
elements)#

Columns are orthonormal#


Rotation Matrix#

•  Problem with 3 angle representations: singularities#

•  The mapping between angles and Rotation matrix is unique#

•  The inverse mapping between Rotation matrix and the angles


sometimes cannot be computed or is not unique#

Angle Axis Representation: #


#
•  Two coordinates frames of arbitrary orientations can be related
by a single rotation about ‘some’ axis in space and an angle#
Canonical Coordinates for Rotation#

Property of R#

Taking derivative#

Skew symmetric matrix property#

By algebra#

By solution to ODE#
3D Rotation (axis & angle)#

Solution to the ODE#

with#

or#
Rotation Matrices#

Given#

How to compute angle and axis#


3D Translation of Points#

Translate by a vector #

P
’# t#
Y’# x’# x#
P#
z’# y#
z#
Rigid Body Motion – Homogeneous
Coordinates#

3-D coordinates are related by:


Homogeneous coordinates:

Homogeneous coordinates are related by:


Rigid Body Motion – Homogeneous
Coordinates#

3-D coordinates are related by:


Homogeneous coordinates:

Homogeneous coordinates are related by:


Properties of Rigid Body Motions#

Rigid body motion composition#

Rigid body motion inverse#

Rigid body motion acting on vectors#


Vectors are only affected by rotation – 4th homogeneous coordinate is zero#
Rigid Body Transformation#

Coordinates are related by:#


Camera pose is specified by:#
Rigid Body Motion#

•  Shown how to describe positions and orientations of


coordinate frames (poses) with respect to the origin
world frame#

•  Relative pose (R,T) – relationship between two


consecutive poses#

CS223b, Jana Kosecka#

Das könnte Ihnen auch gefallen