& Stereo Tues Oct 20 Last time: How to stitch a panorama? - - PDF document

stereo
SMART_READER_LITE
LIVE PREVIEW

& Stereo Tues Oct 20 Last time: How to stitch a panorama? - - PDF document

10/19/2015 Mosaics wrapup & Stereo Tues Oct 20 Last time: How to stitch a panorama? Basic Procedure Take a sequence of images from the same position Rotate the camera about its optical center Compute transformation


slide-1
SLIDE 1

10/19/2015 1

Tues Oct 20

Mosaics wrapup & Stereo

Last time: How to stitch a panorama?

  • Basic Procedure

– Take a sequence of images from the same position

  • Rotate the camera about its optical center

– Compute transformation (homography) between second image and first using corresponding points. – Transform the second image to overlap with the first. – Blend the two together to create a mosaic. – (If there are more images, repeat)

Source: Stev e Seitz

slide-2
SLIDE 2

10/19/2015 2

Panoramas: main steps

  • 1. Collect correspondences (manually for now)
  • 2. Solve for homographymatrix H

– Least squares solution

  • 3. Warp content from one image frame to the other to combine:

say im1 into im2 reference frame – Determine bounds of the new combined image

  • Where will the corners of im1 fall in im2’s coordinate frame?
  • We will attempt to lookup colors for any of these positions

we can get from im1. – Compute coordinates in im1’s reference frame (via homography) for all points in that range – Lookup all colors for all these positions from im1

  • Inverse warp : interp2 (watch for nans)
  • 4. Overlay im2 content onto the warped im1 content.

– Careful about new bounds of the output image: minx, miny

Panoramas: main steps

  • 1. Collect correspondences (manually for now)
  • 2. Solve for homographymatrix H

– Least squares solution

  • 3. Warp content from one image frame to the other to combine:

say im1 into im2 reference frame – Determine bounds of the new combined image:

  • Where will the corners of im1 fall in im2’s coordinate frame?
  • We will attempt to lookup colors for any of these positions

we can get from im1. – Compute coordinates in im1’s reference frame (via homography) for all points in that range: H-1 – Lookup all colors for all these positions from im1

  • Inverse warp : interp2 (watch for nans : isnan)
  • 4. Overlay im2 content onto the warped im1 content.

– Careful about new bounds of the output image: minx, miny

slide-3
SLIDE 3

10/19/2015 3 im2 im1

H

(Assuming we have solved for the H that maps points from im1 to im2.)

                     1

1 1 2 2

y x w wy wx H

im2 im1

slide-4
SLIDE 4

10/19/2015 4

Panoramas: main steps

  • 1. Collect correspondences (manually for now)
  • 2. Solve for homographymatrix H

– Least squares solution

  • 3. Warp content from one image frame to the other to combine:

say im1 into im2 reference frame – Determine bounds of the new combined image:

  • Where will the corners of im1 fall in im2’s coordinate frame?
  • We will attempt to lookup colors for any of these positions

we can get from im1. – Inverse warp:

  • Compute coordinates in im1’s reference frame (via

homography) for all points in that range.

  • Lookup all colors for all these positions from im1 (interp2)
  • 4. Overlay im2 content onto the warped im1 content.

im2 im1

H-1

(Assuming we have solved for the H that maps points from im1 to im2.)

slide-5
SLIDE 5

10/19/2015 5

im1 warped into reference frame of im2.

im2 im1

Use interp2 to ask for the colors (possibly interpolated) from im1 at all the positions needed in im2’s reference frame.

Panoramas: main steps

  • 1. Collect correspondences (manually for now)
  • 2. Solve for homographymatrix H

– Least squares solution

  • 3. Warp content from one image frame to the other to combine:

say im1 into im2 reference frame – Determine bounds of the new combined image:

  • Where will the corners of im1 fall in im2’s coordinate frame?
  • We will attempt to lookup colors for any of these positions

we can get from im1. – Inverse warp:

  • Compute coordinates in im1’s reference frame (via

homography) for all points in that range.

  • Lookup all colors for all these positions from im1 (interp2)
  • 4. Overlay im2 content onto the warped im1 content.

– Careful about new bounds of the output image

slide-6
SLIDE 6

10/19/2015 6

Image warping with homographies

image plane in front image plane below

black area w here no pixel maps to

Source: Steve Seitz

slide-7
SLIDE 7

10/19/2015 7

Image rectification

p p’

Analysing patterns and shapes

Automatically rectified floor The floor (enlarged) What is the shape of the b/w floor pattern?

Slide from Antonio Criminisi

slide-8
SLIDE 8

10/19/2015 8

From Martin Kemp The Science of Art (manual reconstruction) Automatic rectification

Analysing patterns and shapes

Slide from Antonio Criminisi

Automatically rectified floor

  • St. Lucy Altarpiece, D. Veneziano

Analysing patterns and shapes

What is the (complicated) shape of the floor pattern?

Slide from Criminisi

slide-9
SLIDE 9

10/19/2015 9

From Martin Kemp, The Science of Art (manual reconstruction) Automatic rectification

Analysing patterns and shapes

Slide from Criminisi Andrew Harp Andy Luong

Ekapol Chuangsuwanich, CMU

Sung Ju Hwang

slide-10
SLIDE 10

10/19/2015 10

slide-11
SLIDE 11

10/19/2015 11

Changing camera center

Does it still work?

synthetic PP PP1 PP2

Source: Aly osha Ef ros

slide-12
SLIDE 12

10/19/2015 12

Recall: same camera center

real camera synthetic camera

Can generate synthetic camera view as long as it has the same center of projection.

Source: Alyosha Efros

…Or: Planar scene (or far away)

PP3 is a projection plane of both centers of projection, so we are OK! This is how big aerial photographs are made PP1 PP3 PP2

Source: Alyosha Efros

slide-13
SLIDE 13

10/19/2015 13

Boundary extension

  • Wide-Angle Memories of Close-

Up Scenes, Helene Intraub and Michael Richardson, Journal of Experimental Psychology: Learning, Memory, and Cognition, 1989, Vol. 15, No. 2, 179-187

slide-14
SLIDE 14

10/19/2015 14

Creating and Exploring a Large Photorealistic Virtual Space

Josef Sivic, Biliana Kaneva, Antonio Torralba, Shai Avidan and William T. Freeman, Internet Vision Workshop, CVPR 2008. http://www.youtube.com/watch?v=E0rboU10rPo

Creating and Exploring a Large Photorealistic Virtual Space

Synthesized view from new camera Current view, and desired view in green Induced camera motion

slide-15
SLIDE 15

10/19/2015 15

Summary: alignment & warping

  • Write 2d transformations as matrix-vector

multiplication (including translation when we use homogeneous coordinates)

  • Perform image warping (forward, inverse)
  • Fitting transformations: solve for unknown

parameters given corresponding points from two views (affine, projective (homography)).

  • Mosaics: uses homography and image warping

to merge views taken from same center of projection.

Multiple views

Hartley and Zisserman Lowe

Multi-view geometry, matching, invariant features, stereo vision

slide-16
SLIDE 16

10/19/2015 16

Why multiple views?

  • Structure and depth are inherently ambiguous from

single views.

Images from Lana Lazebnik

Why multiple views?

  • Structure and depth are inherently ambiguous from

single views.

Optical center

P1 P2 P1’=P2’

slide-17
SLIDE 17

10/19/2015 17

  • What cues help us to perceive 3d shape

and depth?

Texture

[From A.M. Loh. The recovery of 3-D structure using visual texture patterns. PhD thesis]

slide-18
SLIDE 18

10/19/2015 18

Shading

[Figure from Prados & Faugeras 2006]

Perspective effects

Image credit: S. Seitz

slide-19
SLIDE 19

10/19/2015 19

Motion

Figures from L. Zhang http://www.brainconnection.com/teasers/?main=illusion/moti on-shape

Focus/defocus

[f igs f rom H. Jin and P. Fav aro, 2002]

Images from same point of view, different camera parameters 3d shape / depth estimates

slide-20
SLIDE 20

10/19/2015 20

Estimating scene shape

  • “Shape from X”: Shading, Texture, Focus, Motion…
  • Stereo:

– shape from “motion” between two views – infer 3d shape of scene from two (multiple) images from different viewpoints

scene point

  • ptical center

image plane

Main idea:

Outline

  • Human stereopsis
  • Epipolar geometry and the epipolar constraint

– Case example with parallel optical axes – General case with calibrated cameras

  • Stereo solutions

– Correspondences – Additional constraints

slide-21
SLIDE 21

10/19/2015 21

Human eye

Fig from Shapiro and Stockman

Pupil/Iris – control amount of light passing through lens Retina - contains sensor cells, where image is formed Fovea – highest concentration of cones

Rough analogy with human visual system:

Human stereopsis: disparity

Human eyes fixate on point in space – rotate so that corresponding images form in centers of fovea.

slide-22
SLIDE 22

10/19/2015 22

Disparity occurs when eyes fixate on one object;

  • thers appear at different

visual angles

Human stereopsis: disparity

Disparity: d = r-l = D-F . d=0

Human stereopsis: disparity

Forsyth & Ponce

slide-23
SLIDE 23

10/19/2015 23

Random dot stereograms

  • Julesz 1960: Do we identify local brightness

patterns before fusion (monocular process) or after (binocular)?

  • To test: pair of synthetic images obtained by

randomly spraying black dots on white objects

Random dot stereograms

Forsyth & Ponce

slide-24
SLIDE 24

10/19/2015 24

Random dot stereograms Random dot stereograms

  • When viewed monocularly, they appear random;

when viewed stereoscopically, see 3d structure.

  • Conclusion: human binocular fusion not directly

associated with the physical retinas; must involve the central nervous system

  • Imaginary “cyclopean retina” that combines the

left and right image stimuli as a single unit

slide-25
SLIDE 25

10/19/2015 25

Stereo photography and stereo viewers

Invented by Sir Charles Wheatstone, 1838

Image from fisher-price.com

T ake two pictures of the same subject from two slightly different viewpoints and display so that each eye sees

  • nly one of the images.

http://www.johnsonshawmuseum.org

slide-26
SLIDE 26

10/19/2015 26

http://www.johnsonshawmuseum.org

Public Library , Stereoscopic Looking Room, Chicago, by Phillips, 1923

slide-27
SLIDE 27

10/19/2015 27

http://www.well.com/~jimg/stereo/stereo_list.html

Autostereograms

Images from magiceye.com

Exploit disparity as depth cue using single image. (Single image random dot stereogram, Single image stereogram)

slide-28
SLIDE 28

10/19/2015 28

Images from magiceye.com

Autostereograms Outline

  • Human stereopsis
  • Stereograms
  • Epipolar geometry and the epipolarconstraint

– Case example with parallel optical axes – General case with calibrated cameras

slide-29
SLIDE 29

10/19/2015 29 Two cameras, simultaneous views Single moving camera and static scene

Stereo vision Estimating depth with stereo

  • Stereo: shape from “motion” between two views
  • We’ll need to consider:
  • Info on camera pose (“calibration”)
  • Image point correspondences

scene point

  • ptical

center image plane

slide-30
SLIDE 30

10/19/2015 30

Geometry for a simple stereo system

  • First, assuming parallel optical axes, known camera

parameters (i.e., calibrated cameras): baseline

  • ptical

center (left)

  • ptical

center (right) Focal length World point image point (left) image point (right) Depth of p

slide-31
SLIDE 31

10/19/2015 31

  • Assume parallel optical axes, known camera parameters

(i.e., calibrated cameras). What is expression for Z? Similar triangles (pl, P, pr) and (Ol, P, Or):

Geometry for a simple stereo system

Z T f Z x x T

r l

   

l r

x x T f Z  

disparity

Depth from disparity

image I(x,y) image I´(x´,y´) Disparity map D(x,y)

(x´,y´)=(x+D(x,y), y) So if we could find the corresponding points in two images, we could estimate relative depth…

slide-32
SLIDE 32

10/19/2015 32

Outline

  • Human stereopsis
  • Stereograms
  • Epipolar geometry and the epipolarconstraint

– Case example with parallel optical axes – General case with calibrated cameras

General case, with calibrated cameras

  • The two cameras need not have parallel optical axes.

Vs.

slide-33
SLIDE 33

10/19/2015 33

  • Given p in left image, where can corresponding

point p’ be?

Stereo correspondence constraints Stereo correspondence constraints

slide-34
SLIDE 34

10/19/2015 34 Geometry of two views constrains where the corresponding pixel for some image point in the first view must occur in the second view.

  • It must be on the line carved out by a plane

connecting the world point and optical centers.

Epipolar constraint

  • Epipolar Plane

Epipole Epipolar Line Baseline

Epipolar geometry

Epipole http://www.ai.sri.com/~luong/research/Meta3DViewer/EpipolarGeo.html

slide-35
SLIDE 35

10/19/2015 35

  • Baseline: line joining the camera centers
  • Epipole: point of intersection of baseline with image plane
  • Epipolar plane: plane containing baseline and world point
  • Epipolar line: intersection of epipolar plane with the image

plane

  • All epipolar lines intersect at the epipole
  • An epipolar plane intersects the left and right image planes

in epipolar lines

Epipolar geometry: terms

Why is the epipolar constraint useful?

Epipolar constraint

This is useful because it reduces the correspondence problem to a 1D search along an epipolar line.

Image f rom Andrew Zisserman

slide-36
SLIDE 36

10/19/2015 36

Example

What do the epipolar lines look like?

Ol Or Ol Or

1. 2.

slide-37
SLIDE 37

10/19/2015 37

Example: converging cameras

Figure f rom Hartley & Zisserman Figure f rom Hartley & Zisserman

Example: parallel cameras

Where are the epipoles?

slide-38
SLIDE 38

10/19/2015 38

Stereo image rectification

reproject image planes onto a common plane parallel to the line between optical centers pixel motion is horizontal after this transformation two homographies (3x3 transforms), one for each input image reprojection

Slide credit: Li Zhang

In practice, it is convenient if image scanlines (rows) are the epipolar lines.

Stereo image rectification: example

Source: Alyosha Efros

slide-39
SLIDE 39

10/19/2015 39

An audio camera & epipolar geometry

Adam O' Donovan, Ramani Duraiswami and Jan Neumann Microphone Arrays as Generalized Cameras for Integrated Audio Visual Processing, IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Minneapolis, 2007

Spherical microphone array

An audio camera & epipolar geometry

slide-40
SLIDE 40

10/19/2015 40

An audio camera & epipolar geometry

Summary

  • Depth from stereo: main idea is to triangulate

from corresponding image points.

  • Epipolar geometry defined by two cameras

– We’ve assumed known extrinsic parameters relating their poses

  • Epipolar constraint limits where points from one

view will be imaged in the other

– Makes search for correspondences quicker

  • Terms: epipole, epipolarplane / lines, disparity,

rectification, intrinsic/extrinsic parameters, essential matrix, baseline

slide-41
SLIDE 41

10/19/2015 41

Correspondence problem

Multiple match hypotheses satisfy epipolar constraint, but which is correct?

Figure from Gee & Cipolla 1999

Correspondence problem

  • Beyond the hard constraint of epipolar

geometry, there are “soft” constraints to help identify corresponding points

– Similarity – Uniqueness – Ordering – Disparity gradient

  • To find matches in the image pair, we will

assume

– Most scene points visible from both views – Image regions for the matches are similar in appearance

slide-42
SLIDE 42

10/19/2015 42

Dense correspondence search

For each epipolar line For each pixel / window in the left image

  • compare with every pixel / window on same epipolar line in right

image

  • pick position with minimum match cost (e.g., SSD, correlation)

Adapted from Li Zhang

Correspondence problem

Source: Andrew Zisserman

Parallel camera example: epipolar lines are corresponding image scanlines

slide-43
SLIDE 43

10/19/2015 43

Correspondence problem

Source: Andrew Zisserman

Intensity profiles

Correspondence problem

Neighborhoods of corresponding points are similar in intensity patterns.

Source: Andrew Zisserman

slide-44
SLIDE 44

10/19/2015 44

Correlation-based window matching

Source: Andrew Zisserman

Textureless regions

Textureless regions are non-distinct; high ambiguity for matches.

Source: Andrew Zisserman

slide-45
SLIDE 45

10/19/2015 45 W = 3 W = 20

Figures from Li Zhang

Want window large enough to have sufficient intensity variation, yet small enough to contain only pixels with about the same disparity.

Effect of window size Foreshortening effects

Source: Andrew Zisserman

slide-46
SLIDE 46

10/19/2015 46

Occlusion

Slide credit: David Kriegman

Sparse correspondence search

  • Restrict search to sparse set of detected features (e.g., corners)
  • Rather than pixel values (or lists of pixel values) use feature

descriptor and an associated feature distance

  • Still narrow search further by epipolar geometry

Tradeoffs betw een dense and sparse search?

slide-47
SLIDE 47

10/19/2015 47

Correspondence problem

  • Beyond the hard constraint of epipolar

geometry, there are “soft” constraints to help identify corresponding points

– Similarity – Uniqueness – Disparity gradient – Ordering

Uniqueness constraint

  • Up to one match in right image for every point in left

image

Figure from Gee & Cipolla 1999

slide-48
SLIDE 48

10/19/2015 48

Disparity gradient constraint

  • Assume piecewise continuous surface, so want disparity

estimates to be locally smooth

Figure from Gee & Cipolla 1999

Ordering constraint

  • Points on same surface (opaque object) will be in same
  • rder in both views

Figure from Gee & Cipolla 1999

slide-49
SLIDE 49

10/19/2015 49

Error sources

  • Low-contrast ; textureless image regions
  • Occlusions
  • Camera calibration errors
  • Violations of brightness constancy (e.g.,

specular reflections)

  • Large motions

Virtual viewpoint video

  • C. Zitnick et al, High-quality video view interpolation using a layered representation,

SIGGRAPH 2004.

slide-50
SLIDE 50

10/19/2015 50

Virtual viewpoint video

http://research.microsoft.com/IVM/VVV/

Summary

  • Depth from stereo: main idea is to triangulate

from corresponding image points.

  • Epipolar geometry defined by two cameras

– We’ve assumed known extrinsic parameters relating their poses

  • Epipolar constraint limits where points from one

view will be imaged in the other

– Makes search for correspondences quicker

  • To estimate depth

– Limit search by epipolar constraint – Compute correspondences, incorporate matching preferences