distance2border function

A function to compute the distance from spots to borders of classes