SLIDE 2 2
7
Sum of Squared (Pixel) Differences
Left Right
L
w
R
w
L
I
R
I
∑
∈
− − = + ≤ ≤ − + ≤ ≤ − =
) , ( ) , ( 2 2 2 2 2
)] , ( ) , ( [ ) , , ( : disparity
function a as difference intensity the measures cost SSD The } , | , { ) , ( : function window the define We pixels.
windows by ing correspond are and
y x W v u R L r m m m m m R L
m
v d u I v u I d y x C y v y x u x v u y x W m m w w
L
w
R
w ) , (
L L y
x ) , (
L L
y d x −
m m 8
Image Normalization
- Even when the cameras are identical models, there
can be differences in gain and sensitivity.
- The cameras do not see exactly the same surfaces,
so their overall light levels can differ.
- For these reasons and more, it is a good idea to
normalize the pixels in each window:
pixel Normalized ) , ( ) , ( ˆ magnitude Window )] , ( [ pixel Average ) , (
) , ( ) , ( ) , ( 2 ) , ( ) , ( ) , ( ) , ( 1 y x W y x W v u y x W y x W v u y x W
m m m m m
I I I y x I y x I v u I I v u I I − − = = =
∑ ∑
∈ ∈ 9
Images as Vectors
Left Right
L
w
R
w
m m L
w
L
w
row 1 row 2 row 3
m m m
“Unwrap” image to form vector, using raster scan order
Each window is a vector in an m2 dimensional vector space. Normalization makes them unit length.
10
Image windows as vectors
11
Possible metrics
L
w ) (d wR
Distance? Angle?
12
Image Metrics
L
w ) (d wR
2 ) , ( ) , ( 2 SSD
) ( )] , ( ˆ ) , ( ˆ [ ) ( d w w v d u I v u I d C
R L y x W v u R L
m
− = − − =
∑
∈
(Normalized) Sum of Squared Differences Normalized Correlation
θ cos ) ( ) , ( ˆ ) , ( ˆ ) (
) , ( ) , ( NC
= ⋅ = − =
∑
∈
d w w v d u I v u I d C
R L y x W v u R L
m
) ( max arg ) ( min arg
2 *
d w w d w w d
R L d R L d
⋅ = − =