- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using "ippiRotate_8u_C1R" to rotate one image by 180 degrees. Below find code for the rotation
//! set centre/shift of rotation for luma dShiftX = (double)((usiDstWidth - usiSrcWidth) >> 1); dShiftY = (double)((usiDstHeight - usiSrcHeight) >> 1); //! set for luma ippiAddRotateShift(((double)(usiSrcWidth>>1)), ((double)(usiSrcHeight>>1)), dAngle, &dShiftX, &dShiftY); //! call for luma iRelVal = ippiRotate_8u_C1R((const Ipp8u*)pucSrc, IppiSizeSrc,usiSrcWidth, IppiRectSrcROI, (Ipp8u* )pucDst,usiDstWidth,IppiRectDstROI, dAngle, (dShiftX + iDeltaX), (dShiftY + iDeltaY), IPPI_INTER_NN);
Here the source and the destination buffers are of the same size i.e. have the same width and height. This should work since we are trying to rotate the image by 180 degrees.
We would like to understand why do we have to manipulate the dShiftX and dShiftY values in order to get the correct image.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Arvind,
I've forwarded your question to our development team. Stay tuned. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Arvind,
Does the source image have odd width or height? If so, the operation (usiSrcWidth>>1) or (usiSrcHeight>>1) can lead to a loss of precision.
Best regards,
Valentin
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page