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

ippiGetAffineTransform wont work

micromysore
Beginner
682 Views
I am not sure as to what am i missing here .. but any pointers will help ..

I am trying to get transform coeffs using ippiGetAffineTransform.

I supply the quad ..



[assume appropriate declarations have been made .. ]



IppiRect imgRect1 = { -IMAGE_WIDTH/2, -IMAGE_HEIGHT/2, IMAGE_WIDTH/2, IMAGE_HEIGHT/2 };

quad1[0][0] = imgRect1.x; // tl

quad1[0][1] = imgRect1.y;

quad1[1][0] = imgRect1.width; // tr

quad1[1][1] = imgRect1.y;

quad1[2][0] = imgRect1.x; // bl

quad1[2][1] = imgRect1.height;

quad1[3][0] = imgRect1.width; //br

quad1[3][1] = imgRect1.height;

for(i=0;i<4;i++)

{

quad[0] = coeffs1[0][0]*(quad1[0]) + coeffs1[0][1]*(quad1[1]);

quad[1] = coeffs1[1][0]*(quad1[0]) + coeffs1[1][1]*(quad1[1]);

}



stat = ippiGetAffineTransform(imgRect1, quad, coeffs);



now the coeffs doesnt have the coefficients (some junk values)..

ideally i wud expect the fn to load the coeffs with the same values as coeffs1 which was used to create the quad.



-madan

Message Edited by micromysore@yahoo.com on 03-07-2006 12:33 PM

0 Kudos
1 Reply
Vladimir_Dudnik
Employee
682 Views

Hi,

there is comment from our expert

IPP Geometrical functions work with convex (not concave) quadrilaterals only.

The parameter 'quad' whichyou pass to the ippiGetAffineTransform is non-convex. It seems that the mistake is at following lines

quad1[

2][0] = 0;//imgRect1.x; // bl (should be quad1[2][0]=imgRect1.width)
quad1[3][0] = imgRect1.width; //br (should be quad1[3][0] = 0)

Regards,
Vladimir

0 Kudos
Reply