[arrayfire] 116/284: Updated transform documentation
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Sun Feb 7 18:59:24 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/experimental
in repository arrayfire.
commit 81dca062d9691905c8f13291f3ccd6b66186859d
Author: Peter Andreas Entschev <peter at arrayfire.com>
Date: Tue Dec 29 11:36:31 2015 -0500
Updated transform documentation
---
docs/details/image.dox | 47 +++++++++++++++++++++++++++++++----------------
1 file changed, 31 insertions(+), 16 deletions(-)
diff --git a/docs/details/image.dox b/docs/details/image.dox
index 234f4f7..53ac761 100644
--- a/docs/details/image.dox
+++ b/docs/details/image.dox
@@ -501,10 +501,12 @@ grad(dx, dy, in);
Resize an input image
-Resizing an input image can be done using either \ref AF_INTERP_NEAREST or
-\ref AF_INTERP_BILINEAR interpolations. Nearest interpolation will pick the
-nearest value to the location, whereas bilinear interpolation will do a
-weighted interpolation for calculate the new size.
+Resizing an input image can be done using either \ref AF_INTERP_NEAREST,
+\ref AF_INTERP_BILINEAR or \ref AF_INTERP_LOWER, interpolations. Nearest
+interpolation will pick the nearest value to the location, bilinear
+interpolation will do a weighted interpolation for calculate the new size
+and lower interpolation is similar to the nearest, except it will use the
+floor function to get the lower neighbor.
This function does not differentiate between images and data. As long as
the array is defined and the output dimensions are not 0, it will resize any
@@ -556,10 +558,10 @@ Rotate an input image
The angle theta is in radians.
-Rotating an input image can be done using either \ref AF_INTERP_NEAREST or
-\ref AF_INTERP_BILINEAR interpolations. Nearest interpolation will pick the
-nearest value to the location, whereas bilinear interpolation will do a
-weighted interpolation for calculate the new size.
+Rotating an input image can be done using \ref AF_INTERP_NEAREST,
+\ref AF_INTERP_BILINEAR or \ref AF_INTERP_LOWER interpolations. Nearest
+interpolation will pick the nearest value to the location, whereas bilinear
+interpolation will do a weighted interpolation for calculate the new size.
This function does not differentiate between images and data. As long as
the array is defined, it will rotate any type or size of array.
@@ -659,22 +661,35 @@ Skew is a special case of the \ref af::transform function.
Transform an input image
-The transform function uses an affine transform matrix to tranform an input
+The transform function uses an affine or perspective transform matrix to tranform an input
image into a new one.
-The transform matrix \p 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
+If matrix \p 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
+The operation is as below:\n
+tf = [r00 r10\n
+ r01 r11\n
t0 t1]
-x' = x * r00 + y * r01 + t0;
+x' = x * r00 + y * r01 + t0;\n
y' = x * r10 + y * r11 + t1;
-Interpolation types of \ref AF_INTERP_NEAREST and \ref AF_INTERP_BILINEAR are allowed.
+If matrix \p tf is is a 3x3 matrix, a perspective transformation will be performed.
+
+The operation is as below:\n
+tf = [r00 r10 r20\n
+ r01 r11 r21\n
+ t0 t1 t2]
+
+x' = (x * r00 + y * r01 + t0) / (x * r20 + y * r21 + t2);\n
+y' = (x * r10 + y * r11 + t1) / (x * r20 + y * r21 + t2);
+
+The transformation matrix \p tf should always be of type f32.
+
+Interpolation types of \ref AF_INTERP_NEAREST, \ref AF_INTERP_BILINEAR and
+AF_INTERP_LOWER are allowed.
Affine transforms can be used for various purposes. \ref af::translate, \ref af::scale and \ref af::skew
are specializations of the transform function.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list