Transform an input image. More...
AFAPI array transform (const array &in, const array &transform, const dim_t odim0=0, const dim_t odim1=0, const interpType method=AF_INTERP_NEAREST, const bool inverse=true) C++ Interface for transforming an image. More...Transform an input image.
The transform function uses an affine or perspective transform matrix to tranform an input image into a new one.
If matrix tf
is is a 3x2 matrix, an affine transformation will be performed. 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;
If matrix tf
is is a 3x3 matrix, a perspective transformation will be performed.
The operation is as below:
tf = [r00 r10 r20
r01 r11 r21
t0 t1 t2]
x' = (x * r00 + y * r01 + t0) / (x * r20 + y * r21 + t2);
y' = (x * r10 + y * r11 + t1) / (x * r20 + y * r21 + t2);
The transformation matrix tf
should always be of type f32.
Interpolation types of AF_INTERP_NEAREST, AF_INTERP_BILINEAR and AF_INTERP_LOWER are allowed.
Affine transforms can be used for various purposes. af::translate, af::scale and af::skew are specializations of the transform function.
◆ af_transform()C Interface for transforming an image.
C Interface for the version of af_transform that accepts a preallocated output array.
out
can either be a null or existing af_array
object. If it is a sub-array of an existing af_array
, only the corresponding portion of the af_array
will be overwritten
af_array
that has not been initialized to out
will cause undefined behavior.
C++ Interface for transforming an image.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4