Accord.Imaging.UnsafeTools.Scatter C# (CSharp) Method

Scatter() public static method

Computes the pixel scatter within a given image region.
public static Scatter ( byte src, int width, int height, int stride, double mean ) : double
src byte The image region.
width int The region width.
height int The region height.
stride int The image stride.
mean double The region pixel mean.
return double
        public static double Scatter(byte* src, int width, int height, int stride, double mean)
        {
            double scatter = 0;
            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++, src++)
                    scatter += (*src - mean) * (*src - mean);

                src += stride - width;
            }

            return scatter;
        }