introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · course...

138
Camera models 16-385 Computer Vision Spring 2018, Lecture 9 http://www.cs.cmu.edu/~16385/

Upload: others

Post on 09-May-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Camera models

16-385 Computer VisionSpring 2018, Lecture 9http://www.cs.cmu.edu/~16385/

Page 2: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Course announcements

• Homework 2 was posted on Friday.- Due on February 23rd at midnight.- Start early cause it is much larger and more difficult than homework 1.

• Homework schedule has been adjusted.- Homeworks are due on and are released on Fridays.

Page 3: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Overview of today’s lecture

• Some motivational imaging experiments.

• Pinhole camera.

• Accidental pinholes.

• Camera matrix.

• Perspective.

• Other camera models.

• Pose estimation.

Page 4: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Slide credits

Most of these slides were adapted from:

• Kris Kitani (15-463, Fall 2016).

Some slides inspired from:

• Fredo Durand (MIT).

Page 5: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Some motivational imaging experiments

Page 6: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Let’s say we have a sensor…

digital sensor (CCD or CMOS)

Page 7: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

… and an object we like to photograph

digital sensor (CCD or CMOS)

real-world object

What would an image taken like this look like?

Page 8: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Bare-sensor imaging

digital sensor (CCD or CMOS)

real-world object

Page 9: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Bare-sensor imaging

digital sensor (CCD or CMOS)

real-world object

Page 10: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Bare-sensor imaging

digital sensor (CCD or CMOS)

real-world object

Page 11: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Bare-sensor imaging

digital sensor (CCD or CMOS)

real-world object

All scene points contribute to all sensor pixelsWhat does the image on the

sensor look like?

Page 12: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Bare-sensor imaging

All scene points contribute to all sensor pixels

Page 13: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Let’s add something to this scene

digital sensor (CCD or CMOS)

real-world object

barrier (diaphragm)

pinhole (aperture)

What would an image taken like this look like?

Page 14: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole imaging

digital sensor (CCD or CMOS)

real-world object

most rays are blocked

one makes it through

Page 15: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole imaging

digital sensor (CCD or CMOS)

real-world object

most rays are blocked

one makes it through

Page 16: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole imaging

digital sensor (CCD or CMOS)

real-world object

Each scene point contributes to only one sensor pixelWhat does the image on the

sensor look like?

Page 17: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole imaging

real-world object

copy of real-world object (inverted and scaled)

Page 18: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole camera

Page 19: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole camera a.k.a. camera obscura

Page 20: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Chinese philosopher Mozi (470 to 390 BC)

First mention … First camera …

Greek philosopher Aristotle(384 to 322 BC)

Pinhole camera a.k.a. camera obscura

Page 21: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole camera terms

digital sensor (CCD or CMOS)

real-world object

barrier (diaphragm)

pinhole (aperture)

Page 22: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole camera terms

digital sensor (CCD or CMOS)

real-world object

barrier (diaphragm)

pinhole (aperture)

image plane

camera center (center of projection)

Page 23: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Focal length

real-world object

focal length f

Page 24: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Focal length

real-world object

focal length 0.5 f

What happens as we change the focal length?

Page 25: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Focal length

real-world object

focal length 0.5 f

What happens as we change the focal length?

Page 26: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Focal length

real-world object

focal length 0.5 f

What happens as we change the focal length? object projection is half the size

Page 27: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole size

real-world object

pinhole diameter

Ideal pinhole has infinitesimally small size• In practice that is impossible.

Page 28: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole size

real-world object

pinhole diameter

What happens as we change the pinhole diameter?

Page 29: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole size

real-world object

What happens as we change the pinhole diameter?

Page 30: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole size

real-world object

What happens as we change the pinhole diameter?

Page 31: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole size

real-world object

What happens as we change the pinhole diameter? object projection becomes blurrier

Page 32: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

What about light efficiency?

real-world object

pinhole diameter

focal length f• What is the effect of doubling the pinhole diameter? • What is the effect of doubling the focal length?

Page 33: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

What about light efficiency?

real-world object

pinhole diameter

focal length f• 2x pinhole diameter → 4x light• 2x focal length → ¼x light

Page 34: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

In practice

How does this mapping work exactly?Lenses map “bundles” of rays from points on the scene to the sensor.

Page 35: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Accidental pinholes

Page 36: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start
Page 37: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start
Page 38: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

What does this image say about the world outside?

Page 39: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Accidental pinhole camera

Page 40: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Accidental pinhole camera

window is an aperture

projected pattern on the wall window with smaller gap

upside down view outside window

Page 41: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pinhole cameras

What are we imaging here?

Page 42: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Camera matrix

Page 43: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The camera as a coordinate transformation

A camera is a mapping from:

the 3D world

to:

a 2D image

3D object

2D image2D image

2D to 2D transform(image warping)

3D to 2D transform(camera)

Page 44: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The camera as a coordinate transformation

cameramatrix

3D world point

2D image point

What are the dimensions of each variable?

A camera is a mapping from:

the 3D world

to:

a 2D image

homogeneous coordinates

Page 45: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The camera as a coordinate transformation

homogeneousworld coordinates

4 x 1

homogeneousimage coordinates

3 x 1

cameramatrix3 x 4

Page 46: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The pinhole camera

real-world object

camera center

image plane

focal length f

Page 47: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The (rearranged) pinhole camera

real-world object

image plane

focal length fcamera center

Page 48: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The (rearranged) pinhole camera

camera center

image plane

principal axis

What is the equation for image coordinate x in terms of X?

Page 49: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The 2D view of the (rearranged) pinhole camera

What is the equation for image coordinate x in terms of X?

image plane

Page 50: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The 2D view of the (rearranged) pinhole camera

image plane

Page 51: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The (rearranged) pinhole camera

camera center

image plane

principal axis

What is the camera matrix P for a pinhole camera?

Page 52: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The pinhole camera matrix

Relationship from similar triangles:

General camera model:

What does the pinhole camera projection look like?

Page 53: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The pinhole camera matrix

Relationship from similar triangles:

General camera model:

What does the pinhole camera projection look like?

Page 54: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Generalizing the camera matrix

How does the camera matrix change?

Camera origin and image origin might be different

camera coordinate system

image coordinate system

image plane

Page 55: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Generalizing the camera matrix

How does the camera matrix change?

Camera origin and image origin might be different

camera coordinate system

image coordinate system

image plane

Page 56: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

world point

In general, the camera and image sensor have different coordinate systems

image point

Page 57: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

world point

In general, there are three different coordinate systems…

image point

so you need the know the transformations between them

Page 58: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Camera matrix decomposition

We can decompose the camera matrix like this:

calibration matrix

intrinsic (3 x 3) extrinsic (3 x 4)

Page 59: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Extrinsic camera parameters

We can decompose the camera matrix like this:

intrinsic (3 x 3) extrinsic (3 x 4)

world coordinate system

camera coordinate system

What if world and camera coordinate systems are different?

assumes camera and world share the same

coordinate system

Page 60: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Extrinsic camera parameters

We can decompose the camera matrix like this:

intrinsic (3 x 3) extrinsic (3 x 4)

world coordinate system

camera coordinate system

What if world and camera coordinate systems are different?

assumes camera and world share the same

coordinate system

3D rotation and translation

Page 61: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

World

coordinate

system

Camera

coordinate

system

Page 62: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

World

coordinate

system

Camera

coordinate

system

Coordinate of the

camera center in the

world coordinate frame

Page 63: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

World

coordinate

system

Camera

coordinate

system

Coordinate of the

camera center in the

world coordinate frame

Translate

Page 64: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

World

coordinate

system

Camera

coordinate

system

Why aren’t

the points

aligned?

Translate

Page 65: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

What happens to points after alignment?

World

coordinate

system

Camera

coordinate

system

Rotate

TranslateRotate

Page 66: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Extrinsic camera parameters

We can decompose the camera matrix like this:

intrinsic (3 x 3) extrinsic (3 x 4)

What if world and camera coordinate systems are different?

assumes camera and world share the same

coordinate system

heterogeneous homogeneous

Page 67: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Extrinsic camera parameters

We can decompose the camera matrix like this:

intrinsic (3 x 3) extrinsic (3 x 4)

What if world and camera coordinate systems are different?

Page 68: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

General pinhole camera matrix

We can decompose the camera matrix like this:

Another way to write the mapping:

where

(translate first then rotate)

(rotate first then translate)

Page 69: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Recap

What is the size and meaning of each term in the camera matrix?

? ? ? ?

Page 70: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Recap

What is the size and meaning of each term in the camera matrix?

3x3 intrinsics

? ? ?

Page 71: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Recap

What is the size and meaning of each term in the camera matrix?

3x3 intrinsics

3x3 3D rotation

? ?

Page 72: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Recap

What is the size and meaning of each term in the camera matrix?

3x3 intrinsics

3x3 3D rotation

3x3 identity

?

Page 73: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Recap

What is the size and meaning of each term in the camera matrix?

3x3 intrinsics

3x3 3D rotation

3x3 identity

3x1 3D translation

Page 74: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Quiz

The camera matrix relates what two quantities?

Page 75: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Quiz

The camera matrix relates what two quantities?

Page 76: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Quiz

The camera matrix relates what two quantities?

3D points to 2D image points

Page 77: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Quiz

The camera matrix relates what two quantities?

3D points to 2D image points

The camera matrix can be decomposed into?

Page 78: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Quiz

The camera matrix relates what two quantities?

3D points to 2D image points

The camera matrix can be decomposed into?

Page 79: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Quiz

The camera matrix relates what two quantities?

3D points to 2D image points

The camera matrix can be decomposed into?

intrinsic and extrinsic parameters

Page 80: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Generalized pinhole camera model

extrinsic parametersintrinsic parameters

3D rotation 3D translation

Page 81: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Perspective

Page 82: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Forced perspective

Page 83: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The Ames room illusion

Page 84: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The Ames room illusion

Page 85: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

The 2D view of the (rearranged) pinhole camera

image plane

magnification changes with depth

Page 86: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Magnification depends on depth

real-world object

What happens as we change the focal length?

depth Z

depth 2 Z

Page 87: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Magnification depends on focal length

real-world object

focal length f

focal length 2 f

Page 88: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

What if…

real-world object

focal length f

focal length 2 f1. Set focal length to halfdepth 2 Z

Page 89: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

What if…

real-world object

1. Set focal length to half2. Set depth to half

depth Z focal length f

Is this the same image as the one I had at focal

length 2f and distance 2Z?

Page 90: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Perspective distortion

long focal length short focal lengthmid focal length

Page 91: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Perspective distortion

Page 92: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Vertigo effectNamed after Alfred Hitchcock’s movie• also known as “dolly zoom”

Page 93: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Vertigo effect

How would you create this effect?

Page 94: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Other camera models

Page 95: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

What if…

real-world object

depth Z focal length f

Continue increasing Z and f while maintaining same

magnification?

𝑓 → ∞ and𝑓

𝑍= constant

Page 96: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Different cameras

Perspective camera Orthographic camera

Page 97: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Camera is

close to object

small focal length

Camera is

far from object

large focal length

Page 98: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

There are many types of camera models (projections)

Page 99: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

CCD camera

How many degrees of freedom?

(assuming that axes are aligned)

Page 100: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

CCD camera

10 DOF

How many degrees of freedom?

(assuming that axes are aligned)

Page 101: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Finite projective camera

(assuming that axes are aligned)

How many degrees of freedom?

Page 102: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Finite projective camera

11 DOF

(assuming that axes are aligned)

How many degrees of freedom?

Page 103: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Orthographic camera(parallel projection)

Image World

(assuming that axes are aligned)

Page 104: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Orthographic camera(parallel projection)

Image World

(assuming that axes are aligned)

Affine camera

Page 105: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Weak perspective vs perspective camera

image plane

magnification changes with depth

magnification does not change with depth

Page 106: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Weak Perspective Camera

(assuming that axes are aligned)

Page 107: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

When can you assume a weak perspective camera model?

Page 108: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

When can you assume a weak perspective camera model?

all the mountains are roughly ‘far away’

Page 109: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Weak Perspective Camera

(assuming that axes are aligned)

Affine camera

Page 110: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Orthographic vs pinhole camera

General pinhole camera:

General orthographic camera:

Bottom row is always [0 0 0 1]

Projective camera

Affine camera

We also call these cameras:

What is the rationale behind these names?

Page 111: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Pose estimation

Page 112: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Structure(scene geometry)

Motion(camera geometry)

Measurements

Pose Estimation known estimate3D to 2D

correspondences

Triangulation estimate known2D to 2D

coorespondences

Reconstruction estimate estimate2D to 2D

coorespondences

Page 113: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Given a single image,

estimate the exact position of the photographer

Pose Estimation

Page 114: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Given a set of matched points

and camera model

Find the (pose) estimate of

parametersprojection

model

point in 3D

space

point in the

image

3D Pose Estimation(Resectioning, Geometric Calibration, Perspective n-Point)

Camera

matrix

Page 115: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Recall: Camera Models (projections)

Weak perspective

Perspective

Parallel (Orthographic)

world point

We’ll use a perspective camera model for pose estimation

Page 116: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

What is Pose Estimation?

world point

Given

Page 117: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

world point

Estimate

What is Pose Estimation?

extrinsic parameters

intrinsic parameters

Page 118: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Same setup as homography estimation using DLT(slightly different derivation here)

Page 119: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Heterogeneous coordinates

(non-linear correlation between coordinates)

Mapping between 3D point and image points

How can we make these relations linear?

What are the unknowns?

Page 120: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Make them linear with algebraic manipulation…

Now you can setup a system of linear equations

with multiple point correspondences(this is just DLT for different dimensions)

How can we make these relations linear?

Page 121: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

In matrix form …

For N points …

Page 122: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Solve for camera matrix by

SVD!

Page 123: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Solve for camera matrix by

Solution x is the column of V

corresponding to smallest singular

value of

Page 124: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Solve for camera matrix by

Equivalently, solution x is the

Eigenvector corresponding to

smallest Eigenvalue of

Page 125: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

How do you get the intrinsic and extrinsic

parameters from the projection matrix?

Almost there …

Page 126: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Decomposition of the Camera Matrix

Page 127: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Decomposition of the Camera Matrix

Page 128: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Decomposition of the Camera Matrix

Page 129: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Decomposition of the Camera Matrix

Find the camera center C Find intrinsic K and rotation R

Page 130: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Decomposition of the Camera Matrix

Find the camera center C Find intrinsic K and rotation R

Page 131: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

SVD of P!

c is the Eigenvector corresponding to

smallest Eigenvalue

Decomposition of the Camera Matrix

Find the camera center C Find intrinsic K and rotation R

Page 132: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

SVD of P!

c is the Eigenvector corresponding to

smallest Eigenvalue

Decomposition of the Camera Matrix

Find the camera center C Find intrinsic K and rotation R

right upper

triangleorthogonal

Page 133: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

RQ decomposition

SVD of P!

c is the Eigenvector corresponding to

smallest Eigenvalue

Decomposition of the Camera Matrix

Find the camera center C Find intrinsic K and rotation R

Page 134: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start
Page 135: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

Simple AR program

1. Compute point correspondences (2D and AR tag)

2. Estimate the pose of the camera P

3. Project 3D content to image plane using P

3D locations of planar marker features

are known in advance

3D content prepared in advance

(0,0,0)

(10,10,0)

(0,0,0)

(10,10,0)

Page 136: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start
Page 137: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start
Page 138: Introduction and course overvie16385/s18/lectures/lecture9.pdf · 2018-02-16 · Course announcements • Homework 2 was posted on Friday. - Due on February 23rd at midnight. - Start

References

Basic reading:• Szeliski textbook, Section 2.1.5, 6.2.

Additional reading:• Hartley and Zisserman, “Multiple View Geometry in Computer Vision,” Cambridge University Press 2004.

chapter 6 of this book has a very thorough treatment of camera models.• Torralba and Freeman, “Accidental Pinhole and Pinspeck Cameras,” CVPR 2012.

the eponymous paper discussed in the slides.