42
1 COMP 546 Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018

Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

1

COMP 546

Lecture 12

Illumination and Reflectance

Tues. Feb. 20, 2018

Page 2: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Illumination and Reflectance

• Shading

• Brightness versus Lightness

• Color constancy

Page 3: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

N(x)

L

Shading on a sunny day

𝑁

𝐿

Lambert’s (cosine) Law:

𝐼 𝑋 = 𝑁(𝑋) ∙ 𝐿

Page 4: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Unit Surface Normal

1

𝜕𝑍𝜕𝑋

2

+𝜕𝑍𝜕𝑌

2

+ 1

𝜕𝑍

𝜕𝑋,𝜕𝑍

𝜕𝑌,−1𝑁 ≡

𝑁

4

Page 5: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Shading on a sunny day

5

Page 6: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Cast and Attached Shadows

cast : 𝑁(𝑋) ∙ 𝐿 > 0

but light isoccluded

attached : 𝑁(𝑋) ∙ 𝐿 < 0

𝐿

Page 7: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Shading models

• sunny day (last lecture)

• sunny day + low relief

• cloudy day

Page 8: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Examples of low relief surfaces

(un)crumpled paper

Page 9: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Low relief surface

1

𝜕𝑍𝜕𝑋

2

+𝜕𝑍𝜕𝑌

2

+ 1

𝜕𝑍

𝜕𝑋,𝜕𝑍

𝜕𝑌,−1𝑁 ≡

9

𝜕𝑍

𝜕𝑋≈ 0

≈0 ≈0

𝜕𝑍

𝜕𝑌≈ 0

Thus,

Suppose and are both small.

Page 10: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Linear shading model for low relief

𝐼 𝑋, 𝑌 ≈𝜕𝑍

𝜕𝑋,𝜕𝑍

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

10

• shadows can still occur

• one equation per point but two unknowns

Page 11: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Example: curtains

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

𝐿 𝑁

𝑋

𝑍

Page 12: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Example: curtains

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

𝜕𝑍

𝜕𝑋= 𝑎 𝑘𝑋 cos 𝑘𝑋 𝑋

𝜕𝑍

𝜕𝑌= 0,

𝑋

𝑍

Page 13: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Example: curtains

𝐼 𝑋, 𝑌 ≈𝜕𝑍

𝜕𝑋,𝜕𝑍

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

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

𝜕𝑍

𝜕𝑋= 𝑎 𝑘𝑋 cos 𝑘𝑋 𝑋

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

𝜕𝑍

𝜕𝑌= 0,

Page 14: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Example: curtains

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

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

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

𝑋

𝑍

𝑁

Q: where do the intensity maxima and minima occur?

Page 15: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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

15

Page 16: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

(x)

Shading on a Cloudy Day

Shadowing effects cannot be ignored.

Page 17: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Shading on a Cloudy Day

17

Shading is determined by shadowing and surface normal.

Page 18: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Shading on a Sunny Day

Shading determined by surface normal only.

Page 19: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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 ?

Page 20: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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

Page 21: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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?

Page 22: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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?

Page 23: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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

Abstract version

“Real” example

Page 24: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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

shading & shadows material

luminance

Physical quantities

Page 25: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

low reflectance, high illumination

low reflectance, low illumination

high reflectance, low illumination

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

Page 26: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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

“lightness”

“brightness”

Perceptual quantities

(no standard term for perceived illumination)

Page 27: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

All four indicated “squares” have same intensity.

What is the key difference between the two configurations ?

Adelson’s corrugated plaid illusion.

Page 28: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

“Lightness” perception

Q: What is the task ?

What problem is being solved?

A:

Page 29: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

“Lightness” perception

Q: What is the task ?

What problem is being solved?

A: Estimate the surface reflectance, by

discounting the illumination.

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

?

Page 30: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

“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)=

Page 31: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Illumination and Reflectance

• Shading

• Brightness versus Lightness

• Color constancy

Page 32: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Recall lecture 3 - color

32

Illumination

Surface Reflectance (fraction)

Absorption by photoreceptors(fraction)

There are three different spectra here.

Page 33: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

LMS cone responses

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

Cone response

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

Page 34: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Surface Color Perception

34

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

A:

illumination

Surface Reflectance

Page 35: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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

Page 36: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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

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

𝜆

Cone response

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

Page 37: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

“Color Constancy”

37

Task: estimate the surface reflectance, by discounting the illumination

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

illumination

Surface Reflectance

Page 38: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Why we need color constancy

• object recognition

• skin evaluation (health, emotion, …)

• food quality

• …

Page 39: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Example 1: spatially uniform illumination

= *

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

Given this, how to estimate this?

Page 40: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Solution 1: ‘max-RGB’ Adaptation

= *

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

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

When does this give the correct answer?

Page 41: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

Example 2: non-uniform illumination

= *

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

Solution: See Exercises.

sun +blue sky

onlyblue sky

Page 42: Lecture 12 - McGill CIMlanger/546/12-illumination-reflectance-slides.pdf · Lecture 12 Illumination and Reflectance Tues. Feb. 20, 2018. Illumination and Reflectance •Shading •Brightness

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.