2-View Geometry. Mark Fiala Ryerson University Mark.fiala@ryerson.ca



Similar documents
Epipolar Geometry. Readings: See Sections 10.1 and 15.6 of Forsyth and Ponce. Right Image. Left Image. e(p ) Epipolar Lines. e(q ) q R.

Orthogonal Projections

Introduction Epipolar Geometry Calibration Methods Further Readings. Stereo Camera Calibration

521493S Computer Graphics. Exercise 2 & course schedule change

Vector Notation: AB represents the vector from point A to point B on a graph. The vector can be computed by B A.

Section 5.3. Section 5.3. u m ] l jj. = l jj u j + + l mj u m. v j = [ u 1 u j. l mj

Geometric Camera Parameters

Question 2: How do you solve a matrix equation using the matrix inverse?

Solution Guide III-C. 3D Vision. Building Vision for Business. MVTec Software GmbH

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

Equations Involving Lines and Planes Standard equations for lines in space

The Matrix Stiffness Method for 2D Trusses

3D Tranformations. CS 4620 Lecture 6. Cornell CS4620 Fall 2013 Lecture Steve Marschner (with previous instructors James/Bala)

α = u v. In other words, Orthogonal Projection

Linear Algebra Review. Vectors

Eigenvalues and Eigenvectors

Lecture 5: Singular Value Decomposition SVD (1)

Lecture 2 Matrix Operations

Linear algebra and the geometry of quadratic equations. Similarity transformations and orthogonal matrices

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

Linear Algebra Notes for Marsden and Tromba Vector Calculus

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Projective Geometry. Projective Geometry

Rotation Matrices and Homogeneous Transformations

x = + x 2 + x

Lecture 2: Homogeneous Coordinates, Lines and Conics

Vector Spaces. Chapter R 2 through R n

Beginner s Matlab Tutorial

GeoGebra. 10 lessons. Gerrit Stols

2D Geometric Transformations

Figure 1.1 Vector A and Vector F

Lecture 2: Geometric Image Transformations

2. SPATIAL TRANSFORMATIONS

5. Orthogonal matrices

Math 215 HW #6 Solutions

Part I. Basic Maths for Game Design

[1] Diagonal factorization

Essential Mathematics for Computer Graphics fast

Group Theory and Chemistry

Geometric Transformation CS 211A

ISOMETRIES OF R n KEITH CONRAD

L 2 : x = s + 1, y = s, z = 4s Suppose that C has coordinates (x, y, z). Then from the vector equality AC = BD, one has

CONCEPT-II. Overview of demo examples

Introduction to Matrices

3D Scanner using Line Laser. 1. Introduction. 2. Theory

Epipolar Geometry and Visual Servoing

Bedford, Fowler: Statics. Chapter 4: System of Forces and Moments, Examples via TK Solver

Summary: Transformations. Lecture 14 Parameter Estimation Readings T&V Sec Parameter Estimation: Fitting Geometric Models

Vectors VECTOR PRODUCT. Graham S McDonald. A Tutorial Module for learning about the vector product of two vectors. Table of contents Begin Tutorial

x1 x 2 x 3 y 1 y 2 y 3 x 1 y 2 x 2 y 1 0.

Solving Simultaneous Equations and Matrices

CS3220 Lecture Notes: QR factorization and orthogonal transformations

Section 13.5 Equations of Lines and Planes

Chapter 17. Orthogonal Matrices and Symmetries of Space

Machine Learning and Data Mining. Regression Problem. (adapted from) Prof. Alexander Ihler

is in plane V. However, it may be more convenient to introduce a plane coordinate system in V.

Time Domain and Frequency Domain Techniques For Multi Shaker Time Waveform Replication

5: Magnitude 6: Convert to Polar 7: Convert to Rectangular

160 CHAPTER 4. VECTOR SPACES

Wii Remote Calibration Using the Sensor Bar

MATH2210 Notebook 1 Fall Semester 2016/ MATH2210 Notebook Solving Systems of Linear Equations... 3

TWO-DIMENSIONAL TRANSFORMATION

1 Introduction to Matrices

Solving simultaneous equations using the inverse matrix

Least-Squares Intersection of Lines

DERIVATIVES AS MATRICES; CHAIN RULE

Recall that two vectors in are perpendicular or orthogonal provided that their dot

MATH 304 Linear Algebra Lecture 9: Subspaces of vector spaces (continued). Span. Spanning set.

1.5 Equations of Lines and Planes in 3-D

Section 9.5: Equations of Lines and Planes

3 Orthogonal Vectors and Matrices

Camera geometry and image alignment

Gerrit Stols

Cabri Geometry Application User Guide

1.3 LINEAR EQUATIONS IN TWO VARIABLES. Copyright Cengage Learning. All rights reserved.

6. Vectors Scott Surgent (surgent@asu.edu)

13.4 THE CROSS PRODUCT

Intellect Platform - Tables and Templates Basic Document Management System - A101

An Efficient Solution to the Five-Point Relative Pose Problem

Lecture L3 - Vectors, Matrices and Coordinate Transformations

CS 534: Computer Vision 3D Model-based recognition

Terrain Traversability Analysis using Organized Point Cloud, Superpixel Surface Normals-based segmentation and PCA-based Classification

What are the place values to the left of the decimal point and their associated powers of ten?

The Projection Matrix

REVIEW EXERCISES DAVID J LOWRY

Algebra I Vocabulary Cards

Lecture 14: Section 3.3

Lecture 8 : Coordinate Geometry. The coordinate plane The points on a line can be referenced if we choose an origin and a unit of 20

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

9 MATRICES AND TRANSFORMATIONS

1.3. DOT PRODUCT If θ is the angle (between 0 and π) between two non-zero vectors u and v,

discuss how to describe points, lines and planes in 3 space.

A vector is a directed line segment used to represent a vector quantity.

Grassmann Algebra in Game Development. Eric Lengyel, PhD Terathon Software

Typical Linear Equation Set and Corresponding Matrices

Statistical Functions in Excel

Lecture 7. Matthew T. Mason. Mechanics of Manipulation. Lecture 7. Representing Rotation. Kinematic representation: goals, overview

Transcription:

CRV 2010 Tutorial Day 2-View Geometry Mark Fiala Ryerson University Mark.fiala@ryerson.ca

3-Vectors for image points and lines Mark Fiala 2010 2D Homogeneous Points Add 3 rd number to a 2D point on image plane (add 1) Extend [u,v] t to [u,v,1] t 2D point is now represented by 3D line, can multiply entire vector by a constant and it s still the same point k[u,v,1] t = [ku,kv,k] t = [u,v,1] t 2D Projective Geometry Point is represented by 3D line passing through origin (2D point -> 3D vector) p=k[u,v,1] t Image plane is horizontal plane at z=1 Image point is where 3D line passes through image plane Image line represented by where 3D plane passes through image plane 3D plane passes through origin, defined by normal (perpendicular) 3D vector L=[a,b,c] t Standard line definition: ax+by+c=0 Line defined as vectors perpendicular to vector L (dot product=0) L t p=0 3-Vectors scale does not matter Image point: [u,v,1] t Image line: [a,b,c] t

Homography and Fundamental Matrices Mark Fiala 2010 Two View Geometry When you have two images, what relations can you find between them? A homography matrix maps a point in one image to a point in another, but only under special cases: 1-both looking at the same plane (any R or T allowed) can do planar mosaic 2-only rotation R, no translation T can do panoramic mosaic Is there anything we can do for two arbitrary images with unknown R & T that are not aimed at a plane? Point->Line Mapping With any configuration with T!=0 we can find a point-to-line mapping A point in one image maps to a line in another image For a single camera, all points along a line in 3D space fall onto a single image point. Project all those points onto another camera, they appear as a line emanating from the image of the focal point of the first camera. Imagine a laser beam shooting out of Cam 1, see the laser beam in second camera Cam 2 will appear as a line. Therefore a point p 1 in Cam 1 maps to a line l 2 in Cam 2 What is the relation? Answer l 2 = Fp 1 F is the fundamental matrix (3x3) Since l t p= p t l=0 for points p lying on line l, we can say an object at p 1 in Cam 1 must lie upon l 2 Cam 2 therefore p 2t Fp 1 =0

Matrices, World-Image and Image-Image Relationships Projection Matrix p=px Homogeneous point p as a function of world coords X Size P=3x4, not invertible (cannot go from image point to world point) Homography Matrix p=hx or p 2 = Hp 1 Homogeneous point p as a function of world planar coords X Or rotating but not translating camera, Homogeneous points p 1,p 2 Point in one image maps to point in other image via H Size H=3x3, invertible (can go from image point to world planar point) Fundamental Matrix p 2t Fp 1 =0 Line l 2 = Fp 1 as a function of homogeneous point p 1 Size F=3x3, not invertible (cannot go from point back to line, F contains T x matrix, det(t x )=0, cannot be inverted) 3-View Tensor p 3 = T(p 1, p 2 ) Homogeneous point p 3 in 3 rd image as a function of homogeneous point p 1 in first image and p 2 in second image Works for arbitrary R and T between cameras, world not restricted to planar case Size tensor=3x3x3 (27 numbers) Mark Fiala 2010

Mark Fiala 2010 Entities where scale doesn t matter All the following are independent of scale: each is represented by one more number than the degrees of freedom Homogeneous point (2D point->3d line) 3 numbers, 2 dof (degrees of freedom) Line 3 numbers, 2 dof p=k[u, v, 1] t l=k[a, b, c] t Projection Matrix Homogeneous point p as a function of world coords X 12 numbers, 11 dof p=px Homography Matrix p=hx or p 2 = Hp 1 Map a homogeneous point between a plane and image, or between rotated images 9 numbers, 8 dof Fundamental Matrix p 2t Fp 1 =0 Line l 2 = Fp 1 as a function of homogeneous point p 1 9 numbers, 8 dof 3-View Tensor p 3 = T(p 1, p 2 ) Homogeneous point p 3 in 3 rd image as a function of homogeneous point p 1 in first image and p 2 in second image 27 numbers, 26 dof

view_homog_matrix.exe Mark Fiala 2010

Mark Fiala 2010 Recover Homography matrix from correspondences w 2 = H 11 H 12 H 13 H 21 H 22 H 23 H 31 H 32 H 33 u 1 w 1 = H 11 u 1 + H 12 + H 13 H 31 u 1 + H 32 + H 33 = H 21 u 1 + H 22 + H 23 H 31 u 1 + H 32 + H 33 Multiply up denominators H 31 u 1 + H 32 + H 33 = H 11 u 1 + H 12 + H 13 H 31 u 1 + H 32 + H 33 = H 21 u 1 + H 22 + H 23 Solving for AX=0 -gives us 2 equations/correspondence need 4 correspondences H 31 u 1 + H 32 + H 33 -H 11 u 1 -H 12 -H 13 = 0 H 31 u 1 + H 32 + H 33 -H 21 u 1 -H 22 -H 23 = 0 Each correspondence provides two rows of A matrix [-u 1 - -1 0 0 0 u 1 ] [ 0 0 0 -u 1 - -1 u 1 ] H 11 H 12 H 13

Mark Fiala 2010 Recover Homography matrix from correspondences Each correspondence provides two rows of A matrix [-u 1 - -1 0 0 0 u 1 ] [ 0 0 0 -u 1 - -1 u 1 ] 8 equations, 9 unknowns (from 4 correspondences) -u 11-1 -1 0 0 0 u 11 1 1 1 1 0 0 0 -u 11-1 -1 u 11 1 1 1 1 -u 12-2 -1 0 0 0 u 12 2 2 2 2 0 0 0 -u 12-2 -1 u 12 2 2 2 2 -u 13-3 -1 0 0 0 u 13 3 3 3 3 0 0 0 -u 13-3 -1 u 13 3 3 3 3 -u 14-4 -1 0 0 0 u 14 4 4 4 4 0 0 0 -u 14-4 -1 u 14 4 4 4 4 H 11 H 12 H 13 H 21 H 22 H 23 H 31 H 32 H 33 = 0 AX=b X=column vector of homography matrix elements Get last vector using SVD

Image Rectification using a homography matrix Mark Fiala 2010 H H inv Correspondences See matlab_lec9_solve_for_homog_matrix.txt

view_fund_matrix.exe view_homog_matrix.zip on course and Dr. Fiala webpage Point in left image (red cross, white arrow) maps to red line in right image Notice corner of shelves (red cross in left image) lies on line in right image Blue crosses are epipoles = projection of focal point of other camera Transpose of fundamental matrix is the reverse fundamental matrix mapping points in right image to lines in left (unlike reverse=matrix inverse with homographies)

view_fund_matrix.exe Space bar turns on grid mode shows epipolar lines Epipolar lines radiate from epipoles

Fundamental matrix for rectified images To do proper stereo disparity, we needed rectified images images where a point (x1,y) in the 1 st image appears at (x2,y) in the 2 nd image (y is the same) Fundamental matrix is: 0 0 0 0 0-1 0 1 0

Mark Fiala 2010 Recover Fundamental matrix from correspondences [ 1 ] F 11 F 12 F 13 F 21 F 22 F 23 F 31 F 32 F 33 u 1 1 = 0 Solving for AX=0 -gives us 1 equation/correspondence need 8 correspondences F 11 u 1 + F 12 + F 13 + F 21 u 1 + F 22 + F 23 + F 31 u 1 + F 32 + F 33 = 0 Each correspondence provides one rows of A matrix need 8 correspondences [u 1 u 1 u 1 1 ] F 11 F 12 F 13 F 21 F 22

Mark Fiala 2010 Recover Fundamental matrix from correspondences Each correspondence provides one rows of A matrix [u 1 u 1 u 1 1 ] 8 equations, 9 unknowns (from 8 correspondences) u 11 1 1 1 1 u 11 1 1 1 1 u 11 1 1 u 12 2 2 2 2 u 12 2 2 2 2 u 12 2 1 u 13 3 3 3 3 u 13 3 3 3 3 u 13 3 1 u 14 4 4 4 4 u 14 4 4 4 4 u 14 4 1 u 15 5 5 5 5 u 15 5 5 5 5 u 15 5 1 u 16 6 6 6 6 u 16 6 6 6 6 u 16 6 1 u 17 7 7 7 7 u 17 7 7 7 7 u 17 7 1 u 18 8 8 8 8 u 18 8 8 8 8 u 18 8 1 F 11 F 12 F 13 F 21 F 22 F 23 F 31 F 32 F 33 = 0 AX=b X=column vector of fundamental matrix elements Get last vector using SVD

Mark Fiala 2010 Full system fundamental matrix example from http://www.csse.uwa.edu.au/~pk/research/matlabfns/robust/example/index.html Steps: 1. Interest point detection 2. Correlation matching 3. RANSAC search for fundamental matrix 4. Inlier/outliers labeled Input images

Mark Fiala 2010 Full system fundamental matrix example from http://www.csse.uwa.edu.au/~pk/research/matlabfns/robust/example/index.html Interest points found matches

Mark Fiala 2010 Full system fundamental matrix example from http://www.csse.uwa.edu.au/~pk/research/matlabfns/robust/example/index.html Inliers after Fund. Matrix found Point to epipolar lines gui