Lecture 13 - Massachusetts Institute of...

103
Lecture 13 Shape from X

Transcript of Lecture 13 - Massachusetts Institute of...

Page 1: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Lecture 13 Shape from X

Page 2: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Depth Perception: The inverse problem

Page 3: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Monocular cues to depth

• Absolute depth cues: (assuming known camera parameters) these cues provide information about the absolute depth between the observer and elements of the scene

• Relative depth cues: provide relative information about depth between elements in the scene (this point is twice as far at that point, …)

Page 4: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Relative depth cues

Simple and powerful cue, but hard to make it work in practice…

Page 5: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Atmospheric perspective

• Based on the effect of air on the color and visual acuity of objects at various distances from the observer.

• Consequences: – Distant objects appear

bluer – Distant objects have lower

contrast.

Page 6: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Atmospheric perspective

http://encarta.msn.com/medias_761571997/Perception_(psychology).html

Page 7: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Claude Lorrain (artist) French, 1600 - 1682 Landscape with Ruins, Pastoral Figures, and Trees, 1643/1655

Page 8: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

[Golconde Rene Magritte]

Page 9: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Shadows

http://www.cs.cornell.edu/courses/cs569/2008sp/schedule.stm Slide by Steve Marschner

Page 10: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Shadows

video

Page 11: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Shadows

http://vision.psych.umn.edu/users/kersten/kersten-lab/shadows.html

Page 12: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Linear perspective

Page 13: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Linear Perspective

Based on the apparent convergence of parallel lines to common vanishing points with increasing distance from the observer.

(Gibson : “perspective order”) In Gibson’s term, perspective is a

characteristic of the visual field rather than the visual world. It approximates how we see (the retinal image) rather than what we see, the objects in the world.

Perspective : a representation that is specific to one individual, in one position in space and one moment in time (a powerful immediacy).

Is perspective a universal fact of the visual

retinal image ? Or is perspective something that is learned ?

Simple and powerful cue, and easy to make it work in practice…

Page 14: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Linear Perspective

Ponzo’s illusion

Page 15: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Linear Perspective

Muller-Lyer 1889

Page 16: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Linear Perspective

Muller-Lyer 1889

Page 17: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Linear Perspective

Muller-Lyer 1889

Page 18: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

The two Towers of Pisa

Frederick Kingdom, Ali Yoonessi and Elena Gheorghiu of McGill Vision Research unit.

Page 19: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

3D percept is driven by the scene, which imposes its ruling to the objects

The strength of linear perspective

Page 20: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Manhattan assumption

Slide by James Coughlan J. Coughlan and A.L. Yuille. "Manhattan World: Orientation and Outlier Detection by Bayesian Inference." Neural Computation. May 2003.

Page 21: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Slide by James Coughlan

Page 22: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Slide by James Coughlan

Camera orientation

Edge type

Gradient magnitude and orientation

Page 23: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Slide by James Coughlan

Page 24: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual
Page 25: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Slide by James Coughlan

Page 26: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual
Page 27: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

The importance of the horizon line

Page 28: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Distance from the horizon line

• Based on the tendency of objects to appear nearer the horizon line with greater distance to the horizon.

• Objects approach the horizon line with greater distance from the viewer. The base of a nearer column will appear lower against its background floor and further from the horizon line. Conversely, the base of a more distant column will appear higher against the same floor, and thus nearer to the horizon line.

Page 29: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Moon illusion

Page 30: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Relative height

The object closer to the horizon is perceived as farther away, and the object further from the horizon is perceived as closer

If you know camera parameters: height of

the camera, then we know real depth

Page 31: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

At which elevation has been taken this picture?

Page 32: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Comparing heights

Vanishing Point

Page 33: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Measuring height

1

2

3

4

5 5.4

2.8

3.3

Camera height

Page 34: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

q1

Computing vanishing points (from lines)

Intersect p1q1 with p2q2

v

p1

p2

q2

Least squares version

• Better to use more than two lines and compute the “closest” point of intersection

• See notes by Bob Collins for one good way of doing this: – http://www-2.cs.cmu.edu/~ph/869/www/notes/vanishing.txt

Page 35: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

C

Measuring height without a ruler

ground plane

Compute H from image measurements • Need more than vanishing points to do this

H

Page 36: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Measuring height

R H

vz

r

b

t

H

b0

t0 v vx vy

vanishing line (horizon)

Page 37: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Measuring height vz

r

b

t0 vx vy

vanishing line (horizon)

v

t0

m0

What if the point on the ground plane b0 is not known? • Here the guy is standing on the box • Use one side of the box to help find b0 as shown above

b0

t1

b1

Page 38: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

What if vz is not infinity?

Page 39: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

The cross ratio A Projective Invariant

• Something that does not change under projective transformations (including perspective projection)

P1

P2

P3 P4

1423

2413

PPPPPPPP

−−−−

The cross-ratio of 4 collinear points

Can permute the point ordering • 4! = 24 different orders (but only 6 distinct values)

This is the fundamental invariant of projective geometry

=

1i

i

i

i ZYX

P

3421

2431

PPPPPPPP

−−−−

Page 40: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

vZ

r t

b

tvbrrvbt

−−−−

Z

Z

image cross ratio

Measuring height

B (bottom of object)

T (top of object)

R (reference point)

ground plane

H C

TBRRBT

−∞−−∞−

scene cross ratio

=

1ZYX

P

=

1yx

pscene points represented as image points as

RH

=

RH

=

R

Page 41: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Measuring height

R H

vz

r

b

t

image cross ratio

H

b0

t0 v vx vy

vanishing line (horizon)

t − b vZ − rr − b vZ − t

=HR

Page 42: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Measuring heights in real photos

Problem: How tall is this person?

reference 185.3 cm

Page 43: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Assessing geometric accuracy

Measuring relative heights

Problem: Are the heights of the two groups of people consistent with each other?

Piero della Francesca, Flagellazione di Cristo,

c.1460, Urbino

Page 44: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Single-View Metrology

Complete 3D reconstructions from single views

Page 45: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Example: The Virtual Trinity

Masaccio, Trinita’ , 1426, Florence

Complete 3D reconstruction

Page 46: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Example: The Virtual Flagellation

Piero della Francesca, Flagellazione di Cristo,

c.1460, Urbino

Complete 3D reconstruction

Page 47: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Henry V Steenwick, St.Jerome in His Study, 1630, The Netherlands

Example: The Virtual St. Jerome

Complete 3D reconstruction

Page 48: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

J. Vermeer, The Music Lesson,

1665, London

Example: The Virtual Music Lesson

Complete 3D reconstruction

Page 49: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Example: A Virtual Museum @ Microsoft

The Image-Based Realities team @ Microsoft Research

Page 50: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Antonio Criminisi Accurate Visual Reconstruction

from Single and Multiple Uncalibrated Images

(Springer-Verlag) ISBN: 1-85233-468-1 look for it on amazon.com !

www.research.microsoft.com/~antcrim

References

Page 51: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Texture Gradient

Page 52: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Texture Gradient

A Witkin. Recovering Surface Shape and Orientation from Texture (1981)

Page 53: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Texture Gradient

Shape from Texture from a Multi-Scale Perspective. Tony Lindeberg and Jonas Garding. ICCV 93

Page 54: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Texture Gradient

• Filter outputs

• Textons

Page 55: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual
Page 56: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Assumptions: • Smooth closed surface • Homogeneous texture • (sometimes, isotropic texture)

Page 57: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Texture description Use filter outputs to measure local spatial frequency.

Page 58: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Texture projection Assume orthographic projection.

Page 59: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Slant and tilt Slant

Tilt

Page 60: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual
Page 61: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

CVPR 04

Page 62: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Texture description Non-occluded textons, and approximated as flat.

Page 63: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

The two pieces of the solution If we knew the transformations

• We can find the textons • We can find the local

intensity contrast

By minimization of:

If we knew the texton and contrast

• Recover the transformation by transforming the texton to match each local patch.

Texton Local contrast

Local texture with inverse transform

Page 64: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

64

Expectation Maximization (EM): a solution to chicken-and-egg problems

Page 65: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

65

Model fitting example Fitting two lines to observed data

x

y

Page 66: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

66

Fitting two lines: on the one hand…

x

y

If we knew which points went with which lines, we’d be back at the single line-fitting problem, twice.

Line 1

Line 2

Page 67: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

67

Maximum likelihood estimation for the slope of a single line

Maximum likelihood estimate:

where

gives regression formula

Data likelihood for point n: x

y

Page 68: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

68

Fitting two lines, on the other hand…

x

y

We could figure out the probability that any point came from either line if we just knew the two equations for the two lines.

Page 69: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

69

MLE with hidden/latent variables: Expectation Maximisation

General problem:

data parameters hidden variables

For MLE, want to maximise the log likelihood

The sum over z inside the log gives a complicated expression for the ML solution.

Page 70: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

70

Maximizing the log likelihood of the data

ˆ θ = argmaxθ δ(zn =1)log p(yn | zn =1,θ)n

∑ + δ(zn = 2)log p(yn | zn = 2,θ)

if you knew the zn labels for each sample n:

Page 71: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

71

Maximizing the log likelihood of the data

ˆ θ = argmaxθ δ(zn =1)log p(yn | zn =1,θ)n

∑ + δ(zn = 2)log p(yn | zn = 2,θ)

if you knew the zn labels for each sample n:

In the EM algorithm, we replace those known labels with their expectation under the current algorithm parameters. So

E[δ(zn = i)] = p(zn = i | y,θold )

= α i(n)Call that quantity

∝ p(y | zn = i,θold ) ∝e−(yn −ai xn )2 / 2

Page 72: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

72

Maximizing gives

and maximising that gives

ˆ a i =α i(n)yn xnn∑α i(n)xn

2

n∑

And then for the estimate of the line parameters, we have

ˆ θ = argminθ α1(n)n

∑ (yn − a1xn )2 + α2(n)(yn − a2xn )2

Page 73: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

73

EM fitting to two lines

with

and

Regression becomes:

“E-step”

“M-step”

repeat

α i(n) ∝e−(yn −ai xn )2 / 2

α1(n) + α2(n) =1

ˆ a i =α i(n)yn xnn∑α i(n)xn

2

n∑

Page 74: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

74

Experiments: EM fitting to two lines

Iteration 1 2 3

Line weights

line 1

line 2

(from a tutorial by Yair Weiss, http://www.cs.huji.ac.il/~yweiss/tutorials.html)

Page 75: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

EM

Find interest points

EM iterations

Page 76: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual
Page 77: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Shading

• Based on 3 dimensional modeling of objects in light, shade and shadows.

• Perception of depth through shading alone is always subject to the concave/convex inversion. The pattern shown can be perceived as stairsteps receding towards the top and lighted from above, or as an overhanging structure lighted from below.

Page 78: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Reflectance map

p = dZ / dx

q = dZ / dy R(p,q)

Page 79: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Linear shape from shading

A close form solution can be obtained using the Fourier transform (Pentland 88)

Pentland 88

Page 80: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Ground truth

Linear shape from shading

Page 81: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Learning based methods • User recognition to learn structure of the world from labeled examples

Slides by Efros

Page 82: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

• Goal: learn labeling of image into 7 Geometric Classes: • Support (ground) • Vertical

– Planar: facing Left (), Center ( ), Right () – Non-planar: Solid (X), Porous or wiry (O)

• Sky

Label Geometric Classes

Slides by Efros

Page 83: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

What cues to use?

Vanishing points, lines

Color, texture, image location

Texture gradient Slides by Efros

Page 84: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Dataset very general

Slides by Efros

Page 85: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

The General Case (outdoors)

• Typical outdoor photograph off the Web – Got 300 images using Google Image Search

keyboards: “outdoor”, “scenery”, “urban”, etc. • Certainly not random samples from world

– 100% horizontal horizon – 97% pixels belong to 3 classes -- ground, sky,

vertical (gravity) – Camera axis usually parallel to ground plane

• Still very general dataset!

Slides by Efros

Page 86: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Let’s use many weak cues

• Material

• Image Location

• Perspective

Slides by Efros

Page 87: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Need Spatial Support

50x50 Patch 50x50 Patch

Color Texture Perspective Color Texture Perspective

Slides by Efros

Page 88: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Image Segmentation • Naïve Idea #1: segment the image

– Chicken & Egg problem

• Naïve Idea #2: multiple segmentations – Decide later which segments are good

Slides by Efros

Page 89: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

• We want to know: – Is this a good (coherent) segment?

– If so, what is the surface label?

• Learn these likelihoods from training images – we use Boosted Decision Trees

Estimating surfaces from segments

P(good segment | data)

P(label | good segment, data)

Slides by Efros

Page 90: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Gray?

High in Image?

Many Long Lines?

Yes

No

No No

No

Yes Yes

Yes

Very High Vanishing

Point?

High in Image?

Smooth? Green?

Blue?

Yes

No

No No

No

Yes Yes

Yes

Boosted Decision Trees

Ground Vertical Sky

Slides by Efros

Page 91: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Labeling Segments

For each segment:

- Get P(good segment | data) P(label | good segment, data)

Slides by Efros

Page 92: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Image Labeling

Labeled Segmentations

Labeled Pixels Slides by Efros

Page 93: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

No Hard Decisions

Support Vertical Sky

V-Left V-Center V-Right V-Porous V-Solid

Page 94: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Labeling Results

Input image Ground Truth Our Result Slides by Efros

Page 95: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Labeling Results

Input image Ground Truth Our Result Slides by Efros

Page 96: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Labeling Results

Input image Ground Truth Our Result Slides by Efros

Page 97: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Labeling Results

Input image Ground Truth Our Result Slides by Efros

Page 98: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Labeling Results

Input image Ground Truth Our Result Slides by Efros

Page 99: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Labeling Results

Input image Ground Truth Our Result Slides by Efros

Page 100: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Labeling Results

Input image Ground Truth Our Result Slides by Efros

Page 101: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Some Failures

Input image Ground Truth Our Result Slides by Efros

Page 102: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Catastrophic Failures

Input image Ground Truth Our Result Slides by Efros

Page 103: Lecture 13 - Massachusetts Institute of Technology6.869.csail.mit.edu/sp11/lectures/lecture13.pdf · Atmospheric perspective • Based on the effect of air on the color and visual

Automatic Photo Popup Labeled Image Fit Ground-Vertical

Boundary with Line Segments

Form Segments into Polylines

Cut and Fold

Final Pop-up Model

[Hoiem Efros Hebert 2005]