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

Image rotation bu 90, 180, 270 deg using IPP

daren_tyminski
Beginner
351 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
351 Views
Hei I rotated my 12 bit images with: ippiRotate_, found example on how to do rotation in iplwrap.c from the ipp examples
daren_tyminski
Beginner
351 Views
Hi Rolf,
That's what I ended up using. ippiRotate is fast enough.
Thanks for the replay.
Daren

Vladimir_Dudnik
Employee
351 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

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

Vladimir
Reply