Professional Documents
Culture Documents
Computer Vision - 3D Transformations
Computer Vision - 3D Transformations
Computer Vision - 3D Transformations
3D Transformations
X0
2/23/2023
Coordinate Frames
• Interested in Some Point described by a Vector R
• We need to express R which we know in Frame 1 in Frame 0
x1 = R sin( )
y1 = R cos( ) Y0
x0 = x1 cos(1 ) − y1 sin(1 ) R
y0 = x1 sin(1 ) + y1 cos(1 )
2/23/2023
Coordinate Frames
• Now lets put it in matrix form
x0 = x1 cos(1 ) − y1 sin(1 )
y0 = x1 sin(1 ) + y1 cos(1 )
x0 cos(1 ) − sin(1 ) x1
y = sin( ) cos( ) y
0 1 1 1
x0 x1
y = T y
0 1
2/23/2023
Coordinate Frames
• If we look at the columns and rows of T we see that they have a norm of
one.
• Also if we take the dot product of the columns we find they are orthogonal
to each other.
• So T is an ortho-normal Matrices. Thus its transpose is its inverse.
cos(1 ) − sin(1 ) cos(1 ) sin(1 )
T = T
−1
=
sin(1 ) cos(1 ) − sin(1 ) cos(1 )
2/23/2023
Coordinate Frames
• The 3D transformation axes about the Z axes is:
cos( ) − sin( ) 0
T z = sin( ) cos( ) 0
0 0 1
2/23/2023
Coordinate Transformations
• For multiple transformation we simply multiply by more matrices.
• If we have multiple rotations about the same axes we can just add the angles of the matrices. Does this make sense.
2/23/2023
Coordinate Transformation
• So now we can express a vector in a reference frame rotated to
an arbitrary angle in space.
• What if we want to express it in a translated frame
2/23/2023
Translating Coordinate Frames
Y1
Y0
X1
X0
2/23/2023
Translating Coordinate Frames
• Now we can translate and rotate. Y0
Y1
x0 = x1 + x R
y0 = y1 + y
X1
• Or in terms of vectors X0
R0 = R1 + R
2/23/2023
What if we have a rotation and a translation
• First we can rotate the frames
Y0’
• then we can translate R
Y0
x0 x1 x
y = T y + y
0 1 1 X0’
X0
2/23/2023
Homogeneous Transformation Matrices
C1 − S1 0
• 3x3 Rotation Matrix T1 = S1 C1 0
0 0 1
C1 − S1 0 0
• What does a pure rotation look like S1 C1 0 0
TR =
0 0 1 0
0 0 0 1
2/23/2023
Notation
2/23/2023
Matrix Notation
A
A T
B R B
2/23/2023
Homogenous Transformations Represent 3 Things
• Describe a Frame
• Map from one Frame to another
• Act as an Operator to move within a Frame
A
B T
2/23/2023
Transforms Describe Frames
C1 − S1 0 A
PBorgX
S1 A
• Frames can be described by
A Homogenous Transformation
A
BT = C1
0 B0
R 0
1
A
A
PBorgY
PBorgZ
Matrices 0 0 0 1
• Description of Frame
– Columns of BA R are the Unit Vectors defining the directions of the principle axes of {B}
in terms of {A} B Xˆ A
A
B R= Xˆ
A
B YˆB
A A ˆ
Z B = BYˆA
B Zˆ
A
A
– Rows of R are the Unit Vectors defining the directions of the principle axes of {A} in
B
terms of {B}
– A PBorg is the location of the origin of {B} in terms or {A}
2/23/2023
Mapping Between Frames
• Maps vector from Frame {B} to Frame {A}
C1 − S1 0 A
PBorgX
• A
will rotate a vector to project its
R
S1 A
B
components originally described in
A
BT = C1
0 B0
R 0
1
A
A
PBorgY
PBorgZ
{B} in the {A} of Frame 0 0 0 1
• A
will translate the vector to adjust its origin from frame {B} to
PBorg
its new origin in {A}
B A
P P
2/23/2023
Acts as an Operator within a coordinate frame
• Operator will rotate and translate a vector
2/23/2023
Bài tập
• Ký hiệu hệ tọa độ 3 chiều của căn phòng là N
• Ký hiệu hệ tọa độ 3 chiều của 01 camera gắn trong phòng là C
• Tọa độ của camera C trong căn phòng là (3, 5, 10) mét
• Góc xoay của camera C so với căn phòng theo từng trục x, y, z
là (20, 45, 210) độ
• Hãy thiết lập ma trận chuyển đổi (homogenerous matrix) 𝑵𝑪𝑻
để chuyển đổi tọa độ của một đối tượng trong camera sang
hệ tọa độ của căn phòng.
2/23/2023