Need help on Image rotation.

Ying H (Intel)
Total Points:
5,217
Status Points:
4,717
Brown Belt
July 6, 2009 12:52 AM PDT
Rate
 
#2 Reply to #1

Hi Matthieu,

Thank you for your suggestion. Yes, we recomment to use ippiMirror to do special rotation like 90,180,270.

To mahantesh,

if use ippiRotate, the no-intergate interpolation, round issue are unavaidable.  ippiRotate provide one parameter IPPI_SMOOTH_EDGE to make edge look better.  But the black strips may still visiable. how width of the strips in your test? does it affect your result?

Here is small piece of code for your reference.

 IppiSize srcTempSize = {w, h};
 IppiSize dstTempSize = {h, w};

IppiRect srcTempRect = { 0, 0,w, h };
IppiRect dstTempRect = { 0, 0,h, w };
 double xTempShift = 0.0;
 double yTempShift = 1.0*w; // conterwise rotate 90 degree, origin (0, 0) will be (0, w) after rotation, so the y shift is w

/* Use this function if you need to rotate an image about an arbitrary center (xCenter, yCenter) rather than the origin (0,0), we will rotate the image by 0, 0 first, so it is not necessary to call it here
/*
//ippiGetRotateShift(0.0, 0.0, 90.0, &xTempShift, &yTempShift);

ippiSet_8u_C4R ( 0, (Ipp8u*) dstTemp->imageData, dstTemp->widthStep, dstTempSize );
status=ippiRotate_8u_C4R ( (Ipp8u*) srcTemp->imageData, srcTempSize, srcTemp->widthStep, srcTempRect,
       (Ipp8u*) dstTemp->imageData, dstTemp->widthStep, dstTempRect, 90.0,
    xTempShift, yTempShift, IPPI_INTER_LINEAR|IPPI_SMOOTH_EDGE);
//my test: the rotate operation will show 1 pixel width black line on upper of the rotated image)

Best Regards,
Ying
 



Intel Software Network Forums Statistics

8484 users have contributed to 31619 threads and 100691 posts to date.
In the past 24 hours, we have 34 new thread(s) 123 new posts(s), and 181 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 gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member monkeybrains