Method DistanceTransform
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
DistanceTransform(InputArray, OutputArray, DistanceTypes, DistanceTransformMasks, int)
computes the distance transform map
public static void DistanceTransform(InputArray src, OutputArray dst, DistanceTypes distanceType, DistanceTransformMasks maskSize, int dstType = 4)
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.
distanceTypeDistanceTypesType of distance
maskSizeDistanceTransformMasksSize of the distance transform mask, see #DistanceTransformMasks. 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.
dstTypeintType of output image. It can be MatType.CV_8U or MatType.CV_32F. Type CV_8U can be used only for the first variant of the function and distanceType == #DIST_L1.