Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

## WarpAffine and ROI specification

Beginner
138 Views
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!
Employee
138 Views

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 bound[2][2];

const double coeffs[2][3]={{1,0,2},{0,1,0}};

ippiSet_8u_C1R( 10, x, 8,roi );

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.