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

Image rotation bu 90, 180, 270 deg using IPP

daren_tyminski
Beginner
1,409 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

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

0 Kudos
Vladimir_Dudnik
Employee
1,409 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,
Vladimir

0 Kudos
rolf-anders
Beginner
1,409 Views
:D your welcome
0 Kudos
eldadk
Beginner
1,409 Views
does the inplace flavor change the dimensions of the pSrcDst if it is not square? (i.e. MxN -> NxM)
0 Kudos
Vladimir_Dudnik
Employee
1,409 Views
ippiTranspose function support only square images (so width should be equal to height)

Vladimir
0 Kudos
Reply