+ All Categories
Home > Documents > James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case...

James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case...

Date post: 19-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
60
Transcript
Page 1: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite
Page 2: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

James, San Francisco, Aug. 2017

Page 3: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

CAMERAS, MULTIPLE VIEWS, AND MOTION

Page 4: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

What is a camera?

Page 5: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite
Page 6: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Camera obscura: dark room

• Known during classical period in China and Greece (e.g., Mo-Ti, China, 470BC to 390BC)

Illustration of Camera Obscura Freestanding camera obscura at UNC Chapel Hill

Photo by Seth Ilys

James Hays

Page 7: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Camera obscura / lucida used for tracing

Lens Based Camera Obscura, 1568

drawingchamber.wordpress.com

Camera lucida

Page 8: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Tim’s Vermeer

Vermeer, The Music Lesson, 1665 Tim Jenison (Lightwave 3D, Video Toaster)

Page 9: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Tim’s Vermeer – video still

Page 10: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

First Photograph

Oldest surviving photograph

– Took 8 hours on pewter plate

Joseph Niepce, 1826

Photograph of the first photograph

Stored at UT Austin

Niepce later teamed up with Daguerre, who eventually created Daguerrotypes

Page 11: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Point of observation

Figures © Stephen E. Palmer, 2002

Dimensionality Reduction Machine (3D to 2D)

3D world 2D image

Page 12: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Lake Sørvágsvatn in Faroe Islands

100 metres above sea level

Page 13: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Lake Sørvágsvatn in Faroe Islands

100 30 metres above sea level

amusingplanet.com, thanks to Aaron Gokaslan

Page 14: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite
Page 15: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite
Page 16: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Holbein’s The Ambassadors - 1533

Page 17: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Holbein’s The Ambassadors – Memento Mori

Page 18: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Cameras and World Geometry

How tall is this woman?

Which ball is closer?

How high is the camera?

What is the camera

rotation wrt. world?

James Hays

Page 19: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite
Page 20: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Let’s design a camera

Idea 1: Put a sensor in front of an object

Do we get a reasonable image?

Slide source: Seitz

sensor

Page 21: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Let’s design a camera

Idea 2: Add a barrier to block most rays– Pinhole in barrier

– Only sense light from one direction.• Reduces blurring.

– In most cameras, this aperture can vary in size.

Slide source: Seitz

sensor

Page 22: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Pinhole camera model

Figure from Forsyth

f

f = Focal length

c = Optical center of the camera

c

Real

object

Page 23: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projection: world coordinatesimage coordinates

Camera

Center

(0, 0, 0)

Z

Y

X

P.

.

. f Z Y

V

Up

.V

U

Z

fXU *

Z

fYV *

What is the effect if f and Z are equal?

p = distance from

image center

Image

center

(u0, v0)

Page 24: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projective Geometry

Length (and so area) is lost.

Which is closer?

Who is taller?

Page 25: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Length and area are not preserved

Figure by David Forsyth

B’

C’

A’

Page 26: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projective Geometry

Perpendicular?

Parallel?

Angles are lost.

Page 27: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projective Geometry

What is preserved?

• Straight lines are still straight.

Page 28: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Vanishing points and lines

Parallel lines in the world

intersect in the projected image at a “vanishing point”.

Parallel lines on the same plane in the world converge to vanishing points on a “vanishing line”.

E.G., the horizon.

Vanishing Point Vanishing Point

Vanishing Line

Page 29: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Vanishing points and lines

Vanishingpoint

Vanishingpoint

Vertical vanishingpoint

(at infinity)

Slide from Efros, Photo from Criminisi

Page 30: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Pinhole camera model

Forsyth

f

f = Focal length

c = Optical center of the camera

c

Real

object

Page 31: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projection: world coordinatesimage coordinates

Camera

Center

(0, 0, 0)

Z

Y

X

P.

.

. f Z Y

V

Up

.V

U

Z

fXU *

Z

fYV *

What is the effect if f and Z are equal?

p = distance from

image center

Image

center

(u0, v0)

Page 32: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Slide Credit: Savarese

Camera (projection) matrix

XtRKx x: Image Coordinates: (u,v,1)

K: Intrinsic Matrix (3x3)

R: Rotation (3x3)

t: Translation (3x1)

X: World Coordinates: (X,Y,Z,1)

Ow

iw

kw

jwR,t

X

x

Extrinsic Matrix

Page 33: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Demo – Kyle Simek

• “Dissecting the Camera Matrix”

• Three-part blog series

• http://ksimek.github.io/2012/08/14/decompose/

• http://ksimek.github.io/2012/08/22/extrinsic/

• http://ksimek.github.io/2013/08/13/intrinsic/

• “Perspective toy”

• http://ksimek.github.io/perspective_camera_toy.html

Page 34: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projective geometry

• 2D point in cartesian = (x,y) coordinates

• 2D point in projective = (x,y,w) coordinates

Idea from www.tomdalling.com

Y

X

Projector

Page 35: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projective geometry

• 2D point in cartesian = (x,y) coordinates

• 2D point in projective = (x,y,w) coordinates

Y

X

Projector W

Idea from www.tomdalling.com

Page 36: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Varying w

w1 w2 < w1

Projected image becomes smaller.

Y

X

Projector

Y

X

Projector

Page 37: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projective geometry

• 2D point in projective = (x,y,w) coordinates

– w defines the scale of the projected image.

– Each x,y point becomes a ray!

Y

X

Projector W

Page 38: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projective geometry

• In 3D, point (x,y,z) becomes (x,y,z,w)

• Perspective is w varying with z:

– Objects far away are appear smaller

B’

C’

Page 39: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Homogeneous coordinates

Converting to homogeneous coordinates

2D (image) coordinates 3D (scene) coordinates

Converting from homogeneous coordinates

2D (image) coordinates 3D (scene) coordinates

Page 40: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Homogeneous coordinates

Scale invariance in projection space

w

y

wx

kw

ky

kwkx

kw

ky

kx

w

y

x

k

Homogeneous Coordinates

Cartesian Coordinates

E.G., we can uniformly scale the projective space, and it will still

produce the same image -> scale ambiguity

Page 41: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Slide Credit: Savarese

Camera (projection) matrix

XtRKx x: Image Coordinates: (u,v,1)

K: Intrinsic Matrix (3x3)

R: Rotation (3x3)

t: Translation (3x1)

X: World Coordinates: (X,Y,Z,1)

Ow

iw

kw

jwR,t

X

x

Extrinsic Matrix

Page 42: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

X0IKx

10100

000

000

1z

y

x

f

f

v

u

w

K

Slide Credit: Savarese

Projection matrix

Intrinsic Assumptions

• Unit aspect ratio

• Optical center at (0,0)

• No skew

Extrinsic Assumptions• No rotation

• Camera at (0,0,0)

X

x(0,0,0)

Page 43: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Projection: world coordinatesimage coordinates

Camera

Center

(0, 0, 0)

Z

Y

X

P.

.

. f Z Y

V

Up

.V

U

Z

fXU *

Z

fYV *

p = distance from

image center

Image

center

(u0, v0)

Page 44: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Remove assumption: known optical center

X0IKx

10100

00

00

1

0

0

z

y

x

vf

uf

v

u

w

Intrinsic Assumptions

• Unit aspect ratio

• No skew

Extrinsic Assumptions• No rotation

• Camera at (0,0,0)

James Hays

K

Page 45: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Remove assumption: equal aspect ratio

X0IKx

10100

00

00

1

0

0

z

y

x

vf

uf

v

u

w y

x

Intrinsic Assumptions• No skew

Extrinsic Assumptions• No rotation

• Camera at (0,0,0)

James Hays

Page 46: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Remove assumption: non-skewed pixels

X0IKx

10100

00

0

1

0

0

z

y

x

vf

usf

v

u

w y

x

Intrinsic Assumptions Extrinsic Assumptions• No rotation

• Camera at (0,0,0)

Note: different books use different notation for parameters James Hays

Page 47: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Oriented and Translated Camera

Ow

iw

kw

jw

t

R

X

x

James Hays

Page 48: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Allow camera translation

XtIKx

1100

010

001

100

0

1

0

0

z

y

x

t

t

t

vf

usf

v

u

w

z

y

x

y

x

Intrinsic Assumptions Extrinsic Assumptions• No rotation

James Hays

Page 49: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

3D Rotation of Points

Rotation around the coordinate axes, counter-clockwise:

100

0cossin

0sincos

)(

cos0sin

010

sin0cos

)(

cossin0

sincos0

001

)(

z

y

x

R

R

R

p

p’

γ

y

z

Slide Credit: Saverese

x

Page 50: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Allow camera rotation

XtRKx

1100

0

1 333231

232221

131211

0

0

z

y

x

trrr

trrr

trrr

vf

usf

v

u

w

z

y

x

y

x

James Hays

Page 51: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Demo – Kyle Simek

• “Dissecting the Camera Matrix”

• Three-part blog series

• http://ksimek.github.io/2012/08/14/decompose/

• http://ksimek.github.io/2012/08/22/extrinsic/

• http://ksimek.github.io/2013/08/13/intrinsic/

• “Perspective toy”

• http://ksimek.github.io/perspective_camera_toy.html

Page 52: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Orthographic Projection

• Special case of perspective projection

– Distance from the COP to the image plane is infinite

– Also called “parallel projection”

– What’s the projection matrix?

Image World

Slide by Steve Seitz

11000

0010

0001

1z

y

x

v

u

w

Page 53: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Field of View (Zoom, focal length)

Page 54: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Beyond Pinholes: Radial Distortion

Image from Martin Habbecke

Corrected Barrel Distortion

Page 55: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Beyond Pinholes: Real apertures

Page 56: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Accidental Cameras

Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture.

Antonio Torralba, William T. Freeman

Page 57: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Accidental Cameras

James Hays

Page 58: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Things to remember

• Vanishing points and vanishing lines

• Pinhole camera model and camera projection matrix

• Homogeneous coordinates

Vanishingpoint

Vanishingline

Vanishingpoint

Vertical vanishingpoint

(at infinity)

XtRKx

James Hays

Page 59: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

IS THIS ENOUGH?

Page 60: James, San Francisco, Aug. 2017 - Brown University€¦ · Orthographic Projection • Special case of perspective projection –Distance from the COP to the image plane is infinite

Erik Johansson – The Architect


Recommended