DistanceTransform


Computes an image in which the pixel values denote the estimated distances to the nearest bright pixel in the input image.

Applications:This is an initial step of some advanced traditional image analysis algorithms.

Syntax

C++
C#
Python
 
def DistanceTransform(
	inImage: Image,
	outImage: Image,
	/,
	*,
	inThreshold: int = 128,
	inStraightDistance: float = 1.0,
	inDiagonalDistance: float = 1.414,
	inMaxDistance: float = 255.0
)
-> None

Parameters

Name Type Range Default Description
Input value inImage Image Input image
Input value inThreshold int 0 - + 128 Minimal brightness above which pixels are called bright
Input value inStraightDistance float 0.0 - 1.0 Distance between two neighboring in a row or a column pixels
Input value inDiagonalDistance float 0.0 - 1.414 Distance between two pixels connected by vertices
Input value inMaxDistance float 0.0 - 255.0 Maximum value of the calculated distance
Output value outImage Image Output distance image