Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Dual origins in rotate

Deleted_U_Intel
Employee
673 Views
Hi
I see that ippiRotateCentre allows me to set a rotation centre for the source.
I assume that this rotation centre point will will be mapped to the 0,0 point on the destination.
But I want to place the result at an arbitary point on the destination, and as far as I can tell there is no way of combining the two origins "in to one" so as to use the function? Am I right, is there an alternative?Or is this an embarrissingconsequence of coming back from a two week holiday and not yet having re-engaged the 2d equation solving part of my brain? [If so, pls advise required algebra.]
Thanks
Dave Turnbull
0 Kudos
2 Replies
Vladimir_Dudnik
Employee
673 Views
Hi,

ippiRotateCenter uses a rotation centre for the source image and mapped source center to the point in destination image with the same coordinates. If you want to place the result at an arbitary point on the destination you should use ippiRotate function with required xShift and yShift parameters for example you can use the follwing code

xCenterSrc = ...;
yCenterSrc = ...;
angle = ...;
xCenterDst = ...;
yCenterDst = ...;

ippiGetRotateShift(xCenterSrc, yCenterSrc, angle, &xShift, &yShift);

xShift += xCenterDst - xCenterSrc;
yShift += yCenterDst - yCenterSrc;

ippiRotate(..., angle, xShift, yShift, interpolate);

Regards,
Vladimir

0 Kudos
Vladimir_Dudnik
Employee
673 Views
Hi,
there is answers from our expert:

1) yes, if You mean matrix of kind

a00 a01 a02
a10 a11 a12
0 0 1

2) yes, ippiWarpAffine is quick as Rotate (and in current implementation ippiRotate uses it)

3) there is ippiWarpAffineBack function in IPP which perform tramsformation with inverse matrix

4) ippiGetAffineTransform, ippiGetAffineTransform, ippiWarpAffine and ippiWarpAffineBack deal with matrix

X' = coeffs[0][0] * X + coeffs[0][1] * Y + coeffs[0][2]
Y' = coeffs[1][0] * X + coeffs[1][1] * Y + coeffs[1][2]

Regards,
Vladimir

0 Kudos
Reply