• distform(M, fg)—Returns the distance transform of image M using foreground gray value fg.
This function performs a Euclidean distance transform of a binary image. The output matrix values represent the distance from each pixel to the nearest foreground pixel. Distance transformation is frequently used for matching two images or computing the edge distance between two images.