Distance Transform
imout = imdistransf(imin)
Input binary image or 8-bit, single-channel (binary)
Distance type, l1, l2, or c where the setting shall correspond to 1, 2 and 3 respectively:
distance = |x1-x2| + |y1-y2|, use 1
the simple euclidean distance, use 2
distance = max(|x1-x2|,|y1-y2|), use 3
Output image with calculated distances. It is a double precision single-channel image of the same size as input
This function used to calculates the distance to the closest zero pixel for each pixel of the source image.
1. OpenCV 4.1.2 Online Documentation