Пример #1
0
        public Image_Panel(Bitmap image, string imageName)
        {
            InitializeComponent();

            this.chHisto.Width = this.Width - panelImage.Width;

            imageForReset = (Bitmap)image.Clone();

            originalImage  = image;
            this.imageName = imageName;

            this.Text = imageName;

            secondaryImage = (Bitmap)image.Clone();

            this.pctbImage.Image = image;
            this.pctbImage.Show();

            hist = new ImageHistogram((Bitmap)pctbImage.Image, this);

            hist.CreateChart(chHisto);
            this.pctbHistogram.Show();

            basicImageOpertions = new BasicImageOpertions((Bitmap)pctbImage.Image);

            basicImageOpertions.ImageFinished += OnImageFinished;
        }
        public UOPPanel(Bitmap image, Image_Panel caller)
        {
            InitializeComponent();

            this.caller = caller;

            originalImage = image;

            BasicImageOpertions = new BasicImageOpertions(originalImage);

            BasicImageOpertions.ToGreyScale();

            secondaryImage = (Bitmap)originalImage.Clone();

            this.pctbImage.Image = secondaryImage;

            hist = new ImageHistogram((Bitmap)pctbImage.Image);

            hist.CreateChart(this.chHisto);

            this.pctbUOP.Image = new Bitmap(256, 256);

            grafika = Graphics.FromImage(pctbUOP.Image);

            LUT   = new int[256];
            linia = new Krzywa();
            RysujLinie();
        }
Пример #3
0
        private void stretchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            hist = new ImageHistogram((Bitmap)pctbImage.Image, this);
            hist.StretchHistogram();
            this.pctbImage.Show();


            this.pctbHistogram.Show();
            hist.CreateChart(chHisto);
        }
Пример #4
0
        private void neighbourToolStripMenuItem_Click(object sender, EventArgs e)
        {
            hist = new ImageHistogram((Bitmap)pctbImage.Image, this);
            hist.EqulizeHist(3);
            this.pctbImage.Show();


            this.pctbHistogram.Show();
            hist.CreateChart(chHisto);
        }
Пример #5
0
        private void resetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pctbImage.Image = (Bitmap)imageForReset.Clone();
            originalImage   = (Bitmap)imageForReset.Clone();


            hist = new ImageHistogram((Bitmap)pctbImage.Image, this);

            hist.CreateChart(chHisto);
            this.pctbHistogram.Show();
        }
        private void pctbUOP_MouseDown(object sender, MouseEventArgs e)
        {
            grafika.Clear(Color.White);
            if (e.Button == MouseButtons.Left)
            {
                Point punkt = e.Location;

                for (int i = 0; i < linia.LSkladoweKrzywej.Count; i++)
                {
                    if ((punkt.X <= linia.LSkladoweKrzywej[i].X + 5 && punkt.X >= linia.LSkladoweKrzywej[i].X - 5) &&   //sprawdza czy klikniety punkt nalezy do punktu na linii
                        (punkt.Y <= linia.LSkladoweKrzywej[i].Y + 5 && punkt.Y >= linia.LSkladoweKrzywej[i].Y - 5))
                    {
                        RysujLinie();
                        grafika.DrawRectangle(new Pen(Color.Navy, 2), linia.LSkladoweKrzywej[i].X - 3, linia.LSkladoweKrzywej[i].Y - 3, 7, 7); //zaznacza klikniety punkt na czerwono
                        linia.Zaznaczony = i;
                        pctbImage.Refresh();
                        return;
                    }
                }
                punkt.X--;                         //zmniejsza o jeden by zniwelowac roznice (panel rozmiar 1-256 a tablica 0-255)
                punkt.Y--;
                linia.LSkladoweKrzywej.Add(punkt); //dodaje klikniety punkt do listy
                RysujLinie();
            }
            else //jesli prawy przycisk myszy to usuwamy punkt
            {
                if (linia.Zaznaczony > 0 && linia.LSkladoweKrzywej.Count > 2 && linia.Zaznaczony != linia.LSkladoweKrzywej.Count - 1)
                {
                    linia.LSkladoweKrzywej.RemoveAt(linia.Zaznaczony);
                    grafika.Clear(Color.White);
                    RysujLinie();
                }
            }

            //ChangeImage(secondaryImage);
            //originalImage = (Bitmap)secondaryImage.Clone();
            secondaryImage  = (Bitmap)originalImage.Clone();
            pctbImage.Image = ChangeImage(secondaryImage);
            hist            = new ImageHistogram((Bitmap)pctbImage.Image);
            hist.CreateChart(chHisto);

            pctbImage.Refresh();
        }
Пример #7
0
        public void SetImageAndHist(Bitmap image)
        {
            originalImage = image;

            secondaryImage = (Bitmap)image.Clone();

            this.pctbImage.Image = null;

            this.pctbImage.Image = image;
            this.pctbImage.Show();

            hist = new ImageHistogram((Bitmap)pctbImage.Image, this);

            hist.CreateChart(chHisto);
            this.pctbHistogram.Show();

            basicImageOpertions = new BasicImageOpertions((Bitmap)pctbImage.Image);

            basicImageOpertions.ImageFinished += OnImageFinished;

            this.Refresh();
        }