Computer vision: models, learning and inference

Slides:



Advertisements
Similar presentations
Zhengyou Zhang Vision Technology Group Microsoft Research
Advertisements

Computer vision: models, learning and inference
Single-view geometry Odilon Redon, Cyclops, 1914.
3D reconstruction.
Last 4 lectures Camera Structure HDR Image Filtering Image Transform.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Two-view geometry.
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.
Structure from motion.
3D Geometry and Camera Calibration. 3D Coordinate Systems Right-handed vs. left-handedRight-handed vs. left-handed x yz x yz.
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
MSU CSE 240 Fall 2003 Stockman CV: 3D to 2D mathematics Perspective transformation; camera calibration; stereo computation; and more.
Used slides/content with permission from
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
COMP322/S2000/L221 Relationship between part, camera, and robot (cont’d) the inverse perspective transformation which is dependent on the focal length.
Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Stanford CS223B Computer Vision, Winter 2007 Lecture 4 Camera Calibration Professors.
Previously Two view geometry: epipolar geometry Stereo vision: 3D reconstruction epipolar lines Baseline O O’ epipolar plane.
Single-view geometry Odilon Redon, Cyclops, 1914.
The Pinhole Camera Model
Projected image of a cube. Classical Calibration.
CSCE 641 Computer Graphics: Image-based Modeling (Cont.) Jinxiang Chai.
Camera parameters Extrinisic parameters define location and orientation of camera reference frame with respect to world frame Intrinsic parameters define.
Camera Parameters and Calibration. Camera parameters From last time….
CSCE 641 Computer Graphics: Image-based Modeling (Cont.) Jinxiang Chai.
Cameras, lenses, and calibration
Structure Computation. How to compute the position of a point in 3- space given its image in two views and the camera matrices of those two views Use.
CS 558 C OMPUTER V ISION Lecture IX: Dimensionality Reduction.
Sebastian Thrun CS223B Computer Vision, Winter Stanford CS223B Computer Vision, Winter 2006 Lecture 4 Camera Calibration Professor Sebastian Thrun.
Multi-view geometry. Multi-view geometry problems Structure: Given projections of the same 3D point in two or more images, compute the 3D coordinates.
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
Computer vision: models, learning and inference
Camera Geometry and Calibration Thanks to Martial Hebert.
Multi-view geometry.
Epipolar geometry The fundamental matrix and the tensor
© 2005 Yusuf Akgul Gebze Institute of Technology Department of Computer Engineering Computer Vision Geometric Camera Calibration.
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.
Geometric Camera Models and Camera Calibration
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
CSCE 643 Computer Vision: Structure from Motion
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.
Lecture 03 15/11/2011 Shai Avidan הבהרה : החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
Affine Structure from Motion
Single-view geometry Odilon Redon, Cyclops, 1914.
Ch. 3: Geometric Camera Calibration
CS-498 Computer Vision Week 7, Day 2 Camera Parameters Intrinsic Calibration  Linear  Radial Distortion (Extrinsic Calibration?) 1.
EECS 274 Computer Vision Affine Structure from Motion.
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)
Computer vision: models, learning and inference M Ahad Multiple Cameras
Camera Model Calibration
Single-view geometry Odilon Redon, Cyclops, 1914.
Camera Calibration Course web page: vision.cis.udel.edu/cv March 24, 2003  Lecture 17.
Computer vision: geometric models Md. Atiqur Rahman Ahad Based on: Computer vision: models, learning and inference. ©2011 Simon J.D. Prince.
Multi-view geometry. Multi-view geometry problems Structure: Given projections of the same 3D point in two or more images, compute the 3D coordinates.
Lecture 16: Image alignment
Calibrating a single camera
Computer vision: models, learning and inference
Depth from disparity (x´,y´)=(x+D(x,y), y)
Epipolar geometry.
Geometric Camera Models
Multiple View Geometry for Robotics
Single-view geometry Odilon Redon, Cyclops, 1914.
The Pinhole Camera Model
Presentation transcript:

Computer vision: models, learning and inference Chapter 14 The pinhole camera

Structure Pinhole camera model Three geometric problems Homogeneous coordinates Solving the problems Exterior orientation problem Camera calibration 3D reconstruction Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 2

Motivation Sparse stereo reconstruction Compute the depth at a set of sparse matching points Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Instead model impossible but more convenient virtual image Pinhole camera Instead model impossible but more convenient virtual image Real camera image is inverted Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Pinhole camera terminology Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Normalized Camera By similar triangles: Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Focal length parameters Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Focal length parameters Can model both the effect of the distance to the focal plane the density of the receptors with a single focal length parameter f In practice, the receptors may not be square: So use different focal length parameter for x and y dims Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Offset parameters Current model assumes that pixel (0,0) is where the principal ray strikes the image plane (i.e. the center) Model offset to center Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Skew parameter Finally, add skew parameter Accounts for image plane being not exactly perpendicular to the principal ray Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Position and orientation of camera Position w=(u,v,w)T of point in the world is generally not expressed in the frame of reference of the camera. Transform using 3D transformation or Point in frame of reference of camera Point in frame of reference of world Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Complete pinhole camera model Intrinsic parameters (stored as intrinsic matrix) Extrinsic parameters Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Complete pinhole camera model For short: Add noise – uncertainty in localizing feature in image Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Radial distortion Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Pinhole camera model Three geometric problems Homogeneous coordinates Solving the problems Exterior orientation problem Camera calibration 3D reconstruction Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 15

Problem 1: Learning extrinsic parameters (exterior orientation) Use maximum likelihood: Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Problem 2 – Learning intrinsic parameters (calibration) Use maximum likelihood: Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Calibration Use 3D target with known 3D points Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Problem 3 – Inferring 3D points (triangulation / reconstruction) Use maximum likelihood: TO Change Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Solving the problems None of these problems can be solved in closed form Can apply non-linear optimization to find best solution but slow and prone to local minima Solution – convert to a new representation (homogeneous coordinates) where we can solve in closed form. Caution! We are not solving the true problem – finding global minimum of wrong* problem. But can use as starting point for non-linear optimization of true problem *= We’ll first minimize algebraic error, instead of geometric error (see Minimizing Algebraic Error in Geometric Estimation Problems, Hartley 1998) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Pinhole camera model Three geometric problems Homogeneous coordinates Solving the problems Exterior orientation problem Camera calibration 3D reconstruction Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 21

Homogeneous coordinates Convert 2D coordinate to 3D To convert back Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Geometric interpretation of homogeneous coordinates Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Pinhole camera in homogeneous coordinates Camera model: In homogeneous coordinates: (linear!) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Pinhole camera in homogeneous coordinates Writing out these three equations Eliminate l to retrieve original equations Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Adding in extrinsic parameters Or for short: Or even shorter: Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Pinhole camera model Three geometric problems Homogeneous coordinates Solving the problems Exterior orientation problem Camera calibration 3D reconstruction Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 27

Problem 1: Learning extrinsic parameters (exterior orientation) Use maximum likelihood: Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Exterior orientation Start with camera equation in homogeneous coordinates Pre-multiply both sides by inverse of camera calibration matrix Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 29

Exterior orientation The third equation gives us an expression for l Substitute back into first two lines Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 30

Exterior orientation Linear equation – two equations per point – form system of equations Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 31

Exterior orientation Minimum direction problem of the form , Find minimum of subject to . To solve, compute the SVD and then set to the last column of . Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 32

Exterior orientation Now we extract the values of and from . Problem: the scale is arbitrary and the rows and columns of the rotation matrix may not be orthogonal. Solution: compute SVD and then choose . Use the ratio between the rotation matrix before and after to rescale Use these estimates for start of non-linear optimisation. Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 33

Structure Pinhole camera model Three geometric problems Homogeneous coordinates Solving the problems Exterior orientation problem Camera calibration 3D reconstruction Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 34

Problem 2 – Learning intrinsic parameters (calibration) Use maximum likelihood: Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Calibration One approach (not very efficient) is to alternately Optimize extrinsic parameters for fixed intrinsic Optimize intrinsic parameters for fixed extrinsic ( Then use non-linear optimization ) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Intrinsic parameters Maximum likelihood approach This is a least squares problem. Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Intrinsic parameters The function is linear w.r.t. intrinsic parameters. Can be written in form Now solve least squares problem Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Pinhole camera model Three geometric problems Homogeneous coordinates Solving the problems Exterior orientation problem Camera calibration 3D reconstruction Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 39

Problem 3 – Inferring 3D points (triangulation / reconstruction) Use maximum likelihood: Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Reconstruction Write jth pinhole camera in homogeneous coordinates: Pre-multiply with inverse of intrinsic matrix Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Reconstruction Last equations gives Substitute back into first two equations Re-arranging get two linear equations for [u,v,w] Solve using >1 cameras and then use non-linear optimization Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Structure Pinhole camera model Three geometric problems Homogeneous coordinates Solving the problems Exterior orientation problem Camera calibration 3D reconstruction Applications Computer vision: models, learning and inference. ©2011 Simon J.D. Prince 43

Depth from structured light Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Depth from structured light Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Depth from structured light Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Shape from silhouette Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Shape from silhouette Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Shape from silhouette Computer vision: models, learning and inference. ©2011 Simon J.D. Prince

Conclusion Pinhole camera model is a non-linear function that takes points in 3D world and finds where they map to in image Parameterized by intrinsic and extrinsic matrices Difficult to estimate intrinsic/extrinsic/depth because non-linear Use homogeneous coordinates where we can get closed form solutions (initial sol’ns only) Computer vision: models, learning and inference. ©2011 Simon J.D. Prince