Automatic Image Alignment, Part 3
with a lot of slides stolen from
Steve Seitz and Rick Szeliski
© Mike Nese
CS180: Intro to Comp. Vision and Comp. Photo
Alexei Efros, UC Berkeley, Fall 2024
Feature-space outliner rejection
Can we now compute H from the blue points?
Matching features
What do we do about the “bad” matches?
RAndom SAmple Consensus
Select one match, count inliers
RAndom SAmple Consensus
Select one match, count inliers
Least squares fit
Find “average” translation vector
RANSAC for estimating homography
RANSAC loop:
RANSAC
Example: Recognising Panoramas
M. Brown and D. Lowe,
University of British Columbia
Why “Recognising Panoramas”?
Why “Recognising Panoramas”?
1D Rotations (θ)
Why “Recognising Panoramas”?
1D Rotations (θ)
Why “Recognising Panoramas”?
1D Rotations (θ)
Why “Recognising Panoramas”?
1D Rotations (θ)
Why “Recognising Panoramas”?
1D Rotations (θ)
Why “Recognising Panoramas”?
1D Rotations (θ)
Why “Recognising Panoramas”?
RANSAC for Homography
RANSAC for Homography
RANSAC for Homography
Probabilistic model for verification
Finding the panoramas
Finding the panoramas
Finding the panoramas
Finding the panoramas
Homography for Rotation
Parameterise each camera by rotation and focal length
This gives pairwise homographies
Bundle Adjustment
New images initialised with rotation, focal length of best matching image
Bundle Adjustment
New images initialised with rotation, focal length of best matching image
Results
Bad panorama?
Output of Brown & Lowe software
No geometrically consistent solution
The Chair
David Hockney (1985)
Joiners are popular
4,985 photos matching joiners.
4,007 photos matching Hockney.
41 groups about Hockney
Thousands of members
Flickr statistics:
Main goals: ���Automate joiners�� Generalize panoramas to general image collections
Zelnik-Manor & Perona (2007)
Objectives
For Artists:�Reduce manual labor
Manual: ~40min.
Fully automatic
Objectives
For Artists:�Reduce manual labor
For non-artists:�Generate pleasing-to-the-eye joiners
Objectives
For Artists:�Reduce manual labor
For non-artists:�Generate pleasing-to-the-eye joiners
For data exploration:�Organize images spatially
What’s going on here?
A cacti garden
Principles
Principles
Convey topology�
Correct
Incorrect
Principles
Convey topology�
A 2D layering of images
Blending:
blurry
Graph-cut:
cuts hood
Desired joiner
Principles
Convey topology�
A 2D layering of images�
Don’t distort images�
rotate
scale
translate
Principles
Convey topology�
A 2D layering of images�
Don’t distort images�
Minimize inconsistencies
Good
Bad
Algorithm
Step 1: Feature matching
Brown & Lowe, ICCV’03
Step 2: Align
Large inconsistencies
Brown & Lowe, ICCV’03
Step 3: Order
Reduced inconsistencies
Ordering images
Try all orders: only for small datasets
Ordering images
Try all orders: only for small datasets�
complexity: (m+n)α�m = # images�n = # overlaps�α = # acyclic orders
Ordering images
Observations:
Ordering images
Approximate solution:
Can we do better?
Step 4: Improve alignment
Iterate Align-Order-Importance
Iterative refinement
Initial
Final
Iterative refinement
Initial
Final
Iterative refinement
Initial
Final
What is this?
That’s me reading
Anza-Borrego
Tractor
Art reproduction
Paolo Uccello, 1436
Art reproduction
Paolo Uccello, 1436
Zelnik & Perona, 2006
Art reproduction
Single view-point
Zelnik & Perona, 2006
Manual by Photographer
Our automatic result
Homage to David Hockney
This Class Project
http://www.cs.cmu.edu/afs/andrew/scs/cs/15-463/f07/proj_final/www/echuangs/
Limitations of Alignment
We need to know the global transform (e.g. affine, homography, etc)
Optical flow
Will start by estimating motion of each pixel separately
Then will consider motion of entire image
Why estimate motion?
Lots of uses
Problem definition: optical flow
How to estimate pixel motion from image H to image I?
Key assumptions
This is called the optical flow problem
Optical flow constraints (grayscale images)
Let’s look at these constraints more closely
Optical flow equation
Combining these two equations
In the limit as u and v go to zero, this becomes exact
Optical flow equation
Q: how many unknowns and equations per pixel?
Intuitively, what does this constraint mean?
Aperture problem
Aperture problem
Solving the aperture problem
How to get more equations for a pixel?
RGB version
How to get more equations for a pixel?
Lukas-Kanade flow
Prob: we have more equations than unknowns
Solution: solve least squares problem
Conditions for solvability
When is This Solvable?
ATA is solvable when there is no aperture problem
Local Patch Analysis
Edge
Low texture region
High textured region
Observation
This is a two image problem BUT
Errors in Lukas-Kanade
When our assumptions are violated
Iterative Refinement
Iterative Lukas-Kanade Algorithm
- use image warping techniques
Revisiting the small motion assumption
Is this motion small enough?
Reduce the resolution!
Coarse-to-fine optical flow estimation
image I
image H
Gaussian pyramid of image H
Gaussian pyramid of image I
image I
image H
u=10 pixels
u=5 pixels
u=2.5 pixels
u=1.25 pixels
Coarse-to-fine optical flow estimation
image I
image J
Gaussian pyramid of image H
Gaussian pyramid of image I
image I
image H
run iterative L-K
run iterative L-K
warp & upsample
.
.
.