Method DistanceTransformWithLabels
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
DistanceTransformWithLabels(InputArray, OutputArray, OutputArray, DistanceTypes, DistanceTransformMasks, DistanceTransformLabelTypes)
Calculates the distance to the closest zero pixel for each pixel of the source image.
public static void DistanceTransformWithLabels(InputArray src, OutputArray dst, OutputArray labels, DistanceTypes distanceType, DistanceTransformMasks maskSize, DistanceTransformLabelTypes labelType = DistanceTransformLabelTypes.CComp)
Parameters
srcInputArray8-bit, single-channel (binary) source image.
dstOutputArrayOutput image with calculated distances. It is a 8-bit or 32-bit floating-point, single-channel image of the same size as src.
labelsOutputArrayOutput 2D array of labels (the discrete Voronoi diagram). It has the type CV_32SC1 and the same size as src.
distanceTypeDistanceTypesType of distance
maskSizeDistanceTransformMasksSize of the distance transform mask, see #DistanceTransformMasks. #DIST_MASK_PRECISE is not supported by this variant. In case of the #DIST_L1 or #DIST_C distance type, the parameter is forced to 3 because a 3x3 mask gives the same result as 5x5 or any larger aperture.
labelTypeDistanceTransformLabelTypesType of the label array to build