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

Image rotation bu 90, 180, 270 deg using IPP

Beginner
637 Views
Hi All,
I need fast image (8 bit mono and 32 bit RGB) rotation by 90, 180, and 270 degs.
I figured out that I can do 180 in following way:
IppiSize roiSize;
roiSize.width=m_nWidth;
roiSize.height=m_nHeight;
ippiMirror_8u_C1IR((Ipp8u*)m_pBuf, m_nRowStride, roiSize, ippAxsBoth);

Questions:
1) how do I do rotation by 90 and 270 in most efficient way using IPP
2) is there a better way for doing 180 rotation?

Anyone with an idea? Thank you!
Daren

6 Replies
Beginner
637 Views
Hei I rotated my 12 bit images with: ippiRotate_, found example on how to do rotation in iplwrap.c from the ipp examples
Beginner
637 Views
Hi Rolf,
That's what I ended up using. ippiRotate is fast enough.
Thanks for the replay.
Daren

Employee
637 Views

Hello,

there is also ippiTranspose function.

IppStatus ippiTranspose_<mod>(const Ipp* pSrc, int srcStep,Ipp* pDst, int dstStep, IppiSize roiSize);

The function

ippiTranspose is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP). This function transposes the source image pSrc (pSrcDst for in-place flavors) and stores the result in the pDst (pSRcDst). The destination image is obtained from the source image by transforming the columns to the rows, that is pDst(x,y) = pSrc(y,x) for each pixel. The parameter roiSize is specified for the source image; therefore the roiSize.width for the destination image is equal to the roiSize.height for the source image, and the roiSize.height for the destination image is equal to the roiSize.width for the source image.

Regards,