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

1-D Interpolation with IPP

sureshdeoda
Beginner
91 Views
Hi,
I am trying to use IPP libraries for 1-d interpolation, as mentioned in some of the post in forum to use ippresize for sinle row to get the 1-d interpolation.
my code is as follows,

[bash]Ipp32f image_temp[] = { 1 ,2 ,3,4,5,6,7,8,9,10,11,12};
rows = 1;cols=12;
newrows = 1;newcols = 34;
size.width = cols;
size.height = rows;
roi.x=0;
roi.y=0;
roi.width=cols;
roi.height=rows;
step = cols*sizeof(float);
newstep = newcols*sizeof(float);
newsize.width=newcols;
newsize.height=newrows;
image_new=(float *) calloc(newrows*newcols, sizeof(float));
   if(image_new == NULL){printf("Unable to allocate memory for image_new \n"); exit(1);}

   xfactor=(float)newcols/cols;
   yfactor=(float)newrows/rows;
   status= ippiResize_32f_C1R((float*)image_temp, size, step, roi, (float*)image_new, newstep, newsize, xfactor, yfactor,IPPI_INTER_CUBIC);
   if ( status != ippStsNoErr )
   {
      exit(1);
   }



The results are,

1.0000 1.0000 1.0000 2.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 4.0000 5.0000 5.0000 5.0000 6.0000 6.0000

6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 9.0000 10.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 0.0000


Which somehow are truncated ??



Thanks ,
Suresh









[/bash]
0 Kudos
0 Replies
Reply