Defining the costs
s
q
c
r
p
Want to hug image edges:  how to define cost of a link?
the link should follow the intensity edge
want intensity to change rapidly to the link
 c            |intensity of r – intensity of s|