Ejemplo n.º 1
0
        public void Solve(Bitmap image, Form mainForm)
        {
            var PALGrayScaleImage  = Transformer.GetInstance().Transform(image, GrayScaleFilter.GetPALGrayScaleFilterInstance());
            var HDTVGrayScaleImage = Transformer.GetInstance().Transform(image, GrayScaleFilter.GetHDTVGrayScaleFilterInstance());
            var difference         = ImageComparator.GetInstance().Differ(PALGrayScaleImage, HDTVGrayScaleImage);
            var forms = new List <Form>()
            {
                new Form2(PALGrayScaleImage)
                {
                    Text = "PAL grayscale"
                },
                new Form2(HDTVGrayScaleImage)
                {
                    Text = "HDTV grayscale"
                },
                new Form2(difference)
                {
                    Text = "Difference between PAL and HDTV"
                },
                new Bar_chart(GrayHistogramData.GetInstance(difference))
                {
                    Text = "Gray histogram"
                }
            };

            forms.ForEach(form =>
            {
                form.Owner = mainForm;
                form.Show();
            });
        }
Ejemplo n.º 2
0
 private void DrawGrayscaleData(GrayHistogramData grayscale, Chart chart)
 {
     chart.Visible = true;
     chart.Series["Gray"].Color = Color.Gray;
     for (var i = 0; i < grayscale.Data.Count; i++)
     {
         chart.Series["Gray"].Points.AddXY(i, grayscale.Data[i]);
     }
 }