Need help on Image rotation.

mahantesh
Total Points:
115
Status Points:
65
Green Belt
September 9, 2009 5:07 PM PDT
Rate
 
#3 Reply to #2
Quoting - Ying Hu (Intel)

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


Hi Ying,

Thanks for the pointers to rotate the image. The rotation is working good for all the resolutions except for 160 x 120. Is there anything we need to take care for lower resolutions?

Thanks,
Mahantesh



Intel Software Network Forums Statistics

8470 users have contributed to 31601 threads and 100646 posts to date.
In the past 24 hours, we have 30 new thread(s) 113 new posts(s), and 159 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 kopernikus