Low-level vision: shading, paint, and texture Bill Freeman - - PowerPoint PPT Presentation

low level vision shading paint and texture
SMART_READER_LITE
LIVE PREVIEW

Low-level vision: shading, paint, and texture Bill Freeman - - PowerPoint PPT Presentation

Low-level vision: shading, paint, and texture Bill Freeman October 27, 2008 Why shading, paint, and texture matters in object recognition We want to recognize objects independently from surface colorings lighting surface


slide-1
SLIDE 1

Low-level vision: shading, paint, and texture

Bill Freeman October 27, 2008

slide-2
SLIDE 2

Why shading, paint, and texture matters in

  • bject recognition
  • We want to recognize objects independently from

– surface colorings – lighting – surface texture

  • One approach: learn appearance-based models of objects,

spanning the space of all possible

  • Alternate approach: develop bottom-up processing to

separate shading from paint from texture. Hence, we study those issues today.

slide-3
SLIDE 3

Separating shading from paint

slide-4
SLIDE 4

Separating shading from paint

  • From a single image:

– identify all-shading versus all-paint – locally separate shading from paint

  • From a sequence of images:

– separate stable from varying component

  • From a stereo pair

– separate shading, paint, occlusion.

slide-5
SLIDE 5

Separating shading from paint

  • From a single image:

– identify all-shading versus all-paint – locally separate shading from paint

  • From a sequence of images:

– separate stable from varying component

  • From a stereo pair

– separate shading, paint, occlusion.

slide-6
SLIDE 6

end

slide-7
SLIDE 7

end

Shading Paint

slide-8
SLIDE 8

end

slide-9
SLIDE 9

survey instructions

slide-10
SLIDE 10

survey responses

slide-11
SLIDE 11

end

slide-12
SLIDE 12

Evaluate the prior probability

  • f the all-shape and all-reflectance explanations
slide-13
SLIDE 13

end

slide-14
SLIDE 14

algorithm performance vs people

slide-15
SLIDE 15

Separating shading from paint

  • From a single image:

– identify all-shading versus all-paint – locally separate shading from paint

  • From a sequence of images:

– separate stable from varying component

  • From a stereo pair

– separate shading, paint, occlusion.

slide-16
SLIDE 16

Learning to separate shading from paint

Marshall F. Tappen1 William T. Freeman1 Edward H. Adelson1,2

1MIT Computer Science and Artificial Intelligence

Laboratory (CSAIL)

2MIT Dept. Brain and Cognitive Sciences

slide-17
SLIDE 17

Forming an Image

Surface

slide-18
SLIDE 18

Forming an Image

Surface Illuminate the surface to get: Shading Image

The “shading image” is the interaction of the shape

  • f the surface and the illumination
slide-19
SLIDE 19

Painting the Surface

Scene

slide-20
SLIDE 20

Painting the Surface

Scene Image

slide-21
SLIDE 21

Painting the Surface

Scene

We can also include a reflectance pattern or a “paint”

  • image. Now shading and reflectance effects combine to

create the observed image.

Image

slide-22
SLIDE 22

Goal: decompose the image into shading and reflectance components.

=

Shading Image Image Reflectance Image

slide-23
SLIDE 23

Goal: decompose the image into shading and reflectance components.

  • These types of images are known as intrinsic images (Barrow and

Tenenbaum).

  • Note: while the images multiply, we work in a gamma-corrected

domain and assume the images add.

=

Shading Image Image Reflectance Image

slide-24
SLIDE 24

Why compute these intrinsic images

slide-25
SLIDE 25

Why compute these intrinsic images

  • Ability to reason about shading and reflectance

independently is necessary for most image understanding tasks.

– Material recognition – Image segmentation

  • Want to understand how humans might do the task.
  • For image editing, want access and modify the intrinsic

images separately.

slide-26
SLIDE 26

Treat the separation as a labeling problem

slide-27
SLIDE 27

Treat the separation as a labeling problem

  • We want to identify what parts of the image

were caused by shape changes and what parts were caused by paint changes.

slide-28
SLIDE 28

Treat the separation as a labeling problem

  • We want to identify what parts of the image

were caused by shape changes and what parts were caused by paint changes.

  • But how represent that? Can’t label pixels
  • f the image as “shading” or “paint”.
slide-29
SLIDE 29

Treat the separation as a labeling problem

  • We want to identify what parts of the image

were caused by shape changes and what parts were caused by paint changes.

  • But how represent that? Can’t label pixels
  • f the image as “shading” or “paint”.
  • Solution: we’ll label gradients in the image

as being caused by shading or paint.

slide-30
SLIDE 30

Treat the separation as a labeling problem

  • We want to identify what parts of the image

were caused by shape changes and what parts were caused by paint changes.

  • But how represent that? Can’t label pixels
  • f the image as “shading” or “paint”.
  • Solution: we’ll label gradients in the image

as being caused by shading or paint.

  • Assume that image gradients have only one

cause.

slide-31
SLIDE 31

Recovering Intrinsic Images

Original x derivative image Classify each derivative (White is reflectance)

slide-32
SLIDE 32

Recovering Intrinsic Images

  • Classify each x and y image derivative as being

caused by either shading or a reflectance change

Original x derivative image Classify each derivative (White is reflectance)

slide-33
SLIDE 33

Recovering Intrinsic Images

  • Classify each x and y image derivative as being

caused by either shading or a reflectance change

  • Recover the intrinsic images by finding the least-

squares reconstruction from each set of labeled

  • derivatives. (Fast Matlab code for that available

from Yair Weiss’s web page.)

Original x derivative image Classify each derivative (White is reflectance)

slide-34
SLIDE 34

Classic algorithm: Retinex

  • Assume world is made up of Mondrian reflectance

patterns and smooth illumination

  • Can classify derivatives by the magnitude of the

derivative

slide-35
SLIDE 35

Outline of our algorithm

slide-36
SLIDE 36

Outline of our algorithm

  • Gather local evidence for shading or

reflectance

slide-37
SLIDE 37

Outline of our algorithm

  • Gather local evidence for shading or

reflectance

– Color (chromaticity changes)

slide-38
SLIDE 38

Outline of our algorithm

  • Gather local evidence for shading or

reflectance

– Color (chromaticity changes) – Form (local image patterns)

slide-39
SLIDE 39

Outline of our algorithm

  • Gather local evidence for shading or

reflectance

– Color (chromaticity changes) – Form (local image patterns)

  • Integrate the local evidence across space.
slide-40
SLIDE 40

Outline of our algorithm

  • Gather local evidence for shading or

reflectance

– Color (chromaticity changes) – Form (local image patterns)

  • Integrate the local evidence across space.

– Assume a probabilistic model and use “belief propagation”.

slide-41
SLIDE 41

Outline of our algorithm

  • Gather local evidence for shading or

reflectance

– Color (chromaticity changes) – Form (local image patterns)

  • Integrate the local evidence across space.

– Assume a probabilistic model and use “belief propagation”.

slide-42
SLIDE 42

Outline of our algorithm

  • Gather local evidence for shading or

reflectance

– Color (chromaticity changes) – Form (local image patterns)

  • Integrate the local evidence across space.

– Assume a probabilistic model and use “belief propagation”.

  • Results shown on example images
slide-43
SLIDE 43

Probabilistic graphical model

Unknown Derivative Labels (hidden random variables that we want to estimate)

slide-44
SLIDE 44

Derivative Labels

  • Local evidence

Probabilistic graphical model

slide-45
SLIDE 45

Derivative Labels Local Color Evidence

  • Local evidence

Probabilistic graphical model

slide-46
SLIDE 46

Derivative Labels Local Color Evidence

  • Local evidence

Probabilistic graphical model

Some statistical relationship that we’ll specify

slide-47
SLIDE 47

Derivative Labels Local Color Evidence Local Form Evidence

Probabilistic graphical model

  • Local evidence
slide-48
SLIDE 48

Hidden state to be estimated Local Evidence Influence of Neighbor Propagate the local evidence in Markov Random Field. This strategy can be used to solve other low-level vision problems.

Probabilistic graphical model

slide-49
SLIDE 49

Red Green B l u e

θ

Chromaticity Changes

Classifying Color Changes

Angle between the two vectors, θ, is greater than 0

slide-50
SLIDE 50

Red Green B l u e

θ

Chromaticity Changes

Classifying Color Changes

Red Green B l u e

Intensity Changes

Angle between the two vectors, θ, is greater than 0 Angle between two vectors, θ, equals 0

slide-51
SLIDE 51
  • 1. Normalize the two color vectors c1

and c2

  • 2. If (c1 c2) > T
  • Derivative is a reflectance change
  • Otherwise, label derivative as shading

Color Classification Algorithm

c1 c2

slide-52
SLIDE 52

Result using only color information

slide-53
SLIDE 53

Results Using Only Color

Input

slide-54
SLIDE 54

Results Using Only Color

Shading Reflectance Input

slide-55
SLIDE 55

Results Using Only Color

  • Some changes are ambiguous

Shading Reflectance Input

slide-56
SLIDE 56

Results Using Only Color

  • Some changes are ambiguous
  • Intensity changes could be caused by shading or

reflectance

– So we label it as “ambiguous” – Need more information

Shading Reflectance Input

slide-57
SLIDE 57

Utilizing local intensity patterns

slide-58
SLIDE 58

Utilizing local intensity patterns

slide-59
SLIDE 59

Utilizing local intensity patterns

  • The painted eye and

the ripples of the fabric have very different appearances

  • Can learn classifiers

which take advantage

  • f these differences
slide-60
SLIDE 60

Shading/paint training set

Examples from Shading Training Set Examples from Reflectance Change Training Set

slide-61
SLIDE 61

From Weak to Strong Classifiers: Boosting

  • Individually these weak classifiers aren’t very good.
  • Can be combined into a single strong classifier.
  • Call the classification from a weak classifier hi(x).
  • Each hi(x) votes for the classification of x (-1 or 1).
  • Those votes are weighted and combined to produce a

final classification.

slide-62
SLIDE 62

Using Local Intensity Patterns

slide-63
SLIDE 63

Using Local Intensity Patterns

  • Create a set of weak classifiers that use a

small image patch to classify each derivative

slide-64
SLIDE 64

Using Local Intensity Patterns

  • Create a set of weak classifiers that use a

small image patch to classify each derivative

  • The classification of a derivative:
slide-65
SLIDE 65

Using Local Intensity Patterns

  • Create a set of weak classifiers that use a

small image patch to classify each derivative

  • The classification of a derivative:

I

p

slide-66
SLIDE 66

Using Local Intensity Patterns

  • Create a set of weak classifiers that use a

small image patch to classify each derivative

  • The classification of a derivative:

I

p

 F

slide-67
SLIDE 67

Using Local Intensity Patterns

  • Create a set of weak classifiers that use a

small image patch to classify each derivative

  • The classification of a derivative:

I

p

 F

abs

slide-68
SLIDE 68

Using Local Intensity Patterns

  • Create a set of weak classifiers that use a

small image patch to classify each derivative

  • The classification of a derivative:

I

p

 F

> T

abs

slide-69
SLIDE 69

AdaBoost

Initial uniform weight

  • n training examples

(Freund & Shapire ’95)

Viola and Jones, Robust object detection using a boosted cascade of simple features, CVPR 2001

slide-70
SLIDE 70

AdaBoost

Initial uniform weight

  • n training examples

weak classifier 1 (Freund & Shapire ’95)

Viola and Jones, Robust object detection using a boosted cascade of simple features, CVPR 2001

slide-71
SLIDE 71

AdaBoost

Initial uniform weight

  • n training examples

weak classifier 1 Incorrect classifications re-weighted more heavily (Freund & Shapire ’95)

Viola and Jones, Robust object detection using a boosted cascade of simple features, CVPR 2001

slide-72
SLIDE 72

AdaBoost

Initial uniform weight

  • n training examples

weak classifier 1 weak classifier 2 Incorrect classifications re-weighted more heavily (Freund & Shapire ’95)

Viola and Jones, Robust object detection using a boosted cascade of simple features, CVPR 2001

slide-73
SLIDE 73

AdaBoost

Initial uniform weight

  • n training examples

weak classifier 1 weak classifier 2 Incorrect classifications re-weighted more heavily weak classifier 3 Final classifier is weighted combination of weak classifiers (Freund & Shapire ’95)

Viola and Jones, Robust object detection using a boosted cascade of simple features, CVPR 2001

slide-74
SLIDE 74

Beautiful AdaBoost Properties

  • Training Error approaches 0 exponentially
  • Bounds on Testing Error Exist

– Analysis is based on the Margin of the Training Set

  • Weights are related the margin of the example

– Examples with negative margin have large weight – Examples with positive margin have small weights

Viola and Jones, Robust object detection using a boosted cascade of simple features, CVPR 2001

slide-75
SLIDE 75

Ada-Boost Tutorial

  • Given a Weak learning algorithm

– Learner takes a training set and returns the best classifier from a weak concept space

  • required to have error < 50%
  • Starting with a Training Set (initial weights 1/n)

– Weak learning algorithm returns a classifier – Reweight the examples

  • Weight on correct examples is decreased
  • Weight on errors is decreased
  • Final classifier is a weighted majority of Weak

Classifiers

– Weak classifiers with low error get larger weight

Viola and Jones, Robust object detection using a boosted cascade of simple features, CVPR 2001

slide-76
SLIDE 76

Learning the Classifiers

  • The weak classifiers, hi(x), and the weights α are chosen

using the AdaBoost algorithm (see www.boosting.org for introduction).

  • Train on synthetic images.
  • Assume the light direction is from the right.
  • Filters for the candidate weak classifiers—cascade two out of

these 4 categories:

– Multiple orientations of 1st derivative of Gaussian filters – Multiple orientations of 2nd derivative of Gaussian filters – Several widths of Gaussian filters – impulse

slide-77
SLIDE 77

Classifiers Chosen (assuming illumination from above)

  • These are the filters chosen for classifying

vertical derivatives when the illumination comes from the top of the image.

  • Each filter corresponds to one hi(x)
slide-78
SLIDE 78

Characterizing the learned classifiers

slide-79
SLIDE 79

Characterizing the learned classifiers

  • Learned rules for all (but classifier 9) are: if rectified filter

response is above a threshold, vote for reflectance.

slide-80
SLIDE 80

Characterizing the learned classifiers

  • Learned rules for all (but classifier 9) are: if rectified filter

response is above a threshold, vote for reflectance.

  • Yes, contrast and scale are all folded into that. We perform an
  • verall contrast normalization on all images.
slide-81
SLIDE 81

Characterizing the learned classifiers

  • Learned rules for all (but classifier 9) are: if rectified filter

response is above a threshold, vote for reflectance.

  • Yes, contrast and scale are all folded into that. We perform an
  • verall contrast normalization on all images.
  • Classifier 1 (the best performing single filter to apply) is an

empirical justification for Retinex algorithm: treat small derivative values as shading.

slide-82
SLIDE 82

Characterizing the learned classifiers

  • Learned rules for all (but classifier 9) are: if rectified filter

response is above a threshold, vote for reflectance.

  • Yes, contrast and scale are all folded into that. We perform an
  • verall contrast normalization on all images.
  • Classifier 1 (the best performing single filter to apply) is an

empirical justification for Retinex algorithm: treat small derivative values as shading.

  • The other classifiers look for image structure oriented

perpendicular to lighting direction as evidence for reflectance change.

slide-83
SLIDE 83

Results Using Only Form Information

Input Image

slide-84
SLIDE 84

Results Using Only Form Information

Input Image Shading Image

slide-85
SLIDE 85

Results Using Only Form Information

Input Image Shading Image Reflectance Image

slide-86
SLIDE 86

Using Both Color and Form Information

Shading Reflectance Input image

slide-87
SLIDE 87

Using Both Color and Form Information

Results only using chromaticity.

Shading Reflectance Input image

slide-88
SLIDE 88

Some Areas of the Image Are Ambiguous

Input

slide-89
SLIDE 89

Some Areas of the Image Are Ambiguous

Input

slide-90
SLIDE 90

Some Areas of the Image Are Ambiguous

Input Shading Is the change here better explained as

slide-91
SLIDE 91

Some Areas of the Image Are Ambiguous

Input Shading Reflectance Is the change here better explained as

  • r

?

slide-92
SLIDE 92

Propagating Information

  • Can disambiguate areas by propagating

information from reliable areas of the image into ambiguous areas of the image

slide-93
SLIDE 93

Propagating Information

  • Can disambiguate areas by propagating

information from reliable areas of the image into ambiguous areas of the image

slide-94
SLIDE 94

Markov Random Fields

  • Allows rich probabilistic models for

images.

  • But built in a local, modular way. Learn

local relationships, get global effects out.

slide-95
SLIDE 95

Network joint probability

scene image Scene-scene compatibility function neighboring scene nodes local

  • bservations

Image-scene compatibility function

∏ ∏

Φ Ψ =

i i i j i j i

y x x x Z y x P ) , ( ) , ( 1 ) , (

,

slide-96
SLIDE 96

Inference in MRF’s

  • Inference in MRF’s. (given observations, how

infer the hidden states?)

– Gibbs sampling, simulated annealing – Iterated condtional modes (ICM) – Variational methods – Belief propagation – Graph cuts

See www.ai.mit.edu/people/wtf/learningvision for a tutorial on learning and vision.

slide-97
SLIDE 97

y1

Deriva)on
of
belief
propaga)on

x1 y2 x2 y3 x3

slide-98
SLIDE 98

The
posterior
factorizes

y1 x1 y2 x2 y3 x3

slide-99
SLIDE 99

Propaga)on
rules

y1 x1 y2 x2 y3 x3

slide-100
SLIDE 100

Propaga)on
rules

y1 x1 y2 x2 y3 x3

slide-101
SLIDE 101

Propaga)on
rules

y1 x1 y2 x2 y3 x3

slide-102
SLIDE 102

Propaga)on
rules

y1 x1 y2 x2 y3 x3

slide-103
SLIDE 103

Belief
propaga)on:

the
nosey
neighbor


“Given
everything
I’ve
heard,
and
I
know
how
 you
think
about
things,
here’s
what
you
 should
think.” (Given
the
probabili)es
of
my
being
in
 different
states,
and
how
my
states
relate
to
 your
states,
here’s
what
I
think
the
 probabili)es
of
your
states
should
be)

slide-104
SLIDE 104

Belief
propaga)on
messages

j i i

=

j To
send
a
message:

Mul)ply
together
all
the
incoming
messages,
except
from
 the
node
you’re
sending
to, then
mul)ply
by
the
compa)bility
matrix
and
marginalize
over
the
sender’s
 states.
 A
message:

can
be
thought
of
as
a
set
of
weights
on
each
of
your
 possible
states

slide-105
SLIDE 105

Beliefs

j To
find
a
node’s
beliefs:

Mul)ply
together
all
the
messages
coming
in
to
 that
node.

slide-106
SLIDE 106

Op)mal
solu)on
in
a
chain
or
tree:

  • “Do
the
right
thing”
Bayesian
algorithm.
  • For
Gaussian
random
variables
over
)me:



Kalman
filter.

  • For
hidden
Markov
models:
forward/backward


algorithm
(and
MAP
variant
is
Viterbi).

slide-107
SLIDE 107

y1 x1 y2 x2 y3 x3

slide-108
SLIDE 108

y1 x1 y2 x2 y3 x3

3 1

) , ( x x Ψ

slide-109
SLIDE 109

No
factoriza)on
with
loops!

y1 x1 y2 x2 y3 x3

3 1

) , ( x x Ψ

slide-110
SLIDE 110

Jus)fica)on
for
running
belief
propaga)on
in


  • Experimental
results:

– Error‐correc)ng
codes – Vision
applica)ons

  • Theore)cal
results:

– For
Gaussian
processes,
means
are
correct. – Large
neighborhood
local
maximum
for
MAP. – Equivalent
to
Bethe
approx.
in
sta)s)cal
physics.

Weiss
and
Freeman,
2000 Yedidia,
Freeman,
and
Weiss,
2000 Freeman
and
Pasztor,
1999; Frey,
2000 Kschischang
and
Frey,
1998; McEliece
et
al.,
1998 Weiss
and
Freeman,
1999

slide-111
SLIDE 111
  • Extend probability model to consider relationship

between neighboring derivatives

  • β controls how necessary it is for two nodes to have

the same label

  • Use Generalized Belief Propagation to infer labels.

(Yedidia et al. 2000)

Propagating Information

slide-112
SLIDE 112
  • Extend probability model to consider relationship

between neighboring derivatives

  • β controls how necessary it is for two nodes to have

the same label

  • Use Generalized Belief Propagation to infer labels.

(Yedidia et al. 2000)

Propagating Information

Classification

  • f a derivative
slide-113
SLIDE 113

Setting Compatibilities

  • All compatibilities have form
  • Assume derivatives along image

contours should have the same label

  • Set β close to 1 when the

derivatives are along a contour

  • Set β to 0.5 if no contour is

present

  • β is computed from a linear

function of the image gradient’s magnitude and orientation

0.5 1.0

β=

slide-114
SLIDE 114

Setting Compatibilities

  • All compatibilities have form
  • Assume derivatives along image

contours should have the same label

  • Set β close to 1 when the

derivatives are along a contour

  • Set β to 0.5 if no contour is

present

  • β is computed from a linear

function of the image gradient’s magnitude and orientation

0.5 1.0

β=

slide-115
SLIDE 115

Improvements Using Propagation

Input Image Reflectance Image With Propagation Reflectance Image Without Propagation

slide-116
SLIDE 116

Improvements Using Propagation

Input Image Reflectance Image With Propagation Reflectance Image Without Propagation

slide-117
SLIDE 117

More results…

slide-118
SLIDE 118
  • J. J. Gibson,

1968

slide-119
SLIDE 119
  • J. J. Gibson,

1968

slide-120
SLIDE 120

Gibson image

slide-121
SLIDE 121

Gibson image

  • riginal
slide-122
SLIDE 122

Gibson image

shading

  • riginal
slide-123
SLIDE 123

Gibson image

shading reflectance

  • riginal
slide-124
SLIDE 124

Clothing catalog image

Original

(from LL Bean catalog)

slide-125
SLIDE 125

Clothing catalog image

Original

(from LL Bean catalog)

Shading

slide-126
SLIDE 126

Clothing catalog image

Original

(from LL Bean catalog)

Shading Reflectance

slide-127
SLIDE 127

Sign at train crossing

slide-128
SLIDE 128

Separated images

  • riginal
slide-129
SLIDE 129

Separated images

shading

  • riginal
slide-130
SLIDE 130

Separated images

shading reflectance

  • riginal
slide-131
SLIDE 131

Separated images

shading reflectance

Note: color cue omitted for this processing

  • riginal
slide-132
SLIDE 132
slide-133
SLIDE 133
slide-134
SLIDE 134

Finally, returning to our explanatory example…

input Ideal shading image Ideal paint image

slide-135
SLIDE 135

Finally, returning to our explanatory example…

Algorithm output.

Note: occluding edges labeled as reflectance. input Ideal shading image Ideal paint image

slide-136
SLIDE 136

Separating shading from paint

  • From a single image:

– identify all-shading versus all-paint – locally separate shading from paint

  • From a sequence of images:

– separate stable from varying component

  • From a stereo pair

– separate shading, paint, occlusion.

slide-137
SLIDE 137

Yair Weiss’s ICCV 2001 paper

slide-138
SLIDE 138

Assume multiple images where reflectance is constant but lighting varies

slide-139
SLIDE 139

end

slide-140
SLIDE 140

synthetic example

slide-141
SLIDE 141

Result from Yair’s multi-image algorithm

slide-142
SLIDE 142

Result from Yair’s multi-image algorithm

slide-143
SLIDE 143

Separating shading from paint

  • From a single image:

– identify all-shading versus all-paint – locally separate shading from paint

  • From a sequence of images:

– separate stable from varying component

  • From a stereo pair

– separate shading, paint, occlusion.

slide-144
SLIDE 144

end

slide-145
SLIDE 145

Intrinsic images from stereo

  • Input: stereo pair (from Flickr or other)
  • Output: shading image, reflectance image,

material/lighting parameters for different regions, occluding contours.

  • This may help make stereo better (fewer

unexplained phenomena). And could provide a great training set for the monocular image intrinsic image problem.