6 public static partial class StatisticsOperations
16 int SrcIndex = M.
Start;
19 float[] SrcData = M.
Data;
20 float[] Dest =
new float[w * h];
23 Dest[DestIndex++] = SrcData[SrcIndex++];
24 for (x = 1; x < w; x++, DestIndex++)
25 Dest[DestIndex] = Dest[DestIndex - 1] + SrcData[SrcIndex++];
29 for (y = 1; y < h; y++, SrcIndex += SrcSkip)
31 RowSum = SrcData[SrcIndex++];
32 Dest[DestIndex] = Dest[DestIndex - w] + RowSum;
35 for (x = 1; x < w; x++, DestIndex++)
37 RowSum += SrcData[SrcIndex++];
38 Dest[DestIndex] = Dest[DestIndex - w] + RowSum;
53 int SrcIndex = M.
Start;
56 int[] SrcData = M.
Data;
57 long[] Dest =
new long[w * h];
60 Dest[DestIndex++] = SrcData[SrcIndex++];
61 for (x = 1; x < w; x++, DestIndex++)
62 Dest[DestIndex] = Dest[DestIndex - 1] + SrcData[SrcIndex++];
66 for (y = 1; y < h; y++, SrcIndex += SrcSkip)
68 RowSum = SrcData[SrcIndex++];
69 Dest[DestIndex] = Dest[DestIndex - w] + RowSum;
72 for (x = 1; x < w; x++, DestIndex++)
74 RowSum += SrcData[SrcIndex++];
75 Dest[DestIndex] = Dest[DestIndex - w] + RowSum;
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)
int Skip
Number of elements to skip from the right edge in the underlying data to the left edge of the new row...
int Start
Start offset of matrix in underlying data.
static Matrix< long > Integral(this Matrix< int > M)
Computes the integral image of a matrix.
static Matrix< float > Integral(this Matrix< float > M)
Computes the integral image of a matrix.