Perspective projection and Transformations The pinhole camera The

  • Slides: 49
Download presentation
Perspective projection and Transformations

Perspective projection and Transformations

The pinhole camera

The pinhole camera

The pinhole camera Y P= (X, Y, Z) Z O p= (x, y) Z=-1

The pinhole camera Y P= (X, Y, Z) Z O p= (x, y) Z=-1 X

The pinhole camera • Y P= (X, Y, Z) p= (x, y) Z O

The pinhole camera • Y P= (X, Y, Z) p= (x, y) Z O Z=-1 X

The projection equation • A point P = (X, Y, Z) in 3 D

The projection equation • A point P = (X, Y, Z) in 3 D projects to a point p = (x, y) in the image • But pinhole camera’s image is inverted, invert it back!

Another derivation P= (X, Y, Z) Y O Z 1 y p= (x, y,

Another derivation P= (X, Y, Z) Y O Z 1 y p= (x, y, z)

A virtual image plane • A pinhole camera produces an inverted image • Imagine

A virtual image plane • A pinhole camera produces an inverted image • Imagine a ”virtual image plane” in the front of the camera P P Y Y 1 Z O y 1 y Z O

The projection equation

The projection equation

Consequence 1: Farther away objects are smaller (X, Y + h, Z) (X, Y,

Consequence 1: Farther away objects are smaller (X, Y + h, Z) (X, Y, Z) Image of foot: Image of head:

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point •

Consequence 2: Parallel lines converge at a point

Consequence 2: Parallel lines converge at a point

What about planes? Take the limit as Z approaches infinity Vanishing line of a

What about planes? Take the limit as Z approaches infinity Vanishing line of a plane

Changing coordinate systems Y Y P = (X, Y, Z) O Z O’ Z

Changing coordinate systems Y Y P = (X, Y, Z) O Z O’ Z X X

Changing coordinate systems Y Y Z O’ Z X X

Changing coordinate systems Y Y Z O’ Z X X

Changing coordinate systems Y Y Z O’ Z X X

Changing coordinate systems Y Y Z O’ Z X X

Changing coordinate systems Y Y Z Z O’ X X

Changing coordinate systems Y Y Z Z O’ X X

Changing coordinate systems Y Y Z Z O’ X X

Changing coordinate systems Y Y Z Z O’ X X

Changing coordinate systems Y Y Z Z O’ X X

Changing coordinate systems Y Y Z Z O’ X X

Rotations and translations • How do you represent a rotation? • A point in

Rotations and translations • How do you represent a rotation? • A point in 3 D: (X, Y, Z) • Rotations can be represented as a matrix multiplication • What are the properties of rotation matrices?

Properties of rotation matrices • Rotation does not change the length of vectors

Properties of rotation matrices • Rotation does not change the length of vectors

Properties of rotation matrices Rotation Reflection

Properties of rotation matrices Rotation Reflection

Rotation matrices • Rotations in 3 D have an axis and an angle •

Rotation matrices • Rotations in 3 D have an axis and an angle • Axis: vector that does not change when rotated • Rotation matrix has eigenvector that has eigenvalue 1

Rotation matrices from axis and angle •

Rotation matrices from axis and angle •

Rotation matrices from axis and angle •

Rotation matrices from axis and angle •

Translations • Can this be written as a matrix multiplication?

Translations • Can this be written as a matrix multiplication?

Putting everything together • Change coordinate system so that center of the coordinate system

Putting everything together • Change coordinate system so that center of the coordinate system is at pinhole and Z axis is along viewing direction • Perspective projection

The projection equation • Is this equation linear? • Can this equation be represented

The projection equation • Is this equation linear? • Can this equation be represented by a matrix multiplication?

Is projection linear?

Is projection linear?

Can projection be represented as a matrix multiplication? Matrix multiplication Perspective projection

Can projection be represented as a matrix multiplication? Matrix multiplication Perspective projection

The space of rays • (x, y, 1) O

The space of rays • (x, y, 1) O

Projective space •

Projective space •

Projective space and homogenous coordinates • Mapping to (points to rays): • Mapping to

Projective space and homogenous coordinates • Mapping to (points to rays): • Mapping to (rays to points): • A change of coordinates • Also called homogenous coordinates

Homogenous coordinates • In standard Euclidean coordinates • 2 D points : (x, y)

Homogenous coordinates • In standard Euclidean coordinates • 2 D points : (x, y) • 3 D points : (x, y, z) • In homogenous coordinates • 2 D points : (x, y, 1) • 3 D points : (x, y, z, 1)

Why homogenous coordinates? Homogenous coordinates of world point Homogenous coordinates of image point

Why homogenous coordinates? Homogenous coordinates of world point Homogenous coordinates of image point

Why homogenous coordinates? • Perspective projection is matrix multiplication in homogenous coordinates!

Why homogenous coordinates? • Perspective projection is matrix multiplication in homogenous coordinates!

Why homogenous coordinates? • Translation is matrix multiplication in homogenous coordinates!

Why homogenous coordinates? • Translation is matrix multiplication in homogenous coordinates!

Homogenous coordinates

Homogenous coordinates

Homogenous coordinates

Homogenous coordinates

Perspective projection in homogenous coordinates

Perspective projection in homogenous coordinates

More about matrix transformations 3 x 4 : Perspective projection 4 x 4 :

More about matrix transformations 3 x 4 : Perspective projection 4 x 4 : Translation 4 x 4 : Affine transformation (linear transformation + translation)

More about matrix transformations Euclidean

More about matrix transformations Euclidean

More about matrix transformations Similarity transformation

More about matrix transformations Similarity transformation

More about matrix transformations Anisotropic scaling and translation

More about matrix transformations Anisotropic scaling and translation

More about matrix transformations General affine transformation

More about matrix transformations General affine transformation

Matrix transformations in 2 D

Matrix transformations in 2 D