csce 641 computer graphics:csce 641 computer graphics ...gerig/cs6640-f2010/image-mosaicing...mosaic...

36
CSCE 641 Computer Graphics: CSCE 641 Computer Graphics: Image Mosaicing Jinxiang Chai Source: faculty.cs.tamu.edu/jchai/cpsc641_spring10/lectures/lecture8.ppt

Upload: others

Post on 14-Aug-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

CSCE 641 Computer Graphics:CSCE 641 Computer Graphics: Image Mosaicing

Jinxiang Chai

Source:faculty.cs.tamu.edu/jchai/cpsc641_spring10/lectures/lecture8.ppt

Page 2: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

OutlineOutline

Image registrationImage registration- How to break assumptions?

3D-2D registration

Image mosaicingg g

Page 3: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Mosaics: Stitching Image TogetherMosaics: Stitching Image Together

virtual wide-angle camera

Page 4: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Mosaic ProcedureMosaic ProcedureBasic Procedure

Page 5: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Mosaic ProcedureMosaic ProcedureBasic Procedure

Take a sequence of images from the same– Take a sequence of images from the same position

• Rotate the camera about its optical center

Page 6: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Mosaic ProcedureMosaic ProcedureBasic Procedure

Take a sequence of images from the same– Take a sequence of images from the same position

• Rotate the camera about its optical center

– Compute transformation between second image and first

Page 7: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Mosaic ProcedureMosaic ProcedureBasic Procedure

Take a sequence of images from the same– Take a sequence of images from the same position

• Rotate the camera about its optical center

– Compute transformation between second image and firstTransform the second image to overlap with the– Transform the second image to overlap with the first

Page 8: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Mosaic ProcedureMosaic ProcedureBasic Procedure

Take a sequence of images from the same– Take a sequence of images from the same position

• Rotate the camera about its optical center

– Compute transformation between second image and firstTransform the second image to overlap with the– Transform the second image to overlap with the first

– Blend the two together to create a mosaicg

Page 9: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Mosaic ProcedureMosaic ProcedureBasic Procedure

Take a sequence of images from the same– Take a sequence of images from the same position

• Rotate the camera about its optical center

– Compute transformation between second image and firstTransform the second image to overlap with the– Transform the second image to overlap with the first

– Blend the two together to create a mosaicg– If there are more images, repeat

Page 10: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Image MosaicImage MosaicIs a pencil of rays contains all views

realcamera

syntheticcamera

Can generate any synthetic camera viewas long as it has the same center of projection!

Page 11: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Image Re-projectionImage Re projection

mosaic PPThe mosaic has a natural interpretation in 3D

– The images are reprojected onto a common planeThe images are reprojected onto a common plane– The mosaic is formed on this plane– Mosaic is a synthetic wide-angle camera

Page 12: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Issues in Image MosaicIssues in Image MosaicHow to relate two images from the same camera center?

- image registration

How to re-project images to a common plane?image warping- image warping

?

?

mosaic PP

Page 13: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Image MosaicingImage Mosaicing

Geometric relationship between imagesGeometric relationship between images

Page 14: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Image MosaicingImage Mosaicing

Geometric relationship between imagesGeometric relationship between images– Use 8-parameter projective transformation matrix

' xcbax

111' y

hgfedy

Page 15: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Image MosaicingImage Mosaicing

Geometric relationship between imagesGeometric relationship between images– Use 8-parameter projective transformation matrix

' xcbax

111' y

hgfedy

– Use a 3D rotation model (one R per image)

0200100 rfrr

1

210

1

21

1

20

1201110

0200100

frf

fr

fr

rfrrrfrr

Derive it by yourself!

Page 16: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Image MosaicingImage MosaicingGeometric relationship between images

– Use 8-parameter projective transformation matrix– Use a 3D rotation model (one R per image)

Register all pairwise overlapping images– Feature-based registrationFeature based registration– Pixel-based registration

Chain together inter-frame rotations

Page 17: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Image StitchingImage Stitching

Stitch pairs together, blend, then crop

Page 18: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Image StitchingImage StitchingA big image stitched from 5 small imagesg g g

Page 19: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

PanoramasPanoramasWhat if you want a 360 field of view?

mosaic Projection Cylinder

Page 20: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical PanoramasCylindrical Panoramas

Steps– Re-project each image onto a cylinder– Blend – Output the resulting mosaic

Page 21: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical ProjectionCylindrical Projection– Map 3D point (X,Y,Z) onto

li dcylinder

YX

Y

Z

unit cylinder

Page 22: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical ProjectionCylindrical Projection– Map 3D point (X,Y,Z) onto

li dcylinder

Y – Convert to cylindrical coordinatesX

Y

Z

Convert to cylindrical coordinates

unit cylinder

unwrapped cylinderunwrapped cylinder

Page 23: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical ProjectionCylindrical Projection– Map 3D point (X,Y,Z) onto

li dcylinder

Y – Convert to cylindrical coordinatesX

Y

Z

Convert to cylindrical coordinates

– Convert to cylindrical image coordinatescoordinates

• s defines size of the final image

unit cylinder

unwrapped cylinderunwrapped cylinder

cylindrical image

Page 24: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical PanoramasCylindrical Panoramas

A

BB

mosaic Projection Cylinder

Cannot map point A to Point B without knowing (X,Y,Z)

Page 25: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical PanoramasCylindrical Panoramas

B

A

BC

mosaic Projection Cylinder

But we can map point C (images) to Point B.p p ( g )

Page 26: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical WarpingCylindrical WarpingGiven focal length f

d i tand image center (xc,yc)

Y

(X,Y,Z)

(sin,h,cos)

X

YZ

Page 27: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical PanoramasCylindrical PanoramasMap image to cylindrical or spherical coordinates

– need known focal length

f = 180 (pixels)Image 384x300 f = 380f = 280

Page 28: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical PanoramaCylindrical Panorama

3D rotation registration of four images taken with a handheld camera.

Page 29: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Cylindrical PanoramaCylindrical Panorama

Page 30: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Recognizing panoramasRecognizing panoramas

• A fully automatic 2D image stitcher systemA fully automatic 2D image stitcher system

I t IInput Images

Output panorama #1Output panorama #1

Page 31: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Recognizing panoramasRecognizing panoramas

• A fully automatic 2D image stitcher systemA fully automatic 2D image stitcher system

I t IInput Images

Output panorama #2

Page 32: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Recognizing panoramasRecognizing panoramas

• A fully automatic 2D image stitcher systemA fully automatic 2D image stitcher system

I t IInput Images

Output panorama #3

Page 33: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Recognizing panoramasRecognizing panoramas

• A fully automatic 2D image stitcher systemA fully automatic 2D image stitcher system

Input Images

- How to recognize which images can be used for panoramas?How to stitch them automatically?- How to stitch them automatically?

Page 34: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Recognizing panoramasRecognizing panoramas

• A fully automatic 2D image stitcher systemA fully automatic 2D image stitcher system

Page 35: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

Recognizing panoramasRecognizing panoramas

• A fully automatic 2D image stitcher systemA fully automatic 2D image stitcher system

Image matching with SIFT features- Image matching with SIFT features

- For every image, find the M best images with RANSAC

- Form a graph and find connected component in the graph

- Stitching and blending.

Page 36: CSCE 641 Computer Graphics:CSCE 641 Computer Graphics ...gerig/CS6640-F2010/image-mosaicing...Mosaic ProcedureMosaic Procedure Basic Procedure – Take a sequence of images from the

OutlineOutline

Image registrationImage registration- How to break assumptions? (cont.)

3D-2D registration

Image mosaicingg g