Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

IppiConnectedComp

mark_wear
Beginner
526 Views

How do I use this parameter of the FloodFill function? I can't find an adequate description or example of how this works.

Thanks,

Mark

0 Kudos
4 Replies
Vladimir_Dudnik
Employee
526 Views

Hello,

might be this simple sample can help?

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 pBufSize;

IppiConnectedComp pRegion;

ippiFloodFillGetSize_Grad ( roiSize, &pBufSize );

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

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< o:p>

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

Regards,
Vladimir

0 Kudos
Intel_C_Intel
Employee
526 Views

Hi, Mark,

FloodFill function fills the group of pixels ajacent to the seed with the same value.

FloodFill_Range function fills the group of pixels ajacent to the seed belonging to an inverval (equivalent to FloodFill with interval [seed,seed]).

FloodFill_Grad function fills the group of pixels ajacent to the seed with theabsolute gradient no more than the argument value.

in the example max abs gradient for all pixels from ROI is 1, so the whole ROI is flooded.

The description (mb rather formal) is in IPP manual Volume2

regards,

Alexander

0 Kudos
Intel_C_Intel
Employee
526 Views

Hi, Mark,

FloodFill function fills the group of pixels ajacent to the seed with the same value.

FloodFill_Range function fills the group of pixels ajacent to the seed belonging to an inverval (equivalent to FloodFill with interval [seed,seed]).

FloodFill_Grad function fills the group of pixels ajacent to the seed with theabsolute gradient no more than the argument value.

in the example max abs gradient for all pixels from ROI is 1, so the whole ROI is flooded.

The description (mb rather formal) is in IPP manual Volume2

regards,

Alexander

0 Kudos
Intel_C_Intel
Employee
526 Views

Hi, Mark,

FloodFill function fills the group of pixels ajacent to the seed with the same value.

FloodFill_Range function fills the group of pixels ajacent to the seed belonging to an inverval (equivalent to FloodFill with interval [seed,seed]).

FloodFill_Grad function fills the group of pixels ajacent to the seed with theabsolute gradient no more than the argument value.

in the example max abs gradient for all pixels from ROI is 1, so the whole ROI is flooded.

The description (mb rather formal) is in IPP manual Volume2

regards,

Alexander

0 Kudos
Reply