I am trying to replace my opencv resize() function with the Integrated Performance Primitives (IPP) API .
I am using IPP 7.1 version.
But After doing the below replacement I am not getting resized width and height .
Here is OpenCV function :
Mat src,dest;
resize(src, dest, Size(cvRound(8.0 * src.cols/ width), cvRound(8.0 * src.rows / height)), INTER_LINEAR );
//dest rows and cols are getting updated
Here is IPP function :
IppiSize srcsize,dstsize;
IppiPoint zoomedOffset = {0, 0};
Ipp32s zoomOpSpecSize = 0, zoomOpInitSize = 0, zoomOpBufSize = 0;
Ipp8u * zoomOpBuf = NULL;
IppiResizeSpec_32f * zoomOpSpec = NULL;
srcsize.height = src.rows;
srcsize.width = src.cols;
dstsize.height = dest.rows;
dstsize.width = dest.cols;
ippiResizeGetSize_8u(srcsize,dstsize,ippLinear, 0, &zoomOpSpecSize, &zoomOpInitSize);
zoomOpSpec = (IppiResizeSpec_32f *)ippsMalloc_8u(zoomOpSpecSize);
ippiResizeLinearInit_8u(srcsize, dstsize,zoomOpSpec);
ippiResizeGetBufferSize_8u(zoomOpSpec, dstsize, 1, &zoomOpBufSize);
zoomOpBuf = ippsMalloc_8u(zoomOpBufSize);
ippiResizeLinear_8u_C1R(src.data,
src.cols,
dest.data,
dest.cols,
zoomedOffset,
dstsize,
ippBorderRepl,
0,
zoomOpSpec,
zoomOpBuf
);
ippsFree(zoomOpSpec);
ippsFree(zoomOpBuf);