680 likes | 923 Views
Image Stitching. Tamara Berg CSE 590 Computational Photography. Many slides from Alyosha Efros & Derek Hoiem. How can we align two pictures?. What about global matching?. How can we align two pictures?. Global matching? But what if Not just translation change, but rotation and scale?
E N D
Image Stitching Tamara Berg CSE 590 Computational Photography Many slides from AlyoshaEfros & Derek Hoiem
How can we align two pictures? • What about global matching?
How can we align two pictures? • Global matching? • But what if • Not just translation change, but rotation and scale? • Only small pieces of the pictures match?
Keypoint Matching 1. Find a set of distinctive key- points 2. Define a region around each keypoint A1 B3 3. Extract and normalize the region content A2 A3 B2 B1 4. Compute a local descriptor from the normalized region 5. Match local descriptors K. Grauman, B. Leibe
Main challenges • Change in position, scale, and rotation • Change in viewpoint • Occlusion • Articulation, change in appearance
Question • Why not just take every patch in the original image and find best match in second image?
Goals for Keypoints Detect points that are repeatable and distinctive
Key trade-offs B3 A1 A2 A3 B2 B1 Localization More Repeatable More Points Robust to occlusion Works with less texture Robust detection Precise localization Description More Selective More Robust Minimize wrong matches Deal with expected variations Maximize correct matches
Keypoint Localization • Goals: • Repeatable detection • Precise localization K. Grauman, B. Leibe
Choosing interest points • If you wanted to meet a friend would you say • “Let’s meet on campus.” • “Let’s meet on Green street.” • “Let’s meet at Green and Wright.” • Or if you were in a secluded area: • “Let’s meet in the Plains of Akbar.” • “Let’s meet on the side of Mt. Doom.” • “Let’s meet on top of Mt. Doom.”
Choosing interest points • Corners • “Let’s meet at Green and Wright.” • Peaks/Valleys • “Let’s meet on top of Mt. Doom.”
Many Existing Detectors Available Hessian & Harris[Beaudet ‘78], [Harris ‘88] Laplacian, DoG[Lindeberg ‘98], [Lowe 1999] Harris-/Hessian-Laplace [Mikolajczyk & Schmid ‘01] Harris-/Hessian-Affine [Mikolajczyk & Schmid ‘04] EBR and IBR [Tuytelaars & Van Gool ‘04] MSER[Matas ‘02] Salient Regions [Kadir & Brady ‘01] Others… K. Grauman, B. Leibe
Harris Detector [Harris88] Intuition: Search for local neighborhoods where the image content has two main directions. K. Grauman, B. Leibe
Harris Detector – Responses [Harris88] Effect: A very precise corner detector.
Automatic Scale Selection How to find corresponding patch sizes? K. Grauman, B. Leibe
Automatic Scale Selection • Function responses for increasing scale (scale signature) K. Grauman, B. Leibe
Automatic Scale Selection • Function responses for increasing scale (scale signature) K. Grauman, B. Leibe
Automatic Scale Selection • Function responses for increasing scale (scale signature) K. Grauman, B. Leibe
Automatic Scale Selection • Function responses for increasing scale (scale signature) K. Grauman, B. Leibe
Automatic Scale Selection • Function responses for increasing scale (scale signature) K. Grauman, B. Leibe
Automatic Scale Selection • Function responses for increasing scale (scale signature) K. Grauman, B. Leibe
What Is A Useful Signature Function? • Difference of Gaussian = “blob” detector K. Grauman, B. Leibe
DoG – Efficient Computation • Computation in Gaussian scale pyramid Sampling withstep s4=2 s s s s Original image K. Grauman, B. Leibe
Results: Lowe’s DoG K. Grauman, B. Leibe
p 2 0 Orientation Normalization [Lowe, SIFT, 1999] • Compute orientation histogram • Select dominant orientation • Normalize: rotate to fixed orientation T. Tuytelaars, B. Leibe
Available at a web site near you… • For most local feature detectors, executables are available online: • http://robots.ox.ac.uk/~vgg/research/affine • http://www.cs.ubc.ca/~lowe/keypoints/ • http://www.vision.ee.ethz.ch/~surf K. Grauman, B. Leibe
Local Descriptors • The ideal descriptor should be • Robust • Distinctive • Compact • Efficient • Most available descriptors focus on edge/gradient information • Capture texture information • Color rarely used K. Grauman, B. Leibe
Local Descriptors: SIFT Descriptor • Histogram of oriented gradients • Captures important texture information • Robust to small translations / affine deformations [Lowe, ICCV 1999] K. Grauman, B. Leibe
What to use when? Detectors • Harris gives very precise localization but doesn’t predict scale • Good for some tracking applications • DOG (difference of Gaussian) provides ok localization and scale • Good for multi-scale or long-range matching Descriptors • SIFT: good general purpose descriptor
Things to remember • Keypoint detection: repeatable and distinctive • Corners, blobs • Harris, DoG • Descriptors: robust and selective • SIFT: spatial histograms of gradient orientation
Image Stitching • Combine two or more overlapping images to make one larger image Add example Slide credit: Vaibhav Vaish
Panoramic Imaging • Higher resolution photographs, stitched from multiple images • Capture scenes that cannot be captured in one frame • Cheaply and easily achieve effects that used to cost a lot of money
Pike’s Peak Highway, CO Photo: Russell J. Hewett Nikon D70s, Tokina 12-24mm @ 16mm, f/22, 1/40s
Pike’s Peak Highway, CO Photo: Russell J. Hewett (See Photo On Web)
360 Degrees, Tripod Leveled Photo: Russell J. Hewett Nikon D70, Tokina 12-24mm @ 12mm, f/8, 1/125s
Howth, Ireland Photo: Russell J. Hewett (See Photo On Web)
Capturing Panoramic Images • Tripod vs Handheld • Help from modern cameras • Leveling tripod • Or wing it • Image Sequence • Requires a reasonable amount of overlap (at least 15-30%) • Enough to overcome lens distortion • Exposure • Consistent exposure between frames • Gives smooth transitions • Manual exposure • Caution • Distortion in lens (Pin Cushion, Barrel, and Fisheye) • Motion in scene
Handheld Camera Photo: Russell J. Hewett Nikon D70s, Nikon 18-70mm @ 70mm, f/6.3, 1/200s
Handheld Camera Photo: Russell J. Hewett
Les Diablerets, Switzerland Photo: Russell J. Hewett (See Photo On Web)
Macro Photo: Russell J. Hewett & Bowen Lee Nikon D70s, Tamron 90mm Micro @ 90mm, f/10, 15s
Side of Laptop Photo: Russell J. Hewett & Bowen Lee
Ghosting and Variable Intensity Photo: Russell J. Hewett Nikon D70s, Tokina 12-24mm @ 12mm, f/8, 1/400s
Ghosting From Motion Photo: Bowen Lee Nikon e4100 P&S
Motion Between Frames Photo: Russell J. Hewett Nikon D70, Nikon 70-210mm @ 135mm, f/11, 1/320s