Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

50
Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    213
  • download

    0

Transcript of Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Page 1: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Lecture 2

Image cuesShading, Stereo, Specularities

Dana CobzasPIMS Postdoc

Page 2: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Image cues

Color (texture)

Shading

Shadows

Specular highlights

Silhouette

Page 3: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Image cues

Shading [reconstructs normals]

shape from shading (SFS)

photometric stereo

Specular highlights

Texture [reconstructs 3D]

stereo (relates two views)

Silhouette [reconstructs 3D]

shape from silhouette

[Focus]

[ignore, filtered]

[parametric BRDF]

Page 4: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Geometry from shading

Shading reveals 3D shape geometry

Shape from ShadingOne imageKnown light directionKnown BRDF (unit albedo)Ill-posed : additional constraints(intagrability …)

Photometric StereoSeveral images, different lightsUnknown Lambertian BRDF1. Known lights2. Unknown lights

Reconstruct normalsIntegrate surface

[Silver 80, Woodman 81][Horn]

Page 5: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Shading

)(cos),,()( iiiiiLE lnxx

albedo normal light dir

Lambertian reflectance

Fixing light, albedo, we can express reflectance only as function of normal.

Page 6: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Surface parametrization

x

z=f(x,y)

y

depth

Surface orientation

Surface

Tangent plane

Normal vector

)),(,,(),( yxfyxyxs T

x

f

x

s

,0,1T

y

f

y

s

,1,0

T

y

f

x

f

y

s

x

s

1,,n

Gradient space

x

fp

y

fq

)1,,(1

)1,,(

22

qpqp

qp

n

n

-1 (p,q,-1)

Page 7: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Lambertian reflectance map)1,,( qp

)1,,( ss qp2222 11

1),(

ss

ss

qpqp

qqppLqpE

ps=0,qs=0 ps=-2,qs=-1

Local surface orientation that produces equivalent intensities are quadratic conic sections contours in gradient space

Page 8: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Specular reflectance

Photometric stereoOne image =one light direction

Radiance of one pixel constrains the normal to a curve

Two images = two light directions

A third image disambiguates between the two. Normal = intersection of 3 curves

E1

E2

Page 9: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Photometric stereo

Recover

Albedo = magnitude

Normal = normalized

)()()( xnxxb

)(

)(

xb

xb

)(xb

[Birkbeck]

iBI lxnxxx )()()()( One image, one light direction

)()()(;

)(

)(

)(

)()( 2

1

2

1

xxnx

x

x

x

xnx

l

l

l

IA

I

I

I

Tn

T

T

Tn

T

T

)(xb

n images, n light directions

Given: n>=3 images with different known light dir. (infinite light)Assume: Lambertain object

orthograhic camera ignore shadows, interreflections

Page 10: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Depth from normals (1)

Integrate normal (gradients p,q) across the imageSimple approach – integrate along a curve from ),( 00 yx

),( 00 yx)0,(xf 1. From

2. Integrate along to get

3. Integrate along each column

zyzxzyx nnqnnpnnn //),,( n

xfp / )0,(x )0,(xf

yfq /

),(

),(

00

00

)(),(),(yx

yx

qdypdxyxfyxf

[D. Kriegman]

Page 11: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Depth from normals (2)

),(

),(

00

00

)(),(),(yx

yx

qdypdxyxfyxf

Integrate along a curve fromMight not go back to the start because of noise – depth is not unique

),( 00 yx

Impose integrabilityA normal map that produces a unique depth map is called integrable

Enforced by y

f

xx

f

yx

q

y

p

;

[Escher] no integrability

Page 12: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Impose integrabilty[Horn – Robot Vision 1986]Solve f(x,y) from p,q by minimizing the cost functional

Iterative update using calculus of variation Integrability naturally satisfied F(x,y) can be discrete or represented in terms of basis functions Example : Fourier basis (DFT)-close form solution [Frankfot, Chellappa A method for enforcing integrability in SFS Alg. PAMI 1998]

image

yx dxdyqfpf 22 )()(

Page 13: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Example integrability

images with different light

[Neil Birkbeck ]

normals Integrated depth originalsurface

reconstructed

Page 14: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

All images Unknown lights and normals : It is possible to

reconstruct the surface and light positions ? What is the set of images of an object under all

possible light conditions ?

[Debevec et al]

Page 15: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Space of all images Problem: Lambertian object Single view, orthographic camera Different illumination conditions (distant illumination)

1. 3D subspace: [Moses 93][Nayar,Murase 96][Shashua 97]

2. Illumination cone: [Belhumeur and Kriegman CVPR 1996]

3. Spherical harmonic representation: [Ramamoorthi and Hanharan Siggraph 01][Barsi and Jacobs PAMI 2003]

+ convex obj(no shadows)

3D subspace

Convex cone

Linear combination of harmonic imag.(practical 9D basis)

Page 16: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

3D Illumination subspaceLambertian reflection :

(one image point x)

Whole image :

(image as vector I)

lbln I

nT

T

I

b

b

BBlx ...(:)

1

3n

The set of images of a Lambertain surface with no shadowing is a subset of a

3D subspace. [Moses 93][Nayar,Murase 96][Shashua 97]

},|{ 3 lBlxxL

=

x1 x2 x3x4 B

l1 l3l2 l4

3nmn m3

L

x1 x2

x3

image

Tn

Page 17: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Reconstructing the basis

PCA

},|{ 3 lBlxxL Any three images without shadows span L. L – represented by an orthogonal basis B. How to extract B from images ?

Page 18: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Ex: images with all pixels illuminated

Shadows

},|{ 3 lBlxxL)0,max(Blx

No shadowsShadows

S1

S5

S3

S2

S4

S0

Single light source Li intersection of L with an orthant i of Rn

corresponding cell of light source directions Si for which the same pixels are in shadow and the same pixels are illuminated.

P(Li) projection of Li that sets all negative components of Li to 0 (convex cone)

The set of images of an object produces by a single light source is :

i

ii LPRU )(}),0,max(|{ 3 lBlxx

},0,|{0 jIRLL jn xx

Page 19: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Shadows and multiple images

)0,max( ii

Blx Shadows, multiple lights

The image illuminated with two light sources l1, l2, lies on the line between the images of x1 and x2.

The set of images of an object produces by an arbitrary number of lights is the convex hull of U = illumination cone C.

Page 20: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Illumination coneThe set of images of a any Lambertain object under all light conditions is a

convex cone in the image space. [Belhumeur,Kriegman: What is the set of images of an object under all possible light conditions ?, IJCV 98]

Page 21: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Do ambiguities exist ? Can two different objects produce the same illumination

cone ? YES

Convex object B span L Any AGL(3), B*=BA span L I=B*S*=(BA)(A-1S)=BS Same image B lighted with S

and B* lighted with S*

When doing PCA the resulting basis is generally not normal*albedo

Page 22: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

GBR transformation

Surface integrability : Real B, transformed B*=BA is integrable only for General Bas Relief transformation.

[Belhumeur et al: The bas-relief ambiguity IJCV 99]

100

0

0

TGA yxyxfyxf ),(),(

Page 23: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Uncalibrated photometric stereo Without knowing the light source positions, we can recover

shape only up to a GBR ambiguity.

Comments

GBR preserves shadows [Kriegman, Belhumeur 2001]

If albedo is known (or constant) the ambiguity G reduces to a binary subgroup [Belhumeur et al 99]

Interreflections : resolve ambiguity [Kriegman CVPR05]

1. From n input images compute B* (SVD)2. Find A such that B* A close to integrable3. Integrate normals to find depth.

Page 24: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Spherical harmonic representationTheory : infinite no of light directions

space of images infinite dimensional [Illumination cone, Belhumeur and Kriegman 96]

Practice : (empirical ) few bases are enough [Hallinan 94, Epstein 95]

= +.3 +….2

[Ramamoorthi and Hanharan: Analytic PCA construction for Theoretical analysis of Lighting variability in images of a Lambertian object: SIGGRAPH01]

[Barsi and Jacobs: Lambertain reflectance and linear subspaces: PAMI 2003]

Simplification : Convex objects (no shadows, intereflections)

Page 25: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Basis approximation

Page 26: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Spherical harmonics basis Analog on the sphere to the Fourier basis on the line or circle Angular portion of the solution to Laplace equation in spherical

coordinates Orthonormal basis for the set of all functions on the surface of

the sphere

02

immllm eP

ml

mllY )(cos

)!(

)!(

4

)12(),(

Normalization factor

Legendre functions

Fourier basis

Page 27: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Illustration of SH

-1-2 0 1 2

0

1

2

.

.

.

xy z

xy yz 23 1z zx 2 2x y

l

m

1

odd components even components

,

immlmllm ePNY )(cos),(

Positive

Negative

x,y,z space coordinates;

polar coordinates

o

ml

e

mllm iYYY

)cos,sinsin,sin(cos),,( zyxu

Page 28: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Properties of SHFunction decomposition f piecewise continuous function on the surface of the sphere

where

)()(0

uYfufl

l

lmlmlm

duuYuffS

lmlm )()(2

*

Rotational convolution on the sphereFunk-Hecke theorem:k circularly symmetric bounded integrable function on [-1,1]

lllmllm kl

YYk12

4

0

0)(l

llYkuk -1-2 0 1 2

0

1

2

( , )lmY

xy z

xy yz 23 1z zx 2 2x y

l

m

1

Page 29: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Reflectance as convolutionLambertian reflectance

)',0max()()'( uuuluR

2

)()'()'(S

duuluukuR

)',0max()'( uuuuk u

u'u

One light

Lambertian kernel

Integrated light

SH representation

0

0l

llYkk)()(0

uYlull

l

lmlmlm

00

)12

4(

l

l

lmlmlm

l

l

lmlmlml YrYlk

llkR

Lambertian kernellight

Lambertian reflectance (convolution theorem)

Page 30: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Convolution kernel

0

0l

llYkk

odd,20

even,22/)2)(1(2

)12()1(

13

02

12/

n

nl

l

ll

l

n

n

k

ll

l

Lambertian kernel

l0 1 2

2 / 3

/ 4

0[Basri & Jacobs 01][Ramamoorthi & Hanrahan 01]

Second order approximation accounts for 99% variability

k like a low-pass filter

Asymptotic behavior of kl for large l2/52 lrlk lml

)',0max()'( uuuuk

lk

Page 31: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

From reflectance to imagesUnit sphere general shapeRearrange normals on the sphere

0

0

)(l

l

lmilmlmii

l

l

lmlmlm

nYrI

YrlkR

Reflectance on a sphere

Image point with normal in

Page 32: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Example of approximation

Exact image 9 terms approximation

Not good for hight frequency (sharp) effects ! (specularities)

[Ramamoorthi and Hanharan: An efficient representation for irradiance enviromental map Siggraph 01]

Efficient rendering known shape complex illumination

(compressed)

Page 33: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Relation between SH and PCA

[Ramamoorthi PAMI 2002]

42% 33% 16% 4% 2%

Prediction: 3 basis 91% variance 5 basis 97%

Empirical: 3 basis 90% variance 5 basis 94%

Page 34: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Shape from Shading

)),(,,(),( yxfyxyxs

x

fp

y

fq

Surface

Gradient space

)1,,(1

)1,,(

22

qpqp

qp

n

nNormal

Lambertian reflectance: depends only on n (p,q):

)(

)()),(cos()(

xn

lxnlxnx

E

),( qpR

Radiance of one pixel constrains the normal to a curve

ILL-POSED

Given: one image of an object illuminated with a distant light source Assume: Lambertian object, with known, or constant albedo (usually assumes 1)

orthograhic camera known light direction ignore shadows, interreflections

Recover: normals

Page 35: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Variational SFS

shading Integrated normalsImage info Recovers

Defined by Horn and others in the 70’s.

Variational formulation

object objectobject

dxdyx

q

y

pdxdy

qp

qpyxIdxdyqpEyxI

22

22

2

1

]'1,,[),(),(),( l

Showed to be ill –posed [Brooks 92] (ex . Ambiguity convex/concave)

Classical solution – add regularization, integrability constraints

Most published algorithms are non-convergent [Duron and Maitre 96]

regularization

Page 36: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Examples of results

Synthetic imagesPentland’s method 1994

Tsai and Shah’s method 1994

Page 37: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

[Prados ICCV03, ECCV04] reformulated SFS as a well-posed problem

)(

)()),(cos()(

xn

LxnLxnx

E Lambertian reflectance

Orthographic camera

),()(1

)()(

)1),(())((

}),(|))(,{(

2c

f

cfI

fs

vufs

lLx

lxx

xxn

xxx

xf(x) (x ,f(x))

222 ))()(()(

))()(()()(

))()(),(())((

}),(|),)(({

xxxx

xxxxlx

xxxxxn

xxx

fff

ffcfI

fffs

vufs

Perspective camera

(x,- )f(x)(x,-)

Hamilton-Jacobi equations - no smooth solutions;

- require boundary conditions 0),( uxH

Well posed SFS

Page 38: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Hamilton-Jacobi equations - no smooth solutions;

- require boundary conditions

Solution

1. Impose smooth solutions – not practical because of image noise

2. Compute viscosity solutions [Lions et al.93] (smooth almost everywhere)

still require boundary conditions

E. Prados :general framework – characterization viscosity solutions.

(based on Dirichlet boundary condition)

efficient numerical schemes for orthogonal and perspective camera

showed that SFS is a well-posed for a finite light source

[Prados ECCV04]

Well-posed SFS (2)

Page 39: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Shading: Summary

1. 3D subspace

2. Illumination cone:

2. Spherical harmonic representation:

+ Convex objects 3D subspace

Convex cone

Linear combination of harmonic imag.(practical 9D basis)

Space of all images :

Reconstruction :

1. Shape from shading

2. Photometric stereo

3. Uncalibrated photometric stereo

One imageUnit albedoKnown light

Multiple imag/1 viewArbitrary albedoKnown light

+ Unknown light

Ill-posed+ additional constraints

GBR ambiguityFamily of solutions

Lambertian objectDistant illumination One view (orthographic)

Single light source

Page 40: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Extension to multiple viewsProblem: PS/SFS one view incomplete object

Solution : extension to multiple views – rotating obj., light var.

Problem: we don’t know the pixel correspondence anymore

Solution: iterative estimation: normals/light – shape

initial surface from SFM or visual hull

Input images Initial surface Refined surface

1. Kriegman et al ICCV05; Zhang, Seitz … ICCV 03

2. Cipolla, Vogiatzis ICCV05, CVPR06

SFM

Visual hull

Page 41: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Multiview PS+ SFM points

LNI

[Kriegman et al ICCV05][Zhang, Seitz … ICCV 03]

1. SFM from corresponding points: camera & initial surface (Tomasi Kanade)

2. Iterate:

• factorize intensity matrix : light, normals, GBR ambiguity

• Integrate normals

• Correct GBR using SFM points (constrain surface to go close to points)

images Initial surface

Integrated surface

Rendered Final surface

xy z

y

z

x

n

n

y

f

n

n

x

f22

Page 42: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Multiview PS + frontier points[Cipolla, Vogiatzis ICCV05, CVPR06]

1. initial surface SFS visual hull – convex envelope of the object

2. initial light positions from frontier points plane passing through the point and the camera

center is tangent to the object > known normals

3. Alternate photom normals / surface (mesh)v photom normals

n surface normals – using the mesh mesh –occlusions, correspondence in I

fff

f ififi

vn

ivl

2

2

Page 43: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Multiview PS + frontier points

Page 44: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Stereo

[ Assumptions two imagesLambertian reflectance

textured surfaces]

Image info

Recover per pixel depth

Approach triangulation of corresponding points

corresponding points recovered correlation of small parches around each point calibrated cameras – search along epipolar lines

texture

[Birkbeck]

Page 45: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Rectified images

Page 46: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Disparity

Z

X(0,0) (B,0)

Z=f

xl xr d

Bf

xx

BfZ

BXx

fX

x

fZ

rl

rl

)(

Disparity d

d

Page 47: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Correlation scoresPoint:

Calibrated cameras: pixel in I1

pixel in I2

Small planar patch:

)),(,,( yxfyxx

)(

),()(

22

11

x

x

Pm

yxPm

With respect to first image

),( yxΝ

2. Compensate for illumination change

meaniiiiii

mNm

ImImmImCdmmCmCNCC )()()()()()(

2112

1

1I 2I

1. Plane parallel with image planes, no illumination variation

dmmmImmISADmNm

)(

221112

1

)()(1I 2I

)( 1mΝ

3. Arbitrary plane

dRHdmmmHImmI

T

mNm

tN

))(()( 1

)(

211

1

)( 1mΝ

),( dN

t,R

),( yx

Page 48: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

)cos(),(),,,( iiiooiio lR Reflectance equation

require: BRDF, light position

Image info

Approaches

1. Filter specular highlights (brightness, appear at sharp angles)

2. Parametric reflectance

3. Non-parametric reflectance map (discretization of BRDF)

4. Account for general reflectance

Helmholz reciprocity [Magda et al ICCV 01, IJCV03]

shading+specular highlights

Specular surfaces

Page 49: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Shape and Materials by Example[Hertzmann, Seitz CVPR 2003 PAMI 2005]

Reconstructs objects with general BRDF with no illumination info.Idea : A reference object from the same material but with known geometry (sphere) is inserted into the scene.

Reference images

Multiple materials Results

Page 50: Lecture 2 Image cues Shading, Stereo, Specularities Dana Cobzas PIMS Postdoc.

Reflectance Light + -

stereo textured Lambertian

Constant [SAD] Rec. texture

Rec. depth discont.

Complete obj

Needs texture

Occlusions

Varying [NCC]

shading uniform

Lamb

Constant [SFS] Uniform material

Not robust

Needs light pose

unif/textured

Lamb

Varying [PS] Unif/varying albedo

Do not reconstr depth disc., one view

Summary of image cues