- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 linesquad1[
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page