Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination...

Preview:

Citation preview

1

COMP 546

Lecture 12

Illumination and Reflectance

Tues. Feb. 20, 2018

Illumination and Reflectance

• Shading

• Brightness versus Lightness

• Color constancy

N(x)

L

Shading on a sunny day

𝑁

𝐿

Lambert’s (cosine) Law:

𝐼 𝑋 = 𝑁(𝑋) ∙ 𝐿

Unit Surface Normal

1

𝜕𝑍𝜕𝑋

2

+𝜕𝑍𝜕𝑌

2

+ 1

𝜕𝑍

𝜕𝑋,𝜕𝑍

𝜕𝑌,−1𝑁 ≡

𝑁

4

Shading on a sunny day

5

Cast and Attached Shadows

cast : 𝑁(𝑋) ∙ 𝐿 > 0

but light isoccluded

attached : 𝑁(𝑋) ∙ 𝐿 < 0

𝐿

Shading models

• sunny day (last lecture)

• sunny day + low relief

• cloudy day

Examples of low relief surfaces

(un)crumpled paper

Low relief surface

1

𝜕𝑍𝜕𝑋

2

+𝜕𝑍𝜕𝑌

2

+ 1

𝜕𝑍

𝜕𝑋,𝜕𝑍

𝜕𝑌,−1𝑁 ≡

9

𝜕𝑍

𝜕𝑋≈ 0

≈0 ≈0

𝜕𝑍

𝜕𝑌≈ 0

Thus,

Suppose and are both small.

Linear shading model for low relief

𝐼 𝑋, 𝑌 ≈𝜕𝑍

𝜕𝑋,𝜕𝑍

𝜕𝑌,−1 ∙ 𝐿𝑋 , 𝐿𝑌 , 𝐿𝑍

10

• shadows can still occur

• one equation per point but two unknowns

Example: curtains

𝑍 𝑋, 𝑌 = 𝑍0 + 𝑎 sin( 𝑘𝑋 𝑋 )

𝐿 𝑁

𝑋

𝑍

Example: curtains

𝑍 𝑋, 𝑌 = 𝑍0 + 𝑎 sin( 𝑘𝑋 𝑋 )

𝜕𝑍

𝜕𝑋= 𝑎 𝑘𝑋 cos 𝑘𝑋 𝑋

𝜕𝑍

𝜕𝑌= 0,

𝑋

𝑍

Example: curtains

𝐼 𝑋, 𝑌 ≈𝜕𝑍

𝜕𝑋,𝜕𝑍

𝜕𝑌, −1 ∙ 𝐿𝑋 , 𝐿𝑌 , 𝐿𝑍

𝑍 𝑋, 𝑌 = 𝑍0 + 𝑎 sin( 𝑘𝑋 𝑋 )

𝜕𝑍

𝜕𝑋= 𝑎 𝑘𝑋 cos 𝑘𝑋 𝑋

𝐼 𝑋, 𝑌 = 𝑎 𝑘𝑋 cos 𝑘𝑋 𝑋 𝐿𝑋 − 𝐿𝑍

𝜕𝑍

𝜕𝑌= 0,

Example: curtains

𝑍 𝑋, 𝑌 = 𝑍0 + 𝑎 sin( 𝑘𝑋 𝑋 )

𝐼 𝑋, 𝑌 = − 𝐿𝑍 + 𝑎 𝑘𝑋 𝐿𝑋 cos 𝑘𝑋 𝑋

𝐿 = (𝐿𝑋, 𝐿𝑌, 𝐿𝑍)

𝑋

𝑍

𝑁

Q: where do the intensity maxima and minima occur?

Shading on a cloudy day(my Ph.D. thesis)

15

(x)

Shading on a Cloudy Day

Shadowing effects cannot be ignored.

Shading on a Cloudy Day

17

Shading is determined by shadowing and surface normal.

Shading on a Sunny Day

Shading determined by surface normal only.

Shape from shading

19

Q: What is the task ? What problem is being solved?

A: Estimate surface slant, tilt, curvature.

How to account for (or estimate) the lighting ?

Illumination and Reflectance

• Shading

[Shading and shadowing models assume that intensity variations on a surface are entirely due to illumination. But surfaces have reflectance variations too. ]

• Brightness versus Lightness

• Color constancy

Which paper is lighter ?

21

Paper on the left is in shadow. It has lower physical intensity and it appears darker. But do both papers seem to be of same (white) material?

Which paper is lighter ?

22

Image is processed so that the right paper is given same image intensities as left paper. Now, right paper appears to be made of different material. Why?

𝐼 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 (𝑥, 𝑦)

Abstract version

“Real” example

𝐼 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 (𝑥, 𝑦)

shading & shadows material

luminance

Physical quantities

low reflectance, high illumination

low reflectance, low illumination

high reflectance, low illumination

𝐼 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 (𝑥, 𝑦)

𝐼 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 (𝑥, 𝑦)

“lightness”

“brightness”

Perceptual quantities

(no standard term for perceived illumination)

All four indicated “squares” have same intensity.

What is the key difference between the two configurations ?

Adelson’s corrugated plaid illusion.

“Lightness” perception

Q: What is the task ?

What problem is being solved?

A:

“Lightness” perception

Q: What is the task ?

What problem is being solved?

A: Estimate the surface reflectance, by

discounting the illumination.

𝐼 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 (𝑥, 𝑦)

?

“Lightness” perception: solution sketch

Q: What is the task ?

What problem is being solved?

A: Estimate the surface reflectance, by

discounting illumination effects.

Compare points that have same illumination.

𝐼 𝑥1, 𝑦1 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 (𝑥1, 𝑦1)

𝐼 𝑥2, 𝑦2 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 (𝑥2, 𝑦2)=

Illumination and Reflectance

• Shading

• Brightness versus Lightness

• Color constancy

Recall lecture 3 - color

32

Illumination

Surface Reflectance (fraction)

Absorption by photoreceptors(fraction)

There are three different spectra here.

LMS cone responses

𝐼 𝑥, 𝑦, 𝜆 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 𝑥, 𝑦, 𝜆 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 𝑥, 𝑦, 𝜆

Cone response

𝐼 𝑥, 𝑦, 𝜆 𝐶𝐿𝑀𝑆(𝜆) 𝑑𝜆

Surface Color Perception

34

Q: What is the task? What is the problem to be solved?

A:

illumination

Surface Reflectance

Surface Color Perception

35

Q: What is the task? What is the problem to be solved?

A: Estimate the surface reflectance, by discounting the illumination.

𝐼 𝑥, 𝑦, 𝜆 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛 𝑥, 𝑦, 𝜆 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒 𝑥, 𝑦, 𝜆

illumination

Surface Reflectance

𝐼𝑅𝐺𝐵 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛𝑅𝐺𝐵 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒𝑅𝐺𝐵 (𝑥, 𝑦)

For simplicity, let’s ignore the continuous wavelength 𝜆 and just consider 𝑅𝐺𝐵 (LMS).

𝜆

Cone response

𝐼 𝑥, 𝑦, 𝜆 𝐶𝐿𝑀𝑆(𝜆) 𝑑𝜆

“Color Constancy”

37

Task: estimate the surface reflectance, by discounting the illumination

𝐼𝑅𝐺𝐵 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛𝑅𝐺𝐵 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒𝑅𝐺𝐵 (𝑥, 𝑦)

illumination

Surface Reflectance

Why we need color constancy

• object recognition

• skin evaluation (health, emotion, …)

• food quality

• …

Example 1: spatially uniform illumination

= *

𝐼𝑅𝐺𝐵 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛𝑅𝐺𝐵 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒𝑅𝐺𝐵 (𝑥, 𝑦)

Given this, how to estimate this?

Solution 1: ‘max-RGB’ Adaptation

= *

𝐼𝑅𝐺𝐵 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛𝑅𝐺𝐵 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒𝑅𝐺𝐵 (𝑥, 𝑦)

Divide each 𝐼𝑅𝐺𝐵 channel by the max value of 𝐼𝑅𝐺𝐵 in each channel.

When does this give the correct answer?

Example 2: non-uniform illumination

= *

𝐼𝑅𝐺𝐵 𝑥, 𝑦 = 𝑖𝑙𝑙𝑢𝑚𝑖𝑛𝑎𝑡𝑖𝑜𝑛𝑅𝐺𝐵 𝑥, 𝑦 ∗ 𝑟𝑒𝑓𝑙𝑒𝑐𝑡𝑎𝑛𝑐𝑒𝑅𝐺𝐵 𝑥, 𝑦

Solution: See Exercises.

sun +blue sky

onlyblue sky

Illumination and Reflectance

• Shape from Shading

• Brightness versus Lightness

• Color constancy

Different solutions require different underlying assumptions. This is separate issue from how we can code up a solution using neural circuits.

Recommended