Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
6632 Discussions

ippiFilter32f and memory alignment or border

hayaroby
Beginner
129 Views

I want to apply ippiFilter32f_8u_C1R() to convolve full image with 7x5 floating point kernel.

Butthis function returns IppStsStepErr result. I checked both step size(src, dst). I think step size is correct.

This problem is caused by border or memory alignment? Why this happens?

Please give me some clue to overcome this problem.

My code is as follows

/* pSrc, pDst are an image (57x512). */
int width = 512;
int height = 57;
float *Kernel = {
0.0000f,0.0000f,0.0000f,0.0000f, 0.0000f,
-0.0001f,0.0001f,0.0003f,0.0001f,-0.0001f,
-0.0338f,0.0338f,0.1353f,0.0338f,-0.0338f,
-0.2500f,0.2500f,1.0000f,0.2500f,-0.2500f,
-0.0338f,0.0338f,0.1353f,0.0338f,-0.0338f,
-0.0001f,0.0001f,0.0003f,0.0001f,-0.0001f,
0.0000f,0.0000f,0.0000f,0.0000f, 0.0000f
};
int srcStep = 512 * sizeof(unsigned char);
int dstStep = 512 * sizeof(unsigned char);
IppiSize KernelSize = {5, 7};
IppiPoint anchor = {2, 3};
IppiSize dstRoi = {width, height};
ippiFilter32f_8u_C1R(pSrc, srcStep,
pDst, dstStep,
dstRoi,
Kernel,
KernelSize,
anchor);
0 Kudos
1 Reply
Ivan_Z_Intel
Employee
129 Views

I think the correct code must be such.

/* pSrc, pDst are an image (57x512). */
int width = 512;
int height = 57;
float *Kernel = {
0.0000f,0.0000f,0.0000f,0.0000f, 0.0000f,
-0.0001f,0.0001f,0.0003f,0.0001f,-0.0001f,
-0.0338f,0.0338f,0.1353f,0.0338f,-0.0338f,
-0.2500f,0.2500f,1.0000f,0.2500f,-0.2500f,
-0.0338f,0.0338f,0.1353f,0.0338f,-0.0338f,
-0.0001f,0.0001f,0.0003f,0.0001f,-0.0001f,
0.0000f,0.0000f,0.0000f,0.0000f, 0.0000f
};
int srcStep = 512 * sizeof(unsigned char);
int dstStep = 512 * sizeof(unsigned char);
IppiSize KernelSize = {5, 7};
IppiPoint anchor = {2, 3};
IppiSize dstRoi = {width-KernelSize.width+1, height-KernelSize.height+1};
Ipp8u *pStartPoint;
pStartPoint = pSrc + anchor.y * srcStep + anchor.x;
ippiFilter32f_8u_C1R(pStartPoint, srcStep,
pDst, dstStep,
dstRoi,
Kernel,
KernelSize,
anchor);
It must be
srcStep >= (dstRoi.width+KernelSize.width-1)*sizeof(Ipp8u)
else
IppStsStepErr.
Reply