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

ippiResize for 1d "images" - signals

Jonathan_D
Principiante
1.631 Vistas

Hello forum,

I've used ippiResize in multiple forms to resize both images and 1d signals.  For example:

ippiResizeNearest_32f_C1R, ippiResizeCubic_32f_C1R etc.

In short, these only seem to work with 2d images, and if a 1d image is used, they will throw an error.

So, I I have:

IppiSize srcSize = { 10, 1};
IppiSize dstSize = { 20, 1};

 

The following will return an error in all cases unless ippInterType==1 (NN):

status = ippiResizeGetSize_32f(srcSize, dstSize, ippInterType, antialiasing, &specSize, &bufferSz);

 

Does anyone know if there are any work arounds for this?  Or, is 1d support explicitly removed?

 

For context, this has worked in previous versions (8.1, 9.0), but is not working in 2021.10.

 

Thank you,

 

Jonathan.

0 kudos
4 Respuestas
Aleksandra_K
Moderador
1.533 Vistas

Hi,

Could you provide some simple sample code demonstrating the problem?


Thanks,

Alex


Jonathan_D
Principiante
1.521 Vistas

Hi Alex,

Attached is the code as a function.  You'll have to paste into your own environ.  You can choose your interpolation type here:

IppiInterpolationType ippInterType = ippLinear; // Options: ippNearest ippLinear ippCubic ippLanczos ippSuper

All will fail aside from ippNearest 

 

The error message is:

performIpp1dInterpTest(): ERROR -6 returned from ippiResizeGetSize_32f()!

So "Incorrect value for data size"

Any insight would be appreciated.

 

Thanks,

Jonathan.

Jonathan_D
Principiante
1.347 Vistas

Hi Alex,

 

Any thoughts on this or is this definitely a bug?

 

Thanks,

 

Jonathan.

Aleksandra_K
Moderador
1.321 Vistas

Hi,


This behavior is actually expected. Note that in ResizeGetSize in the list of return values there is ippStsSizeErr, which indicates an error if the source image size is less than the filter size of the chosen interpolation method. The filter size for the nearest neighbor is 1x1, but for other types of filters the sizes are bigger (linear is 2x2, cubic and 2-lobed Lanczos are 4x4). 


Regards,

Aleksandra


Responder