| Cv2DistanceTransformWithLabels Method |
Calculates the distance to the closest zero pixel for each pixel of the source image.
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax public static void DistanceTransformWithLabels(
InputArray src,
OutputArray dst,
OutputArray labels,
DistanceTypes distanceType,
DistanceMaskSize maskSize,
DistanceTransformLabelTypes labelType = DistanceTransformLabelTypes.CComp
)
Public Shared Sub DistanceTransformWithLabels (
src As InputArray,
dst As OutputArray,
labels As OutputArray,
distanceType As DistanceTypes,
maskSize As DistanceMaskSize,
Optional labelType As DistanceTransformLabelTypes = DistanceTransformLabelTypes.CComp
)
public:
static void DistanceTransformWithLabels(
InputArray^ src,
OutputArray^ dst,
OutputArray^ labels,
DistanceTypes distanceType,
DistanceMaskSize maskSize,
DistanceTransformLabelTypes labelType = DistanceTransformLabelTypes::CComp
)
static member DistanceTransformWithLabels :
src : InputArray *
dst : OutputArray *
labels : OutputArray *
distanceType : DistanceTypes *
maskSize : DistanceMaskSize *
?labelType : DistanceTransformLabelTypes
(* Defaults:
let _labelType = defaultArg labelType DistanceTransformLabelTypes.CComp
*)
-> unit
Parameters
- src
- Type: OpenCvSharpInputArray
8-bit, single-channel (binary) source image. - dst
- Type: OpenCvSharpOutputArray
Output image with calculated distances. It is a 8-bit or 32-bit floating-point,
single-channel image of the same size as src. - labels
- Type: OpenCvSharpOutputArray
Output 2D array of labels (the discrete Voronoi diagram). It has the type
CV_32SC1 and the same size as src. - distanceType
- Type: OpenCvSharpDistanceTypes
Type of distance - maskSize
- Type: OpenCvSharpDistanceMaskSize
Size 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. - labelType (Optional)
- Type: OpenCvSharpDistanceTransformLabelTypes
Type of the label array to build
See Also