cameras - illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • cameras project 3d to 2d • distort...

25
Cameras D.A. Forsyth

Upload: others

Post on 01-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Cameras D.A. Forsyth

Page 2: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Cameras

• First photograph due to Niepce• First on record, 1822• Key abstraction

• Pinhole camera

Page 3: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Pinhole camera

Page 4: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Freestanding room-sized camera obscura outside Hanes Art Center at the University of North Carolina at Chapel Hill. Picture taken by User:Seth Ilys on 23 April 2005 and released into the public domain.

Page 5: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

A photo of the Camera Obscura in San Francisco. This Camera Obscura is located at the Cliff House on the Pacific ocean. Credit to Jacob Appelbaum of http://www.appelbaum.net.

Page 6: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Distant objects are smaller in a pinhole camera

Page 7: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Vanishing points

• Each set of parallel lines meets at a different point• The vanishing point for this direction

• Coplanar sets of parallel lines have a horizon• The vanishing points lie on a line• Good way to spot faked images

Page 8: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Railroad tracks "vanishing" into the distance

Sourceown work

Date2006-05-23

AuthorUser:MikKBDFJKGeMalak

Page 9: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Parallel lines meet in a pinhole camera

Page 10: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Vanishing points

 

Vanishing point

Vanishing line

Vanishing point

Vertical vanishing point

(at infinity)

Slide from Efros, Photo from Criminisi

Page 11: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates
Page 12: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates
Page 13: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Horizons

Page 14: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Which ball is closer to the viewer?

Page 15: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Projection in Coordinates

• From the drawing, we have X/Z = -x/f• Generally

Page 16: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Homogeneous coordinates

• Add an extra coordinate and use an equivalence relation• for 2D

• three coordinates for point• equivalence relation

k*(X,Y,Z) is the same as (X,Y,Z)

• for 3D• four coordinates for point• equivalence relation

k*(X,Y,Z,T) is the same as (X,Y,Z,T)

• Canonical representation • by dividing by one coordinate (if it isn’t zero).

Page 17: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Homogeneous coordinates

• Why?• Possible to represent points “at infinity”• Where parallel lines intersect (vanishing points)• Where parallel planes intersect (horizons)• Possible to write the action of a perspective camera as a matrix

Page 18: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

A perspective camera as a matrix

• Turn previous expression into HC’s• HC’s for 3D point are (X,Y,Z,T)• HC’s for point in image are (U,V,W)

UVW

=

1 0 0 00 1 0 00 0 1

f 0

XYZT

Page 19: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Weak perspective

• Issue• perspective effects, but not over the scale of individual objects

• For example, texture elements in picture below• collect points into a group at about the same depth, then divide each point

by the depth of its group• Adv: easy• Disadv: wrong

Page 20: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Orthographic projection

• Perspective effects are often not significant• eg

• pictures of people• all objects at the same distance

Page 21: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Orthographic projection in HC’s

• In conventional coordinates, we just drop z

UVW

=

1 0 0 00 1 0 00 0 0 1

XYZT

Page 22: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Pinhole Problems

Pinhole too big: brighter, but blurred

Pinhole right size: crisp, but dark

Pinhole too small: diffraction effects blur, dark

Page 23: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Lens Systems

• Collect light from a large range of directions

Page 24: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Lens distortion

Image from Martin Habbecke

Corrected Barrel Distortion

Page 25: Cameras - Illinoisluthuli.cs.uiuc.edu/.../cameras.pdf · • Cameras project 3D to 2D • distort flat patches • distortion can be represented by matrices in homogenous coordinates

Crucial points

• Cameras project 3D to 2D• distort flat patches• distortion can be represented by matrices in homogenous coordinates• models:

• perspective camera• orthographic camera

• Lenses • make images brighter by focusing light• can distort images