图像拼接

从同一位置拍摄一系列图像,(旋转相机的光学中心),第二图像与第一图像之间的计算变换,将第二图像与第一个图像重叠,将两者混合在一起创建一个镶嵌图,如果有更多的图像,重复。
展开查看详情

1.Image Stitching Linda Shapiro EE/CSE 576 1

2.Combine two or more overlapping images to make one larger image Add example Slide credit: Vaibhav Vaish 2

3.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 Shift the second image to overlap with the first Blend the two together to create a mosaic If there are more images, repeat 3

4.1. Take a sequence of images from the same position Rotate the camera about its optical center 4

5.2. Compute transformation between images Extract interest points Find Matches Compute transformation ? 5

6.3. Shift the images to overlap 6

7.4. Blend the two together to create a mosaic 7

8.5. Repeat for all images 8

9.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 Shift the second image to overlap with the first Blend the two together to create a mosaic If there are more images, repeat ✓ 9

10.Compute Transformations Extract interest points Find good matches Compute transformation ✓ Let’s assume we are given a set of good matching interest points ✓ 10

11.mosaic PP Image reprojection The mosaic has a natural interpretation in 3D The images are reprojected onto a common plane The mosaic is formed on this plane 11

12.Example Camera Center 12

13.Image reprojection Observation Rather than thinking of this as a 3D reprojection, think of it as a 2D image warp from one image to another 13

14.Motion models What happens when we take two images with a camera and try to align them? translation? rotation? scale? affine? Perspective? 14

15.Recall: Projective transformations (aka homographies ) 15

16.Parametric (global) warping Examples of parametric warps: translation rotation aspect affine perspective 16

17.2D coordinate transformations translation: x’ = x + t x = ( x , y ) rotation: x’ = R x + t similarity: x’ = s R x + t affine: x’ = A x + t perspective: x ’  H x x = ( x , y ,1) ( x is a homogeneous coordinate ) 17

18.Image Warping Given a coordinate transform x’ = h ( x ) and a source image f ( x ), how do we compute a transformed image g ( x’ ) = f ( h ( x ))? f ( x ) g ( x’ ) x x’ h ( x ) 18

19.Forward Warping Send each pixel f ( x ) to its corresponding location x’ = h ( x ) in g ( x’ ) f ( x ) g ( x’ ) x x’ h ( x ) What if pixel lands “between” two pixels? 19

20.Forward Warping Send each pixel f ( x ) to its corresponding location x’ = h ( x ) in g ( x’ ) f ( x ) g ( x’ ) x x’ h ( x ) What if pixel lands “between” two pixels? Answer: add “contribution” to several pixels, normalize later ( splatting ) 20

21.21 Inverse Warping Get each pixel g ( x’ ) from its corresponding location x’ = h ( x ) in f ( x ) f ( x ) g ( x’ ) x x’ h -1 ( x ) What if pixel comes from “between” two pixels?

22.22 Inverse Warping Get each pixel g ( x’ ) from its corresponding location x’ = h ( x ) in f ( x ) What if pixel comes from “between” two pixels ? Answer: resample color value from interpolated source image f ( x ) g ( x’ ) x x’ h -1 ( x )

23.Interpolation Possible interpolation filters: nearest neighbor bilinear bicubic (interpolating ) 23

24.Motion models Translation 2 unknowns Affine 6 unknowns Perspective 8 unknowns 24

25.Finding the transformation Translation = 2 degrees of freedom Similarity = 4 degrees of freedom Affine = 6 degrees of freedom Homography = 8 degrees of freedom How many corresponding points do we need to solve? 25

26.Plane perspective mosaics 8-parameter generalization of affine motion works for pure rotation or planar surfaces Limitations: local minima slow convergence difficult to control interactively 26

27.Simple case: translations How do we solve for ? 27

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

29.Simple case: translations System of linear equations What are the knowns? Unknowns? How many unknowns? How many equations (per match)? 29