This method creates a distance-transformed image (distance map, distance image) from a binary image. The Euclidean distance to the next background pixel (gray value 0) is calculated for each pixel within the white regions of the binary image (input image), and coded as a gray value. Bright pixels (high gray values) indicate a long distance to the background.