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

IPP 2D convolution work properly on demo data only

alexandr_s_
Beginner
648 Views

Hello,

I have a question.

There are two functions of 2D convolution in attached cpp-file.

The first one is a standard convolution on floating-point data.

The second is a function, that use ippiConvValid_32f_C1R() for convolution.

When I use data of this example (https://software.intel.com/sites/products/documentation/doclib/ipp_sa/80/ipp_manual/GUID-DB033BE0-5621-4C7A-AA34-B8E0BCA74B0C.htm) with integer numbers for source matrix and kernel, everything is ok, results of two functions are equal, but when i use generator of random integer or floating-point numbers, ippiConvValid_32f_C1R() returns wrong result.

What's the problem?

0 Kudos
7 Replies
Chao_Y_Intel
Moderator
648 Views

Hello,

Which version of Intel IPP are you using now?

ippiConvValid_ functions is deprecated, could you use the ippiConv_xxx as the replacement?

Thanks,
Chao

0 Kudos
alexandr_s_
Beginner
648 Views

I have downloaded last demo version IPP two weeks ago. 
I would like to buy the license if it will work properly.
Now, I have tried to use the function ippiConv_32f_C1R(...) instead ippiConvValid_32f_C1R(...), but i get the same result.
I noticed, when i am using the kernel and src1 from example(https://software.intel.com/sites/products/documentation/doclib/ipp_sa/80/ipp_manual/GUID-F26546FF-2F62-4CC2-888E-9849C8D0DE78.htm), both functions are working properly, but if I try to change at least one number in the kernel, thus disrupting its "symmetry", I get absolutely wrong result. What else can i do?

0 Kudos
Igor_A_Intel
Employee
648 Views

Hi Alexander,

I guess you've implemented correlation instead of convolution - Ii think that if you perform a mirroring of your generated kernel (so that right bottom pixel becomes the left top) for your function (or for IPP) - you'll get the expected and comparable result.

regards, Igor

0 Kudos
alexandr_s_
Beginner
648 Views

I don't quite understand, what you mean?

0 Kudos
alexandr_s_
Beginner
648 Views

In the documentation for the function I see the formula

I need the exactly this formula for convolution, not for correlation. In documentation I don't see any limitation that kernel should be mirrored (symmetric).

 

0 Kudos
Igor_A_Intel
Employee
648 Views

Hi Alexander,

I've said nothing about symmetry. It's seen from the formula that kernel (g in the formula) is applied from the top index to bottom. So for your implementation of convolution (I guess) you should perform kernel transposition in the next manner:

from:

k00,k01,k02

k10,k11,k12

k20,k21,k22

to:

k22,k21,k20

k12,k11,k10

k02,k01,k00

regards, Igor

0 Kudos
alexandr_s_
Beginner
648 Views

Hi, Igor,

After transposition of the kernel, you recommended, it works!

Thank you so much!

0 Kudos
Reply