http://www.emgu.com
Calculates distance to closest zero pixel for all non-zero pixels of source image

Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: 2.4.10.1935 (2.4.10.1935)

Syntax

C#
public static void cvDistTransform(
	IntPtr src,
	IntPtr dst,
	DIST_TYPE distanceType,
	int maskSize,
	float[] userMask,
	IntPtr labels
)
Visual Basic
Public Shared Sub cvDistTransform ( 
	src As IntPtr,
	dst As IntPtr,
	distanceType As DIST_TYPE,
	maskSize As Integer,
	userMask As Single(),
	labels As IntPtr
)
Visual C++
public:
static void cvDistTransform(
	IntPtr src, 
	IntPtr dst, 
	DIST_TYPE distanceType, 
	int maskSize, 
	array<float>^ userMask, 
	IntPtr labels
)
F#
static member cvDistTransform : 
        src : IntPtr * 
        dst : IntPtr * 
        distanceType : DIST_TYPE * 
        maskSize : int * 
        userMask : float32[] * 
        labels : IntPtr -> unit 

Parameters

src
Type: System..::..IntPtr
Source 8-bit single-channel (binary) image.
dst
Type: System..::..IntPtr
Output image with calculated distances (32-bit floating-point, single-channel).
distanceType
Type: Emgu.CV.CvEnum..::..DIST_TYPE
Type of distance
maskSize
Type: System..::..Int32
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.
userMask
Type: array<System..::..Single>[]()[][]
User-defined mask in case of user-defined distance. It consists of 2 numbers (horizontal/vertical shift cost, diagonal shift cost) in case of 3x3 mask and 3 numbers (horizontal/vertical shift cost, diagonal shift cost, knights move cost) in case of 5x5 mask.
labels
Type: System..::..IntPtr
The optional output 2d array of labels of integer type and the same size as src and dst.

See Also