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

ippiResizeCenter equivalent

Aditya_Kadambi
Beginner
529 Views

I am facing a similar situation to this poster;

http://software.intel.com/en-us/forums/topic/305657

I am trying to achieve zoom effect using the resize mechanism. It works, but the image is also shifted. There is no equivalent to the function ippiResizeCenter anymore as it is deprecated. How can I achieve zoom effect?

0 Kudos
6 Replies
Aditya_Kadambi
Beginner
529 Views

Well, I had been putting off upgrade to 7.1 for a while. I upgraded to 7.1 and due to the new resize implementation, my executable, in debug mode went from 8 MB to 1 MB!

Awesome upgrade, IPP team! thank you!

Now, let me investigate how I can do zoom with the new resize functions.

0 Kudos
Aditya_Kadambi
Beginner
529 Views

Hmm, I am stumped! with previous resize methods, I could get zoom effects. With the new one, I am not able to find a way: I am using resize per this new method here:

http://software.intel.com/en-us/articles/intel-ipp-71-resize-changes

Can anybody give me some pointers?

0 Kudos
Aditya_Kadambi
Beginner
529 Views

OK, more progress. I am able to get zoom with the new methods. The way to do it would be to increase the destination size of the image during these operations:

ippiResizeGetSize_8u, ippiResizeLanczosInit_8u, ippiResizeGetBufferSize_8u.

But when the actual processing takes place in this method: ippiResizeLanczos_8u_C1R, revert destination size to original size.

I still can't figure out how to reset the displacement due to zooming effect though!

0 Kudos
Aditya_Kadambi
Beginner
529 Views

Any help Intel guys on how to get this offset in the destination image?

0 Kudos
Aditya_Kadambi
Beginner
529 Views

OK, this is what I am doing:

Ipp32s zoomOpSpecSize = 0, zoomOpInitSize = 0, zoomOpBufSize = 0;
IppiPoint zoomedOffset = {0, 0};
Ipp8u * zoomOpBuf = NULL, * zoomOpInitBuf = NULL;
IppiResizeSpec_32f * zoomOpSpec = NULL;

IppiSize srcSize = {0, 0, width, height}

IppiSize dstSize = {0, 0, width * 2, height *2} // Just for experimentation

ippiResizeGetSize_8u(srcSize, dstSize, ippCubic, 0, &zoomOpSpecSize, &zoomOpInitSize);

zoomOpInitBuf = ippsMalloc_8u(zoomOpInitSize);
zoomOpSpec = (IppiResizeSpec_32f *)ippsMalloc_8u(zoomOpSpecSize);

ippiResizeCubicInit_8u(srcSize, dstSize, 0, 0, zoomOpSpec, zoomOpInitBuf);

ippiResizeGetBufferSize_8u(zoomOpSpec, dstSize, 4, &zoomOpBufSize);

zoomOpBuf = ippsMalloc_8u(zoomOpBufSize);

Now, when I do the actual processing, I set dstSize to be srcSize. This brings the zoomed effect, but predictably, "displaces" the destination image as well:

ippiResizeCubic_8u_C4R(src,
                                         srcStride,
                                         dst,
                                         srcStride,
                                         zoomedOffset,
                                         srcSize, // Note here, it is not dstSize, but srcSize
                                         border,
                                         0,
                                         zoomOpSpec,
                                         zoomOpBuf);

Can the intel guys please give me some pointers?

0 Kudos
Aditya_Kadambi
Beginner
529 Views

I think there really is no way to accomplish this based on my reading.

0 Kudos
Reply