matching by mapping

54
1 Matching by Mapping Yacov Hel-Or I.D.C. Visiting Scholar – Google joint work with Hagit Hel-Or and Eyal David U. of Haifa, Israel

Upload: quade

Post on 23-Feb-2016

70 views

Category:

Documents


0 download

DESCRIPTION

Matching by Mapping. Yacov Hel-Or I.D.C. Visiting Scholar – Google joint work with Hagit Hel-Or and Eyal David U. of Haifa, Israel . Dense Pattern Matching. A given pattern p is sought in an image. The pattern may appear at any location in the image. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Matching by Mapping

1

Matching by MappingYacov Hel-OrI.D.C.

Visiting Scholar – Google

joint work withHagit Hel-Or and Eyal

DavidU. of Haifa, Israel

Page 2: Matching by Mapping

• A given pattern p is sought in an image. • The pattern may appear at any location in the image.• The pattern may be subject to some deformations T(p).

2

Dense Pattern Matching

pattern p

image similarity map

Page 3: Matching by Mapping

3

Possible Deformations• Geometric deformations:– Different point of views– Different articulated poses

• Photometric deformations:– Different camera’s photometric parameters (exposure,

white balancing, sensor’s sensitivity, tone correction, etc.)

– Different illuminant colors– Different lighting geometry

Page 4: Matching by Mapping

• Serves as a building block in many applications.

• Applications: “patch based” methods– Image summarization– Image retargeting– Super resolution– Image denoising– Tracking, Recognition, many more …

Pattern Matching

Page 5: Matching by Mapping

Invariance – Find a signature that will be invariant to the deformation.

– Lose information. Weaken discriminative power.

Canonization– Transform into canonical position.

– Slow.

Brute force search– Search the entire deformation space.

– Slow

Dealing with Deformations

Page 6: Matching by Mapping

• In this work we deal only with tone mapping deformation.• Commonly can be locally represented as a functional

relationship between the sought pattern p and a candidate window w:

6

Pattern matching under Tone Mapping

w=M(p)or

p=M(w)Vp

Vw

Vp

Page 7: Matching by Mapping

Joint histograms of two images taken under different illumination conditions and different camera photometric parameters.

From Kagarlitsky, Moses, and Hel-Or, ICCV 2010.

Page 8: Matching by Mapping

• Given a pattern p and a candidate window w a distance metric must be defined, according to which matchings are determined:

• Desired properties of D(p,w) :– Discriminative– Robust to Noise– Invariant to some deformations: tone mapping– Fast to execute

Distance Metric

D(p,w)

Page 9: Matching by Mapping

Possible Tone Mappings

identity mapping affine mapping

monotonic mapping non-monotonic mapping

Page 10: Matching by Mapping

• Sum of Squared Difference (SSD):

– By far the most common solution.– Assumes the identity tone mapping.– Fast implementation (~1 convolution).

Common Distance Metrics

2

, wpwpDE

Page 11: Matching by Mapping

• Normalized Cross Correlation (NCC):

– Compensates for affine mappings (canonization).– Fast implementation (~ 1 convolution) .

)var()var(

),cov(1varvar

,2

wpwp

www

pppEwpDNCC

Page 12: Matching by Mapping

• Local Binary Pattern (LBP): Ojala et al. 96

– Each pixel is assigned a value representing its surrounding structural content.

– Compensates for monotonic mappings.– Fast implementation.– Sensitive to noise.

nP

nnc ggscLBP 2)(

1

0

0001

)(xifxif

xs

Page 13: Matching by Mapping

• Mutual Information (MI):

– Matching is sought by maximizing the MI.– Compensates for non-linear mappings.

H(w)

H(p)I(w,p)

I(p,w) = H(w)-H(w | p) = H(p)+H(w)-H(p,w)

Page 14: Matching by Mapping

• A functional dependency between two variables, p and w, can be detected in their joint histogram P(p,w)

The Joint Histogram

50 100 150 200 250

50

100

150

200

250

50

100

150

200

250

50 100 150 200 250

p and w are independent p and w are strongly dependant

Page 15: Matching by Mapping

Joint Histograms and MI wpHwHpHwpI ,),(

p

w

H(p)

H(w)

Page 16: Matching by Mapping

Joint Histograms and MI

p

w

p

w wpHwHpHwpI ,),(

p

w

p

w

p

w matching

non matching

Page 17: Matching by Mapping

Properties:• Measures the entropy loss in w given p.• High MI values indicate good match between w and p.• Compensates for non-monotonic mappings • Discriminative.• Sensitive to bin-size / kernel-variance. • Sensitive to small samples.• Very slow to apply.

MI as a Distance Measure:

H(w)H(p)

Page 18: Matching by Mapping

Properties:• Highly discriminative.• Tone mapping invariant.• Robust to noise and bin-size.• As fast as NCC (~1 convolution).• A natural generalization of the NCC for non-linear

mappings.

Proposed Approach: Matching by Tone Mapping (MTM)

Page 19: Matching by Mapping

• Proposed distance measure:

• Note: the division by var(w) avoids the trivial mapping.

Matching by Tone Mapping (MTM)

wnwpMwpD

M varmin,

2

pnpwMpwD

M varmin,

2

Page 20: Matching by Mapping

Basic Ideas:• Approximate M(p) by a piece-wise constant mapping.• Represent M(p) in a linear form:

• Solve for the parameter vector (closed form).

How can MTM be calculated efficiently?

M(p) Sp

Slice matrix Parameter vector

Page 21: Matching by Mapping

• Assume the pattern/window values are restricted to the half open interval [a,b).

• We divide [a,b) into k bins =[1,2,...,k+1]

• A value z is naturally associated with a single bin:

B(z)=j if z[j,j+1)

MTM as a linear form:

z

1 2 k+1j j+1

Page 22: Matching by Mapping

Pattern Slices

• We define a pattern slice

Page 23: Matching by Mapping

Pattern Slices

2nd slice p2 1st slice p1

0 1

• We define a pattern slice

Page 24: Matching by Mapping

The Slice Matrix

• Raster scanning the slice windows and stacking into a matrix constructs a slice matrix Sp =[p1 p2 … pk].

= Sp

Page 25: Matching by Mapping

*

• The matrix Sp is orthogonal: pipj = |pi| ij

• Its columns span the space of piecewise constant tone mappings of p:

Sp p

S p p

Page 26: Matching by Mapping

M(p)

*

Changing the values to a different vector, , applies piece-wise tone mapping:

p Sp

S p M(p)

Page 27: Matching by Mapping

27

Page 28: Matching by Mapping

• Representing tone mapping in a linear form, the MTM distance D(p,w) is defined as:

• Since Sp is orthogonal ( STS(i,j)=ij|pj| ), the above expression can be minimized in a closed form solution:

Back to Pattern Matching

wnwS

wpD p

varmin,

2

j

jj

wpp

wwn

wpD22 1

var1),(

Page 29: Matching by Mapping

j

jj

wpp

w22 1

D( ) =( , )

( )--( )

2

2

p w ( )-2

Page 30: Matching by Mapping

*

Loop j

:|||| 2w

2

p:

MTM for running windows:

j

jj

wpp

wwn

wpD22 1

var1),(

Page 31: Matching by Mapping

*

Loop j

:|||| 2p

2

p:

MTM for running windows:

j

jj

pww

ppn

pwD22 1

var1),(

Page 32: Matching by Mapping

• Convolutions can be applied efficiently since pj

is sparse.

• Convolving with pj requires |pj| operations.

• Since pipj= run time for all k sparse convolutions sum up to a single convolution!

Complexity

Page 33: Matching by Mapping

• Since we can rewrite: 1j

jp

j

jj

j

j

j

jj

wpp

wpwpp

w2222 11

jj

j

j

jj

pwp

pwpp

22

E2(w|pj)E(w2|pj)var(w|pj)n E (var(w|p))

MTM: Statistical Properties

Page 34: Matching by Mapping

E(w |p=pj)

var(w |p=pj)

pjp

w

Tone Mapping

E(var(w |p))

Page 35: Matching by Mapping

• The Law of Total Variance gives:

• Therefore

• Thus, rather than minimizing E(var(w|p)) we may equivalently maximize var(E(w|p)) .

Observations:

pwE

pwEw

pwEw

pwEwwpD|var|var

var|var

var|var)var(,1

pwEpwEw |var|varvar

Correlation Ratio )Pearson 1930(

FLD)Fisher 1936(

Page 36: Matching by Mapping

E(w |p=pj)

pj p

w

Tone Mappingvar(E(w |p))

Page 37: Matching by Mapping

• The correlation ratio 1-D(w,p) measures the relative reduction in variance of w given p.

• Restricting M to be a linear tone mapping: M(z)=az+b, the measure 1-D(w,p) boils down to the Normalized Cross Correlation:

Observations:

w

pwEwwpDvar

|var)var(,1

),(,1 2 wpNCCwpD

Page 38: Matching by Mapping

• MTM and MI are similar in spirit.

• While MI maximizes the entropy reduction in w given p, MTM maximizes the variance reduction in w given p.

MTM and MI

MI MTM

Maximizes Entropy reduction

Variance reduction

Speed slow fast

Bin size sensitive insensitive

Small samples sensitive insensitive

Page 39: Matching by Mapping

Results

Page 40: Matching by Mapping

• Minimum distance measure for each image column:

40

Page 41: Matching by Mapping

41

Non Monotonic mappings: Detection rates (over 2000 image pattern pairs) v.s extremity of the applied tone mapping.

Page 42: Matching by Mapping

42

Monotonic mappings: Detection rates (over 2000 image pattern pairs) v.s extremity of the applied tone mapping.

Page 43: Matching by Mapping

43

Performance of MI and MTM for various pattern sizes and over various bin-sizes

Page 44: Matching by Mapping

44

Run time for various pattern size (in 512x512 image)

Page 45: Matching by Mapping

Visual SAR

Example Application: Multi-Modal Registration

Page 46: Matching by Mapping

46

Page 47: Matching by Mapping

47

Page 48: Matching by Mapping

• How can we distinguish between target and shadow?

Example Application: Shadow Detection

Background model Video frame

Page 49: Matching by Mapping

Background Subtraction

Page 50: Matching by Mapping

Background model Video frame

• Assumption: Shadow areas are functionally dependent on the background model.

Page 51: Matching by Mapping

MTM distance

Page 52: Matching by Mapping

MTM distance

Page 53: Matching by Mapping

• A new distance measure that accounts for non-linear tone mappings.

• An efficient scheme for applying over the entire image (~1 convolution).

• Statistically motivated.

• A natural generalization of NCC.• Extension: Piecewise-linear tone mapping

– Enables fewer bins– Robust– Solving using TDMA– Requires ~2 convolutions

53

Conclusions:

Page 54: Matching by Mapping

54

THANK YOU