Automatic Image Alignment

Similar documents
Automatic Image Alignment

Automatic Image Alignment (feature-based)

Feature Based Registration - Image Alignment

Automatic Image Alignment (direct) with a lot of slides stolen from Steve Seitz and Rick Szeliski

Feature Matching and RANSAC

Motion Estimation and Optical Flow Tracking

Object Recognition with Invariant Features

Computer Vision for HCI. Topics of This Lecture

Wikipedia - Mysid

Prof. Feng Liu. Spring /26/2017

Local features: detection and description. Local invariant features

Homographies and RANSAC

Lecture: RANSAC and feature detectors

Local invariant features

Building a Panorama. Matching features. Matching with Features. How do we build a panorama? Computational Photography, 6.882

CS5670: Computer Vision

CS 4495 Computer Vision A. Bobick. CS 4495 Computer Vision. Features 2 SIFT descriptor. Aaron Bobick School of Interactive Computing

Image Stitching. Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi

Stitching and Blending

Local features and image matching. Prof. Xin Yang HUST

Local Feature Detectors

Local features: detection and description May 12 th, 2015

Mosaics. Today s Readings

Image matching. Announcements. Harder case. Even harder case. Project 1 Out today Help session at the end of class. by Diva Sian.

Image Features. Work on project 1. All is Vanity, by C. Allan Gilbert,

Multi-Image Matching using Multi-Scale Oriented Patches

Image-based Modeling and Rendering: 8. Image Transformation and Panorama

Lecture 6: Finding Features (part 1/2)

Today s lecture. Image Alignment and Stitching. Readings. Motion models

Harder case. Image matching. Even harder case. Harder still? by Diva Sian. by swashford

Midterm Wed. Local features: detection and description. Today. Last time. Local features: main components. Goal: interest operator repeatability

BSB663 Image Processing Pinar Duygulu. Slides are adapted from Selim Aksoy

Harder case. Image matching. Even harder case. Harder still? by Diva Sian. by swashford

Instance-level recognition

The SIFT (Scale Invariant Feature

Edge and corner detection

Image correspondences and structure from motion

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Instance-level recognition

Problems with template matching

Patch Descriptors. EE/CSE 576 Linda Shapiro

Local Image Features

3D from Photographs: Automatic Matching of Images. Dr Francesco Banterle

Image warping and stitching

Evaluation and comparison of interest points/regions

Feature Detectors and Descriptors: Corners, Lines, etc.

Feature Detection and Matching

SIFT: SCALE INVARIANT FEATURE TRANSFORM SURF: SPEEDED UP ROBUST FEATURES BASHAR ALSADIK EOS DEPT. TOPMAP M13 3D GEOINFORMATION FROM IMAGES 2014

Invariant Features from Interest Point Groups

Motion illusion, rotating snakes

Image warping and stitching

Video Google: A Text Retrieval Approach to Object Matching in Videos

Outline 7/2/201011/6/

Instance-level recognition part 2

Patch Descriptors. CSE 455 Linda Shapiro

CSE 252B: Computer Vision II

Image Features: Local Descriptors. Sanja Fidler CSC420: Intro to Image Understanding 1/ 58

Image stitching. Announcements. Outline. Image stitching

A Comparison of SIFT, PCA-SIFT and SURF

Local Features: Detection, Description & Matching

Features Points. Andrea Torsello DAIS Università Ca Foscari via Torino 155, Mestre (VE)

Visual Tracking (1) Tracking of Feature Points and Planar Rigid Objects

Lecture 10 Detectors and descriptors

Local Image Features

School of Computing University of Utah

CS4670: Computer Vision

Keypoint detection. (image registration, panorama stitching, motion estimation + tracking, recognition )

CS 1674: Intro to Computer Vision. Midterm Review. Prof. Adriana Kovashka University of Pittsburgh October 10, 2016

Computer Vision. Recap: Smoothing with a Gaussian. Recap: Effect of σ on derivatives. Computer Science Tripos Part II. Dr Christopher Town

Computer Vision I - Filtering and Feature detection

Image warping and stitching

Augmented Reality VU. Computer Vision 3D Registration (2) Prof. Vincent Lepetit

Computer Vision I - Basics of Image Processing Part 2

EECS150 - Digital Design Lecture 14 FIFO 2 and SIFT. Recap and Outline

Instance-level recognition II.

Low-level Vision Processing Algorithms Speaker: Ito, Dang Supporter: Ishii, Toyama and Y. Murakami

Image stitching. Digital Visual Effects Yung-Yu Chuang. with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac

Computer Vision I - Appearance-based Matching and Projective Geometry

Feature Detection. Raul Queiroz Feitosa. 3/30/2017 Feature Detection 1

Local features and image matching May 8 th, 2018

Computer Vision I - Appearance-based Matching and Projective Geometry

3D Photography. Marc Pollefeys, Torsten Sattler. Spring 2015

SUMMARY: DISTINCTIVE IMAGE FEATURES FROM SCALE- INVARIANT KEYPOINTS

More Mosaic Madness. CS194: Image Manipulation & Computational Photography. Steve Seitz and Rick Szeliski. Jeffrey Martin (jeffrey-martin.

A NEW FEATURE BASED IMAGE REGISTRATION ALGORITHM INTRODUCTION

Matching. Compare region of image to region of image. Today, simplest kind of matching. Intensities similar.

Final Exam Study Guide

CAP 5415 Computer Vision Fall 2012

CSE 527: Introduction to Computer Vision

CS 378: Autonomous Intelligent Robotics. Instructor: Jivko Sinapov

Multi-modal Registration of Visual Data. Massimiliano Corsini Visual Computing Lab, ISTI - CNR - Italy

Step-by-Step Model Buidling

Feature Matching and Robust Fitting

CS664 Lecture #19: Layers, RANSAC, panoramas, epipolar geometry

Image stitching. Digital Visual Effects Yung-Yu Chuang. with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac

AK Computer Vision Feature Point Detectors and Descriptors

LOCAL AND GLOBAL DESCRIPTORS FOR PLACE RECOGNITION IN ROBOTICS

3D Vision. Viktor Larsson. Spring 2019

Keypoint-based Recognition and Object Search

Local Image preprocessing (cont d)

Transcription:

Automatic Image Alignment with a lot of slides stolen from Steve Seitz and Rick Szeliski Mike Nese CS194: Image Manipulation & Computational Photography Alexei Efros, UC Berkeley, Fall 2018

Live Homography https://www.youtube.com/watch?v=qtoxoij1q28 Also see OpenPhoto VR: http://openphotovr.org/

Image Alignment How do we align two images automatically? Two broad approaches: Feature-based alignment Find a few matching features in both images compute alignment Direct (pixel-based) alignment Search for alignment where most pixels agree

Direct Alignment The simplest approach is a brute force search (hw1) Need to define image matching function SSD, Normalized Correlation, edge matching, etc. Search over all parameters within a reasonable range: e.g. for translation: for tx=x0:step:x1, for ty=y0:step:y1, compare image1(x,y) to image2(x+tx,y+ty) end; end; Need to pick correct x0,x1 and step What happens if step is too large?

Direct Alignment (brute force) What if we want to search for more complicated transformation, e.g. homography? wx' wy' w = a d g c x f y i 1 for a=a0:astep:a1, for b=b0:bstep:b1, for c=c0:cstep:c1, for d=d0:dstep:d1, for e=e0:estep:e1, for f=f0:fstep:f1, for g=g0:gstep:g1, for h=h0:hstep:h1, compare image1 to H(image2) end; end; end; end; end; end; end; end; b e h

Problems with brute force Not realistic Search in O(N 8 ) is problematic Not clear how to set starting/stopping value and step What can we do? Use pyramid search to limit starting/stopping/step values For special cases (rotational panoramas), can reduce search slightly to O(N 4 ): H = K 1 R 1 R 2-1 K 2-1 (4 DOF: f and rotation) Alternative: gradient decent on the error function i.e. how do I tweak my current estimate to make the SSD error go down? Can do sub-pixel accuracy BIG assumption? Images are already almost aligned (<2 pixels difference!) Can improve with pyramid Same tool as in motion estimation

Image alignment

Feature-based alignment 1. Feature Detection: find a few important features (aka Interest Points) in each image separately 2. Feature Matching: match them across two images 3. Compute image transformation: as per Project #6 Part I How do we choose good features automatically? They must be prominent in both images Easy to localize Think how you did that by hand in Project #6 Part I Corners!

Feature Detection

Feature Matching How do we match the features between the images? Need a way to describe a region around each feature e.g. image patch around each feature Use successful matches to estimate homography Issues: Need to do something to get rid of outliers What if the image patches for several interest points look similar? Make patch size bigger What if the image patches for the same feature look different due to scale, rotation, etc. Need an invariant descriptor

Invariant Feature Descriptors Schmid & Mohr 1997, Lowe 1999, Baumberg 2000, Tuytelaars & Van Gool 2000, Mikolajczyk & Schmid 2001, Brown & Lowe 2002, Matas et. al. 2002, Schaffalitzky & Zisserman 2002

Invariant Local Features Image content is transformed into local feature coordinates that are invariant to translation, rotation, scale, and other imaging parameters Features Descriptors

Applications Feature points are used for: Image alignment (homography, fundamental matrix) 3D reconstruction Motion tracking Object recognition Indexing and database retrieval Robot navigation other

Today s lecture 1 Feature detector scale invariant Harris corners 1 Feature descriptor patches, oriented patches Reading: Multi-image Matching using Multi-scale image patches, CVPR 2005

Feature Detector Harris Corner

Harris corner detector C.Harris, M.Stephens. A Combined Corner and Edge Detector. 1988

The Basic Idea We should easily recognize the point by looking through a small window Shifting a window in any direction should give a large change in intensity

Harris Detector: Basic Idea flat region: no change in all directions edge : no change along the edge direction corner : significant change in all directions

Harris Detector: Mathematics Change of intensity for the shift [u,v]: xy, [ ] 2 Euv (, ) = wxy (, ) Ix ( + uy, + v) Ixy (, ) Window function Shifted intensity Intensity Window function w(x,y) = or 1 in window, 0 outside Gaussian

Harris Detector: Mathematics For small shifts [u,v] we have a bilinear approximation: u Euv (, ) [ uv, ] M v where M is a 2 2 matrix computed from image derivatives: M 2 Ix II x y = wxy (, ) 2 xy, II x y Iy

Harris Detector: Mathematics Classification of image points using eigenvalues of M: λ 2 Edge λ 2 >> λ 1 Corner λ 1 and λ 2 are large, λ 1 ~ λ 2 ; E increases in all directions λ 1 and λ 2 are small; E is almost constant in all directions Flat region Edge λ 1 >> λ 2 λ 1

Harris Detector: Mathematics Measure of corner response: R = det M Trace M det M trace M = λλ 1 2 = λ + λ 1 2

Harris Detector The Algorithm: Find points with large corner response function R (R > threshold) Take the points of local maxima of R

Harris Detector: Workflow

Harris Detector: Workflow Compute corner response R

Harris Detector: Workflow Find points with large corner response: R>threshold

Harris Detector: Workflow Take only the points of local maxima of R

Harris Detector: Workflow

Harris Detector: Some Properties Rotation invariance Ellipse rotates but its shape (i.e. eigenvalues) remains the same Corner response R is invariant to image rotation

Harris Detector: Some Properties Partial invariance to affine intensity change Only derivatives are used => invariance to intensity shift I I + b Intensity scale: I a I R threshold R x (image coordinate) x (image coordinate)

Harris Detector: Some Properties But: non-invariant to image scale! All points will be classified as edges Corner!

Scale Invariant Detection Consider regions (e.g. circles) of different sizes around a point Regions of corresponding sizes will look the same in both images

Scale Invariant Detection The problem: how do we choose corresponding circles independently in each image? Choose the scale of the best corner

Feature selection Distribute points evenly over the image

Adaptive Non-maximal Suppression Desired: Fixed # of features per image Want evenly distributed spatially Sort points by non-maximal suppression radius [Brown, Szeliski, Winder, CVPR 05]

Feature descriptors We know how to detect points Next question: How to match them?? Point descriptor should be: 1. Invariant 2. Distinctive

Feature Descriptor MOPS

Multi-Scale Oriented Patches Interest points Multi-scale Harris corners Orientation from blurred gradient Geometrically invariant to rotation Descriptor vector Bias/gain normalized sampling of local patch (8x8) Photometrically invariant to affine changes in intensity [Brown, Szeliski, Winder, CVPR 2005]

Detect Features, setup Frame Orientation = blurred gradient Rotation Invariant Frame Scale-space position (x, y, s) + orientation (θ)

Detections at multiple scales

MOPS descriptor vector 8x8 oriented patch Sampled at 5 x scale Bias/gain normalisation: I = (I µ)/σ 8 pixels

Automatic Feature Matching

Feature matching?

Feature matching Pick best match! For every patch in image 1, find the most similar patch (e.g. by SSD). Called nearest neighbor in machine learning Can do various speed ups: Hashing compute a short descriptor from each feature vector, or hash longer descriptors (randomly) Fast Nearest neighbor techniques kd-trees and their variants Clustering / Vector quantization So called visual words

What about outliers??

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?

Feature-space outlier rejection Let s not match all features, but only these that have similar enough matches? How can we do it? Symmetry: x s NN is y, and y s NN is x

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?

Feature-space outliner rejection Can we now compute H from the blue points? No! Still too many outliers What can we do?

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: 1. Select four feature pairs (at random) 2. Compute homography H (exact) 3. Compute inliers where SSD(p i, H p i) < ε 4. Keep largest set of inliers 5. Re-compute least-squares H estimate on all of the inliers

RANSAC

Example: Recognising Panoramas M. Brown and D. Lowe, University of British Columbia

Why Recognising Panoramas?

Why Recognising Panoramas? 1D Rotations (θ) Ordering matching images

Why Recognising Panoramas? 1D Rotations (θ) Ordering matching images

Why Recognising Panoramas? 1D Rotations (θ) Ordering matching images

Why Recognising Panoramas? 1D Rotations (θ) Ordering matching images 2D Rotations (θ, φ) Ordering matching images

Why Recognising Panoramas? 1D Rotations (θ) Ordering matching images 2D Rotations (θ, φ) Ordering matching images

Why Recognising Panoramas? 1D Rotations (θ) Ordering matching images 2D Rotations (θ, φ) Ordering matching images

Why Recognising Panoramas?

Overview Feature Matching Image Matching Bundle Adjustment Multi-band Blending Results Conclusions

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

Multi-band Blending Burt & Adelson 1983 Blend frequency bands over range λ

Results