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

ippiResizeCentered - how to use it?

ids-removed171
Beginner
350 Views
I am having some problems with ippiResizeCentered.
I don't know if I don't understand the xCenter, yCenter parameters or if there is a bug.

Here is my example:
I have a srcBitmap like this:
0 0 0 0 0
0 0 0 0 0
0 0 255 0 0
0 0 0 0 0
0 0 0 0 0

I want to resize it around the center (255 should stay 255):
my destination should look like this (zoom factor < 3):
0 0 0 0 0
0 c b c 0
0 b a b 0
0 c b c 0
0 0 0 0 0

The values of a, b, and c will depend on the interpolation method used (linear of cubic) - but the symetric structure should be obtained.


For this example I would assume that the center parameters should both be 2.5 - but then I get a different result.

Using linear interpolation and a zoom factor of 3 I get this (not what I would expect):
0 0 0 0 0
0 15 31 47 0
0 31 63 95 0
0 47 95 143 0
0 0 0 0 0


One more thing I should add:
I first noticed my problems with ippResizeCenter when scaling a bitmap around the center - and then changing the scale factor with the mouse. And the result is that the image is not staying centered but jitteres around a little bit. It almost looks as if there is some truncation to integer where it should not happen.

Attached is a small test program.

regards
harald
0 Kudos
1 Reply
ids-removed171
Beginner
350 Views
the missing attachment.
0 Kudos
Reply