CSC 589 Lecture 22 Image Alignment and least square methods Bei Xiao American University April 13.

Slides:



Advertisements
Similar presentations
The fundamental matrix F
Advertisements

Lecture 11: Two-view geometry
Last 4 lectures Camera Structure HDR Image Filtering Image Transform.
MASKS © 2004 Invitation to 3D vision Lecture 7 Step-by-Step Model Buidling.
Computer vision: models, learning and inference
Two-View Geometry CS Sastry and Yang
Image alignment Image from
Image alignment Image from
Mosaics con’t CSE 455, Winter 2010 February 10, 2010.
Homographies and Mosaics : Computational Photography Alexei Efros, CMU, Fall 2005 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen.
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.
Epipolar geometry. (i)Correspondence geometry: Given an image point x in the first view, how does this constrain the position of the corresponding point.
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
Projective geometry Slides from Steve Seitz and Daniel DeMenthon
Lecture 9: Image alignment CS4670: Computer Vision Noah Snavely
1Jana Kosecka, CS 223b Cylindrical panoramas Cylindrical panoramas with some slides from R. Szeliski, S. Seitz, D. Lowe, A. Efros,
CSCE 641 Computer Graphics: Image Mosaicing Jinxiang Chai.
Lecture 8: Image Alignment and RANSAC
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2005 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
Panoramas and Calibration : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski.
Image Warping and Mosacing : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski.
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.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Mosaics CSE 455, Winter 2010 February 8, 2010 Neel Joshi, CSE 455, Winter Announcements  The Midterm went out Friday  See to the class.
Robust fitting Prof. Noah Snavely CS1114
Automatic Camera Calibration
Image Stitching Ali Farhadi CSE 455
CSE 185 Introduction to Computer Vision
Lecture 12: Image alignment CS4670/5760: Computer Vision Kavita Bala
Camera Geometry and Calibration Thanks to Martial Hebert.
Epipolar geometry The fundamental matrix and the tensor
Last Lecture (optical center) origin principal point P (X,Y,Z) p (x,y) x y.
Course 12 Calibration. 1.Introduction In theoretic discussions, we have assumed: Camera is located at the origin of coordinate system of scene.
IMAGE MOSAICING Summer School on Document Image Processing
Mosaics Today’s Readings Szeliski, Ch 5.1, 8.1 StreetView.
Image stitching Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac.
CSCE 643 Computer Vision: Structure from Motion
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.
Computer Vision : CISC 4/689 Going Back a little Cameras.ppt.
Reconnaissance d’objets et vision artificielle Jean Ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire.
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.
Homographies and Mosaics : Computational Photography Alexei Efros, CMU, Fall 2006 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen.
Lecture 10: Image alignment CS4670/5760: Computer Vision Noah Snavely
776 Computer Vision Jan-Michael Frahm Spring 2012.
Lecture 16: Image alignment
Prof. Adriana Kovashka University of Pittsburgh October 3, 2016
CS4670 / 5670: Computer Vision Kavita Bala Lecture 20: Panoramas.
University of Ioannina
COSC579: Image Align, Mosaic, Stitch
Lecture 7: Image alignment
The Brightness Constraint
A special case of calibration
Image Stitching Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi.
Idea: projecting images onto a common plane
Lecture 8: Image alignment
Lecture 8: Image alignment
Computational Photography
Calibration and homographies
Back to equations of geometric transformations
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
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:

CSC 589 Lecture 22 Image Alignment and least square methods Bei Xiao American University April 13

Final project Due May 4 th. The final websites will be shared among students!! Presentations will be recorded as a 5 mins you-tube video! We will learn how to do this. Cite the papers you used and the methods you implemented!! Do not copy codes form the internet!!! If you must copy one or two lines, cite the resources. Plagiarism is easy to detect these days!! Team members clearly specify who contributed what in your final report.

Reading Appendix A.2, 6.1

A pencil of rays contains all views Can generate any synthetic camera view as long as it has the same center of projection

How to do it? Basic Procedure: – Take a sequence of images from the same position – Rotate the camera about its optical center – Compute transformation between second image and first – Transform the second image overlap the first – Blend the two together to create a mosaic – If there are more images, repeat But wait, why should this work at all? – What about 3D geometry of the scenes? – Why aren’t we use it at all?

Image Alignment ses/CompPhoto/cpv03.pdf

Image reprojection The mosaic has a natural Interpretation in 3D The images are repojected onto a common plane The mosaic is formed on this plane Mosaic is a synthetic wide- angel camera

Homography A projective-mapping between any two PPs with the same center of projection Properties of projective transformations: Origin does not necessarily map to origin Lines map to lines Parallel lines do not necessarily remain parallel Ratios are not preserved Closed under composition P’ H P

Fitting: find the parameters of a model that best fit the data Alignment: find the parameters of the transformation that best align matched points Common problems in vision

Alignment Alignment: find parameters of model that maps one set of points to another Typically want to solve for a global transformation that accounts for *most* true correspondences Difficulties – Noise (typically 1-3 pixels) – Outliers (often 50%)

Computing transformations ?

Simple case: translations How do we solve for ?

Mean displacement = Simple case: translations Displacement of match i =

Another view System of linear equations – What are the knowns? Unknowns? – How many unknowns? How many equations (per match)?

Another view Problem: more equations than unknowns – “Overdetermined” system of equations – We will find the least squares solution

Least squares formulation For each point we define the residuals as

Least squares formulation Goal: minimize sum of squared residuals “Least squares” solution For translations, is equal to mean displacement

Least squares formulation Can also write as a matrix equation 2n x 22 x 12n x 1

Matrix Product mini-review ation ation System of linear equations tions

Matrix manipulations with Numpy course.eu/matrix_arithmetic.php course.eu/matrix_arithmetic.php 06/14/multiple-matrix-multiplication-in- numpy/ 06/14/multiple-matrix-multiplication-in- numpy/

Least squares Find t that minimizes

Least squares: find t to minimize To solve, form the normal equations Differentiate and equate to 0 to minimize

Affine transformations How many unknowns? How many equations per match? How many matches do we need?

Affine transformations Residuals: Cost function:

Affine transformations Matrix form 2n x 6 6 x 1 2n x 1

Homographies To unwarp (rectify) an image solve for homography H given p and p’ solve equations of the form: p’ = Hp p p’

Alternate formulation for homographies where the length of the vector [h 00 h 01 … h 22 ] is 1

Solving for homographies Linear or non-linear?

Solving for homographies

Defines a least squares problem: 2n × 9 9 2n Since is only defined up to scale, solve for unit vector

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

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

Recap: Two Common Optimization Problems Problem statementSolution Problem statementSolution (matlab)

Least squares: linear regression y = mx + b (y i, x i )

Linear regression residual error

Linear regression

Image Alignment Algorithm Given images A and B 1.Compute image features for A and B 2.Match features between A and B 3.Compute homography between A and B using least squares on set of matches What could go wrong?

Outliers outliers inliers

Robustness Problem: Fit a line to these datapointsLeast squares fit

What can we do? Suggestions?

Idea Given a hypothesized line Count the number of points that “agree” with the line – “Agree” = within a small distance of the line – I.e., the inliers to that line For all possible lines, select the one with the largest number of inliers

Counting inliers

Inliers: 3

Counting inliers Inliers: 20