예제 #1
0
        private void bWГистограммаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Filters filter   = new GrayScaleFilter();
            Bitmap  palImage = filter.processImage(image);

            int[] histogram = new int[256];
            for (int x = 0; x < image.Width; x++)
            {
                for (int y = 0; y < image.Height; y++)
                {
                    histogram[palImage.GetPixel(x, y).R]++;
                }
            }
            HistogramWindowcs histogramView = new HistogramWindowcs();

            histogramView.ShowIntensityHistogram(histogram);
        }
예제 #2
0
        private void rgbhistogramToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _ = new GrayScaleFilter();
            int[][] histogram = new int[3][];
            histogram[0] = new int[256];
            histogram[1] = new int[256];
            histogram[2] = new int[256];
            for (int x = 0; x < image.Width; x++)
            {
                for (int y = 0; y < image.Height; y++)
                {
                    Color sourceColor = image.GetPixel(x, y);
                    histogram[0][sourceColor.R]++;
                    histogram[1][sourceColor.G]++;
                    histogram[2][sourceColor.B]++;
                }
            }
            HistogramWindowcs histogramView = new HistogramWindowcs();

            histogramView.ShowRGBHistogram(histogram);
        }