Distance Transforms of Sampled Functions