Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson,...

35
Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004

Transcript of Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson,...

Page 1: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Intrinsic Images by Entropy Minimization(Midway Presentation, by Yingda Chen)

Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004

Page 2: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Project Goals:

Obtain the intrinsic image by removing shadows from images :

Without camera calibration (no knowledge about the imagery source)

Based on one single image (instead of multiple image arrays) by entropy minimization

Page 3: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

dSEBb

dSEGg

dSERr

)()()(

)()()(

)()()(

)(S

)(E)()( SE

How an Image is Formed?

Camera responses depend on 3 factors:

• Light (E),

• Surface (S),

• Camera sensor (R,G, B)

In an RGB image, the R, G , B components are obtained by:

(*)

Page 4: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Planck’s Law Blackbody:

A blackbody is a hypothetical object that emits radiation at a maximum rate for its given temperature and absorbs all of the radiation that strikes it.

Illumination sources such as can be well approximately as a blackbody radiator.

Planck’s Law [Max Planck, 1901]Planck’s Law defines the energy emission rate of a blackbody , in unit of watts per square meter per wavelength interval, as a function of wav

elength (in meters) and temperature T (in degrees Kelvin). 2

1

51( ) 1

c

TrP c e

-16 21 3.74183 10 Wmc

-21 1.4388 10 mKc

Where and

are constants.

Page 5: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Planck’s Law (cont.)

The temperature of a lighting source and the wavelength together determine the relative amounts radiation being emitted (color of the illuminator).

2 21

5 51 1( ) 1

c c

T TrE I P Ic e Ic e

Given the intensity of the radiation I, the Planck’s law gives the spectral power of the lighting source:

Page 6: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

is Blue; is Red;

Page 7: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Image formation for Lambertian surface

RR GG BB

Assume idea camera sensors:

G()

Sen s

i tiv

i ty

B() R())(S

)(E )()( SE ( ) ( )

( ) ( )

( )

( )

( ) ( )

)

)

(

) (

)

(

(

R

B

R

G

R

B

G

r

g

R

b E S

E S

E S d

E S

E S

d

Page 8: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

5 21ln ln ln ( )R R

R

cr I S c

T

5 21ln ln ln ( )G G

G

cg I S c

T

5 21ln ln ln ( )B B

B

cb I S c

T

Analysis of the components in image formation

Depends on the surface property only Depend on property of the illumination

Need some manipulations to get rid of the illumination dependence

Page 9: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

How to remove shadows (illumination)?

Define a 2-D chromaticity vector V,

1

2

ln( / )

ln( / )

v r gV

v b g

The 2-D vector V forms a straight line in the space of logs of ratios, the slope of the which is determined by T (i.e. by illumination color). Project the 2D log ratios into the direction , the 1-D grayscale invariant image can be obtained. is the direction orthogonal to vector

52

1 5

( )ln

( )R R R

G G G

S cv

S T

5

22 5

( )ln

( )B B B

G G G

S cv

S T

2 2[ , ]R B

G G

c c

T T

Shadow which occurs when there is a change in light but not surface will disappear in the invariant image

e

e

Page 10: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

How to remove shadows (illumination)? (cont.)

Page 11: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

The key of the obtaining the invariant image is to determine the right projection direction. For a calibrated camera whose sensor sensitivity is known, the task is relatively easy.

Question: How to determine the projection direction for images from Uncalibrated Cameras? Answer: Problematic, but artificial calibration can still be performed by obtaining a series of image from the same camera.

Question: How to determine the projection direction for images whose source is unknown?

How to remove shadows (illumination) ? (cont. II)

Page 12: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Entropy minimization

Correct Projection Incorrect Projection

Page 13: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Entropy minimization (cont.)

The scalar values can be encoded into a grayscale image, and the entropy be calculated as

( ) log ( )i ii

H p x p x

For each , we can obtain an corresponding entropy. As the more “spread-out” distribution results in a larger entropy value, the projection direction that produces the minimum entropy is the correct projection direction

Given projection angle , the projection result in a scalar value

1 2[cos , sin ] cos sinTV v v ��������������

1,2, 180

Page 14: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Assumptions? Delta sensor functions of camera

The image must be unbiased of R,G,B

G()

Sen s

i tiv

i ty

B() R()

400 450 500 550 600 650 7000

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Wavelength

Re

lativ

e S

en

siti

vity

This assumption is idealized, but experiments show that it performs reasonably well.

This is NOT true for many images, which can be “reddish”, “bluish” or “greenish” in color. So some more dedicated approach should be introduced to remove (or at least suppress) the potential bias.

Page 15: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Geometric Mean Invariant ImageUse the geometric mean as the reference color channel whentaking the log ratios, so we will not favor for any particular color

3refC r g b

5 21

, , , ,

1 1ln( ) ln( ) ln( ) ln( ( ) )

3ref k kk R G B k R G B k

cC I c S

T

2

11 12

221 22

231 32

ln( / )

ln( / )

ln( / )

ref

ref

ref

cK K K

Tr Cc

g C K K KT

b C cK K K

T

Where the K’s are just constants

The geometric mean is unbiased, however, the invariant image is a projection from 2-D space into 1-D grayscale. The log ratios vector is 3-D.

Page 16: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Geometric Mean Invariant Image (cont.) From 3-D to 2-D before we can get the invariant. A 2 x 3 matrix can do this by

The transform should satisfy:

A straight line in the 3-D space is still straight after the transformation

How do we find ?

U

U

U3ln( / ) 0

0, (1/ 3) [1 1 1]

R G B ref

T

r g b C

u where u

Since

The orthogonal matrix satisfies UT TU U I u u

The rows of are just the eigenvectors associated with the non-zero eigenvaluesof the matrix .

U

Page 17: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Geometric Mean Invariant Image (cont. II)

With , we converted the 3-D log ratios space into 2-D, but with no color bias, the invariant image is then ac

hieved by , is the correct projection angle, and we are back to the original track.

Obtain by entropy minimization: Decide the number of bins by Scott’s rule:

The probability of the ith bin is

The entropy is calculated as

U

[cos ,sin ]T

1/3binNumber= 3.5 (data) Nstd

ii

n

N

2log ( )i ii

Page 18: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Midway Results: invariant image

Original Image Invariant Image

Page 19: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Entropy Minimization (Camera: Nikon CoolPix8700)

0 20 40 60 80 100 120 140 160 1800.5

1

1.5

2

2.5

3

3.5Entropy Minization

projection angle

entr

opy

Page 20: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Edge in Original Image Edge in Invariant Image

Page 21: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Original Image Invariant Image

Page 22: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Entropy Minimization (Camera: Nikon CoolPix8700)

0 20 40 60 80 100 120 140 160 1802.2

2.4

2.6

2.8

3

3.2

3.4

3.6

3.8Entropy Minization

projection angle

entr

opy

Page 23: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Edge in Original Image Edge in Invariant Image

Page 24: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Original Image Invariant Image

Page 25: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Entropy Minimization (Camera: Nikon CoolPix8700)

0 20 40 60 80 100 120 140 160 1800

0.5

1

1.5

2

2.5

3Entropy Minization

projection angle

entr

opy

Page 26: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Edge in Original Image Edge in Invariant Image

Page 27: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Entropy Minimization (Camera: HP-912, better camera sensors?) [from author’s website]

0 20 40 60 80 100 120 140 160 1801

2

3

4

5

6

7

8Entropy Minization

projection angle

entr

opy

Page 28: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Is the projected 1-D data really “colorless”?

We can recover 2-D chromaticity along the line

Page 29: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Invariant chromaticity Image Recall that the grayscale image

let , where , the 3-D log ratio is

recovered by

Invariant chromaticity image:

is the invariant chromaticity image that presents the color information inherent in the 1-D projection yet absent in the grayscale invariant image

[cos ,sin ]Te

P TP e e

TU

exp( ) / exp( )ii

r

r

Page 30: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Determine the shadow edges Comparing the edges in the original image and the invariant image

(Mean Shift?)

Shadow Edge = Edge in Original but NOT in Invariant

Thicken the identified shadow edges using morphological operato

Let be one of the RGB channels, and be one of the log of RGB channels. {Recall that }, difference of reflects a change in either illumination or surface, the change in reflectance can be revealed by the operation:

( , )x y ( , )x y

0 '( , ) 1 & ( , ) 2( , )

'( , )

if x y thre g x y threS x y

x y otherwise

( ) ( ), , ,k k kE S k r g b ( , )x y

Page 31: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Reintegrate Solve the Poisson Equation under Neumann

boundary condition ( on the boundary), where being the log of the shadow-free image we wish to recover.

How to solve the Poisson Equation?

In Fourier Domain, rewrite the equation as :

Solve for ,and the IFFT( ) gives the up to an unknown constant.

Map the maximum of each of the R,G,B channel to 1 and factor the unknown constant.

2 '( , ) ( , )q x y S x y '( , )q x y'( , ) 0q x y

2 2 2'( , ) ( ) ( , ) ( , )q x y u v Q u v S x y

( , )Q u v ( , )Q u v '( , )q x y

Page 32: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Plan Take some qualified

pictures Preprocessing (Smoothing,

Data refinement etc.) Geometric Mean: to exclude

bias for a certain color channel

Entropy Minimization to obtain the best projection angle

Project to get 1D grayscale invariant

Recover part of the color information by chromaticity invariant image

Determine shadow edge (edge thickening, clear noisy edges, etc.)

Remove shadows in the gradient of the original image

Solve Poisson PDE in Fourier domain (perform reintegration)

RGB intrinsic image.

I am somewhere here

Dreams: Improvement and Compare to other Algorithms

Page 33: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Expected Results :

Original

Entropy Minimization

Invariant

Shadow Edge

Intrinsic image

Page 34: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Reference “Intrinsic Images by Entropy Minimization”, Graham D. Finlayson, Mark

S. Drew and Cheng Lu, ECCV, Prague, 2004; “Removing Shadows from Images”, Graham D. Finlayson, Steven D. Hordl

ey and Mark S. Drew; Removing shadows from images. In European Conference on Computer Vision, pages 4:823–836, 2002;

“Color constancy at a pixel ”, G.D. Finlayson and S.D. Hordley, Journal of Optical Society of America. A, 18(2):253–264, Feb. 2001.

“On the Law of Distribution of Energy in the Normal Spectrum”, Max Planck, Annalen der Physik, vol. 4, p. 553 ff (1901)

“Recovery of Chromaticity Image Free from Shadows via Illumination Invariance”, Mark S. Drew, Graham D. Finlayson and Steven D. Hordley, ICCV’03 Workshop on Color and Photometric Methods in Computer Vision, Nice, France, pp. 32-39

“Deriving intrinsic images from image sequences”, Yair Weiss, ICCV ’01, Volume II pages: 68-75.

Page 35: Intrinsic Images by Entropy Minimization (Midway Presentation, by Yingda Chen) Graham D. Finlayson, Mark S. Drew and Cheng Lu, ECCV, Prague, 2004.

Thanks!