- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have an image that is being warped using an affine transformation. When using the GetAffineBound function to calculate the destination ROI, I get negative pixel coordinates for the left corner. However if I specify the negative pixels in the dstROI parameter in warpAffine, I get a ippStsSizeErr because one of the entries in the dstROI is negative. How can I get the whole image transformed in this case where the transformation causes the destination coordinates to be negative ?
Thanks!
I have an image that is being warped using an affine transformation. When using the GetAffineBound function to calculate the destination ROI, I get negative pixel coordinates for the left corner. However if I specify the negative pixels in the dstROI parameter in warpAffine, I get a ippStsSizeErr because one of the entries in the dstROI is negative. How can I get the whole image transformed in this case where the transformation causes the destination coordinates to be negative ?
Thanks!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you post your code/image here? so we can review it and see if there is any problem.
I had some simple code that demontrate the funtion usage before. Hope it can provide some help.
Thanks,
Chao
void testfunction()
{
Ipp8u x[8*8]={0};
Ipp8u y[8*8]={0};
IppiRect rect = {0,0,4,4};
IppiRect dstRect = {0,0,4,2};
IppiSize sz = {8,8}, roi = {4,4};
double quad[4][2];
double bound[2][2];
const double coeffs[2][3]={{1,0,2},{0,1,0}};
ippiSet_8u_C1R( 10, x, 8,roi );
ippiGetAffineQuad(rect, quad,coeffs);
ippiGetAffineBound(rect,bound,coeffs);
ippiWarpAffine_8u_C1R(x,sz, 8, rect, y,8,dstRect, coeffs,IPPI_INTER_NN);
}
Here, the data for X is:
10 10 10 10 0 0 0 0
10 10 10 10 0 0 0 0
10 10 10 10 0 0 0 0
10 10 10 10 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
...........
This affine transform is to move data in source image to left by 2.
So after calling ippiGetAffineQuad(rect, quad,coeffs), we get quad data:
2, 0
5, 0
5, 3,
2, 3
Because ROI for Y is {0,0,4,2}, So Y data is:
0 0 10 10 0 0 0 0
0 0 10 10 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
...........
![](/skins/images/7FC17B7B85029576C25F1E43CE255B51/responsive_peak/images/icon_anonymous_message.png)
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