780 likes | 940 Views
The Image Formation Pipeline. Computer Graphics. Output. Image. Model. Synthetic Camera. (slides courtesy of Michael Cohen). Computer Vision. Output. Model. Real Scene. Real Cameras. (slides courtesy of Michael Cohen). Combined. Output. Image. Real Scene. Model. Synthetic
E N D
The Image Formation Pipeline Computer Vision : CISC4/689
Computer Graphics Output Image Model Synthetic Camera (slides courtesy of Michael Cohen) Computer Vision : CISC4/689
Computer Vision Output Model Real Scene Real Cameras (slides courtesy of Michael Cohen) Computer Vision : CISC4/689
Combined Output Image Real Scene Model Synthetic Camera Real Cameras (slides courtesy of Michael Cohen) Computer Vision : CISC4/689
Abstract camera model - box with a small hole in it Pinhole cameras work in practice Pinhole cameras Computer Vision : CISC4/689
Distant objects are smaller Computer Vision : CISC4/689
Consequences: Parallel lines meet • There exist vanishing points Marc Pollefeys Computer Vision : CISC4/689
The Effect of Perspective Computer Vision : CISC4/689
Vanishing Points Vertical Line Vanishing Point • Parallel scene lines meet at a vanishing point in the image. Horizontal Line Vanishing Point Andrew C. Gallagher CRV 2005 Computer Vision : CISC4/689
Vanishing points VP1 VP2 VP3 Different directions correspond to different vanishing points Marc Pollefeys Computer Vision : CISC4/689
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 If lines are parallel to an axis, corresponding VPs are called axis vanishing points. Good ways to spot faked images scale and perspective don’t work vanishing points behave badly supermarket tabloids are a great source. Vanishing points Computer Vision : CISC4/689
Computer Vision : CISC4/689 Slide credit: David Jacobs
Properties of Projection(Perspective) • 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 Computer Vision : CISC4/689
Pinhole Camera Terminology Image plane Optical axis Principal point/ image center Focal length Camera center/ pinhole Camera point Image point Computer Vision : CISC4/689
The equation of projection Computer Vision : CISC4/689
Cartesian coordinates: We have, by similar triangles, that (x, y, z) -> (f x/z, f y/z, -f) Ignore the third coordinate, and get The equation of projection Computer Vision : CISC4/689
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) The camera matrix Computer Vision : CISC4/689
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 Weak perspective Computer Vision : CISC4/689
Weak Perspective Projection Z Reduction of height by same amount even though they are at different distances. O -x Z Z f Computer Vision : CISC4/689
The Equation of Weak Perspective(scaled Orthographic) • s is constant for all points. • Parallel lines no longer converge, they remain parallel. Computer Vision : CISC4/689 Slide credit: David Jacobs
Generalization of Orthographic Projection When the camera is at a (roughly constant) distance from the scene, take m=1. Computer Vision : CISC4/689 Marc Pollefeys
The projection matrix for orthographic projection Computer Vision : CISC4/689
Pictorial Comparison Weak perspective Perspective Computer Vision : CISC4/689 Marc Pollefeys
Summary: Perspective Laws • Perspective • Weak perspective • Orthographic Computer Vision : CISC4/689
Pros 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) Computer Vision : CISC4/689 Slide credit: David Jacobs
Affine cameras Computer Vision : CISC4/689
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. Camera parameters Note the matrix dimensions Computer Vision : CISC4/689
Issues: what are intrinsic parameters of the camera? what is the camera matrix? (intrinsic+extrinsic) 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 Camera calibration Computer Vision : CISC4/689
Outline • Vector, matrix basics • 2-D point transformations • Translation, scaling, rotation, shear • Homogeneous coordinates and transformations • Homography, affine transformation Computer Vision : CISC4/689
Notes 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 Computer Vision : CISC4/689
Block 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 : Computer Vision : CISC4/689
2-D Transformations • Types • Scaling • Rotation • Shear • Translation • Mathematical representation Computer Vision : CISC4/689
2-D Scaling Computer Vision : CISC4/689
2-D Scaling Computer Vision : CISC4/689
2-D Scaling sx 1 Horizontal shift proportional to horizontal position Computer Vision : CISC4/689
2-D Scaling sy 1 Vertical shift proportional to vertical position Computer Vision : CISC4/689
2-D Scaling Computer Vision : CISC4/689
Matrix form of 2-D Scaling Computer Vision : CISC4/689
2-D Scaling Computer Vision : CISC4/689
2-D Rotation Computer Vision : CISC4/689
µ 2-D Rotation Computer Vision : CISC4/689
µ 2-D Rotation Computer Vision : CISC4/689
µ Matrix form of 2-D Rotation (this is a counterclockwise rotation; reverse signs of sines to get a clockwise one) Computer Vision : CISC4/689
µ Matrix form of 2-D Rotation Computer Vision : CISC4/689
2-D Shear (Horizontal) Computer Vision : CISC4/689
2-D Shear (Horizontal) Horizontal displacement proportional to vertical position Computer Vision : CISC4/689
2-D Shear (Horizontal) (Shear factorh is positive for the figure above) Computer Vision : CISC4/689
2-D Shear (Horizontal) Computer Vision : CISC4/689
2-D Shear (Vertical) Computer Vision : CISC4/689
2-D Translation Computer Vision : CISC4/689