Need help on Image rotation.

matthieu.darbois
Total Points:
1,025
Status Points:
525
Brown Belt
July 3, 2009 1:12 AM PDT
Rate
 
#1
Quoting - mahantesh
Hi,

When we rotate image by 90 degree using ippiRotate_8u_C4R() , for MxN resolutions the output is MxN image with 2 black strips at the sides of the image. Is it possible to get rid of these black strips? Is it possible to change the size of the image to NXM ? or Is it possible to change the size of the image to MxM ?

We are trying to remove these black strips by the calling the function ippiRotate_8u_C4R() and then ippiResizeShift_8u_C4R(), this does the trick but image get stretched and there is peformance hit in our application because of calling two functions. Is there any other way to acieve this through a single call ?

Thanks,
Mahantesh


Hi,
I've never used ippiRotate_... for 90, 180, 270 degree rotations, instead I use a combination of mirror and/or transpose functions. I never had time to check if it was faster than ippiRotate but at least I'm sure to get an exact rotation (no rounding...).

For a 90 degree rotation :
ippiMirror_8u_C1R(pSrc, srcStep, pTempBuffer, srcStep, srcSize, ippAxsHorizontal);
ippiTranspose_8u_C1R(pTempBuffer, srcStep, pDst, dstStep, dstSize);
with dstSize.width = srcSize.height...

For a 270 degree rotation :
ippiTranspose_8u_C1R(pSrc, srcStep, pTempBuffer, dstStep, srcSize);
ippiMirror_8u_C1R(pTempBuffer, dstStep, pDst, dstStep, dstSize, ippAxsHorizontal);

For a 180 degree rotation :
ippiMirror_8u_C1R(pSrc, srcStep, pDst, dstStep, roiSize, ippAxsBoth);


Matthieu


Intel Software Network Forums Statistics

8491 users have contributed to 31629 threads and 100764 posts to date.
In the past 24 hours, we have 32 new thread(s) 141 new posts(s), and 200 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to Crash when loading skeleton The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member shadowwolf99