20 int i, c = M.
Data.Length;
23 for (i = 0; i < c; i++)
53 throw new ArgumentException(
"Invalid transform matrix.", nameof(Transform));
57 float a00 = (float)a[0, 0];
58 float a10 = (float)a[0, 1];
59 float a20 = (float)a[0, 2];
60 float a01 = (float)a[1, 0];
61 float a11 = (float)a[1, 1];
62 float a21 = (float)a[1, 2];
63 float a02 = (float)a[2, 0];
64 float a12 = (float)a[2, 1];
65 float a22 = (float)a[2, 2];
68 float[] Dest = Result.
Data;
73 float x0, y0, t0, v0, v1, v2, v3, w0, w1;
77 for (y = 0; y < Height; y++)
79 for (x = 0; x < Width; x++)
81 x0 = a00 * x + a10 * y + a20;
82 y0 = a01 * x + a11 * y + a21;
83 t0 = a02 * x + a12 * y + a22;
85 if (t0 != 0 && t0 != 1)
91 if (x0 >= 0 && x0 < w && y0 >= 0 && y0 < h)
100 if (fx0 == 0 && fy0 == 0)
101 Dest[DestIndex] = v0;
105 v1 = M[ix0 + 1, iy0];
111 v2 = M[ix0, iy0 + 1];
114 v3 = M[ix0 + 1, iy0 + 1];
121 w0 = v1 * fx0 + v0 * (1 - fx0);
122 w1 = v3 * fx0 + v2 * (1 - fx0);
124 Dest[DestIndex] = w1 * fy0 + w0 * (1 - fy0);
Implements a Matrix, basic component for computations in Image Processing and Computer Vision.
int Height
Height of matrix (number of rows)
T[] Data
Underlying data on which the matrix is defined.
int Width
Width of matrix (number of columns)
double[,] Values
Matrix element values.
int Columns
Number of columns.
override IRingElement Invert()
Inverts the element, if possible.