Exemple #1
0
        private void UpdateHistogram()
        {
            HistogramProcessing histogramProcessing = new HistogramProcessing();

            int[]     histogram      = histogramProcessing.GetHistogram(Image);
            PlotModel histogramModel = new PlotModel();

            OxyPlot.Series.LineSeries columnSeries = new OxyPlot.Series.LineSeries()
            {
                Color = OxyColor.FromRgb(0, 0, 0),
            };

            for (int i = 0; i < histogram.Length; i++)
            {
                columnSeries.Points.Add(new DataPoint(i, histogram[i]));
            }
            histogramModel.Series.Clear();
            histogramModel.Series.Add(columnSeries);

            histogramModel.Axes.Add(new LinearAxis
            {
                Position = AxisPosition.Bottom,
                Minimum  = -1,
                Maximum  = 257
            });
            histogramModel.Axes.Add(new LinearAxis
            {
                Position = AxisPosition.Left,
                Minimum  = -1
            });

            histogramView.Model = histogramModel;
        }
Exemple #2
0
        private void equalizeMeanMethodToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HistogramProcessing histogramProcessing = new HistogramProcessing();

            Image = histogramProcessing.EqualizeHistogramAverage(Image);
        }
Exemple #3
0
        private void stretchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HistogramProcessing histogramProcessing = new HistogramProcessing();

            Image = histogramProcessing.StretchHistogram(Image);
        }