<<

Equation of

Image Formation and Cameras

Guest Professor: Dr. Ana Murillo

Computer Vision I CSE 252A Cartesian coordinates: Lecture 4 • We have, by similar , that (x, y, z) -> (f’ x/z, f’ y/z, f’) • Establishing an image coordinate system at C’ aligned with i x y and j, we get (x,y,z) →( f ' , f ' ) z z

CS252A, Fall 2012 I CS252A, Fall 2012 Computer Vision I

Projective of Projective geometry provides an elegant means for handling these different 1. Every two distinct points define a situations in a unified way and 2. Every two distinct lines define a (intersect at a point) homogenous coordinates are a way to represent entities (points & lines) in 3. There exists three points, A,B,C such that C does not lie on the line defined by A and B. projective spaces. • Different than Euclidean (affine) geometry • Projective plane is “bigger” than affine plane – includes “line at

Projective Affine Line at Plane = Plane + Infinity

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Conversion The equation of projection: Euclidean -> Homogenous -> Euclidean Euclidean & Homogenous Coordinates In 2-D • Euclidean -> Homogenous: (x, y) -> k (x,y,1) • Homogenous -> Euclidean: (x, y, z) -> (x/z, y/z) (x,y,1) Z 1 In 3-D Y (x,y) Homogenous Coordinates • Euclidean -> Homogenous: and Camera matrix Cartesian coordinates: ⎛ X⎞ (x, y, z) -> k (x,y,z,1) ⎛ ⎞ ⎛ ⎞ X U ⎜ 1 0 0 0⎟⎜ ⎟ ⎜ ⎟ ⎜ Y ⎟ • Homogenous -> Euclidean: x y ⎜ V ⎟ = ⎜ 0 1 0 0⎟ (x,y,z) →( f , f ) ⎜ ⎟ ⎜ ⎟⎜ Z ⎟ (x, y, z, w) -> (x/w, y/w, z/w) z z ⎝W ⎠ ⎜ 0 0 1 0⎟⎜ ⎟ ⎝ f ⎠⎝ T ⎠

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

€ €

1 Mapping from a Plane to a Plane under Projective transformation Perspective is given by a projective transform H x’ = Hx H is a 3x3 matrix, • Also called a x is a 3x1 vector of • This is a mapping from 2-D to 2-D in homogenous coordinates homogenous coordinates • 3 x 3 linear transformation of homogenous coordinates

• Points map to points • Lines map to lines Figure borrowed from Hartley and Zisserman “Multiple View Geometry in computer vision”

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Application: Panoramas Planar Homography: Pure Coordinates between pairs of images are related by projective transformations Transforms

-1 -1 x’ = H2X = H2(H1 x) = (H2H1 )x Figure borrowed from Hartley and Zisserman “Multiple View Geometry in computer vision”

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Planar Homography More applications: OCRs, scan,…

x’ =H2X x =H1X

-1 -1 x’ = H2X = H2(H1 x) = (H2H1 )x Figure borrowed from Hartley and Zisserman “Multiple View Geometry in computer vision”

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

2 Augmented reality

• In the projective , lines meet at a .

Corresponding points Region of interest • The vanishing point is the perspective projection of that point at infinity, resulting H matrix? from multiplication by the camera matrix.

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Some applications … Simplified Camera Models Perspective Projection Approximation Affine Camera Model

Scaled Orthographic Particular case Projection

Orthographic Figure from “Handling Urban Location Recognition as a 2D Homothetic Problem” G. Baatz, K. Koser1, D. Chen, R. Grzeszczuk, M. Pollefeys ECCV 2010. Projection CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Appropriate • Perspective Affine Camera Model in Neighborhood About (x0,y0,z0)

• Assume that f=1, and perform a Taylor series

expansion about (x0, y0, z0)

⎡ u⎤ 1 ⎡ x0 ⎤ 1 ⎡ x0 ⎤ 1 ⎡1 ⎤ ⎢ ⎥ = ⎢ ⎥ − 2 ⎢ ⎥( z − z0) + ⎢ ⎥( x − x0 ) ⎣ v⎦ z0 ⎣ y0 ⎦ z0 ⎣ y0 ⎦ z0 ⎣0 ⎦

1 ⎡0 ⎤ 1 2 ⎡ x0 ⎤ 2 + ⎢ ⎥ y − y0 + 3 ⎢ ⎥ z − z0 + z 1 ( ) 2 z y ( ) • Take perspective projection equation, and perform 0 ⎣ ⎦ 0 ⎣ 0 ⎦ Taylor series expansion about some point P= (x0,y0,z0). • Dropping higher order terms and regrouping. ⎡ x⎤ • Drop terms that are higher order than linear. ⎡ ⎤ ⎡ ⎤ ⎡ 2 ⎤ € u 1 x0 1/z0 0 −x0 /z0 ⎢ ⎥ ≈ + y = Ap + b • Resulting expression is affine camera model ⎢ ⎥ ⎢ ⎥ ⎢ 2 ⎥ ⎢ ⎥ ⎣ v⎦ z0 ⎣ y0 ⎦ ⎣0 1/z0 −y0 /z0 ⎦ ⎣⎢ z ⎦⎥ CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

3 Affine camera model in Euclidean Coordinates Scaled Starting with Affine Camera Model, take Taylor series about

(xo, y0, z0) = (0, 0, z0) – a point on the optical axis

Rewrite affine camera model in terms of Homogenous Coordinates

(0, 0, z0)

⎡ u⎤ 1 ⎡ x⎤ ⎢ ⎥ = ⎢ ⎥ ⎣ v⎦ z0 ⎣ y⎦ – That is the z coordinate is dropped, and the image a of the x and y

coordinates, where the scale is 1/z0, the depth of the point of the expansion. CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I €

The projection matrix for scaled orthographic projection

⎛ X⎞ ⎛ U ⎞ ⎛1 /z0 0 0 0⎞⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ Y ⎟ ⎜ V ⎟ = ⎜ 0 1/z0 0 0⎟ ⎜ ⎟ ⎜ ⎟⎜ Z⎟ For all cameras? ⎝W ⎠ ⎝ 0 0 0 1⎠⎜ ⎟ ⎝ 1 ⎠

• Parallel lines project to parallel lines • €Ratios of distances are preserved under orthographic projection

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Other camera models Some Alternative “Cameras”

• Generalized camera – maps points lying on rays and maps them to points on the image plane.

Omnicam (hemispherical) Light Probe (spherical)

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

4 Beyond the pinhole Camera Beyond the pinhole Camera Getting more light – Bigger Aperture

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Pinhole Camera Images with Variable Limits for pinhole cameras Aperture

2 mm 1mm

.6 mm .35 mm

.15 mm .07 mm

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

The reason for lenses We need light, but big pinholes cause blur. Lenses

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

5 Thin Lens Thin Lens: Center

O Optical axis F O

• Rotationally symmetric about optical axis. • Spherical interfaces. • All rays that enter lens along line pointing at O emerge in same direction.

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Thin Lens: Thin Lens: Image of Point

P

F O F O P’ – All rays passing through lens and starting at P converge upon P’ Parallel lines pass through the focus, F – So light gather capability of lens is given the of the lens and all the rays focus on P’ instead of become blurred like a pinhole CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Thin Lens: Image of Point Thin Lens: Image Plane

Q’ P P f F O F O Z’ Z P’ P’ Q Image Plane Relation between depth of Point (Z) A price: Whereas the image of P is in focus, and the depth where it focuses (Z’) the image of Q isn’t.

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

6 Thin Lens: Aperture Field of View Image Plane P f Field of View O O P’ Image Plane • Smaller Aperture -> Less Blur • Pinhole -> No Blur – Field of view is a function of f and size of image plane.

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Deviations from the lens model Spherical aberration Deviations from this ideal are aberrations Rays parallel to the axis do not converge Two types 1. geometrical  spherical aberration Outer portions of the lens yield smaller  astigmatism focal  distortion  coma 2. chromatic Aberrations are reduced by combining lenses

CS252A, Fall 2012 Compound lenses Computer Vision I CS252A, Fall 2012 Computer Vision I

Astigmatism An optical system with astigmatism is one where rays that propagate in Distortion two planes have different focus. If an optical system with astigmatism is used to form an image of a cross, the vertical and magnification/focal different horizontal lines will be in sharp focus at two different distances. for different of inclination object

pincushion (tele-photo)

barrel (wide-)

Can be corrected! (if parameters are know)

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

7 Chromatic aberration Chromatic aberration

(great for prisms, bad for lenses) rays of different wavelengths focused in different planes

cannot be removed completely

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

Vignetting Human eye

– Only part of the light reaches the sensor – Periphery of the image is dimmer

CS252A, Fall 2012 Computer Vision I CS252A, Fall 2012 Computer Vision I

8