55:148 Digital Image Processing Chapter 11 3D Vision, Geometry

Slides:



Advertisements
Similar presentations
Epipolar Geometry.
Advertisements

The fundamental matrix F
Lecture 11: Two-view geometry
MASKS © 2004 Invitation to 3D vision Lecture 7 Step-by-Step Model Buidling.
Two-View Geometry CS Sastry and Yang
Two-view geometry.
Lecture 8: Stereo.
Camera calibration and epipolar geometry
Structure from motion.
Computer Vision : CISC 4/689
Stanford CS223B Computer Vision, Winter 2005 Lecture 5: Stereo I Sebastian Thrun, Stanford Rick Szeliski, Microsoft Hendrik Dahlkamp and Dan Morris, Stanford.
Stanford CS223B Computer Vision, Winter 2006 Lecture 5 Stereo I
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
Lecture 21: Multiple-view geometry and structure from motion
Multiple-view Reconstruction from Points and Lines
© 2003 by Davi GeigerComputer Vision October 2003 L1.1 Structure-from-EgoMotion (based on notes from David Jacobs, CS-Maryland) Determining the 3-D structure.
Previously Two view geometry: epipolar geometry Stereo vision: 3D reconstruction epipolar lines Baseline O O’ epipolar plane.
Lecture 20: Two-view geometry CS6670: Computer Vision Noah Snavely.
3D Computer Vision and Video Computing 3D Vision Lecture 14 Stereo Vision (I) CSC 59866CD Fall 2004 Zhigang Zhu, NAC 8/203A
Projected image of a cube. Classical Calibration.
May 2004Stereo1 Introduction to Computer Vision CS / ECE 181B Tuesday, May 11, 2004  Multiple view geometry and stereo  Handout #6 available (check with.
Lec 21: Fundamental Matrix
Camera parameters Extrinisic parameters define location and orientation of camera reference frame with respect to world frame Intrinsic parameters define.
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.
55:148 Digital Image Processing Chapter 11 3D Vision, Geometry Topics: Basics of projective geometry Points and hyperplanes in projective space Homography.
3-D Scene u u’u’ Study the mathematical relations between corresponding image points. “Corresponding” means originated from the same 3D point. Objective.
55:148 Digital Image Processing Chapter 11 3D Vision, Geometry Topics: Basics of projective geometry Points and hyperplanes in projective space Homography.
CSE 6367 Computer Vision Stereo Reconstruction Camera Coordinate Transformations “Everything should be made as simple as possible, but not simpler.” Albert.
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.
Automatic Camera Calibration
Computer vision: models, learning and inference
Lecture 11 Stereo Reconstruction I Lecture 11 Stereo Reconstruction I Mata kuliah: T Computer Vision Tahun: 2010.
Multi-view geometry.
Projective cameras Motivation Elements of Projective Geometry Projective structure from motion Planches : –
© 2005 Yusuf Akgul Gebze Institute of Technology Department of Computer Engineering Computer Vision Geometric Camera Calibration.
Course 12 Calibration. 1.Introduction In theoretic discussions, we have assumed: Camera is located at the origin of coordinate system of scene.
Epipolar geometry Epipolar Plane Baseline Epipoles Epipolar Lines
Lecture 04 22/11/2011 Shai Avidan הבהרה : החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
Multiview Geometry and Stereopsis. Inputs: two images of a scene (taken from 2 viewpoints). Output: Depth map. Inputs: multiple images of a scene. Output:
Stereo Course web page: vision.cis.udel.edu/~cv April 11, 2003  Lecture 21.
Announcements Project 3 due Thursday by 11:59pm Demos on Friday; signup on CMS Prelim to be distributed in class Friday, due Wednesday by the beginning.
Two-view geometry. Epipolar Plane – plane containing baseline (1D family) Epipoles = intersections of baseline with image planes = projections of the.
stereo Outline : Remind class of 3d geometry Introduction
Feature Matching. Feature Space Outlier Rejection.
55:148 Digital Image Processing Chapter 11 3D Vision, Geometry Topics: Basics of projective geometry Points and hyperplanes in projective space Homography.
55:148 Digital Image Processing Chapter 11 3D Vision, Geometry Topics: Basics of projective geometry Points and hyperplanes in projective space Homography.
Computer vision: models, learning and inference M Ahad Multiple Cameras
MASKS © 2004 Invitation to 3D vision Uncalibrated Camera Chapter 6 Reconstruction from Two Uncalibrated Views Modified by L A Rønningen Oct 2008.
Reconstruction from Two Calibrated Views Two-View Geometry
Geometry Reconstruction March 22, Fundamental Matrix An important problem: Determine the epipolar geometry. That is, the correspondence between.
Uncalibrated reconstruction Calibration with a rig Uncalibrated epipolar geometry Ambiguities in image formation Stratified reconstruction Autocalibration.
Stereo March 8, 2007 Suggested Reading: Horn Chapter 13.
Lec 26: Fundamental Matrix CS4670 / 5670: Computer Vision Kavita Bala.
Correspondence and Stereopsis. Introduction Disparity – Informally: difference between two pictures – Allows us to gain a strong sense of depth Stereopsis.
Multi-view geometry. Multi-view geometry problems Structure: Given projections of the same 3D point in two or more images, compute the 3D coordinates.
CS4670 / 5670: Computer Vision Kavita Bala Lec 27: Stereo.
René Vidal and Xiaodong Fan Center for Imaging Science
Two-view geometry Computer Vision Spring 2018, Lecture 10
Epipolar geometry.
Epipolar geometry continued
Two-view geometry.
Uncalibrated Geometry & Stratification
George Mason University
Reconstruction.
Two-view geometry.
Two-view geometry.
Multi-view geometry.
Presentation transcript:

55:148 Digital Image Processing Chapter 11 3D Vision, Geometry Topics: Basics of projective geometry Points and hyperplanes in projective space Homography Estimating homography from point correspondence The single perspective camera An overview of single camera calibration Calibration of one camera from the known scene Scene reconstruction from multiple views Triangulation Projective reconstruction Matching constraints Bundle adjustment Two cameras, stereopsis The geometry of two cameras. The fundamental matrix Relative motion of the camera; the essential matrix Estimation of a fundamental matrix from image point correspondences Camera Image rectification Applications of the epipolar geometry in vision Three and more cameras Stereo correspondence algorithms

Image epipolar rectification Illustrative description Both image planes being coplanar Baseline along the horizontal axis (x-axis) of the image plane Two epipoles at infinity along the horizontal direction Horizontal epipolar lines Before After

Image epipolar rectification Illustrative description Both image planes being coplanar Baseline along the horizontal axis (x-axis) of the image plane Two epipoles at infinity along the horizontal direction Horizontal epipolar lines Method: Apply suitable homographic transformation on each image Before After

Image rectification (before)

Image rectification (after)

Image rectification Analytic description Suppose that we know camera matrices 𝑀 and 𝑀 ′ for the two cameras The objective is to rotate each image planes around their optical centers until their focal planes becomes coplanar Thereby, containing the baseline More specifically, the new x-axis is parallel to the baseline Both images have y-axis ⊥ x-axis Thus, new camera matrices

Image rectification Analytic description Suppose that we know camera matrices 𝑀 and 𝑀 ′ for the two cameras The objective is to rotate each image planes around their optical centers until their focal planes becomes coplanar Thereby, containing the baseline More specifically, the new x-axis is parallel to the baseline Both images have y-axis ⊥ x-axis Thus, new camera matrices 𝑀 ∗ =𝐾 𝑅 | −𝑅 𝐜 1 and 𝑀 ∗′ =𝐾 𝑅 | −𝑅 𝐜 2 where, 𝑅= 𝐫 1 T 𝐫 2 T 𝐫 3 T

Image rectification Analytic description Suppose that we know camera matrices 𝑀 and 𝑀 ′ for the two cameras The objective is to rotate each image planes around their optical centers until their focal planes becomes coplanar Thereby, containing the baseline More specifically, the new x-axis is parallel to the baseline Both images have y-axis ⊥ x-axis Thus, new camera matrices 𝑀 ∗ =𝐾 𝑅 | −𝑅 𝐜 1 and 𝑀 ∗′ =𝐾 𝑅 | −𝑅 𝐜 2 where, 𝑅= 𝐫 1 T 𝐫 2 T 𝐫 3 T The new x-axis is parallel to the baseline ⇒ 𝐫 1 = 𝐜 1 − 𝐜 2 𝐜 1 − 𝐜 2

Image rectification Analytic description Suppose that we know camera matrices 𝑀 and 𝑀 ′ for the two cameras The objective is to rotate each image planes around their optical centers until their focal planes becomes coplanar Thereby, containing the baseline More specifically, the new x-axis is parallel to the baseline Both images have y-axis ⊥ x-axis Thus, new camera matrices 𝑀 ∗ =𝐾 𝑅 | −𝑅 𝐜 1 and 𝑀 ∗′ =𝐾 𝑅 | −𝑅 𝐜 2 where, 𝑅= 𝐫 1 T 𝐫 2 T 𝐫 3 T The new x-axis is parallel to the baseline ⇒ 𝐫 1 = 𝐜 1 − 𝐜 2 𝐜 1 − 𝐜 2 The new y-axis is orthogonal to the new x-axis ⇒ 𝐫 2 =𝐪× 𝐫 1 , for some 𝐪≠ 𝐫 1 and 𝐪 =1

Image rectification Analytic description Suppose that we know camera matrices 𝑀 and 𝑀 ′ for the two cameras The objective is to rotate each image planes around their optical centers until their focal planes becomes coplanar Thereby, containing the baseline More specifically, the new x-axis is parallel to the baseline Both images have y-axis ⊥ x-axis Thus, new camera matrices 𝑀 ∗ =𝐾 𝑅 | −𝑅 𝐜 1 and 𝑀 ∗′ =𝐾 𝑅 | −𝑅 𝐜 2 where, 𝑅= 𝐫 1 T 𝐫 2 T 𝐫 3 T The new x-axis is parallel to the baseline ⇒ 𝐫 1 = 𝐜 1 − 𝐜 2 𝐜 1 − 𝐜 2 The new y-axis is orthogonal to the new x-axis ⇒ 𝐫 2 =𝐪× 𝐫 1 , for some 𝐪≠ 𝐫 1 and 𝐪 =1 The new z-axis is orthogonal to the new xy-plane ⇒ 𝐫 3 = 𝐫 1 × 𝐫 2

A proof that Image rectification ≅ a suitable homographic transformation

A proof that Image rectification ≅ a suitable homographic transformation Let 𝑀= 𝑀 | − 𝑀 𝐜 1 and 𝑀 ∗ = 𝑀 ∗ | − 𝑀 ∗ 𝐜 2 For any 3D scene point 𝐗, projected image points using camera matrices are: 𝐮 =??, 𝐮 ∗ =??

A proof that Image rectification ≅ a suitable homographic transformation Let 𝑀= 𝑀 | − 𝑀 𝐜 1 and 𝑀 ∗ = 𝑀 ∗ | − 𝑀 ∗ 𝐜 2 For any 3D scene point 𝐗, projected image points using camera matrices are: 𝐮 =𝑀𝐗, 𝐮 ∗ = 𝑀 ∗ 𝐗 Using the relation in homogeneous coordinate system, How can we express 𝐗 interms of 𝑀 and 𝐮 ?

A proof that Image rectification ≅ a suitable homographic transformation Let 𝑀= 𝑀 | − 𝑀 𝐜 1 and 𝑀 ∗ = 𝑀 ∗ | − 𝑀 ∗ 𝐜 2 For any 3D scene point 𝐗, projected image points using camera matrices are: 𝐮 =𝑀𝐗, 𝐮 ∗ = 𝑀 ∗ 𝐗 Using the relation in homogeneous coordinate system, 𝐗= 𝐜 1 + 𝜆 0 𝑀 −1 𝐮 𝐗= 𝐜 1 + 𝜆 1 𝑀 ∗−1 𝐮 ∗ , 𝜆 0 , 𝜆 0 ∈ℝ

A proof that Image rectification ≅ a suitable homographic transformation Let 𝑀= 𝑀 | − 𝑀 𝐜 1 and 𝑀 ∗ = 𝑀 ∗ | − 𝑀 ∗ 𝐜 2 For any 3D scene point 𝐗, projected image points using camera matrices are: 𝐮 =𝑀𝐗, 𝐮 ∗ = 𝑀 ∗ 𝐗 Using the relation in homogeneous coordinate system, 𝐗= 𝐜 1 + 𝜆 0 𝑀 −1 𝐮 𝐗= 𝐜 1 + 𝜆 1 𝑀 ∗−1 𝐮 ∗ , 𝜆 0 , 𝜆 0 ∈ℝ i.e., 𝜆 1 𝑀 ∗−1 𝐮 ∗ = 𝜆 0 𝑀 −1 𝐮 ⇒ 𝐮 ∗ =𝜆 𝑀 ∗ 𝑀 −1 𝐮

A proof that Image rectification ≅ a suitable homographic transformation Let 𝑀= 𝑀 | − 𝑀 𝐜 1 and 𝑀 ∗ = 𝑀 ∗ | − 𝑀 ∗ 𝐜 2 For any 3D scene point 𝐗, projected image points using camera matrices are: 𝐮 =𝑀𝐗, 𝐮 ∗ = 𝑀 ∗ 𝐗 Using the relation in homogeneous coordinate system, 𝐗= 𝐜 1 + 𝜆 0 𝑀 −1 𝐮 𝐗= 𝐜 1 + 𝜆 1 𝑀 ∗−1 𝐮 ∗ , 𝜆 0 , 𝜆 0 ∈ℝ i.e., 𝜆 1 𝑀 ∗−1 𝐮 ∗ = 𝜆 0 𝑀 −1 𝐮 ⇒ 𝐮 ∗ =𝜆 𝑀 ∗ 𝑀 −1 𝐮 𝜆: scale factor 𝑀 ∗ 𝑀 −1 : 3-by-3 matrix ≈ perspective transformation ≈ homography equivalent HENCE PROVED

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Using Kronecker product identity: 𝐴𝐵𝐜= 𝐜 T ⨂𝐴 𝐛, we get 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 = 𝐮 𝑖 T ⨂ 𝐮 𝑖 ′𝐓 𝐟=0

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Using Kronecker product identity: 𝐴𝐵𝐜= 𝐜 T ⨂𝐴 𝐛, we get 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 = 𝐮 𝑖 T ⨂ 𝐮 𝑖 ′𝐓 𝐟=0 Put together all correspondences 𝐮 𝑖,1 T ⨂ 𝐮 𝑖,1 ′𝐓 ⋮ 𝐮 𝑖,𝑚 T ⨂ 𝐮 𝑖,𝑚 ′𝐓 𝐟=𝑊𝐟=0

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Using Kronecker product identity: 𝐴𝐵𝐜= 𝐜 T ⨂𝐴 𝐛, we get 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 = 𝐮 𝑖 T ⨂ 𝐮 𝑖 ′𝐓 𝐟=0 Put together all correspondences 𝐮 𝑖,1 T ⨂ 𝐮 𝑖,1 ′𝐓 ⋮ 𝐮 𝑖,𝑚 T ⨂ 𝐮 𝑖,𝑚 ′𝐓 𝐟=𝑊𝐟=0 Compute 𝑊 𝑇 𝑊 and apply singular value decomposition; choose 𝐟 along the eigenvector corresponding to the smallest eigenvalue

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Using Kronecker product identity: 𝐴𝐵𝐜= 𝐜 T ⨂𝐴 𝐛, we get 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 = 𝐮 𝑖 T ⨂ 𝐮 𝑖 ′𝐓 𝐟=0 Put together all correspondences 𝐮 𝑖,1 T ⨂ 𝐮 𝑖,1 ′𝐓 ⋮ 𝐮 𝑖,𝑚 T ⨂ 𝐮 𝑖,𝑚 ′𝐓 𝐟=𝑊𝐟=0 Compute 𝑊 𝑇 𝑊 and apply singular value decomposition; choose 𝐟 along the eigenvector corresponding to the smallest eigenvalue For 𝐹 to be a valid fundamental matrix, its rank must be 2; but it may not satisfy in reality (why?); thus needs correction

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Using Kronecker product identity: 𝐴𝐵𝐜= 𝐜 T ⨂𝐴 𝐛, we get 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 = 𝐮 𝑖 T ⨂ 𝐮 𝑖 ′𝐓 𝐟=0 Put together all correspondences 𝐮 𝑖,1 T ⨂ 𝐮 𝑖,1 ′𝐓 ⋮ 𝐮 𝑖,𝑚 T ⨂ 𝐮 𝑖,𝑚 ′𝐓 𝐟=𝑊𝐟=0 Compute 𝑊 𝑇 𝑊 and apply singular value decomposition; choose 𝐟 along the eigenvector corresponding to the smallest eigenvalue For 𝐹 to be a valid fundamental matrix, its rank must be 2; but it may not satisfy in reality (why?); thus needs correction SVD decomposition: 𝐹=𝑈𝐷 𝑉 T ; set the smallest eigenvalue of 𝐷 to zero giving a new diagonal matrix 𝐷 ; use the new matrix 𝐹 =𝑈 𝐷 𝑉 T

Algorithmic description Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Using Kronecker product identity: 𝐴𝐵𝐜= 𝐜 T ⨂𝐴 𝐛, we get 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 = 𝐮 𝑖 T ⨂ 𝐮 𝑖 ′𝐓 𝐟=0 Put together all correspondences 𝐮 𝑖,1 T ⨂ 𝐮 𝑖,1 ′𝐓 ⋮ 𝐮 𝑖,𝑚 T ⨂ 𝐮 𝑖,𝑚 ′𝐓 𝐟=𝑊𝐟=0 Compute 𝑊 𝑇 𝑊 and apply singular value decomposition; choose 𝐟 along the eigenvector corresponding to the smallest eigenvalue For 𝐹 to be a valid fundamental matrix, its rank must be 2; but it may not satisfy in reality (why?); thus needs correction SVD decomposition: 𝐹=𝑈𝐷 𝑉 T ; set the smallest eigenvalue of 𝐷 to zero giving a new diagonal matrix 𝐷 ; use the new matrix 𝐹 =𝑈 𝐷 𝑉 T Note that ML estimation method incorporate the validity condition of F into the optimization process

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Output: Fundamental matrix 𝐹 Task 2: Decompose the fundamental 𝐹 to matrix camera matrices

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Output: Fundamental matrix 𝐹 Task 2: Decompose the fundamental 𝐹 to matrix camera matrices 𝑀= 𝐼 | 𝟎 𝑀 ′ = 𝑆 𝐞 ′ 𝐹 | 𝐞 ′

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Output: Fundamental matrix 𝐹 Task 2: Decompose the fundamental 𝐹 to matrix camera matrices 𝑀= 𝐼 | 𝟎 𝑀 ′ = 𝑆 𝐞 ′ 𝐹 | 𝐞 ′ Input of the algorithm : A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Output of the algorithm: camera matrices 𝑀 and 𝑀 ′

Image rectification Algorithmic description As we have seen from analytic discussion Given the knowledge of 𝑀 and 𝑀 ′ , image rectification process is precisely defined So, the first task is to determine camera matrices 𝑀 and 𝑀 ′ Algorithm Compute camera matrices 𝑀 and 𝑀 ′ Task 1: Solve 𝐹 using 𝑚≥8 corresponding point pairs in two images and algebraic error minimization Input: A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Output: Fundamental matrix 𝐹 Task 2: Decompose the fundamental 𝐹 to matrix camera matrices 𝑀= 𝐼 | 𝟎 𝑀 ′ = 𝑆 𝐞 ′ 𝐹 | 𝐞 ′ Input of the algorithm : A linear system: 𝐮 𝑖 ′T 𝐹 𝐮 𝑖 =0, 𝑖=1,2,…, 𝑚 Output of the algorithm: camera matrices 𝑀 and 𝑀 ′ Now what?

Image rectification Algorithmic description Algorithm Compute image rectification

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′ Decompose each camera matrices: 𝑀=𝐴∗ 𝑅;𝐭 and 𝑀 ′ = 𝐴 ′ ∗ 𝑅 ′ ; 𝐭 ′

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′ Decompose each camera matrices: 𝑀=𝐴∗ 𝑅;𝐭 and 𝑀 ′ = 𝐴 ′ ∗ 𝑅 ′ ; 𝐭 ′ Determine two optical centers 𝐜 and 𝐜 ′ using 𝑀 and 𝑀 ′ and their decompositions

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′ Decompose each camera matrices: 𝑀=𝐴∗ 𝑅;𝐭 and 𝑀 ′ = 𝐴 ′ ∗ 𝑅 ′ ; 𝐭 ′ Determine two optical centers 𝐜 and 𝐜 ′ using 𝑀 and 𝑀 ′ and their decompositions Determine new rotation matrix 𝑅 ∗ common to 𝑀 ∗ and 𝑀 ′∗

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′ Decompose each camera matrices: 𝑀=𝐴∗ 𝑅;𝐭 and 𝑀 ′ = 𝐴 ′ ∗ 𝑅 ′ ; 𝐭 ′ Determine two optical centers 𝐜 and 𝐜 ′ using 𝑀 and 𝑀 ′ and their decompositions Determine new rotation matrix 𝑅 ∗ common to 𝑀 ∗ and 𝑀 ′∗ Determine new intrinsic parameters 𝐴 ∗ by averaging 𝐴 and 𝐴 ′ and then annulling skew component

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′ Decompose each camera matrices: 𝑀=𝐴∗ 𝑅;𝐭 and 𝑀 ′ = 𝐴 ′ ∗ 𝑅 ′ ; 𝐭 ′ Determine two optical centers 𝐜 and 𝐜 ′ using 𝑀 and 𝑀 ′ and their decompositions Determine new rotation matrix 𝑅 ∗ common to 𝑀 ∗ and 𝑀 ′∗ Determine new intrinsic parameters 𝐴 ∗ by averaging 𝐴 and 𝐴 ′ and then annulling skew component Compute new projection matrices:

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′ Decompose each camera matrices: 𝑀=𝐴∗ 𝑅;𝐭 and 𝑀 ′ = 𝐴 ′ ∗ 𝑅 ′ ; 𝐭 ′ Determine two optical centers 𝐜 and 𝐜 ′ using 𝑀 and 𝑀 ′ and their decompositions Determine new rotation matrix 𝑅 ∗ common to 𝑀 ∗ and 𝑀 ′∗ Determine new intrinsic parameters 𝐴 ∗ by averaging 𝐴 and 𝐴 ′ and then annulling skew component Compute new projection matrices: 𝑀 ∗ = 𝐴 ∗ ∗ 𝑅 ∗ | − 𝑅 ∗ 𝐜 and 𝑀 ′∗ = 𝐴 ∗ ∗ 𝑅 ∗ | − 𝑅 ∗ 𝐜 ′

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′ Decompose each camera matrices: 𝑀=𝐴∗ 𝑅;𝐭 and 𝑀 ′ = 𝐴 ′ ∗ 𝑅 ′ ; 𝐭 ′ Determine two optical centers 𝐜 and 𝐜 ′ using 𝑀 and 𝑀 ′ and their decompositions Determine new rotation matrix 𝑅 ∗ common to 𝑀 ∗ and 𝑀 ′∗ Determine new intrinsic parameters 𝐴 ∗ by averaging 𝐴 and 𝐴 ′ and then annulling skew component Compute new projection matrices: 𝑀 ∗ = 𝐴 ∗ ∗ 𝑅 ∗ | − 𝑅 ∗ 𝐜 and 𝑀 ′∗ = 𝐴 ∗ ∗ 𝑅 ∗ | − 𝑅 ∗ 𝐜 ′ Compute homography transformations

Image rectification Algorithmic description Algorithm Compute image rectification Input: 𝑀 and 𝑀 ′ Output: 𝑀 ∗ and 𝑀 ′∗ and two homography transformations: 𝐻 and 𝐻 ′ Decompose each camera matrices: 𝑀=𝐴∗ 𝑅;𝐭 and 𝑀 ′ = 𝐴 ′ ∗ 𝑅 ′ ; 𝐭 ′ Determine two optical centers 𝐜 and 𝐜 ′ using 𝑀 and 𝑀 ′ and their decompositions Determine new rotation matrix 𝑅 ∗ common to 𝑀 ∗ and 𝑀 ′∗ Determine new intrinsic parameters 𝐴 ∗ by averaging 𝐴 and 𝐴 ′ and then annulling skew component Compute new projection matrices: 𝑀 ∗ = 𝐴 ∗ ∗ 𝑅 ∗ | − 𝑅 ∗ 𝐜 and 𝑀 ′∗ = 𝐴 ∗ ∗ 𝑅 ∗ | − 𝑅 ∗ 𝐜 ′ Compute homography transformations 𝐻= 𝑀 ∗ 𝑀 −1 and 𝐻 ′ = 𝑀 ′∗ 𝑀 ′−1

Image rectification (before)

Image rectification (after)

Image rectification: application 3D reconstruction becomes easier b a c

Panoramic view

Panoramic view: challenges

Elementary stereo geometry in the rectified image configuration The depth 𝑧 of a 3D scene point 𝐗 can be calculated using the disparity measure 𝑑= 𝑢 ′ −𝑢 𝑢 𝑓 =− ℎ+𝑥 𝑧 , 𝑢 ′ 𝑓 = ℎ−𝑥 𝑧

Elementary stereo geometry in the rectified image configuration The depth 𝑧 of a 3D scene point 𝐗 can be calculated using the disparity measure 𝑑= 𝑢 ′ −𝑢 𝑢 𝑓 =− ℎ+𝑥 𝑧 , 𝑢 ′ 𝑓 = ℎ−𝑥 𝑧 ⇒ 𝑧= 2ℎ𝑓 𝑢 ′ −𝑢 = 𝑏𝑓 𝑢 ′ −𝑢 = 𝑏𝑓 𝑑

Elementary stereo geometry in the rectified image configuration The depth 𝑧 of a 3D scene point 𝐗 can be calculated using the disparity measure 𝑑= 𝑢 ′ −𝑢 𝑢 𝑓 =− ℎ+𝑥 𝑧 , 𝑢 ′ 𝑓 = ℎ−𝑥 𝑧 ⇒ 𝑧= 2ℎ𝑓 𝑢 ′ −𝑢 = 𝑏𝑓 𝑢 ′ −𝑢 = 𝑏𝑓 𝑑 𝑥= −𝑏 𝑢+ 𝑢 ′ 2𝑑 , 𝑦= 𝑏𝑣 𝑑

Elementary stereo geometry in the rectified image configuration The depth 𝑧 of a 3D scene point 𝐗 can be calculated using the disparity measure 𝑑= 𝑢 ′ −𝑢 𝑢 𝑓 =− ℎ+𝑥 𝑧 , 𝑢 ′ 𝑓 = ℎ−𝑥 𝑧 ⇒ 𝑧= 2ℎ𝑓 𝑢 ′ −𝑢 = 𝑏𝑓 𝑢 ′ −𝑢 = 𝑏𝑓 𝑑 𝑥= −𝑏 𝑢+ 𝑢 ′ 2𝑑 , 𝑦= 𝑏𝑣 𝑑