Multiple View Geometry

Slides:



Advertisements
Similar presentations
Epipolar Geometry.
Advertisements

3D reconstruction.
MASKS © 2004 Invitation to 3D vision Lecture 7 Step-by-Step Model Buidling.
Robot Vision SS 2005 Matthias Rüther 1 ROBOT VISION Lesson 3: Projective Geometry Matthias Rüther Slides courtesy of Marc Pollefeys Department of Computer.
Self-calibration.
Two-view geometry.
Recovering metric and affine properties from images
Epipolar Geometry class 11 Multiple View Geometry Comp Marc Pollefeys.
Camera calibration and epipolar geometry
Structure from motion.
Self-calibration and multi-view geometry Class 10 Read Chapter 6 and 3.2.
Recovering metric and affine properties from images
Multiple View Geometry
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Robot Vision SS 2008 Matthias Rüther 1 ROBOT VISION Lesson 6: Shape from Stereo Matthias Rüther Slides partial courtesy of Marc Pollefeys Department of.
Epipolar Geometry Class 7 Read notes Feature tracking run iterative L-K warp & upsample Tracking Good features Multi-scale Transl. Affine.
3D reconstruction class 11
Parameter estimation class 5 Multiple View Geometry Comp Marc Pollefeys.
Projective geometry- 2D Acknowledgements Marc Pollefeys: for allowing the use of his excellent slides on this topic
Computing F Class 8 Read notes Section 4.2. C1C1 C2C2 l2l2  l1l1 e1e1 e2e2 Fundamental matrix (3x3 rank 2 matrix) 1.Computable from corresponding points.
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
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Self-calibration Class 21 Multiple View Geometry Comp Marc Pollefeys.
Multiple View Geometry Comp Marc Pollefeys
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Multiple View Geometry
Projective 3D geometry. Singular Value Decomposition.
Two-view geometry Epipolar geometry F-matrix comp. 3D reconstruction Structure comp.
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
3D photography Marc Pollefeys Fall 2007
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Projective Geometry and Camera model Class 2
CMPUT 412 3D Computer Vision Presented by Azad Shademan Feb , 2007.
Assignment 2 Compute F automatically from image pair (putative matches, 8-point, 7-point, iterative, RANSAC, guided matching) (due by Wednesday 19/03/03)
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
3D photography Marc Pollefeys Fall 2004 / Comp Tue & Thu 9:30-10:45
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Projective 2D geometry course 2 Multiple View Geometry Comp Marc Pollefeys.
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Epipolar geometry Class 5. Geometric Computer Vision course schedule (tentative) LectureExercise Sept 16Introduction- Sept 23Geometry & Camera modelCamera.
Multi-view geometry. Multi-view geometry problems Structure: Given projections of the same 3D point in two or more images, compute the 3D coordinates.
Automatic Camera Calibration
Epipolar geometry The fundamental matrix and the tensor
Projective cameras Motivation Elements of Projective Geometry Projective structure from motion Planches : –
Structure from Motion Course web page: vision.cis.udel.edu/~cv April 25, 2003  Lecture 26.
Projective 3D geometry class 4
Robot Vision SS 2007 Matthias Rüther 1 ROBOT VISION Lesson 6a: Shape from Stereo, short summary Matthias Rüther Slides partial courtesy of Marc Pollefeys.
Two-view geometry Epipolar geometry F-matrix comp. 3D reconstruction
Computing F. Content Background: Projective geometry (2D, 3D), Parameter estimation, Algorithm evaluation. Single View: Camera model, Calibration, Single.
Parameter estimation. 2D homography Given a set of (x i,x i ’), compute H (x i ’=Hx i ) 3D to 2D camera projection Given a set of (X i,x i ), compute.
A Flexible New Technique for Camera Calibration Zhengyou Zhang Sung Huh CSPS 643 Individual Presentation 1 February 25,
Two-view geometry. Epipolar Plane – plane containing baseline (1D family) Epipoles = intersections of baseline with image planes = projections of the.
Auto-calibration we have just calibrated using a calibration object –another calibration object is the Tsai grid of Figure 7.1 on HZ182, which can be used.
Uncalibrated reconstruction Calibration with a rig Uncalibrated epipolar geometry Ambiguities in image formation Stratified reconstruction Autocalibration.
Structure from motion Multi-view geometry Affine structure from motion Projective structure from motion Planches : –
Parameter estimation class 5 Multiple View Geometry CPSC 689 Slides modified from Marc Pollefeys’ Comp
Projective 2D geometry course 2 Multiple View Geometry Comp Marc Pollefeys.
Parameter estimation class 5
Epipolar geometry.
Epipolar Geometry class 11
3D Photography: Epipolar geometry
Multiple View Geometry Comp Marc Pollefeys
Estimating 2-view relationships
3D reconstruction class 11
Uncalibrated Geometry & Stratification
Parameter estimation class 6
Presentation transcript:

Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai

Tutorial outline Image formation 2-D and 3-D projective geometry and transformations Finite perspective camera model Parameter estimation and RANSAC Epipolar geometry and the fundamental matrix 3-D reconstruction (stratification) Image rectification Feature matching Self-calibration

Outline Perspective projection 3D projective geometry Parameter estimation Epipolar geometry and the fundamental matrix 3D reconstruction and self-calibration

Visual 3D models from images and video What can be achieved? unknown scene unknown camera Scene (static) camera unknown motion automatic modelling Visual model

(Pollefeys et al. ICCV’98; … Pollefeys et al.’IJCV04)

Perspective projection Linear equations (in homogeneous coordinates)

Homogeneous coordinates 2-D points represented as 3-D vectors (x y 1)T 3-D points represented as 4-D vectors (X Y Z 1)T Equality defined up to scale (X Y Z 1)T ~ (WX WY WZ W)T Useful for perspective projection  makes equations linear C m M1 M2

The pinhole camera

Effects of perspective projection Colinearity is invariant Parallelism is not preserved

Intrinsic parameters Camera deviates from pinhole Usually: or s: skew fx ≠ fy: different magnification in x and y (cx cy): optical axis does not pierce image plane exactly at the center Usually: rectangular pixels: square pixels: principal point known:

Extrinsic parameters Scene motion Camera motion

Projection matrix Mapping from 2-D to 3-D is a function of internal and external parameters

Ideal points and the line at infinity Intersections of parallel lines Example tangent vector normal direction WEEK 2 move camera stuff after this Ideal points Line at infinity Note that in P2 there is no distinction between ideal points and others

Duality in 2D Duality principle: To any theorem of 2-dimensional projective geometry there corresponds a dual theorem, which may be derived by interchanging the role of points and lines in the original theorem

Outline Perspective projection 3D projective geometry Parameter estimation Epipolar geometry and the fundamental matrix 3D reconstruction and self-calibration

3D Projective Geometry Points, lines, planes and quadrics Transformations П∞, ω∞ and Ω ∞

3D points 3D point in R3 in P3 projective transformation (4x4-1=15 dof)

Planes 3D plane Transformation Euclidean representation Dual: points ↔ planes, lines ↔ lines

Planes from points Or implicitly from coplanarity condition (solve as right nullspace of ) Or implicitly from coplanarity condition

Hierarchy of transformations Projective 15dof Intersection and tangency Parallellism of planes, Volume ratios, centroids, The plane at infinity π∞ Affine 12dof Similarity 7dof The absolute conic Ω∞ Euclidean 6dof Volume

The plane at infinity The plane at infinity π is a fixed plane under a projective transformation H iff H is an affinity canical position contains directions two planes are parallel  line of intersection in π∞ line // line (or plane)  point of intersection in π∞

The absolute conic The absolute conic Ω∞ is a (point) conic on π. In a metric frame: or conic for directions: (with no real points) The absolute conic Ω∞ is a fixed conic under the projective transformation H iff H is a similarity Ω∞ is only fixed as a set Circles intersect Ω∞ in two points Spheres intersect π∞ in Ω∞

Transformation of lines and conics For a point transformation Transformation for lines Transformation for conics Transformation for dual conics

Outline Perspective projection 3D projective geometry Parameter estimation Epipolar geometry and the fundamental matrix 3D reconstruction and self-calibration

Parameter estimation 2D homography 3D to 2D camera projection Given a set of (xi,xi’), compute H (xi’=Hxi) 3D to 2D camera projection Given a set of (Xi,xi), compute P (xi=PXi) Fundamental matrix Given a set of (xi,xi’), compute F (xi’TFxi=0) Trifocal tensor Given a set of (xi,xi’,xi”), compute T

Number of measurements required At least as many independent equations as degrees of freedom required Example: 2 independent equations / point 8 degrees of freedom 4x2≥8

Algebraic distance DLT minimizes residual vector partial vector for each (xi↔xi’) algebraic error vector algebraic distance Not geometrically/statistically meaningfull, but given good normalization it works fine and is very fast (use for initialization)

Geometric distance d(.,.) Euclidean distance (in image) measured coordinates estimated coordinates true coordinates d(.,.) Euclidean distance (in image) Error in one image e.g. calibration pattern Symmetric transfer error Reprojection error

Sampson error between algebraic and geometric error Vector that minimizes the geometric error is the closest point on the variety to the measurement Sampson error: 1st order approximation of Find the vector that minimizes subject to (Sampson error)

RANSAC Objective Robust fit of model to data set S which contains outliers Algorithm Randomly select a sample of s data points from S and instantiate the model from this subset. Determine the set of data points Si which are within a distance threshold t of the model. The set Si is the consensus set of samples and defines the inliers of S. If the subset of Si is greater than some threshold T, re-estimate the model using all the points in Si and terminate If the size of Si is less than T, select a new subset and repeat the above. After N trials the largest consensus set Si is selected, and the model is re-estimated using all the points in the subset Si

proportion of outliers e How many samples? Choose t so probability for inlier is α (e.g. 0.95) Or empirically Choose N so that, with probability p, at least one random sample is free from outliers. e.g. p =0.99 proportion of outliers e s 5% 10% 20% 25% 30% 40% 50% 2 3 5 6 7 11 17 4 9 19 35 13 34 72 12 26 57 146 16 24 37 97 293 8 20 33 54 163 588 44 78 272 1177

Outline Perspective projection 3D projective geometry Parameter estimation Epipolar geometry and the fundamental matrix 3D reconstruction and self-calibration

The fundamental matrix F geometric derivation mapping from 2-D to 1-D family (rank 2)

The fundamental matrix F (note: doesn’t work for C=C’  F=0)

The fundamental matrix F F is the unique 3x3 rank 2 matrix that satisfies x’TFx=0 for all x↔x’ Transpose: if F is fundamental matrix for (P,P’), then FT is fundamental matrix for (P’,P) Epipolar lines: l’=Fx & l=FTx’ Epipoles: on all epipolar lines, thus e’TFx=0, x e’TF=0, similarly Fe=0 F has 7 d.o.f. , i.e. 3x3-1(homogeneous)-1(rank2) F is a correlation, projective mapping from a point x to a line l’=Fx (not a proper correlation, i.e. not invertible)

Projective transformation and invariance Derivation based purely on projective concepts F invariant to transformations of projective 3-space unique not unique canonical form

The singularity constraint SVD from linearly computed F matrix (rank 3) Compute closest rank-2 approximation

The NOT normalized 8-point algorithm ~10000 ~100 1 ! Orders of magnitude difference between column of data matrix  least-squares yields poor results

The normalized 8-point algorithm Transform image to ~[-1,1]x[-1,1] (0,500) (1,-1) (0,0) (1,1) (-1,1) (-1,-1) normalized least squares yields good results (Hartley, PAMI´97) (700,500) (0,0) (700,0)

(overparametrized F=[t]xM) Gold standard Maximum Likelihood Estimation (= least-squares for Gaussian noise) Initialize: normalized 8-point, (P,P‘) from F, reconstruct Xi Parameterize: (overparametrized F=[t]xM) Minimize cost using Levenberg-Marquardt (preferably sparse LM, see book)

Automatic computation of F Interest points Putative correspondences RANSAC (iv) Non-linear re-estimation of F Guided matching (repeat (iv) and (v) until stable)

Image pair rectification simplify stereo matching by warping the images Apply projective transformation so that epipolar lines correspond to horizontal scanlines e e map epipole e to (1,0,0) try to minimize image distortion problem when epipole in (or close to) the image

Planar rectification (standard approach) (calibrated) Bring two views ~ image size (calibrated) Distortion minimization (uncalibrated) Bring two views to standard stereo setup (moves epipole to ) (not possible when in/close to image)

Polar rectification Polar re-parameterization around epipoles (Pollefeys et al. ICCV’99) Polar re-parameterization around epipoles Requires only (oriented) epipolar geometry Preserve length of epipolar lines Choose  so that no pixels are compressed original image rectified image Works for all relative motions Guarantees minimal image size

Polar rectification: example

polar rectification: example

Outline Perspective projection 3D projective geometry Parameter estimation Epipolar geometry and the fundamental matrix 3D reconstruction and self-calibration

Reconstruction problem given xi↔x‘i , compute P,P‘ and Xi for all i without additional information possible up to projective ambiguity

Outline of reconstruction Compute F from correspondences Compute camera matrices from F Compute 3D point for each pair of corresponding points computation of F use x‘iFxi=0 equations, linear in coeff. F 8 points (linear), 7 points (non-linear), 8+ (least-squares) (more on this next class) computation of camera matrices use triangulation compute intersection of two backprojected rays

Reconstruction ambiguity: similarity

Reconstruction ambiguity: projective

The projective reconstruction theorem If a set of point correspondences in two views determine the fundamental matrix uniquely, then the scene and cameras may be reconstructed from these correspondences alone, and any two such reconstructions from these correspondences are projectively equivalent along same ray of P2, idem for P‘2 two possibilities: X2i=HX1i, or points along baseline key result: allows reconstruction from pair of uncalibrated images

Stratified reconstruction Projective reconstruction Affine reconstruction Metric reconstruction

Projective to affine theorem says up to projective transformation, (if D≠0) theorem says up to projective transformation, but projective with fixed p∞ is affine transformation can be sufficient depending on application, e.g. mid-point, centroid, parallellism

Scene constraints Parallel lines parallel lines intersect at infinity reconstruction of corresponding vanishing point yields point on plane at infinity 3 sets of parallel lines allow to uniquely determine p∞ remark: in presence of noise determining the intersection of parallel lines is a delicate problem remark: obtaining vanishing point in one image can be sufficient

Affine to metric identify absolute conic transform so that then projective transformation relating original and reconstruction is a similarity transformation in practice, find image of W∞ image w∞ back-projects to cone that intersects p∞ in W∞ * * projection constraints note that image is independent of particular reconstruction

vanishing points corresponding to orthogonal directions Orthogonality vanishing points corresponding to orthogonal directions vanishing line and vanishing point corresponding to plane and normal direction

Known internal parameters rectangular pixels square pixels

Same camera for all images same intrinsics  same image of the absolute conic e.g. moving camera given sufficient images there is in general only one conic that projects to the same image in all images, i.e. the absolute conic This approach is called self-calibration transfer of IAC: provides 4 constraints, one more needed

Constraints for Reconstruction Scene constraints Parallellism, vanishing points, horizon, ... Distances, positions, angles, ... Unknown scene  no constraints Camera extrinsics constraints Pose, orientation, ... Unknown camera motion  no constraints Camera intrinsics constraints Focal length, principal point, aspect ratio & skew Perspective camera model too general  some constraints

Constraints on intrinsic parameters Constant e.g. fixed camera: Known e.g. rectangular pixels: square pixels: principal point known:

Self-calibration Upgrade from projective structure to metric structure using constraints on intrinsic camera parameters Constant intrinsics Some known intrinsics, others varying Constraints on intrincs and restricted motion (e.g. pure translation, pure rotation, planar motion) (Faugeras et al. ECCV´92, Hartley´93, Triggs´97, Pollefeys et al. PAMI´99, ...) (Heyden&Astrom CVPR´97, Pollefeys et al. ICCV´98,...) (Moons et al.´94, Hartley ´94, Armstrong ECCV´96, ...)

The Absolute Conic  is a specific imaginary conic on , for metric frame or Remember, the absolute conic is fixed under H if, and only if, H is a similarity transformation Image related to intrinsics

The Absolute Dual Quadric (Triggs CVPR´97) Degenerate dual quadric * Encodes both absolute conic  and    * for metric frame:

Absolute Dual Quadric and Self-calibration Eliminate extrinsics from equation Equivalent to projection of dual quadric Abs.Dual Quadric also exists in projective world Transforming world so that reduces ambiguity to metric

Constraints on * condition constraint type #constraints m 2m m-1 Zero skew quadratic m Principal point linear 2m Zero skew (& p.p.) Fixed aspect ratio (& p.p.& Skew) m-1 Known aspect ratio (& p.p.& Skew) Focal length (& p.p. & Skew)

(Pollefeys et al.,ICCV´98/IJCV´99) Linear algorithm (Pollefeys et al.,ICCV´98/IJCV´99) Assume everything known, except focal length Yields 4 constraint per image Note that rank-3 constraint is not enforced

Linear algorithm revisited (Pollefeys et al., ECCV‘02) Weighted linear equations assumptions

Projective to metric Compute T from using eigenvalue decomposition of and then obtain metric reconstruction as