# [−][src]Function arrayfire::transform

pub fn transform<T: HasAfEnum>(    input: &Array<T>,     trans: &Array<f32>,     odim0: i64,     odim1: i64,     method: InterpType,     is_inverse: bool) -> Array<T>

Transform(Affine) an Image

The transform function uses an affine transform matrix to tranform an input image into a new one. The transform matrix tf is a 3x2 matrix of type float. The matrix operation is applied to each location (x, y) that is then transformed to (x', y') of the new array. Hence the transformation is an element-wise operation.

The operation is as below: tf = [r00 r10 r01 r11 t0 t1]

x' = x * r00 + y * r01 + t0; y' = x * r10 + y * r11 + t1;

Interpolation types of NEAREST, LINEAR, BILINEAR and CUBIC are allowed. Affine transforms can be used for various purposes. translate, scale and skew are specializations of the transform function.

This function can also handle batch operations.

# Parameters

• input is the image to be resized
• trans is the transformation matrix to be used for image transformation
• odim0 is the output height
• odim1 is the output width
• method indicates which interpolation method to use for resizing. It uses enum InterpType to identify the interpolation method.
• is_inverse indicates if to apply inverse/forward transform

# Return Values

Transformed Array