Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ROI in ippiGetAffineBound and ippiWarpAffine

quidam
Beginner
294 Views
I run into an issue with ROI specification in the above functions. Here's an example to illustrate the problem:



IppiRect srcROI = { 0, 0, 400, 300 };

coeff[0][0] = 0.55333333333333334;

coeff[0][1] = 0.0;

coeff[0][2] = 0.0;

coeff[1][0] = 0.0;

coeff[1][1] = 0.55333333333333334;

coeff[1][2] = 0.0;



double bound[2][2];

ippiGetAffineBound(srcROI, bound, coeff);



Basically, the transformation scales the source by a factor of 0.55333333333333334 along both axis, hence bound should read:



bound[0][0] = 0.0;

bound[0][1] = 0.0;

bound[1][0] = 221.333333333333336;

bound[1][1] = 166.000000000000002;



Instead, I got the following values:



bound[0][0] = 0.0;

bound[0][1] = 0.0;

bound[1][0] = 220.78000000000000;

bound[1][1] = 165.44666666666666.;



Looks like the function is computing based on a source size of { 399, 299 } instead of { 400, 300 }. Is the ROI specification supposed to exclude the end pixels for both axis?



Thanks in advance for any answers.
0 Kudos
2 Replies
Vladimir_Dudnik
Employee
294 Views

Hello,

there is answer from our expert:

The model of geometrical functions Rotate, Shear, WarpAffine, WarpBilinear, WarpPerspective is the next - the pixel is consider as point not a square socoordinates {0, 0, 399, 299} corresponds to ROI {0, 0, 400, 300}

Regards,
Vladimir

0 Kudos
quidam
Beginner
294 Views
Hi Vladimir,



Thanks for the reply. Appreciate it.
0 Kudos
Reply