예제 #1
0
        private void mntsTransformationsGrayLevel_Click(object sender, EventArgs e)
        {
            if (imageGrayScale == null)
            {
                return;
            }

            var notes      = new List <string>();
            var listBitmap = new List <Bitmap>();

            for (int i = 0; i < 3; i++)
            {
                Bitmap bitmap = (Bitmap)imageGrayScale.Clone();
                listBitmap.Add(bitmap);
            }

            var input = new FormInputGrayLevel();

            input.ShowDialog();
            if (input.DialogResult != DialogResult.OK)
            {
                return;
            }

            var    t11 = int.Parse(input.txtT11.Text);
            var    t12 = int.Parse(input.txtT12.Text);
            var    t13 = int.Parse(input.txtT13.Text);
            var    t21 = int.Parse(input.txtT21.Text);
            var    t22 = int.Parse(input.txtT22.Text);
            var    t23 = int.Parse(input.txtT23.Text);
            string s1  = "t1 = " + t11.ToString() + " / t2 = " + t21.ToString();
            string s2  = "t1 = " + t12.ToString() + " / t2 = " + t22.ToString();
            string s3  = "t1 = " + t13.ToString() + " / t2 = " + t23.ToString();

            notes.AddRange(new List <string>()
            {
                s1, s2, s3
            });
            transfrom.GrayLevelSlicing(listBitmap[0], t11, t21);
            transfrom.GrayLevelSlicing(listBitmap[1], t12, t22);
            transfrom.GrayLevelSlicing(listBitmap[2], t13, t23);

            var outPut = new FormTransformation(listBitmap, notes);

            outPut.Show();

            imageDest    = HistogramExtensions.GetBestImageUseHistogram(listBitmap);
            pbDest.Image = imageDest;
        }
예제 #2
0
        private void mntsTransformationsPower_Click(object sender, EventArgs e)
        {
            if (imageGrayScale == null)
            {
                return;
            }

            var notes      = new List <string>();
            var listBitmap = new List <Bitmap>();

            for (int i = 0; i < 3; i++)
            {
                Bitmap bitmap = (Bitmap)imageGrayScale.Clone();
                listBitmap.Add(bitmap);
            }

            var input = new FormInputPower();

            input.ShowDialog();
            if (input.DialogResult != DialogResult.OK)
            {
                return;
            }

            var    c1     = double.Parse(input.txtC1.Text);
            var    c2     = double.Parse(input.txtC2.Text);
            var    c3     = double.Parse(input.txtC3.Text);
            var    lamda1 = double.Parse(input.txtLamda1.Text);
            var    lamda2 = double.Parse(input.txtLamda2.Text);
            var    lamda3 = double.Parse(input.txtLamda3.Text);
            string s1     = "c = " + c1.ToString() + " / lamda = " + lamda1.ToString();
            string s2     = "c = " + c2.ToString() + " / lamda = " + lamda2.ToString();
            string s3     = "c = " + c3.ToString() + " / lamda = " + lamda3.ToString();

            notes.AddRange(new List <string>()
            {
                s1, s2, s3
            });
            transfrom.PowerLaw(listBitmap[0], lamda1, c1);
            transfrom.PowerLaw(listBitmap[1], lamda2, c2);
            transfrom.PowerLaw(listBitmap[2], lamda3, c3);

            var outPut = new FormTransformation(listBitmap, notes);

            outPut.Show();

            imageDest    = HistogramExtensions.GetBestImageUseHistogram(listBitmap);
            pbDest.Image = imageDest;
        }
예제 #3
0
        private void mntsTransformationsBitPlane_Click(object sender, EventArgs e)
        {
            if (imageGrayScale == null)
            {
                return;
            }

            var listBitmap = new List <Bitmap>();
            var notes      = new List <string>();   // take note c = value into image

            for (int i = 0; i < 3; i++)             // clone 3 image
            {
                Bitmap bitmap = (Bitmap)imageGrayScale.Clone();
                listBitmap.Add(bitmap);
            }

            var input = new FormInputBitPlane();

            input.ShowDialog();
            if (input.DialogResult != DialogResult.OK)
            {
                return;
            }

            var    lv1 = int.Parse(input.txtValue1.Text);
            var    lv2 = int.Parse(input.txtValue2.Text);
            var    lv3 = int.Parse(input.txtValue3.Text);
            string s1  = "Level = " + lv1.ToString();
            string s2  = "Level = " + lv2.ToString();
            string s3  = "Level = " + lv3.ToString();

            notes.AddRange(new List <string>()
            {
                s1, s2, s3
            });
            transfrom.BitPlaneSlicing(listBitmap[0], lv1);
            transfrom.BitPlaneSlicing(listBitmap[1], lv2);
            transfrom.BitPlaneSlicing(listBitmap[2], lv3);

            var outPut = new FormTransformation(listBitmap, notes);

            outPut.Show();

            imageDest    = HistogramExtensions.GetBestImageUseHistogram(listBitmap);
            pbDest.Image = imageDest;
        }