Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Alexander_Brazda
Beginner
36 Views

How to get source bounds for target bounds for AffineTransform

I'm using WarpAffineLinear to rotate a image.

Using tiles for parallel processing works fine, except when my source image its not full in continued memory. For this cases source region it's need but I can't find any function to request for the source image area that would be used to compute the transform in a target area. Of course I can use a inverse transform for this but I would never now witch area it's need with precession and more if bordertype its ippBorderRepl and target ROI it's out of the source image.

In any case this calculations are made internally by the library so it should be accessible, for this cases as it's available for resize using ippiResizeGetSrcRoi functions.

Regards

Alexander Brazda

 

0 Kudos
1 Reply
Valentin_K_Intel
Employee
36 Views

Hi Alexander,

To compute source ROI for the processed destination tile for WarpAffine with Linear interpolation you can use the function ippiGetAffineBound for the inverse transform. This function computes vertex coordinates of the smallest bounding rectangle for the transformed ROI. 

The source ROI can be computed by the following formulas:

IppiRect srcRoi;
srcRoi.x = floor(bound[0][0]);
srcRoi.y = floor(bound[0][1]);
srcRoi.width  = ceil(bound[1][0]) + 1 - srcRoi.x;
srcRoi.height = ceil(bound[1][1]) + 1 - srcRoi.y;

Best regards,
V
alentin

Reply