Click or drag to resize
CvInvokeDistanceTransform Method
Calculates distance to closest zero pixel for all non-zero pixels of source image

Namespace: Emgu.CV
Assembly: Emgu.CV.World (in Emgu.CV.World.dll) Version: (
public static void DistanceTransform(
	IInputArray src,
	IOutputArray dst,
	IOutputArray labels,
	DistType distanceType,
	int maskSize,
	DistLabelType labelType = DistLabelType.CComp


Type: Emgu.CVIInputArray
Source 8-bit single-channel (binary) image.
Type: Emgu.CVIOutputArray
Output image with calculated distances (32-bit floating-point, single-channel).
Type: Emgu.CVIOutputArray
The optional output 2d array of labels of integer type and the same size as src and dst. Can be null if not needed
Type: Emgu.CV.CvEnumDistType
Type of distance
Type: SystemInt32
Size of distance transform mask; can be 3 or 5. In case of CV_DIST_L1 or CV_DIST_C the parameter is forced to 3, because 3x3 mask gives the same result as 5x5 yet it is faster.
labelType (Optional)
Type: Emgu.CV.CvEnumDistLabelType
Type of the label array to build. If labelType==CCOMP then each connected component of zeros in src (as well as all the non-zero pixels closest to the connected component) will be assigned the same label. If labelType==PIXEL then each zero pixel (and all the non-zero pixels closest to it) gets its own label.
See Also