Distance map  
Top  Previous  Next

 
Menu:   Processing > Morphology… > Geodesy->Distance map  
Script:   distance  
 
Use this command to perform the distance transform of a multiphase image
. The function works by assigning each foreground pixel a value equal to its distance from the nearest background pixel. The metric used for computing the digital distance depends on the Mode selected.

If you choose this command, the following options will become available:

Input
 
Displays the input image frame number. If you want to process another image, type or select the corresponding value.  

Output
 
Displays the number of the frame in which the output image will be created. Depending on the Preferences. ImageWarp will set it either to the first available value or to the Input frame number. Type or select another value if you want the output image to be created in a different frame.  
 
Preview
 
Select this check box to watch the Preview of the output image.  

Mode
 
Lets you choose the metric for distance calculation.  
 
Select City block to use a 4-connected metric. Only vertical and horizontal movements are allowed.  
Select Chess board to use an 8-connected metric. Vertical, horizontal and diagonal movements are allowed.  
Select Chamfer to use an 8-connected metric where vertical and horizontal movements are weighted with a weight of 3, while diagonal movements are weighted with a weight of 4.  
Select Euclidian to approximate Euclidian distance.  
 
Multiphase
 
Select this check box to create an output image of the multiphase type. If this box is unchecked, a grayscale 16-bit image will be created instead. Selecting a multiphase output image makes a distance map more perceptible due to steep color differences between adjacent levels, but limits it to the maximum distance of 256 pixels.  
 
Invert
 
Select this check box to compute the distance map for the background pixels. In this case each pixel is assigned a value equal to its distance from the nearest foreground pixel.