Distance transforms on gray-level surfaces