Title: Pinhole cameras
1Pinhole cameras
- Abstract camera model - box with a small hole in
it
- Pinhole cameras work in practice
2Distant objects are smaller
3Parallel lines meet
Common to draw film plane in front of the focal
point. Moving the film plane merely scales the
image.
4Vanishing points
- each set of parallel lines (direction) meets at
a different point - The vanishing point for this direction
- Sets of parallel lines on the same plane lead to
collinear vanishing points. - The line is called the horizon for that plane
- Good ways to spot faked images
- scale and perspective dont work
- vanishing points behave badly
- supermarket tabloids are a great source.
5Slide credit David Jacobs
6(No Transcript)
7Properties of Projection
- Points project to points
- Lines project to lines
- Vanishing points for parallel lines
- Parallel lines parallel to image plane donot
converge - Closer objects appear bigger
- Angles are not preserved
- Degenerate cases
- Line through focal point projects to a point.
- Plane through focal point projects to line
8Pinhole Camera Terminology
Image plane
Optical axis
Principal point/ image center
Focal length
Camera center/ pinhole
Camera point
Image point
9The equation of projection
10The equation of projection
- Cartesian coordinates
- We have, by similar triangles, that
(x, y, z) -gt (f x/z, f y/z, -f) - Ignore the third coordinate, and get
11The camera matrix
- Turn previous expression into HCs
- HCs for 3D point are (X,Y,Z,T)
- HCs for point in image are (U,V,W)
12Weak perspective
- Issue
- perspective effects, but not over the scale of
individual objects - collect points into a group at about the same
depth, then divide each point by the depth of its
group - Adv easy
- Disadv wrong
13The Equation of Weak Perspective
- s is constant for all points.
- Parallel lines no longer converge, they remain
parallel.
Slide credit David Jacobs
14Pros and Cons of These Models
- Weak perspective has simpler math.
- Accurate when object is small and distant.
- Most useful for recognition.
- Pinhole perspective much more accurate for
scenes. - Used in structure from motion.
- When accuracy really matters, we must model the
real camera - Use perspective projection with other calibration
parameters (e.g., radial lens distortion)
Slide credit David Jacobs
15Orthographic projection
16The projection matrix for orthographic projection
17Affine cameras
18Camera parameters
- Issue
- camera may not be at the origin, looking down the
z-axis - extrinsic parameters
- one unit in camera coordinates may not be the
same as one unit in world coordinates - intrinsic parameters - focal length, principal
point, aspect ratio, angle between axes, etc.
Note the matrix dimensions
19Camera calibration
- Issues
- what are intrinsic parameters of the camera?
- what is the camera matrix? (intrinsicextrinsic)
- General strategy
- view calibration object
- identify image points
- obtain camera matrix by minimizing error
- obtain intrinsic parameters from camera matrix
- Error minimization
- Linear least squares
- easy problem numerically
- solution can be rather bad
- Minimize image distance
- more difficult numerical problem
- solution usually rather good,
- start with linear least squares
- Numerical scaling is an issue
20Human Eye
- The eye has an iris like a camera
- Focusing is done by changing shape of lens
- Retina contains cones (mostly used) and rods (for
low light) - The fovea is small region of high resolution
containing mostly cones - Optic nerve 1 million flexible fibres
http//www.cas.vanderbilt.edu/bsci111b/eye/human-e
ye.jpg
Slide credit David Jacobs
21The Image Formation Pipeline
22Outline
- Vector, matrix basics
- 2-D point transformations
- Translation, scaling, rotation, shear
- Homogeneous coordinates and transformations
- Homography, affine transformation
23Notes on Notation
- Vectors, points x, v (assume column vectors)
- Matrices R, T
- Scalars x, a
- Axes, objects X, Y, O
- Coordinate systems W, C
- Number systems R, Z
- Specials
- Transpose operator xT
(as opposed to x0) - Identity matrix Id
- Matrices/vectors of zeroes, ones 0, 1
24Block Notation for Matrices
- Often convenient to write matrices in terms of
parts - Smaller matrices for blocks
- Row, column vectors for ranges of entries on
rows, columns, respectively - E.g. If A is 3 x 3 and
252-D Transformations
- Types
- Scaling
- Rotation
- Shear
- Translation
- Mathematical representation
262-D Scaling
272-D Scaling
282-D Scaling
sx
1
Horizontal shift proportional to horizontal
position
292-D Scaling
sy
1
Vertical shift proportional to vertical position
302-D Scaling
31Matrix form of 2-D Scaling
322-D Scaling
332-D Rotation
342-D Rotation
352-D Rotation
36Matrix form of 2-D Rotation
(this is a counterclockwise rotation reverse
signs of sines to get a clockwise one)
37Matrix form of 2-D Rotation
382-D Shear (Horizontal)
392-D Shear (Horizontal)
Horizontal displacement proportional to vertical
position
402-D Shear (Horizontal)
(Shear factor h is positive for the figure above)
412-D Shear (Horizontal)
422-D Shear (Vertical)
432-D Translation
442-D Translation
452-D Translation
462-D Translation
472-D Translation
482-D Translation
49Representing Transformations
- Note that weve defined translation as a vector
addition but rotation, scaling, etc. as matrix
multiplications - Its inconvenient to have two different
operations (addition and multiplication) for
different forms of transformation - It would be desirable for all transformations to
be expressed in a common, linear form (since
matrix multiplications are linear
transformations)
50Example Trick of additional coordinate makes
this possible
51Translation Matrix
- We can write the formula using this expanded
transformation matrix as - From now on, assume points are in this expanded
form unless otherwise noted
52Homogeneous Coordinates
- Expanded form is called homogeneous coordinates
or projective space - Change to projective space by adding a scale
factor (usually but not always 1)
53Homogeneous Coordinates Projective Space
- Equivalence is defined up to scale (non-zero
for finite points) - Think of projective points in P2 as rays in R3,
where z coordinate is scale factor - All Euclidean points along ray are same in this
sense
54Leaving Projective Space
- Can go back to non-homogeneous representation by
dividing by scale factor and dropping extra
coordinate - This is the same as saying Where does the ray
intersect the plane defined by z 1? - Analogy to perspective projection, where f1
(image plane) and lambda is z of any point in the
ray. For different lambdas along the line,
projected point is the same, thus Equivalence
class
55Homogeneous Coordinates Rotations, etc.
- A 2-D rotation, scaling, shear or other
transformation normally expressed by a 2 x 2
matrix R is written in homogeneous coordinates
with the following 3 x 3 matrix - The non-commutativity of matrix multiplication
explains why different transformation orders give
different resultsi.e., RT ? TR
In homogeneous form
In homogeneous form
56Example Transformations Dont Commute
57Example Transformations Dont Commute
58Example Transformations Dont Commute
59Example Transformations Dont Commute
602-D Transformations
- Full-generality 3 x 3 homogeneous transformation
is called a homography
612-D Transformations
- Full-generality 3 x 3 homogeneous transformation
is called a homography - Translation components
622-D Transformations
- Full-generality 3 x 3 homogeneous
- transformation is called a homography
- Scale/rotation components
632-D Transformations
- Full-generality 3 x 3 homogeneous transformation
is called a homography - Shear/rotation components
642-D Transformations
- Full-generality 3 x 3 homogeneous transformation
is called a homography - Homogeneous scaling factor
652-D Transformations
- Full-generality 3 x 3 homogeneous transformation
is called a homography - When these are zero (as they have been so far), H
is an affine transformation