Accord.Imaging.Tools.StandardDeviation C# (CSharp) Method

StandardDeviation() public static method

Computes the standard deviation of image pixels.
public static StandardDeviation ( this image, Rectangle rectangle, double mean ) : double
image this
rectangle System.Drawing.Rectangle
mean double
return double
        public static double StandardDeviation(this Bitmap image, Rectangle rectangle, double mean)
        {
            BitmapData data = image.LockBits(new Rectangle(0, 0, image.Width, image.Height),
                       ImageLockMode.ReadOnly, image.PixelFormat);

            double dev = StandardDeviation(data, rectangle, mean);

            image.UnlockBits(data);

            return dev;
        }

Same methods

Tools::StandardDeviation ( this image, double mean ) : double

Usage Example

Esempio n. 1
0
        public void StandardDeviationTest()
        {
            double[] values = { 5, 2, 7, 5, 3, 5, 1, 1, 2 };

            Bitmap image; new ArrayToImage(3, 3, 0, 255).Convert(values, out image);
            double mean     = Measures.Mean(values);
            double expected = Measures.StandardDeviation(values);
            double actual   = Tools.StandardDeviation(image, mean);

            Assert.AreEqual(expected, actual);
        }
All Usage Examples Of Accord.Imaging.Tools::StandardDeviation