FloodFill_Grad

Performs gradient flood filling of connected area on an image.

Syntax

Case 1: Operations on one-channel data

IppStatus ippiFloodFill_Grad4Con_<mod>(Ipp<DataType>* pImage, int imageStep, IppiSize roiSize, IppiPoint seed, Ipp<datatype> newVal, Ipp<datatype> minDelta, Ipp<datatype> maxDelta, IppiConnectedComp* pRegion, Ipp8u* pBuffer);

IppStatus ippiFloodFill_Grad8Con_<mod>(Ipp<DataType>* pImage, int imageStep, IppiSize roiSize, IppiPoint seed, Ipp<datatype> newVal, Ipp<datatype> minDelta, Ipp<datatype> maxDelta, IppiConnectedComp* pRegion, Ipp8u* pBuffer);

Supported values for mod:

8u_C1IR

16u_C1IR

32f_C1IR

Case 2: Operations on three-channel data

IppStatus ippiFloodFill_Grad4Con_<mod>(Ipp<DataType>* pImage, int imageStep, IppiSize roiSize, IppiPoint seed, Ipp<datatype>* pNewVal, Ipp<datatype>* pMinDelta, Ipp<datatype>* pMaxDelta, IppiConnectedComp* pRegion, Ipp8u* pBuffer);

IppStatus ippiFloodFill_Grad8Con_<mod>(Ipp<DataType>* pImage, int imageStep, IppiSize roiSize, IppiPoint seed, Ipp<datatype>* pNewVal, Ipp<datatype>* pMinDelta, Ipp<datatype>* pMaxDelta, IppiConnectedComp* pRegion, Ipp8u* pBuffer);

Supported values for mod:

8u_C3IR

32f_C3IR

Parameters

pImage
Pointer to the ROI in the source and destination image (in-place operation).
imageStep
Distance in bytes between starts of consecutive lines in the image buffer.
roiSize
Size of the image ROI in pixels.
seed
Initial point.
minDelta
Minimum difference between neighbor pixels for one-channel data.
maxDelta
Maximum difference between neighbor pixels for one-channel data.
newVal
Value to fill with for one-channel data.
pMinDelta
Pointer to the minimum differences between neighbor pixels for three-channel images.
pMaxDelta
Pointer to the maximum differences between neighbor pixels for three-channel images.
pNewVal
Pointer to the vector containing values to fill with for three-channel data.
pRegion
Pointer to the connected components structure that stores information about the refilled area.
pBuffer
Pointer to the temporary buffer.

Description

The function ippiFloodFill_Grad is declared in the ippcv.h file. It operates with ROI (see Regions of Interest in Intel IPP).

This function performs flood filling of the group of connected pixels in the seed pixel neighborhoods whose pixel values v satisfy the following conditions:

where v0 is the value of at least one of the current pixel neighbors, which already belongs to the refilled area, and dlw, dup are minDelta, maxDelta, respectively. Values of these pixels are set to the newVal value.

The function requires a temporary buffer whose size should be computed with the function ippiFloodFillGetSize_Grad beforehand.

The functions with the “_4con” suffixes check 4-connected neighborhood of each pixel, i.e., side neighbors. The functions with the “_8con” suffixes check 8-connected neighborhood of each pixel, i.e., side and corner neighbors. See Figure Pixels Connectivity Patterns”.

Example Using the function ippiFloodFill_Grad” shows how to use the function ippiFloodFill_Grad4Con_8u_C1IR.

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 imageStep is less than pRoiSize.width * <pixelSize>.

ippStsNotEvenStepErr

Indicates an error condition if steps for floating-point images are not divisible by 4, or steps for 16-bit integer images are not divisible by 2.

ippStsOutOfRangeErr

Indicates an error condition if the seed point is out of ROI.

Using the function ippiFloodFill_Grad

Ipp8u
pImage[8*8] = { 0, 1, 2, 3, 4, 5, 6, 7,
    
                 0, 1, 2, 3, 4, 5, 6, 7,
    
                 0, 1, 2, 3, 4, 5, 6, 7,
    
                 0, 1, 2, 3, 4, 5, 6, 7,
    
                 0, 1, 2, 3, 4, 5, 6, 7,
    
                 0, 1, 2, 3, 4, 5, 6, 7,
    
                 0, 1, 2, 3, 4, 5, 6, 7,
    
                 0, 1, 2, 3, 4, 5, 6, 7};
IppiSize roiSize = { 4, 4 };
IppiPoint seed = { 2, 2 };
Ipp8u newVal = 9;
Ipp8u minDelta = 1;
Ipp8u maxDelta = 1;
int pBufferSize;
IppiConnectedComp pRegion;

		
ippiFloodFillGetSize_Grad ( roiSize, &pBufferSize );

		
Ipp8u* pBuffer = ippiMalloc_8u_C1 ( 8, 8, &pBufferSize );

		
ippiFloodFill_Grad4Con_8u_C1IR ( pImage, 8, roiSize, seed, newVal, minDelta,
                                    maxDelta, &pRegion, pBuffer );
 
result:
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7        pImage (source)
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
 
9 9 9 9 4 5 6 7
9 9 9 9 4 5 6 7
9 9 9 9 4 5 6 7
9 9 9 9 4 5 6 7
0 1 2 3 4 5 6 7        pImage (destination)
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
 
pRegion.area = 16
pRegion.value = 9.0
pRegion.rect.x = 0.0        pRegion (after FloodFill_Grad)
pRegion.rect.y = 0.0
pRegion.rect.width = 4.0
pRegion.rect.height = 4.0

	

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.