Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

GetDistanceTransformMask

Returns an optimal mask for a given type of metrics and given mask size.

Syntax

IppStatus ippiGetDistanceTransformMask_<mod>(int kerSize, IppiNorm norm, Ipp<datatype>* pMetrics);

Supported values for mod:

32s

32f

IppStatus ippiGetDistanceTransformMask(int maskType, Ipp32f* pMetrics);

Include Files

ippcv.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h, ippi.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib

Parameters

kerSize
Specifies the mask size as follows: 3 for 3x3 mask, 5 for 5x5 mask.
norm
Specifies the type of metrics. Possible values are:

ippiNormInf(0)

L, Δ = max(|x1 - x2|, |y1 - y2|),

ippiNormL1(1)

L1, Δ = |x1 - x2| + |y1 - y2|,

ippiNormL2(2)

L2, Δ = sqrt((x1 - x2)2 + (y1 - y2)2)
maskType

Distance type.

pMetrics
Pointer to the output array to store metrics parameters. The array contains the following number of elements:

2

for 3x3 mask,

3

for 5x5 mask.

Description

This function fills up the output array with metrics parameters for the given type of metrics and size of mask. The function returns the following results:

(1, 1)

L, 3x3 mask,

(1, 2)

L1, 3x3 mask,

(2, 3)

L2, 3x3 mask, 32s data type,

(0.955, 1.3693)

L2, 3x3 mask, 32f data type,

(1, 1, 2)

L, 5x5 mask,

(1, 2, 3)

L1, 5x5 mask,

(4, 6, 9)

L2, 5x5 mask, 32s data type,

(1.0, 1.4, 2.1969)

L2, 5x5 mask, 32f data type.

For more information, see [Bor86].

NOTE:

For compatibility with the previous versions of the library the earlier function ippiGetDistanceTransformMask replaced by the function ippiGetDistanceTransformMask_32f in the current version is also supported.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error condition if pMetrics pointer is NULL.

ippStsSizeErr

Indicates an error condition if kerSize has a wrong value.

ippStsBadArgErr

Indicates an error condition if kerSize or norm has a wrong value.