Distance transforms, metrics, algorithms and applications