Function:WarpAffine

From CUVI Wiki
Jump to: navigation, search

Applies affine transformation to an image.

Function

CuviStatus warpAffine(const CuviImage& src,
                      CuviImage& dst,
                      Cuvi64f coeffs[2][3],
                      const CuviStream& stream = CuviStream());


Parameters

Name Type Description
src const CuviImage& Input Image
dst CuviImage& Output Image
coeffs Cuvi64f [2][3] 2 x 3 affine transformation matrix
stream const CuviStream& GPU stream ID for execution


Image Type Support

Input Output
8uC1 8uC1
8uC3 8uC3
16uC1 16uC1
16uC3 16uC3
32fC1 32fC1
32fC3 32fC3


Samples

Example

CuviImage input = cuvi::io::loadImage(path), output;
 
//Set affine transformation matrix
Cuvi64f coeffs[2][3] = { 
                         {0.5, 0.0, 0.0}, 
                         {0.0, 0.5, 0.0} 
                       };
 
//Apply affine transformation
cuvi::geometryTransforms::warpAffine(input,output, coeffs);