Gather statistics about image in YCbCr color space.

The class is used to accumulate statistical values about images, like histogram, mean, standard deviation, etc. for each YCbCr color channel.

The class accepts 24 and 32 bpp color images for processing.

Sample usage:

// gather statistics ImageStatisticsYCbCr stat = new ImageStatisticsYCbCr( image ); // get Y channel's histogram ContinuousHistogram y = stat.Y; // check mean value of Y channel if ( y.Mean > 0.5 ) { // do further processing }
        // Constructor
        public YCbCrLinearForm(AForge.Imaging.ImageStatisticsYCbCr imgStat)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            this.imgStat = imgStat;

            componentCombo.SelectedIndex = 0;

            filterPreview.Filter = filter;
        }
        // Constructor
        public YCbCrLinearForm(AForge.Imaging.ImageStatisticsYCbCr imgStat)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            this.imgStat = imgStat;

            componentCombo.SelectedIndex = 0;

            filterPreview.Filter = filter;
        }
Example #3
0
        // Constructor
        public ColorImageStatisticsDescription(Bitmap image)
        {
            // get image dimensions
            int width = image.Width;
            int height = image.Height;

            // lock it
            BitmapData imgData = image.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);

            // gather statistics
            statRGB = new ImageStatistics(imgData);
            statHSL = new ImageStatisticsHSL(imgData);
            statYCbCr = new ImageStatisticsYCbCr(imgData);

            // unlock image
            image.UnlockBits(imgData);
        }