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

ippiFilterColumnPipeline - can't seem to make it work properly

stormythecat10
Beginner
258 Views
I'm sure what I'm trying to do has been done before. a 2D Gaussian Filter using RowBorderPipeline and ColumnPipeline. I'm attempting a 2D Gaussian by way of 2 1D Gaussian functions - Row then Column. I'm trying to use a mirrored border around the image.

The ippiFilterRowBorderPipeline works and give me a good result. (I dumped the intermediate buffer)
This function is using the built in support for mirrored borders.

The ippiFilterColumnPipeline a few lines down does not work. ippiFilterColumnPipeline does not seem
to have any built in border support. Here are my questions?

1) I need to have mirrored borders for my columns just like I have on my rows.
1a) must i add my own physical borders - a physically bigger image? Or can I add extra pointers that point to the mirrored columns I want?
2) if so, how does this affect ROI?
3) See my ppDst pointer (in the code above) prior to the column function call - is it even remotely right?
4) Is there a sample of a BorderPipeline Row & Column function set that is for a 2D image. (The one sample
I've seen isn't all that help ful as it's 1D or nearly so)
5) Should I be trying to use the ColumnPipeline function? (using IPP5.0) or ippiFilterColumn (no Pipeline)
6) What exactly is the double pointer array pointing to in the colum function. The row pointers for RowBorderPipeline are offset by the width of the image in bytes. Are the column pointers set to be one
image column offset (4 bytes for floats)?


Code background: 512x512 image (Matrix=512), 1D Gaussian kernel of max size 21

static void HUEC_IPPGaussian( float *origPtr, float *outPtr, int NptGauss, float *GaussFilt, int32_t thread, HUEC_CORE_PARAMS *p )
{
IppStatus status;
int i;

int hNptGauss = (NptGauss - 1) / 2;
int Matrix = p->Matrix;
int imageSize = Matrix*Matrix;

IppiSize roi = { Matrix, Matrix }; // 512, 512

int sizeRow, sizeCol;
Ipp8u *pBufferRow, *pBufferCol;

Ipp32f *ppDst[512];

HUEC_THREAD_BUFS *threadBufs = &(p->HUECThrdBufs[thread]);


//This function computes the size of the working buffer required for ippiFilterRowBorderPipeline function.
//The buffer with the length pBufferSize[0] can be used to filter images with width equal to or less than roiSize.
status = ippiFilterRowBorderPipelineGetBufferSize_32f_C1R( roi, hNptGauss, &sizeRow );

//This function computes the size of the working buffer required for ippiFilterColumnPipeline function.
//The buffer with the length pBufferSize[0] can be used to filter images with width equal to or less than roiSize.
status = ippiFilterColumnPipelineGetBufferSize_32f_C1R( roi, hNptGauss, &sizeCol );

printf("sizeRow %d\n", sizeRow);

pBufferRow = ippsMalloc_8u( sizeRow );
pBufferCol = ippsMalloc_8u( sizeCol );

for (i = 0; i < Matrix; i++)
ppDst = threadBufs->tmpGauss + i*Matrix;

status = ippiFilterRowBorderPipeline_32f_C1R( origPtr, Matrix*sizeof(float), ppDst,
roi, GaussFilt, NptGauss, hNptGauss, ippBorderMirror, 0, pBufferRow );

//Offset by one float for each column??? (Attempt border mirror column wise
for (i = hNptGauss; i < hNptGauss; i++)
ppDst = threadBufs->tmpGauss + hNptGauss-i;
for (i = hNptGauss; i < Matrix+hNptGauss; i++)
ppDst = threadBufs->tmpGauss + i;
for (i = Matrix+hNptGauss; i < Matrix+NptGauss; i++)
ppDst = threadBufs->tmpGauss + Matrix+hNptGauss-i;

status = ippiFilterColumnPipeline_32f_C1R( ppDst, outPtr, Matrix*sizeof(float),
roi, GaussFilt, NptGauss, pBufferCol );

Thank you,
Steven
0 Kudos
1 Reply
Chao_Y_Intel
Moderator
258 Views

Is this the same as another threaded before?

Thanks,
Chao
0 Kudos
Reply