Stereo and Epipolar geometry

Slides:



Advertisements
Similar presentations
Lecture 11: Two-view geometry
Advertisements

Stereo Vision Reading: Chapter 11
Public Library, Stereoscopic Looking Room, Chicago, by Phillips, 1923.
Gratuitous Picture US Naval Artillery Rangefinder from World War I (1918)!!
Stereo Many slides adapted from Steve Seitz. Binocular stereo Given a calibrated binocular stereo pair, fuse it to produce a depth image Where does the.
MASKS © 2004 Invitation to 3D vision Lecture 7 Step-by-Step Model Buidling.
Two-View Geometry CS Sastry and Yang
Recap from Previous Lecture Tone Mapping – Preserve local contrast or detail at the expense of large scale contrast. – Changing the brightness within.
Lecture 8: Stereo.
Stereo.
Camera calibration and epipolar geometry
Structure from motion.
Last Time Pinhole camera model, projection
Stereo. STEREOPSIS Reading: Chapter 11. The Stereopsis Problem: Fusion and Reconstruction Human Stereopsis and Random Dot Stereograms Cooperative Algorithms.
CS6670: Computer Vision Noah Snavely Lecture 17: Stereo
Multiple View Geometry : Computational Photography Alexei Efros, CMU, Fall 2005 © Martin Quinn …with a lot of slides stolen from Steve Seitz and.
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
Stereopsis Mark Twain at Pool Table", no date, UCR Museum of Photography.
The plan for today Camera matrix
CS 223b 1 More on stereo and correspondence. CS 223b 2 =?f g Mostpopular For each window, match to closest window on epipolar line in other image. (slides.
3D from multiple views : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Jianbo Shi.
Stereo and Structure from Motion
CSc D Computer Vision / Ioannis Stamos 3-D Computer Vision CSc Stereo.
3D Vision and Graphics. The Geometry of Multiple Views Motion Field Stereo Epipolar Geometry The Essential Matrix The Fundamental Matrix Structure from.
CSE473/573 – Stereo Correspondence
Announcements PS3 Due Thursday PS4 Available today, due 4/17. Quiz 2 4/24.
Multiple View Geometry : Computational Photography Alexei Efros, CMU, Fall 2006 © Martin Quinn …with a lot of slides stolen from Steve Seitz and.
3-D Scene u u’u’ Study the mathematical relations between corresponding image points. “Corresponding” means originated from the same 3D point. Objective.
Epipolar Geometry and Stereo Vision Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 04/12/11 Many slides adapted from Lana Lazebnik,
Computer Vision Spring ,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30am – 11:50am Lecture #15.
Epipolar Geometry and Stereo Vision Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/05/15 Many slides adapted from Lana Lazebnik,
Structure from images. Calibration Review: Pinhole Camera.
Lecture 12 Stereo Reconstruction II Lecture 12 Stereo Reconstruction II Mata kuliah: T Computer Vision Tahun: 2010.
Recap from Monday Image Warping – Coordinate transforms – Linear transforms expressed in matrix form – Inverse transforms useful when synthesizing images.
Stereo Vision Reading: Chapter 11 Stereo matching computes depth from two or more images Subproblems: –Calibrating camera positions. –Finding all corresponding.
Geometry 3: Stereo Reconstruction Introduction to Computer Vision Ronen Basri Weizmann Institute of Science.
Stereo Readings Szeliski, Chapter 11 (through 11.5) Single image stereogram, by Niklas EenNiklas Een.
Stereo Many slides adapted from Steve Seitz.
Stereo Many slides adapted from Steve Seitz. Binocular stereo Given a calibrated binocular stereo pair, fuse it to produce a depth image image 1image.
Computer Vision, Robert Pless
Lec 22: Stereo CS4670 / 5670: Computer Vision Kavita Bala.
EECS 274 Computer Vision Stereopsis.
Computer Vision Stereo Vision. Bahadir K. Gunturk2 Pinhole Camera.
Computer Vision Lecture #10 Hossam Abdelmunim 1 & Aly A. Farag 2 1 Computer & Systems Engineering Department, Ain Shams University, Cairo, Egypt 2 Electerical.
Bahadir K. Gunturk1 Phase Correlation Bahadir K. Gunturk2 Phase Correlation Take cross correlation Take inverse Fourier transform  Location of the impulse.
Geometric Transformations
Lecture 16: Stereo CS4670 / 5670: Computer Vision Noah Snavely Single image stereogram, by Niklas EenNiklas Een.
stereo Outline : Remind class of 3d geometry Introduction
Digital Image Processing
Solving for Stereo Correspondence Many slides drawn from Lana Lazebnik, UIUC.
Project 2 due today Project 3 out today Announcements TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAA.
Reconstruction from Two Calibrated Views Two-View Geometry
Uncalibrated reconstruction Calibration with a rig Uncalibrated epipolar geometry Ambiguities in image formation Stratified reconstruction Autocalibration.
Multiple View Geometry and Stereo. Overview Single camera geometry – Recap of Homogenous coordinates – Perspective projection model – Camera calibration.
CSE 185 Introduction to Computer Vision Stereo 2.
Stereo CS4670 / 5670: Computer Vision Noah Snavely Single image stereogram, by Niklas EenNiklas Een.
Epipolar Geometry and Stereo Vision
CS4670 / 5670: Computer Vision Kavita Bala Lec 27: Stereo.
STEREOPSIS The Stereopsis Problem: Fusion and Reconstruction
STEREOPSIS The Stereopsis Problem: Fusion and Reconstruction
Epipolar geometry.
EECS 274 Computer Vision Stereopsis.
Thanks to Richard Szeliski and George Bebis for the use of some slides
Uncalibrated Geometry & Stratification
George Mason University
Computer Vision Stereo Vision.
Chapter 11: Stereopsis Stereopsis: Fusing the pictures taken by two cameras and exploiting the difference (or disparity) between them to obtain the depth.
Stereo vision Many slides adapted from Steve Seitz.
Presentation transcript:

Stereo and Epipolar geometry Jana Kosecka CS223b

Previously Image Primitives (feature points, lines, contours) Today: How to match primitives between two (multiple) views) Goals: 3D reconstruction, recognition Stereo matching and reconstruction (canonical configuration) Epipolar Geometry (general two view setting) CS223b

2D images project 3D points into 2D: Why Stereo Vision? 2D images project 3D points into 2D: P Q P’=Q’ O center of projection 3D points on the same viewing line have the same 2D image: 2D imaging results in depth information loss CS223b

Canonical Stereo Configuration Assumes (two) cameras Known positions and focal lengths Recover depth P f O1 O2 T CS223b

Depth can be recovered by triangulation Prerequisite: Finding Correspondences Given an image point in left image, the (corresponding) point in the right image, is the point which is the projection of the same 3-D point CS223b

Random dot stereograms B. Julesz: Showed that correspondence is not needed for stereo. CS223b

Autostereograms Depth perception from one image Viewing trick the brain by focusing at the plane behind - match can be established perception of 3D CS223b

Correspondence Problem Two classes of algorithms: Correlation-based algorithms Produce a DENSE set of correspondences Feature-based algorithms Produce a SPARSE set of correspondences CS223b

Stereo – Photometric Constraint Same world point has same intensity in both images. Lambertian fronto-parallel Issues (noise, specularities, foreshortening) Difficulties – ambiguities, large changes of appearance, due to change Of viewpoint, non-uniquess CS223b

Stereo Matching What if ? For each scanline , for each pixel in the left image compare with every pixel on same epipolar line in right image pick pixel with minimum match cost This will never work, so: improvement match windows CS223b (slides O. Camps)

Comparing Windows: ? = g f Most popular For each window, match to closest window on epipolar line in other image. (slides O. Camps) CS223b

Comparing Windows: Minimize Sum of Squared Differences Maximize Cross correlation It is closely related to the SSD: CS223b

Region based Similarity Metrics Sum of squared differences Normalize cross-correlation Sum of absolute differences CS223b

NCC score for two widely separated views CS223b

Window size W = 3 W = 20 Better results with adaptive window Effect of window size smaller window: more detail, more noise bigger window: less noise, more detail Better results with adaptive window T. Kanade and M. Okutomi, A Stereo Matching Algorithm with an Adaptive Window: Theory and Experiment,, Proc. International Conference on Robotics and Automation, 1991. D. Scharstein and R. Szeliski. Stereo matching with nonlinear diffusion. International Journal of Computer Vision, 28(2):155-174, July 1998 (S. Seitz) CS223b

Data from University of Tsukuba Stereo results Data from University of Tsukuba Scene Ground truth (Seitz) CS223b

Results with window correlation Window-based matching (best window size) Ground truth (Seitz) CS223b

Results with better method State of the art Ground truth Boykov et al., Fast Approximate Energy Minimization via Graph Cuts, International Conference on Computer Vision, September 1999. (Seitz) CS223b

More of advanced stereo Ordering constraint Dynamic programming Global optimization – next lecture CS223b

Two view – General Configuration Motion between the two views is not known Given two views of the scene recover the unknown camera displacement and 3D scene structure CS223b

Pinhole Camera Imaging Model 3D points Image points Perspective Projection Rigid Body Motion Rigid Body Motion + Persp. projection CS223b

Rigid Body Motion – Two Views CS223b

3D Structure and Motion Recovery Euclidean transformation Measurements Corresponding points unknowns Find such Rotation and Translation and Depth that the reprojection error is minimized Two views ~ 200 points 6 unknowns – Motion 3 Rotation, 3 Translation - Structure 200x3 coordinates - (-) universal scale Difficult optimization problem CS223b

Notation Cross product between two vectors in where CS223b

Epipolar Geometry Algebraic Elimination of Depth Essential matrix Image correspondences Algebraic Elimination of Depth [Longuet-Higgins ’81]: Essential matrix CS223b

Additional constraints Epipolar Geometry Epipolar lines Epipoles Image correspondences Epipolar transfer Additional constraints CS223b

Characterization of Essential Matrix special 3x3 matrix (Essential Matrix Characterization) A non-zero matrix is an essential matrix iff its SVD: satisfies: with and and CS223b

Estimating Essential Matrix Find such Rotation and Translation that the epipolar error is minimized Space of all Essential Matrices is 5 dimensional 3 DOF Rotation, 2 DOF – Translation (up to scale !) Denote Rewrite Collect constraints from all points CS223b

Estimating Essential Matrix Solution Eigenvector associated with the smallest eigenvalue of If degenerate configuration estimated using linear least squares unstack -> Projection on to Essential Space (Project onto a space of Essential Matrices) If the SVD of a matrix is given by then the essential matrix which minimizes the Frobenius distance is given by with CS223b

Pose Recovery from Essential Matrix There are two relative poses with and corresponding to a non-zero matrix essential matrix. Twisted pair ambiguity CS223b

Two view linear algorithm - summary Solve the LLSE problem: Solution eigenvector associated with smallest eigenvalue of Compute SVD of F recovered from data E is 5 diml. sub. mnfld. in 8-point linear algorithm Project onto the essential manifold: Recover the unknown pose: CS223b

Pose Recovery There are two pairs corresponding to essential matrix . Positive depth constraint disambiguates the impossible solutions Translation has to be non-zero Points have to be in general position - degenerate configurations – planar points - quadratic surface Linear 8-point algorithm Nonlinear 5-point algorithms yields up to 10 solutions CS223b

3D Structure Recovery Eliminate one of the scale’s Solve LLSE problem unknowns Eliminate one of the scale’s Solve LLSE problem Alternatively recover each point depth separately If the configuration is non-critical, the Euclidean structure of the points and motion of the camera can be reconstructed up to a universal scale. CS223b

Example Two views Point Feature Matching CS223b

Sparse Structure Recovery Example Epipolar Geometry Camera Pose and Sparse Structure Recovery CS223b

Epipolar Geometry - Planar case Plane in first camera coordinate frame Image correspondences Planar homography Linear mapping relating two corresponding planar points in two views CS223b

Decomposition of H (into motion and plane normal) Algebraic elimination of depth can be estimated linearly Normalization of Decomposition of H into 4 solutions CS223b

Uncalibrated Camera calibrated coordinates Linear transformation pixel CS223b

Uncalibrated Epipolar Geometry Epipolar constraint Fundamental matrix CS223b

Properties of the Fundamental Matrix Epipolar lines Epipoles Image correspondences CS223b

Epipolar Geometry for Parallel Cameras Epipoles are at infinite Epipolar lines are parallel to the baseline CS223b

Properties of the Fundamental Matrix A nonzero matrix is a fundamental matrix if has a singular value decomposition (SVD) with for some . There is little structure in the matrix except that CS223b

Estimating Fundamental Matrix Find such F that the epipolar error is minimized Pixel coordinates Fundamental matrix can be estimated up to scale Denote Rewrite Collect constraints from all points CS223b

Two view linear algorithm – 8-point algorithm Solve the LLSE problem: Solution eigenvector associated with smallest eigenvalue of Compute SVD of F recovered from data Project onto the essential manifold: cannot be unambiguously decomposed into pose and calibration CS223b

Projective Reconstruction Euclidean Motion Cannot be obtained in uncalibrated setting (F cannot be uniquely decomposed into R,T and K matrix) Can we still say something about 3D ? Notion of the projective 3D structure (study of projective geometry) Euclidean reconstruction Projective reconstruction CS223b

Euclidean vs Projective reconstruction Euclidean reconstruction – true metric properties of objects lenghts (distances), angles, parallelism are preserved Unchanged under rigid body transformations => Euclidean Geometry – properties of rigid bodies under rigid body transformations, similarity transformation Projective reconstruction – lengths, angles, parallelism are NOT preserved – we get distorted images of objects – their distorted 3D counterparts --> 3D projective reconstruction => Projective Geometry CS223b

Image rectification Given general displacement how to warp the views Such that epipolar lines are parallel to each other How to warp it back to canonical configuration (more details later) (Seitz) CS223b

Epipolar rectification Rectified Image Pair Corresponding epipolar lines are aligned with the scan-lines Search for dense correspondence is a 1D search CS223b

Epipolar rectification Rectified Image Pair CS223b

Special Motions – Pure Rotation Calibrated Two views related by rotation only Uncalibrated Case Mapping to a reference view – H can be estimated Mapping to a cylindrical surface - applications – image mosaics CS223b

Epipolar rectification Rectified Image Pair Corresponding epipolar lines are aligned with the scan-lines Search for dense correspondence is a 1D search CS223b

Using H p’ p Image based rectification (given some points in 3D world) compute H which would map them into a square Use H to rectify the entire image In calibrated case inter-image homography CS223b

Single view modeling in projective setting Vermeer’s Music Lesson Planes and distances from the planes can be computed Single view Rendering (A. Crimisi) CS223b

More on stereo CS223b

Usually, order of points in two images is same. Is this always true? Ordering constraint Usually, order of points in two images is same. Is this always true? If we match pixel i in image 1 to pixel j in image 2, no matches that follow will affect which are the best preceding matches. Example with pixels (a la Cox et al.). CS223b

The Ordering Constraint Points on the epipolar lines appear in the same order But it is not always the case ... This enables dynamic programming CS223b

Dynamic Programming (Baker and Binford, 1981) Find the minimum-cost path going monotonically down and right from the top-left corner of the graph to its bottom-right corner. Nodes = matched feature points (e.g., edge points). Arcs = matched intervals along the epipolar lines. Arc cost = discrepancy between intervals. CS223b

Dynamic Programming (Baker and Binford, 1981) Find the minimum-cost path going monotonically down and right from the top-left corner of the graph to its bottom-right corner. Nodes = matched feature points (e.g., edge points). Arcs = matched intervals along the epipolar lines. Arc cost = discrepancy between intervals. CS223b

Dynamic Programming (Ohta and Kanade, 1985) CS223b Reprinted from “Stereo by Intra- and Intet-Scanline Search,” by Y. Ohta and T. Kanade, IEEE Trans. on Pattern Analysis and Machine Intelligence, 7(2):139-154 (1985).  1985 IEEE.

Other constraints Smoothness: disparity usually doesn’t change too quickly. Unfortunately, this makes the problem 2D again. Solved with a host of graph algorithms, Markov Random Fields, Belief Propagation, …. Uniqueness constraint (each feature can at most have one match) Occlusion and disparity are connected. CS223b