Defining the costs
p
q
c
-1
1
w
-1
-1
1
1
c
can be computed using a cross-correlation filter
assume it is centered at
p
Also typically scale
c
by its length
set
c
= (max-|filter response|) * length(
c
)
where max = maximum |filter response| over all pixels in the image