Back to equations of geometric transformations

Slides:



Advertisements
Similar presentations
The fundamental matrix F
Advertisements

Lecture 11: Two-view geometry
Summary of Friday A homography transforms one 3d plane to another 3d plane, under perspective projections. Those planes can be camera imaging planes or.
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.
Two-View Geometry CS Sastry and Yang
Lecture 8: Stereo.
Image alignment Image from
776 Computer Vision Jared Heinly Spring 2014 (slides borrowed from Jan-Michael Frahm, Svetlana Lazebnik, and others)
Multiple View Geometry
Fitting. We’ve learned how to detect edges, corners, blobs. Now what? We would like to form a higher-level, more compact representation of the features.
Uncalibrated Geometry & Stratification Sastry and Yang
Lecture 7: Image Alignment and Panoramas CS6670: Computer Vision Noah Snavely What’s inside your fridge?
Lecture 21: Multiple-view geometry and structure from motion
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Lecture 9: Image alignment CS4670: Computer Vision Noah Snavely
Lecture 8: Image Alignment and RANSAC
Automatic Image Alignment (feature-based) : Computational Photography Alexei Efros, CMU, Fall 2006 with a lot of slides stolen from Steve Seitz and.
Camera parameters Extrinisic parameters define location and orientation of camera reference frame with respect to world frame Intrinsic parameters define.
Lecture 10: Robust fitting CS4670: Computer Vision Noah Snavely.
Computing transformations Prof. Noah Snavely CS1114
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.
Fitting.
Feature Matching and RANSAC : Computational Photography Alexei Efros, CMU, Fall 2005 with a lot of slides stolen from Steve Seitz and Rick Szeliski.
Robust fitting Prof. Noah Snavely CS1114
Automatic Camera Calibration
Image Stitching Ali Farhadi CSE 455
Image alignment.
CSE 185 Introduction to Computer Vision
CSC 589 Lecture 22 Image Alignment and least square methods Bei Xiao American University April 13.
Lecture 12: Image alignment CS4670/5760: Computer Vision Kavita Bala
© 2005 Yusuf Akgul Gebze Institute of Technology Department of Computer Engineering Computer Vision Geometric Camera Calibration.
Example: line fitting. n=2 Model fitting Measure distances.
CSCE 643 Computer Vision: Structure from Motion
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.
Computer Vision : CISC 4/689 Going Back a little Cameras.ppt.
EECS 274 Computer Vision Model Fitting. Fitting Choose a parametric object/some objects to represent a set of points Three main questions: –what object.
Computer Vision - Fitting and Alignment (Slides borrowed from various presentations)
Fitting image transformations Prof. Noah Snavely CS1114
776 Computer Vision Jan-Michael Frahm Spring 2012.
Robust Estimation Course web page: vision.cis.udel.edu/~cv April 23, 2003  Lecture 25.
Fitting.
Parameter estimation class 5 Multiple View Geometry CPSC 689 Slides modified from Marc Pollefeys’ Comp
Invariant Local Features Image content is transformed into local feature coordinates that are invariant to translation, rotation, scale, and other imaging.
Lecture 10: Image alignment CS4670/5760: Computer Vision Noah Snavely
776 Computer Vision Jan-Michael Frahm Spring 2012.
Lecture 16: Image alignment
Lecture 7: Image alignment
Parameter estimation class 5
Two-view geometry Computer Vision Spring 2018, Lecture 10
RANSAC and mosaic wrap-up
Homography From Wikipedia In the field of computer vision, any
A special case of calibration
Image Stitching Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi.
3D Photography: Epipolar geometry
Features Readings All is Vanity, by C. Allan Gilbert,
Singular Value Decomposition
Object recognition Prof. Graeme Bailey
Estimating 2-view relationships
Feature Matching and RANSAC
Lecture 8: Image alignment
Lecture 8: Image alignment
Calibration and homographies
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
Parameter estimation class 6
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
Image Stitching Linda Shapiro ECE/CSE 576.
Lecture 11: Image alignment, Part 2
Image Stitching Linda Shapiro ECE P 596.
Presentation transcript:

Back to equations of geometric transformations

Image of a Point P Homogeneous coordinates of a 3-D point Homogeneous coordinates of its 2-D image Projection of a 3-D point to an image plane P

2D homography (projective transformation) Definition: Line preserving A 2D homography is an invertible mapping h from P2 to itself such that three points x1,x2,x3 lie on the same line if and only if h(x1),h(x2),h(x3) do. Theorem: A mapping h: P2P2 is a homography if and only if there exist a non‐singular 3x3 matrix H such that for any point in P2 represented by a vector x it is true that h(x)=Hx Definition: Homography  x'1  h12 h13  x1  22 3 31 h32 33 3 h11    x'  h h  x   2  h  2  x'= H x 8DOF  or 21 23      x'  h h x       Homography=projective transformation=projectivity=collineation 1414

General homography Note: homographies are not restricted to P2 General definition: A homography is a non‐singular, line preserving, projective mapping h: Pn  Pn. It is represented by a square (n + 1)‐dim matrix with (n + 1)2‐1 DOF Now back to the 2D case… Mapping between planes 1515

Homographies in Computer vision Rotating/translating camera, planar world H H H  X    x, y,1  x  PX T  H Y  1    What happens to the P‐matrix, if Z is assumed zero? 10

Homographies in Computer vision Rotating camera, arbitrary world  X      Y x, y,1T  x  PX  K r r r t   KRK 1 x'  Hx'  Z  1 2 3   1   What happens to the P‐matrix, if t is assumed zero?

To unwarp (rectify) an image solve for homography H given p and p’ solve equations of the form: wp’ = Hp linear in unknowns: w and coefficients of H H is defined up to an arbitrary scale factor how many points are necessary to solve for H?

Solving for homographies

Solving for homographies 2n × 9 9 2n Linear least squares Since h is only defined up to scale, solve for unit vector ĥ Minimize Solution: ĥ = eigenvector of ATA with smallest eigenvalue Works with 4 or more points

Inhomogeneous solution Since h can only be computed up to scale, impose constraint pick hj=1, e.g. h9=1, and solve for 8‐vector 0 0 0  xiwi '  yiwi '  wiwi ' xi yi ' yi yi '~  wi yi ' 0 0 0 x x ' y x 'h   w x '   x w ' y w ' w w '  i i i i   i i  i i i i i i Can be solved using linear least‐squares However, if h9=0 this approach fails Also poor results if h9 close to zero Therefore, not recommended

Feature matching ? descriptors for left image feature points descriptors for right image feature points ?

Strategies to match images robustly Working with individual features: For each feature point, find most similar point in other image (SIFT distance) Reject ambiguous matches where there are too many similar points Working with all the features: Given some good feature matches, look for possible homographies relating the two images Reject homographies that don’t have many feature matches. 2

(a) Feature-space outlier rejection Let’s not match all features, but only these that have “similar enough” matches? How can we do it? SSD(patch1,patch2) < threshold How to set threshold? Not so easy.

Feature-space outlier rejection A better way [Lowe, 1999]: 1-NN: SSD of the closest match 2-NN: SSD of the second-closest match Look at how much better 1-NN is than 2-NN, e.g. 1-NN/2-NN That is, is our best match so much better than the rest?

RAndom SAmple Consensus Select one match, count inliers

RANSAC for estimating homography RANSAC loop: Select four feature pairs (at random) Compute homography H (exact) Compute inliers where ||pi’, H pi|| < ε Keep largest set of inliers Re-compute least-squares H estimate using all of the inliers

RANSAC red: rejected by 2nd nearest neighbor criterion blue: Ransac outliers yellow: inliers

Robustness Proportion of inliers in our pairs is G (for “good”) Our model needs P pairs P=4 for homography Probability that we pick P inliers? GP Probability that after N RANSAC iterations we have not picked a set of inliers? – (1-GP)N 3

Robustness: example Proportion of inliers G=0.5 Matlab: p=4; x=0.5; n=1000; (1-x^p)^n Proportion of inliers G=0.5 Probability that we pick P=4 inliers? – 0.54=0.0625 (6% chance) Probability that we have not picked a set of inliers? N=100 iterations: (1-0.54)100=0.00157 (1 chance in 600) N=1000 iterations: 1 chance in 1e28

Robustness: example Proportion of inliers G=0.3 Probability that we pick P=4 inliers? – 0.34=0.0081 (0.8% chance) Probability that we have not picked a set of inliers? N=100 iterations: (1-0.34)100=0.44 (1 chance in 2) N=1000 iterations: 1 chance in 3400

Robustness: example Proportion of inliers G=0.1 Probability that we pick P=4 inliers? – 0.14=0.0001 (0.01% chances, 1 in 10,000) Probability that we have not picked a set of inliers? – N=100 iterations: (1-0.14)100=0.99 – N=1000 iterations: 90% – N=10,000: 36% – N=100,000: 1 in 22,000

Robustness: conclusions Effect of number of parameters of model/ number of necessary pairs Bad exponential Effect of percentage of inliers Base of the exponential Effect of number of iterations Good exponential 47

RANSAC recap For fitting a model with low number P of parameters (8 for homographies) Loop Select P random data points Fit model Count inliers (other data points well fit by this model) Keep model with largest number of inliers 48

RANSAC for Homography

RANSAC for Homography

RANSAC for Homography

Camera pose estimation Assume all points lie in one plane with Z=0: –r1 and r2 are unit vectors  find lambda –Use this to compute t –Rotation matrices are orthogonal  find r3

Problems Problem: Solution: Solution: orthogonalize R’ The vectors r1 and r2 might not yield the same lambda Solution: Use the average value The estimated rotation matrix might not be orthogonal Solution: orthogonalize R’ Obtain SVD  R’=UWVT Set singular values to 1  R=UVT

Estimate lambda as average length