Computer Vision : CISC4/689

Slides:



Advertisements
Similar presentations
Lecture 3: Transformations and Viewing. General Idea Object in model coordinates Transform into world coordinates Represent points on object as vectors.
Advertisements

Image formation. Image Formation Vision infers world properties form images. How do images depend on these properties? Two key elements –Geometry –Radiometry.
C280, Computer Vision Prof. Trevor Darrell Lecture 2: Image Formation.
Computer Vision, Robert Pless
Computer Graphics Lecture 4 Geometry & Transformations.
CS 691 Computational Photography Instructor: Gianfranco Doretto 3D to 2D Projections.
Three Dimensional Viewing
Study the mathematical relations between corresponding image points.
Computer vision: models, learning and inference
Camera Calibration. Issues: what are intrinsic parameters of the camera? what is the camera matrix? (intrinsic+extrinsic) General strategy: view calibration.
Camera calibration and epipolar geometry
Camera Models A camera is a mapping between the 3D world and a 2D image The principal camera of interest is central projection.
2-D Geometry. The Image Formation Pipeline Outline Vector, matrix basics 2-D point transformations Translation, scaling, rotation, shear Homogeneous.
Structure from motion.
Cameras (Reading: Chapter 1) Goal: understand how images are formed Camera obscura dates from 15 th century Basic abstraction is the pinhole camera Perspective.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Geometry of Images Pinhole camera, projection A taste of projective geometry Two view geometry:  Homography  Epipolar geometry, the essential matrix.
Lecture 5: Projection CS6670: Computer Vision Noah Snavely.
Epipolar geometry. (i)Correspondence geometry: Given an image point x in the first view, how does this constrain the position of the corresponding point.
Structure from motion. Multiple-view geometry questions Scene geometry (structure): Given 2D point matches in two or more images, where are the corresponding.
Uncalibrated Geometry & Stratification Sastry and Yang
CS485/685 Computer Vision Prof. George Bebis
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Computer Vision - A Modern Approach
Camera model Relation between pixels and rays in space ?
Lecture 12: Projection CS4670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Single-view geometry Odilon Redon, Cyclops, 1914.
3D Computer Vision and Video Computing 3D Vision Lecture 14 Stereo Vision (I) CSC 59866CD Fall 2004 Zhigang Zhu, NAC 8/203A
The Pinhole Camera Model
The Image Formation Pipeline
CS223b, Jana Kosecka Rigid Body Motion and Image Formation.
Camera parameters Extrinisic parameters define location and orientation of camera reference frame with respect to world frame Intrinsic parameters define.
1 Digital Images WorldCameraDigitizer Digital Image (i) What determines where the image of a 3D point appears on the 2D image? (ii) What determines how.
Cameras, lenses, and calibration
Instance-level recognition I. - Camera geometry and image alignment Josef Sivic INRIA, WILLOW, ENS/INRIA/CNRS UMR 8548 Laboratoire.
Lecture 14: Projection CS4670 / 5670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Camera Geometry and Calibration Thanks to Martial Hebert.
Image Formation Fundamentals Basic Concepts (Continued…)
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
Course 12 Calibration. 1.Introduction In theoretic discussions, we have assumed: Camera is located at the origin of coordinate system of scene.
Geometric Models & Camera Calibration
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Geometric Camera Models
Vision Review: Image Formation Course web page: September 10, 2002.
Peripheral drift illusion. Multiple views Hartley and Zisserman Lowe stereo vision structure from motion optical flow.
Single-view geometry Odilon Redon, Cyclops, 1914.
CS-498 Computer Vision Week 7, Day 2 Camera Parameters Intrinsic Calibration  Linear  Radial Distortion (Extrinsic Calibration?) 1.
Computer Graphics 3D Transformations. Translation.
1 Chapter 2: Geometric Camera Models Objective: Formulate the geometrical relationships between image and scene measurements Scene: a 3-D function, g(x,y,z)
Geometric Transformations
Reconnaissance d’objets et vision artificielle Jean Ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Computer vision: models, learning and inference M Ahad Multiple Cameras
Computer Graphics Matrices
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Lecture 14: Projection CS4670 / 5670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Lecture 18: Cameras CS4670 / 5670: Computer Vision KavitaBala Source: S. Lazebnik.
CS682, Jana Kosecka Rigid Body Motion and Image Formation Jana Kosecka
CSCE 441 Computer Graphics 3-D Viewing
Homogeneous Coordinates (Projective Space)
Study the mathematical relations between corresponding image points.
2-D Geometry.
Geometric Camera Models
Last Time Canonical view pipeline Projection Local Coordinate Space
Single-view geometry Odilon Redon, Cyclops, 1914.
The Pinhole Camera Model
Presentation transcript:

Computer Vision : CISC4/689 Computer Graphics Output Image Model Synthetic Camera (slides courtesy of Michael Cohen) Computer Vision : CISC4/689

Computer Vision : CISC4/689 Output Model Real Scene Real Cameras (slides courtesy of Michael Cohen) Computer Vision : CISC4/689

Computer Vision : CISC4/689 Combined Output Image Model Real Scene Synthetic Camera Real Cameras (slides courtesy of Michael Cohen) Computer Vision : CISC4/689

Computer Vision : CISC4/689 Pinhole cameras Abstract camera model - box with a small hole in it Pinhole cameras work in practice The point to make here is that each point on the image plane sees light from only one direction, the one that passes through the pinhole. 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

Computer Vision : CISC4/689 Vanishing points H VPL VPR VP1 VP2 Different directions correspond to different vanishing points VP3 Marc Pollefeys Computer Vision : CISC4/689

Computer Vision : CISC4/689 Vanishing 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 don’t work vanishing points behave badly supermarket tabloids are a great source. Computer Vision : CISC4/689

Computer Vision : CISC4/689 Slide credit: David Jacobs

Properties 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 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

The equation of projection Cartesian coordinates: We have, by similar triangles, that (x, y, z) -> (f x/z, f y/z, -f) Ignore the third coordinate, and get Computer Vision : CISC4/689

Computer Vision : CISC4/689 The camera 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) Computer Vision : CISC4/689

Computer Vision : CISC4/689 Weak 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 Computer Vision : CISC4/689

Weak Perspective Projection Z 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

Computer Vision : CISC4/689 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

Computer Vision : CISC4/689 Pictorial Comparison Weak perspective Perspective Computer Vision : CISC4/689  Marc Pollefeys

Summary: Perspective Laws 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

The projection matrix for orthographic projection Computer Vision : CISC4/689

Computer Vision : CISC4/689 Affine cameras Computer Vision : CISC4/689

The Image Formation Pipeline Computer Vision : CISC4/689

Computer Vision : CISC4/689 Camera 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 Computer Vision : CISC4/689

Computer Vision : CISC4/689 Camera calibration 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 Computer Vision : CISC4/689

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

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

Computer Vision : CISC4/689 2-D Transformations Types Scaling Rotation Shear Translation Mathematical representation Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Scaling Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Scaling Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Scaling sx 1 Horizontal shift proportional to horizontal position Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Scaling sy 1 Vertical shift proportional to vertical position Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Scaling Computer Vision : CISC4/689

Matrix form of 2-D Scaling Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Scaling Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Rotation Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Rotation µ Computer Vision : CISC4/689

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

Computer Vision : CISC4/689 2-D Shear (Horizontal) Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Shear (Horizontal) Horizontal displacement proportional to vertical position Computer Vision : CISC4/689

2-D Shear (Horizontal) (Shear factor h is positive for the figure above) Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Shear (Horizontal) Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Shear (Vertical) (v is negative for the figure above) Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Translation Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Translation Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Translation Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Translation Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Translation Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Translation Computer Vision : CISC4/689

Representing Transformations Note that we’ve defined translation as a vector addition but rotation, scaling, etc. as matrix multiplications It’s 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) Computer Vision : CISC4/689

Example: “Trick” of additional coordinate makes this possible Old way: New way: Computer Vision : CISC4/689

Computer Vision : CISC4/689 Translation 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: Computer Vision : CISC4/689

Homogeneous Coordinates “Expanded” form is called homogeneous coordinates or projective space Change to projective space by adding a scale factor (usually but not always 1): Computer Vision : CISC4/689

Homogeneous 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 Computer Vision : CISC4/689

Leaving 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 f=1 (image plane) and lambda is z of any point in the ray. For different lambda’s along the line, projected point is the same, thus Equivalence class Computer Vision : CISC4/689

Homogeneous 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 results—i.e., RT  TR In homogeneous form In homogeneous form Computer Vision : CISC4/689

Example: Transformations Don’t Commute Computer Vision : CISC4/689

Example: Transformations Don’t Commute Computer Vision : CISC4/689

Example: Transformations Don’t Commute Computer Vision : CISC4/689

Example: Transformations Don’t Commute Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-D Transformations Full-generality 3 x 3 homogeneous transformation is called a homography Computer Vision : CISC4/689

2-D Transformations Full-generality 3 x 3 homogeneous transformation is called a homography Translation components Computer Vision : CISC4/689

2-D Transformations Full-generality 3 x 3 homogeneous transformation is called a homography Scale/rotation components Computer Vision : CISC4/689

2-D Transformations Full-generality 3 x 3 homogeneous transformation is called a homography Shear/rotation components Shear/rotation off-diagonal (more about relationship between shearing and rotation at http://splorg.org/people/tobin/projects/israel/projects/paeth/rotation_by_shearing.html) Computer Vision : CISC4/689

2-D Transformations Full-generality 3 x 3 homogeneous transformation is called a homography Homogeneous scaling factor Computer Vision : CISC4/689

Computer Vision : CISC4/689 2-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 Computer Vision : CISC4/689