radiometry & shape from shading · 2009-12-15 · • lambert’s cosine law ... input images...

52
Radiometry & Shape from Shading Martin Fuchs [email protected] 1 Monday, December 14, 2009

Upload: others

Post on 19-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry &Shape from Shading

Martin Fuchs [email protected]

1Monday, December 14, 2009

Page 2: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape acquisition recap

• stereo

• observe objects from multiple positions

• establish correspondences

• triangulation gives depth (“Z”) maps, meshes

• structure from motion

2Monday, December 14, 2009

Page 3: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape acquisition recap

• passive stereo has problems finding correspondences

• active stereo has resolution limits

• multi-megapixel cameras: cheap + available

• scan line techniques take lots of time for hi-res models

• multi-megapixel projectors: expensive

3Monday, December 14, 2009

Page 4: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from appearance

• material appearance gives cues for shape

• can be precise locally (per-pixel)

• challenging to get full geometry

4Monday, December 14, 2009

Page 5: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Normal maps

5Monday, December 14, 2009

Page 6: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Normal maps

http://en.wikipedia.org/wiki/File:Normal_map_example.pngAuthor: Paolo Cignoni, License: Creative Commons Attribution Share-Alike 1.0

6Monday, December 14, 2009

Page 7: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Normal maps

http://en.wikipedia.org/wiki/File:Normal_map_example.pngAuthor: Paolo Cignoni, License: Creative Commons Attribution Share-Alike 1.0

• normal maps can be measured in every surface point

• with active methods

• by looking at local appearance

7Monday, December 14, 2009

Page 8: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Today’s Menu

• Radiometry

• Lambert’s Cosine law

• Photometric Stereo

• Shape from Shading

8Monday, December 14, 2009

Page 9: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Solid Angle

length, unit

area, unit

1 meter = 1 m

1 m2

9Monday, December 14, 2009

Page 10: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Solid Angle

angle = arc length of projection on unit circle,unit

solid angle = area of projection on unit sphere, unit

1 radian = 1 rad

1 steradian = 1 sr

10Monday, December 14, 2009

Page 11: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

Name

Symbol

Unit

Energy

Q

[Q] = 1 Joule = 1 J = 1 kgm2 s−2

11Monday, December 14, 2009

Page 12: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

Name

Symbol

Unit

radiant power, flux

[P ] = 1 J s−1 = 1Watt = 1WP = dQ

dt , Φ

12Monday, December 14, 2009

Page 13: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

Name

Symbol

Unit

area A

radiant power, flux

[P ] = 1 J s−1 = 1Watt = 1WP = dQ

dt , Φ

13Monday, December 14, 2009

Page 14: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

Name

Symbol

Unit

radiant intensity (in direction, of a point light source)

I = dPdω

[I] = 1W sr−1

14Monday, December 14, 2009

Page 15: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

Name

Symbol

Unit

irradiance (in a point on the surface)

dA

E = dPdA

[E] = 1W m−2

15Monday, December 14, 2009

Page 16: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

Name

Symbol

Unit

radiant exitance, radiosity (from a point)

dA

[B] = 1W m−2B = dP

dA

16Monday, December 14, 2009

Page 17: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

Name

Symbol

Unit

radiance

dA

L = d2Pdω dA

[L] = 1 W sr−1m−2

17Monday, December 14, 2009

Page 18: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

In vacuum,

radiance is constant along rays!

18Monday, December 14, 2009

Page 19: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Radiometry

Pinhole cameras record radiance.

19Monday, December 14, 2009

Page 20: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Lambertian Surfacesappear equally bright from all directions

20Monday, December 14, 2009

Page 21: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Lambertian Surfacesappear equally bright from all directions

L =ρ

πE

Albedo ρ ranges from 0 (perfect black) to 1 (perfect white).

21Monday, December 14, 2009

Page 22: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

How is E computed?

dA

r

E ∼ I

r2

22Monday, December 14, 2009

Page 23: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

How is E computed?

dA

23Monday, December 14, 2009

Page 24: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

How is E computed?

24Monday, December 14, 2009

Page 25: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Lambert’s Cosine LawE ∼ cos θ · I

�nθ

25Monday, December 14, 2009

Page 26: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Lambert’s Cosine Law

�n�l

����l��� = ��n� = 1

E ∼��l,�n

�· I

26Monday, December 14, 2009

Page 27: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Lambertian Surfaces

L =ρ

πE

L =ρ

�l,�n

�· I

r2

27Monday, December 14, 2009

Page 28: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Lambertian Surfaces

L ∼ ρ ·��l,�n

28Monday, December 14, 2009

Page 29: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Photometric Stereo

ρ ·�

lx ly lz�

·

nx

ny

nz

= αL

αρ �n subsumes camera properties, light source brightness, and are unknown

r2

29Monday, December 14, 2009

Page 30: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Photometric Stereo

�lx ly lz

�·

ρ · nx

ρ · ny

ρ · nz

= αL

30Monday, December 14, 2009

Page 31: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Photometric Stereo

1

23

l1,x l1,y l1,z

l2,x l2,y l2,z

l3,x l3,y l3,z

·

ρ · nx

ρ · ny

ρ · nz

= α

L1

L2

L3

31Monday, December 14, 2009

Page 32: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Photometric Stereo

• In practice, use more light sources

• discard darkest observations: shadowed

• discard brightest observations: not Lambertian

• use least-squares solution for over-determined system

32Monday, December 14, 2009

Page 33: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Photometric Stereo

[Rushmeier et al., 1997]33Monday, December 14, 2009

Page 34: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Photometric Stereo

[Rushmeier et al., 1997]

Estimated albedo

Estimated normals (lit)Input images

34Monday, December 14, 2009

Page 35: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Photometric Stereo

Practical considerations:

• illumination: flashes vs. steady light sources

• subtract dark frame

• calibrate: light source positions

• either build or measure (mirror balls)

• calibrate: light source intensities

• move same light source: very precise

• observe on known reflectance target: more flexible

• some pre-computation possible

35Monday, December 14, 2009

Page 36: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Photometric Stereo• good:

• fast (real-time)

• high resolution (one normal vector per pixel!)

• bad:

• normals only

• active light only

36Monday, December 14, 2009

Page 37: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from Shading

• like photometric stereo, but with one image and one light source only!

• useful for astronomy etc.

• underconstrained problem. Assume:

• uniform, known albedo

• known illumination

• smooth variation in surface normal

37Monday, December 14, 2009

Page 38: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from Shading

• Further simplifications:

• Camera far from object: in image = in world

• denotes the depth in pixel

(x, y) (x, y)

z(x, y)

38Monday, December 14, 2009

Page 39: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from ShadingDefinitions:

Let

Then, and are tangents, and the normal is

p :=∂

∂xz, q :=

∂yz

10p

01q

�n =1�

1 + p2 + q2

10p

×

01q

39Monday, December 14, 2009

Page 40: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from ShadingDefinitions:

Let

Then, and are tangents, and the normal is

p :=∂

∂xz, q :=

∂yz

10p

01q

�n =1�

1 + p2 + q2

−p−q1

40Monday, December 14, 2009

Page 41: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from ShadingDefinitions:

Let

be the radiance for a hypothesis of and , and

be the radiance in the captured picture.

p q

L

R(p, q) := ρ ·�

�l,1�

1 + p2 + q2

−p−q1

· 1α

41Monday, December 14, 2009

Page 42: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from Shading

Minimize the functional:

for a control parameter

A(L−R(p, q))2 + λ(|∇p|2 + |∇q|2) dx dy

Data term Smoothness Term

λ

42Monday, December 14, 2009

Page 43: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from Shading

Solve by iteration:• initialize with an estimate for and • after step , set

for local averages and • iterate

A(L−R(p, q))2 + λ(|∇p|2 + |∇q|2) dx dy

p q

k

pk+1 = pk +14λ

(L−R(pk, qk))∂R(pk, qk)

∂p

qk+1 = qk +14λ

(L−R(pk, qk))∂R(pk, qk)

∂q

p q

see [Trucco and Verri, 1998] for Details43Monday, December 14, 2009

Page 44: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from Shading• Problems:

• end of computation not necessarily a global optimum

• boundary conditions need to be chosen (enforce after each iteration)

• for a consistent surface,

but this is not necessarily the case

∂2z

∂x ∂y=

∂2z

∂y ∂x⇒ ∂p

∂y=

∂q

∂x

44Monday, December 14, 2009

Page 45: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape from Shading• Enforce constraint in functional: add

to the energy functional (makes things difficult)

• Maintain constraint throughout optimization

• after each iteration, project p and q to closest integrable function pair (in Fourier space)

�∂p

∂y− ∂q

∂x

�2

45Monday, December 14, 2009

Page 46: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape form shadingWhen consistent, p and q can be integrated to yield z:

[Trucco and Verri, 1998]46Monday, December 14, 2009

Page 47: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Shape form shadingWhen consistent, p and q can be integrated to yield z:

[Trucco and Verri, 1998]47Monday, December 14, 2009

Page 48: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Limitations

• material properties

• occlusions ( shadows )

• how to know albedo and light intensity?

• further assumptions needed

48Monday, December 14, 2009

Page 49: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Conclusions

• appearance can be used to estimate shape

• assumptions required, Lambertian common

• photometric stereo is precise, but active light required

• shape from shading can be useful where stereo is impossible

49Monday, December 14, 2009

Page 50: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Knowing more ...

[Blanz and Vetter, 1999]

• with more assumptions, you can know more about the shape

• a statistical model + a single image can give you

• shape

• texture + colors

• additional semantics ...

50Monday, December 14, 2009

Page 51: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Knowing more ...

[Blanz and Vetter, 1999]

Video source: http://mi.informatik.uni-siegen.de/movies/siggraph99.mpg

51Monday, December 14, 2009

Page 52: Radiometry & Shape from Shading · 2009-12-15 · • Lambert’s Cosine law ... Input images Estimated normals (lit) Monday, December 14, 2009 34. Photometric Stereo Practical considerations:

Questions ?

52Monday, December 14, 2009