Developer Reference for Intel® Integrated Performance Primitives 2018

LabelMarkers

Labels markers in image with different values.

Syntax

IppStatus ippiLabelMarkers_8u_C1IR(Ipp8u* pMarker, int markerStep, IppiSize roiSize, int minLabel, int maxLabel, IppiNorm norm, int* pNumber, Ipp8u* pBuffer);

IppStatus ippiLabelMarkers_8u32s_C1R(Ipp8u* pSrcMarker, int srcMarkerStep, Ipp32s* pDstMarker, int dstMarkerStep, IppiSize roiSize, int minLabel, int maxLabel, IppiNorm norm, int* pNumber, Ipp8u* pBuffer);

IppStatus ippiLabelMarkers_16u_C1IR(Ipp16u* pMarker, int markerStep, IppiSize roiSize, int minLabel, int maxLabel, IppiNorm norm, int* pNumber, Ipp8u* pBuffer);

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

pMarker
Pointer to the source and destination image ROI (for in-place flavors).
markerStep
Distance in bytes between starts of consecutive lines in the source and destination image.
pSrcMarker

Pointer to the source image ROI (for not-in-place flavors).

srcMarkerStep

Distance, in bytes, between the starting points of consecutive lines in the source image (for not-in-place flavors).

pDstMarker

Pointer to the source and destination image ROI (for not-in-place flavors).

dstMarkerStep

Distance, in bytes, between the starting points of consecutive lines in the destination image (for not-in-place flavors).

minLabel
Minimal value of the marker label (0 <minLabelmaxLabel).
maxLabel
Maximal value of the marker label (minLabelmaxLabel< 255 for 8-bit markers, and minLabelmaxLabel< 65535 for 16-bit markers, and minLabelmaxLabel< (231-1) for 32-bit markers).
roiSize
Size of the source and destination image ROI in pixels.
norm
Specifies type of the norm to form the mask for marker propagation:

ippiNormInf

Infinity norm (8-connectivity);

ippiNormL1

L1 norm (4-connectivity).
pNumber
Pointer to the number of markers.
pBuffer
Pointer to the working buffer.

Description

This function operates with ROI (see Regions of Interest in Intel IPP).

This function labels markers in the destination image with different integer values. Each connected set of non-zero image pixels is treated as the separate marker. 4- or 8-connectivity can be used depending on the norm type. All pixels belonging to the same marker are set to the same value from the interval [minLabel, maxLabel]. Two markers can be labeled with the same value if the number of connected components exceeds minLabel-maxLabel+1. The image with labeled markers can be used as the seed image for segmentation by functions ippiSegmentWatershed or ippiSegmentGradient functions.

The function requires the working buffer pBuffer whose size should be computed by the function ippiLabelMarkersGetBufferSize beforehand.

Return Values

ippStsNoErr

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

ippStsNullPtrErr

Indicates an error condition if one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error condition if roiSize has a field with zero or negative value.

ippStsStepErr

Indicates an error condition if markerStep is less than roiSize.width * < pixelSize>.

ippStsNotEvenStepErr

Indicates an error condition if markerStep, srcMarkerStep, or dstMarkerStep is not divisible by respective <pixelSize>.

ippStsBadArgErr

Indicates an error condition if one of the minLabel, maxLabel, and norm has an illegal value.

Example

LabelMarkers.c