Download - Image Stitching II
![Page 1: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/1.jpg)
Image Stitching II
Ali FarhadiCSE 455
Several slides from Rick Szeliski, Steve Seitz, Derek Hoiem, and Ira Kemelmacher
![Page 2: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/2.jpg)
RANSAC for Homography
Initial Matched Points
![Page 3: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/3.jpg)
RANSAC for Homography
Final Matched Points
![Page 4: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/4.jpg)
RANSAC for Homography
![Page 5: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/5.jpg)
Image Blending
![Page 6: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/6.jpg)
Feathering
01
01
+
=
![Page 7: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/7.jpg)
Effect of window (ramp-width) size
0
1 left
right0
1
![Page 8: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/8.jpg)
Effect of window size
0
1
0
1
![Page 9: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/9.jpg)
Good window size
0
1
“Optimal” window: smooth but not ghosted• Doesn’t always work...
![Page 10: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/10.jpg)
Pyramid blending
Create a Laplacian pyramid, blend each level• Burt, P. J. and Adelson, E. H., A multiresolution spline with applications to image mosaics, ACM Transactions on
Graphics, 42(4), October 1983, 217-236.
![Page 11: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/11.jpg)
Gaussian Pyramid Laplacian Pyramid
The Laplacian Pyramid
0G
1G
2GnG
- =
0L
- =1L
- = 2Lnn GL
)expand( 1 iii GGL)expand( 1 iii GLG
![Page 12: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/12.jpg)
Laplacianlevel
4
Laplacianlevel
2
Laplacianlevel
0
left pyramid right pyramid blended pyramid
![Page 13: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/13.jpg)
Laplacian image blend
1. Compute Laplacian pyramid2. Compute Gaussian pyramid on weight image 3. Blend Laplacians using Gaussian blurred
weights4. Reconstruct the final image
![Page 14: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/14.jpg)
Multiband Blending with Laplacian Pyramid
0
1
0
1
0
1
Left pyramid Right pyramidblend
• At low frequencies, blend slowly• At high frequencies, blend quickly
![Page 15: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/15.jpg)
Multiband blending
1. Compute Laplacian pyramid of images and mask
2. Create blended image at each level of pyramid
3. Reconstruct complete image
Laplacian pyramids
![Page 16: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/16.jpg)
Blending comparison (IJCV 2007)
![Page 17: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/17.jpg)
Poisson Image Editing
• For more info: Perez et al, SIGGRAPH 2003– http://research.microsoft.com/vision/cambridge/papers/perez_siggraph03.pdf
![Page 18: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/18.jpg)
Encoding blend weights: I(x,y) = (αR, αG, αB, α)
color at p =
Implement this in two steps:1. accumulate: add up the (α premultiplied) RGBα values at each pixel
2. normalize: divide each pixel’s accumulated RGB by its α value
Alpha Blending
Optional: see Blinn (CGA, 1994) for details:http://ieeexplore.ieee.org/iel1/38/7531/00310740.pdf?isNumber=7531&prod=JNL&arnumber=310740&arSt=83&ared=87&arAuthor=Blinn%2C+J.F.
I1
I2
I3
p
![Page 19: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/19.jpg)
Choosing seams
Image 1
Image 2
x x
im1 im2
• Easy method– Assign each pixel to image with nearest center
![Page 20: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/20.jpg)
Choosing seams
• Easy method– Assign each pixel to image with nearest center– Create a mask: – Smooth boundaries ( “feathering”): – Composite
Image 1
Image 2
x x
im1 im2
![Page 21: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/21.jpg)
Choosing seams
• Better method: dynamic program to find seam along well-matched regions
Illustration: http://en.wikipedia.org/wiki/File:Rochester_NY.jpg
![Page 22: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/22.jpg)
Gain compensation• Simple gain adjustment
– Compute average RGB intensity of each image in overlapping region
– Normalize intensities by ratio of averages
![Page 23: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/23.jpg)
Blending Comparison
![Page 24: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/24.jpg)
Recognizing Panoramas
Brown and Lowe 2003, 2007Some of following material from Brown and Lowe 2003 talk
![Page 25: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/25.jpg)
Recognizing Panoramas
Input: N images1. Extract SIFT points, descriptors from all
images2. Find K-nearest neighbors for each point (K=4)3. For each image
a) Select M candidate matching images by counting matched keypoints (m=6)
b) Solve homography Hij for each matched image
![Page 26: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/26.jpg)
Recognizing Panoramas
Input: N images1. Extract SIFT points, descriptors from all images2. Find K-nearest neighbors for each point (K=4)3. For each image
a) Select M candidate matching images by counting matched keypoints (m=6)
b) Solve homography Hij for each matched imagec) Decide if match is valid (ni > 8 + 0.3 nf )
# inliers # keypoints in overlapping area
![Page 27: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/27.jpg)
Recognizing Panoramas (cont.)
(now we have matched pairs of images)4. Find connected components
![Page 28: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/28.jpg)
Finding the panoramas
![Page 29: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/29.jpg)
Finding the panoramas
![Page 30: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/30.jpg)
Finding the panoramas
![Page 31: Image Stitching II](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816647550346895dd9bdcf/html5/thumbnails/31.jpg)
Recognizing Panoramas (cont.)
(now we have matched pairs of images)4. Find connected components5. For each connected component
a) Solve for rotation and fb) Project to a surface (plane, cylinder, or sphere)c) Render with multiband blending