Cameras
CS5670: Computer Vision
Source: S. Lazebnik
Can we use homographies to create a 360 panorama?
Image formation
Let’s design a camera
Pinhole camera
Add a barrier to block off most of the rays
Camera Obscura
Gemma Frisius, 1558
Source: A. Efros
Camera Obscura
Home-made pinhole camera
Why so blurry?
Slide by A. Efros
Pinhole photography
Justin Quinnell, The Clifton Suspension Bridge. December 17th 2007 - June 21st 2008�6-month exposure
Shrinking the aperture
Shrinking the aperture
Adding a lens
A lens focuses light onto the film
“circle of
confusion”
The eye
The human eye is a camera
Eyes in nature: �eyespots to pinhole camera
http://upload.wikimedia.org/wikipedia/commons/6/6d/Mantis_shrimp.jpg
Projection
Projection
Müller-Lyer Illusion
Geometric Model: A Pinhole Camera
Figure credit: Peter Hedman
Modeling projection
z
x
y
(x, y, z)
(x’, y’, f)
f
Center of Projection (COP)
Image Plane
Modeling projection
z
x
y
(x, y, z)
(x’, y’, f)
f
Center of Projection (COP)
Image Plane
Great Camera Demo
Modeling projection
Homogeneous coordinates to the rescue—again!
homogeneous image
coordinates
homogeneous scene
coordinates
Converting from homogeneous coordinates
Perspective Projection
Projection is a matrix multiply using homogeneous coordinates:
This is known as perspective projection
divide by third coordinate
Perspective Projection
How does scaling the projection matrix change the transformation?
Scale by f:
Scaling a projection matrix produces an equivalent projection matrix!
Orthographic projection
Image
World
Orthographic projection
Perspective projection
Variants of orthographic projection
Dimensionality Reduction Machine (3D to 2D)
Figures © Stephen E. Palmer, 2002
3D world
2D image
What have we lost?
Slide by A. Efros
Projection properties
Projection properties
Questions?
Camera parameters
“The World”
Camera
x
y
z
v
w
u
o
COP
Three important coordinate systems:
(x, y, z)
How do we project a given world point (x, y, z) to an image point?
Recap: coordinate frames
World coordinates
Camera coordinates
Image coordinates
Figure credit: Peter Hedman
Camera parameters
To project a point (x, y, z) in world coordinates into a camera
Camera parameters
Projection equation
projection
intrinsics
rotation
translation
identity matrix
A camera is described by several parameters
Projection matrix
0
=
(in homogeneous image coordinates)
Extrinsics: from world to camera coordinates
Step 1: Translate by -c
0
Extrinsics: from world to camera coordinates
0
Step 1: Translate by -c
How do we represent translation as a matrix multiplication?
Extrinsics: from world to camera coordinates
Step 1: Translate by -c
Step 2: Rotate by R
3x3 rotation matrix
0
Extrinsics: from world to camera coordinates
0
Step 1: Translate by -c
Step 2: Rotate by R
(with extra row/column of [0 0 0 1])
Perspective projection
(intrinsics)
in general,
: aspect ratio (1 unless pixels are not square)
: skew (0 unless pixels are shaped like rhombi/parallelograms)
: principal point ((w/2,h/2) unless optical axis doesn’t intersect projection plane at image center)
(upper triangular matrix)
(converts from 3D rays in camera coordinate system to pixel coordinates)
Typical intrinsics matrix
Focal length
24mm
50mm
200mm
800mm
Field of view
Fredo Durand
Fredo Durand
Fredo Durand
Fredo Durand
Dolly zoom
Fredo Durand
Projection matrix
translation
rotation
projection
intrinsics
This part converts 3D points in world coordinates to 3D rays in the camera’s coordinate system. There are 6 parameters represented (3 for position/translation, 3 for rotation).
The K matrix converts 3D rays in the camera’s coordinate system to 2D image points in image (pixel) coordinates.
Projection matrix
(t in book’s notation)
translation
rotation
projection
intrinsics
Projection matrix
0
=
(in homogeneous image coordinates)
Questions?
Perspective distortion
Source: F. Durand
Perspective distortion
Source: F. Durand
Tilting the camera upwards results in converging verticals
Keeping the camera level, with an ordinary lens, captures only the bottom portion of the building
Shifting the lens upwards results in a picture of the entire subject
Perspective distortion
Source: F. Durand
Perspective distortion
Image source: F. Durand
Perspective distortion
Slide by F. Durand
Perspective distortion: People
Distortion-Free Wide-Angle Portraits on Camera Phones
YiChang Shih, Wei-Sheng Lai, and Chia-Kai Liang, Distortion-Free Wide-Angle Portraits on Camera Phones, SIGGRAPH 2019
https://people.csail.mit.edu/yichangshih/wide_angle_portrait/
Distortion
No distortion
Pin cushion
Barrel
Radial distortion
[Image credit: J. Bouguet http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/example.html]
Correcting radial distortion
from Helmut Dersch
Distortion
Modeling distortion
Apply radial distortion
Apply focal length �translate image center
Project �to “normalized” �image coordinates
Other types of projection
360 degree field of view…
Tilt-shift
Tilt-shift images from Olivo Barbieri�and Photoshop imitations
Rotating sensor (or object)
Rollout Photographs © Justin Kerr
Also known as “cyclographs”, “peripheral images”
Questions?