panoramas - computer graphics · the sidewalk art of julian beever! marc levoy reprojecting...

31
Marc Levoy Computer Science Department Stanford University CS 178, Spring 2010 Panoramas

Upload: others

Post on 04-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

Marc LevoyComputer Science DepartmentStanford University

CS 178, Spring 2010

Panoramas

Page 2: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

What is a panorama?

! a wider-angle image than a normal camera can capture

! any image stitched from overlapping photographs

! an extreme aspect ratio on a normal shot

2

Page 3: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Outline

! capturing panoramas

! stitching together a panorama

! perspective versus cylindrical projection

3

Page 4: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Panoramic cameras

4

swing-lens panoramic cameraflatback panoramic camera

SLR on panning clamp motorized pan-tilt head

Page 5: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Swing-lens panoramic images

5

San Francisco in ruins, 1906

101 Ranch, Oklahoma, circa 1920

Page 6: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Panoramic cameras

6

swing-lens panoramic cameraflatback panoramic camera

SLR on panning clamp motorized pan-tilt head

to avoid parallax errors,rotate around center of

perspective

Page 7: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

Lee Frost, Val D’Orcia, Tuscany, Italy

Page 8: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

Lee Frost, Volubilis, Morocco

Page 9: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

Lee Frost,Vertical Panoramas,Santorini

Page 10: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

Matthew Scott, Cuernos del Paine, Chile

Page 11: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

gigapan.org, Scanning Electron Micrograph (SEM) of barnacle

Page 12: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

gigapan.org, Scanning Electron Micrograph (SEM) of barnacle

Page 13: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Stitching images together to make a mosaic

13

Page 14: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Stitching images together to make a mosaic

! given a set of images that should stitch together• by rotating the camera around its center of perspective

! step 1: find corresponding features in a pair of image

! step 2: compute transformation from 2nd to 1st image

! step 3: warp 2nd image so it overlays 1st image

! step 4: blend images where they overlap one another

! repeat for 3rd image and mosaic of first two, etc.14

Page 15: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Stitching images together to make a mosaic

! given a set of images that should stitch together• by rotating the camera around its center of perspective

! step 1: find corresponding features in a pair of image

! step 2: compute transformation from 2nd to 1st image

! step 3: warp 2nd image so it overlays 1st image

! step 4: blend images where they overlap one another

! repeat for 3rd image and mosaic of first two, etc.15

Take CS 148:Introduction to Computer

Graphics (Aut)

Take CS 223B:Computer Vision (Win)

Also CS 448A:Computational

Photography (Win 2012)

Page 16: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

What kind of transformation do we need?

16

translation?

rotation?

rotation?perspective!

Page 17: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Quick review of perspective projection

! these three image formation methods will produce the same perspective view on the p.p. (except for the size of the view)

• all that matters is position of c.p. and orientation of p.p.17

= =

pinhole camera photographic camera Albrecht Dürer’s drawing glass

p.p. p.p. p.p.

= center of perspective (c.p.)= projection of feature in scene onto picture plane (p.p)

Page 18: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Reprojecting an image ontoa different picture plane

! the view on any picture plane can be projected onto any other plane in 3D without changing its appearance as seen from a common center of projection

18

the sidewalk art of Julian Beever

Page 19: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Reprojecting panoramic imagesto a common picture plane

! the common picture plane of the mosaic replaces having had a wide-angle (non-fish-eye) camera in the first place

19

common p.p.of the mosaic

Page 20: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Homography

! perspective mapping between two p.p.’s using the same center of projection is called a homography

• input and output x,y positions are related by a 3!3 matrix20

p.p. #2

p.p. #1

In class I said a 4x4 matrix. Actually, since the positions of features in an image can be fully specified by their x,y positions, the perspective warp (homography) can be treated as a 2D → 2D mapping and described using a 3x3 matrix transformation, where the positions are given as 3D homogeneous coordinates. In other words, output position [x’, y’, w’]T = M × [x, y, 1]T, where M is a 3x3 matrix. Want to learn more about this? Look at this CS 248 lecture: http://graphics.stanford.edu/courses/cs248-08/texturing/texturing.html.

Page 21: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Summary of perspective stitching

! pick one image, typically the central view (red outline)

! warp the others to its plane

! blend21

Page 22: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Cylindrical panoramas

! What if you want a 360° panorama?

! project each image onto a cylinder

! a cylindrical image can be stored as a rectangular image

22

mosaic imagex

y

Page 23: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Cylindrical panoramas

! What if you want a 360° panorama?

! project each image onto a cylinder

! a cylindrical image can be stored as a rectangular image

! to view without distortion, reproject a portion of the cylinder onto a picture plane representing the display screen

• if your FOV is narrow, this view won’t be too distorted23

mosaic imagex

y

Page 24: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Example

24perspective projection

common picture

plane of mosaicimage

Page 25: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Using 4 shots instead of 3

25perspective projection

Page 26: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoycylindrical projection

Back to 3 shots

26

surface of cylinder

Page 27: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoycylindrical projection

Back to 3 shots

27

surface of cylinder

(Flash demo)http://graphics.stanford.edu/courses/cs178/

applets/projection.html

Page 28: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Spherical panoramas

! projections are to a sphere instead of a cylinder

! can’t store as rectangular image without distortion28

+

+

+

+

Page 29: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Recap! panoramas can be captured by a camera with a wide planar back,

a cylindrical back and a moving slit, or a rotating camera• rotate around the center of perspective to avoid parallax errors

! to assemble panoramas from a rotating camera, use corresponding features to compute a perspective warp that projects the images to a common picture plane, then blend them together

! for very wide angle or 360° panoramas, project the images to a common cylindrical surface, which can be stored as an ordinary (wide) rectangular image

• reproject them to a picture plane for display

! spherical panoramas are possible, but cannot be stored as rectangular images without distortion

29 Quest ions?

Page 30: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces

! Marc Levoy

Slide credits! Fredo Durand

! Alyosha Efros

! Steve Seitz

! Rick Szeliski

! Frost, Lee, Panoramic Photography, F+W Publications, 2005.

30

Page 31: Panoramas - Computer Graphics · the sidewalk art of Julian Beever! Marc Levoy Reprojecting panoramic images to a common picture plane! the common picture plane of the mosaic replaces