Light, Camera and Shading CS 543 / ECE 549 Saurabh Gupta Spring - - PowerPoint PPT Presentation

light camera and shading
SMART_READER_LITE
LIVE PREVIEW

Light, Camera and Shading CS 543 / ECE 549 Saurabh Gupta Spring - - PowerPoint PPT Presentation

Light, Camera and Shading CS 543 / ECE 549 Saurabh Gupta Spring 2020, UIUC http://saurabhg.web.illinois.edu/teaching/ece549/sp2020/ Many slides adapted from S. Seitz, L. Lazebnik, D. Hoiem, D. Forsyth Recap - + 1 1 = 1


slide-1
SLIDE 1

Light, Camera and Shading

CS 543 / ECE 549 – Saurabh Gupta Spring 2020, UIUC

http://saurabhg.web.illinois.edu/teaching/ece549/sp2020/

Many slides adapted from S. Seitz, L. Lazebnik, D. Hoiem, D. Forsyth

slide-2
SLIDE 2

Recap

𝜒 = 𝑢𝑏𝑜&' 𝑒 2𝑔 1 𝐸- + 1 𝐸 = 1 𝑔

slide-3
SLIDE 3

Recap

slide-4
SLIDE 4

Recap

L f d E ú ú û ù ê ê ë é ÷ ÷ ø ö ç ç è æ = a p

4 2

cos 4

slide-5
SLIDE 5

Recap

transparent sub-surface reflection fluoroscence phosphoresence

slide-6
SLIDE 6

Overview

  • Lambertian reflection model
  • Shape from shading
  • Color
slide-7
SLIDE 7

Most surfaces have both

Specularity = spot where specular reflection dominates (typically reflects light source)

Photo: northcountryhardwoodfloors.com

Typically, specular component is small

Slide from D. Hoiem

slide-8
SLIDE 8

Specular reflection

Picture source Slide from L. Lazebnik

slide-9
SLIDE 9
  • Some light is absorbed
  • Some light is reflected diffusely

– Independent of viewing direction

  • Some light is reflected specularly

– Light bounces off (like a mirror), depends on viewing direction specular reflection Θ Θ diffuse reflection absorption

Slide from D. Hoiem

When light hits a typical surface

slide-10
SLIDE 10

Bidirectional Reflectance Distribution Function (BRDF)

  • How bright a surface appears when

viewed from one direction when light falls

  • n it from another
  • Definition: ratio of the radiance in the

emitted direction to irradiance in the incident direction

Source: Steve Seitz

slide-11
SLIDE 11

Lambertian reflectance model

Some light is absorbed (function of albedo 𝜍) Remaining light is scattered, equally in all directions. Examples: soft cloth, concrete, matte paints

light source light source absorption diffuse reflection (1 − 𝜍) 𝜍

Slide from D. Hoiem

slide-12
SLIDE 12

Intensity and Surface Orientation

Intensity depends on illumination angle because less light comes in at oblique angles.

𝜍 = albedo 𝑻 = directional source 𝑶 = surface normal I = reflected intensity

𝐽 𝑦 = 𝜍 𝑦 𝑻 ⋅ 𝑶(𝑦)

Slide: Forsyth

slide-13
SLIDE 13

Photometric stereo (shape from shading)

  • Can we reconstruct the shape of an object

based on shading cues?

Slide from L. Lazebnik

slide-14
SLIDE 14

Photometric stereo

Assume:

  • A Lambertian object
  • A local shading model (each point on a surface receives light
  • nly from sources visible at that point)
  • A set of known light source directions
  • A set of pictures of an object, obtained in exactly the same

camera/object configuration but using different sources

  • Orthographic projection

Goal: reconstruct object shape and albedo

Sn ??? S1 S2

F&P 2nd ed., sec. 2.2.4 Slide from L. Lazebnik

slide-15
SLIDE 15

Example 1

Recovered albedo Recovered normal field

F&P 2nd ed., sec. 2.2.4

Recovered surface model

Slide from L. Lazebnik

slide-16
SLIDE 16

Example 2

Input Recovered albedo Recovered normal field x y z Recovered surface model

Slide from L. Lazebnik

slide-17
SLIDE 17

Image model

  • Known: source vectors Sj and pixel values Ij(x,y)
  • Unknown: surface normal N(x,y) and albedo ρ(x,y)

F&P 2nd ed., sec. 2.2.4 Slide from L. Lazebnik

slide-18
SLIDE 18

( ) ( )

( )

( ) ( ) ( )

j j j j

y x k y x y x y x y x k y x I V g S N S N × = × = × = ) , ( ) ( , , , , ) , ( r r

Image model

  • Known: source vectors Sj and pixel values Ij(x,y)
  • Unknown: surface normal N(x,y) and albedo ρ(x,y)
  • Assume that the response function of the camera

is a linear scaling by a factor of k

  • Lambert’s law:

F&P 2nd ed., sec. 2.2.4 Slide from L. Lazebnik

slide-19
SLIDE 19

Least squares problem

  • Obtain least-squares solution for g(x,y)

(which we defined as N(x,y) r(x,y))

  • Since N(x,y) is the unit normal, r(x,y) is given by the

magnitude of g(x,y)

  • Finally, N(x,y) = g(x,y) / r(x,y)

I1(x, y) I2(x, y) ! In(x, y) ! " # # # # # $ % & & & & & = V

1 T

V

2 T

! V

n T

! " # # # # # $ % & & & & & g(x, y)

(n × 1)

known known unknown

(n × 3) (3 × 1)

  • For each pixel, set up a linear system:

F&P 2nd ed., sec. 2.2.4 Slide from L. Lazebnik

slide-20
SLIDE 20

Synthetic example

Recovered albedo Recovered normal field

F&P 2nd ed., sec. 2.2.4 Slide from L. Lazebnik

slide-21
SLIDE 21

Recall the surface is written as This means the normal has the form:

Recovering a surface from normals

If we write the estimated vector g as Then we obtain values for the partial derivatives of the surface:

)) , ( , , ( y x f y x

÷ ÷ ÷ ø ö ç ç ç è æ + + = 1 1 1 ) , (

2 2 y x y x

f f f f y x N ÷ ÷ ÷ ø ö ç ç ç è æ = ) , ( ) , ( ) , ( ) , (

3 2 1

y x g y x g y x g y x g

) , ( / ) , ( ) , ( ) , ( / ) , ( ) , (

3 2 3 1

y x g y x g y x f y x g y x g y x f

y x

= =

F&P 2nd ed., sec. 2.2.4 Slide from L. Lazebnik

slide-22
SLIDE 22

Recovering a surface from normals

Integrability: for the surface f to exist, the mixed second partial derivatives must be equal: We can now recover the surface height at any point by integration along some path, e.g. (for robustness, should take integrals over many different paths and average the results) (in practice, they should at least be similar)

)) , ( / ) , ( ( )) , ( / ) , ( (

3 2 3 1

y x g y x g x y x g y x g y ¶ ¶ = ¶ ¶

f (x, y) = fx(s,0)ds

x

+ fy(x,t)dt

y

+C

F&P 2nd ed., sec. 2.2.4 Slide from L. Lazebnik

slide-23
SLIDE 23

Surface recovered by integration

F&P 2nd ed., sec. 2.2.4 Slide from L. Lazebnik

slide-24
SLIDE 24

Limitations

  • Orthographic camera model
  • Simplistic reflectance and lighting model
  • No shadows
  • No interreflections
  • No missing data
  • Integration is tricky

Slide from L. Lazebnik

slide-25
SLIDE 25

Finding the direction of the light source

I(x,y) = N(x,y) ·S(x,y) Full 3D case:

  • P. Nillius and J.-O. Eklundh, “Automatic estimation of the projected light source

direction,” CVPR 2001

N S

Slide by L. Lazebnik

slide-26
SLIDE 26

Finding the direction of the light source

Consider points on the occluding contour:

  • P. Nillius and J.-O. Eklundh, “Automatic estimation of the projected light source

direction,” CVPR 2001

Image Projection direction (z) Nz positive Nz = 0 Nz negative

Slide by L. Lazebnik

slide-27
SLIDE 27

Finding the direction of the light source

I(x,y) = N(x,y) ·S(x,y) Full 3D case: For points on the occluding contour, Nz = 0:

  • P. Nillius and J.-O. Eklundh, “Automatic estimation of the projected light source

direction,” CVPR 2001

N S

Slide by L. Lazebnik

slide-28
SLIDE 28

Finding the direction of the light source

  • P. Nillius and J.-O. Eklundh, “Automatic estimation of the projected light source

direction,” CVPR 2001

Slide by L. Lazebnik

slide-29
SLIDE 29

Application: Detecting composite photos

Fake photo Real photo

  • M. K. Johnson and H. Farid, Exposing Digital Forgeries by Detecting Inconsistencies in Lighting,

ACM Multimedia and Security Workshop, 2005.

Slide by L. Lazebnik

slide-30
SLIDE 30

Overview

  • Lambertian reflection model
  • Shape from shading
  • Color