Docsity

Matrix Representation of Transformations: Translation and Rotation, Assignments of Computer Science

Partial preview of the text

Download Matrix Representation of Transformations: Translation and Rotation and more Assignments Computer Science in PDF only on Docsity!

Motion -II

-^

Structure from Motion

-^

Review of Motion

-^

Review of camera models

-^

Optical Flow

Structure-from-Motion•^

As with stereo, we can divide problem:– Correspondence.– Reconstruction.

-^

Again, we’ll talk about reconstruction first.– Assume that each image contains some points,– we know which points match which

Motion•^

Rigid and Non-Rigid Motion

-^

Rigid motion: all points on the object move together.– Their relative coordinates do not change

Linear Transformations

-^

A

linear transformation

  • Maps one vector to another– Preserves linear combinations -^

Thus behavior of linear transformation iscompletely determined by what it does to a basis

-^

Turns out any linear transform can be representedby a

matrix

Matrices

-^

By convention, matrix element

M

rc

is located at

row

r

and column

c

-^

By convention,vectors are columns:

mn

m

m

2n

22

21

1n

12

11

M

M

M

M

M

M

M

M

M

M

⎤ ⎥ ⎥ ⎥⎦

⎡ ⎢ ⎢ ⎢⎣

2 3 v v v

v

1

Matrix Transformations

-^

A

sequence

or

composition

of linear

transformations corresponds to the product of thecorresponding matrices– Note: the matrices to the

right

affect vector first

  • Note: order of matrices matters! -^

Some (not all) matrices have an inverse:

-^

So we can reverse the transformation

(^

)

(^

)^

v

v M

M

−^1

Transformations•

Modeling transforms– Size, place, scale, and rotate objects parts of the model

w.r.t. each other

  • Object coordinates

world coordinates X Z

Y

Z X

Y

Transformations

-^

Homogeneous coordinates:

represent coordinates

in 3 dimensions with a 4-vector– Denoted [x, y, z, w]

  • Note that typically w = 1 in model coordinates
    • To get 3-D coordinates, divide by w:

[x’, y’, z’] = [x/w, y/w, z/w]

-^

Transformations are 4x4 matrices

-^

Why? To handle translation, rotation and projectionuniformly

Translations

•^

For convenience we usually describe objects in relation totheir own coordinate system–

Solar system example

-^

We can

translate

or move points to a new position by

adding offsets to their coordinates:–

Note that this translates all points uniformly

⎤ ⎥ ⎥ ⎥⎦ ⎡ ⎢ ⎢ ⎢⎣

⎤ ⎥ ⎥ ⎥⎦ ⎡ ⎢ ⎢ ⎢⎣ = ⎤ ⎥ ⎥ ⎥⎦

⎡ ⎢ ⎢ ⎢⎣

xt yt zt

x y z

x y z

' ' '

2-D Rotations

•^

Rotations in 2-D are easy:

-^

3-D is more complicated–

Need to specify an

axis of rotation

-^

Common pedagogy: express rotation about this axis as thecomposition of

canonical rotations

-^

Canonical rotations: rotation about X-axis, Y-axis, Z-axis

(^

)^

⎤ ⎥ ⎦ ⎡ ⎢ ⎣ ⎤ ⎥ ⎦

⎡ ⎢ ⎣

θ

θ

θ

−

θ

= ⎤ ⎥ ⎦ ⎡ ⎢ ⎣

x y

x y

cos

sin

sin

cos

' '

Scaling•^

Scaling

a coordinate means multiplying each of its

components by a scalar

-^

Uniform scaling

means this scalar is the same for all

components:

×

Scaling

-^

Scaling operation:

-^

Or, in matrix form:

⎤ ⎥ ⎥ ⎥⎦

⎡ ⎢ ⎢ ⎢⎣

⎤ ⎥ ⎥ ⎥⎦

⎡ ⎢ ⎢ ⎢⎣

ax by^ cz

x y z

' ' '

⎤ ⎥ ⎥ ⎥⎦ ⎡ ⎢ ⎢ ⎢⎣ ⎤ ⎥ ⎥ ⎥⎦

⎡ ⎢ ⎢ ⎢⎣

⎤ ⎥ ⎥ ⎥⎦

⎡ ⎢ ⎢ ⎢⎣

x y z

c

b

a

x y z

0

0

0

0

0

0

' ' '

scaling matrix

2-D Rotation

-^

This is easy to capture in matrix form:

-^

3-D is more complicated– Need to specify an

axis of rotation

  • Simple cases: rotation about X, Y, Z axes

(^

)^

⎤ ⎥ ⎦ ⎡ ⎢ ⎣ ⎤ ⎥ ⎦

⎡ ⎢ ⎣

θ

θ

θ

−

θ

= ⎤ ⎥ ⎦ ⎡ ⎢ ⎣

x^ y

x y

cos

sin

sin

cos

' '