Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
6818 Discussions

how does ippiResize_32f_C1R with IPPI_INTER_LINEAR really work

andrebetz
Beginner
1,554 Views
Hallo,

I don't understand the way behind ippiResize_32f_C1R IPPI_INTER_LINEAR (IPP 5.1 or 7).

e.g. I have 2x2 image and resize to 1x1

0 0 = > 1
0 1

1 0 = > 0
0 0

0 1 = > 0
0 0

0 0 = > 0
1 0

normally I expact in all cases

1 0 = > 0.25
0 0

The call is:

CSignal_2d_float src(2,2);
CSignal_2d_float dst(1,1);

src.GetAdr()[0] = 1;
src.GetAdr()[1] = 0;
src.GetAdr()[2] = 0;
src.GetAdr()[3] = 0;

IppiSize s = {src.Sizex(),src.Sizey()};
IppiRect sr = {0,0,src.Sizex(),src.Sizey()};
IppiSize d = {dst.Sizex(),dst.Sizey()};
IppStatus res = ippiResize_32f_C1R(
src.GetAdr(),
s,
src.Sizex()*sizeof(float),
sr,
dst.GetAdr(),
dst.Sizex()*sizeof(float),
d,
0.5,
0.5 ,
IPPI_INTER_LINEAR);



Thank youe
Andre Betz
0 Kudos
3 Replies
SergeyKostrov
Valued Contributor II
1,554 Views
Some time ago I did atest...

Source Image ( 12x12 / floats ):

0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
0.0 1.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0
0.0 1.0 2.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0
0.0 1.0 2.0 3.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0
0.0 1.0 2.0 3.0 4.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0
0.0 1.0 2.0 3.0 4.0 5.0 6.0 6.0 6.0 6.0 6.0 6.0
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 7.0 7.0 7.0 7.0
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 8.0 8.0 8.0
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 9.0 9.0
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 10.0
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0

Output Image ( 6x6 / floats ):

0.25 0.50 0.50 0.50 0.50 0.50
0.50 2.25 2.50 2.50 2.50 2.50
0.50 2.50 4.25 4.50 4.50 4.50
0.50 2.50 4.50 6.25 6.50 6.50
0.50 2.50 4.50 6.50 8.25 8.50
0.50 2.50 4.50 6.50 8.50 11.25 <- ??.??

and I also have a question:

How does'ippiResize_32f_C1R' functioncalculate a right-bottom corner value?

Best regards,
Sergey
0 Kudos
Valentin_K_Intel
Employee
1,554 Views
Hello!

ippiResize_ functionsare deprecated in IPP 7.0, please use ippiResizeSqrPixel_32f_C1R function instead of ippiResize_32f_C1R.

Best regards,
Valentin
0 Kudos
SergeyKostrov
Valued Contributor II
1,554 Views
Hi Valentin,

I expected such a response.Two software developers had indentical problems and their questions were
related to analgorithm that 'ippiResize_...' uses and how it calculates corner values, especially for the case with 2x2 pixelsimage.
The questions arestill not answered.

Best regards,
Sergey
0 Kudos
Reply