链接已复制
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
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
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
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