Esempio n. 1
0
        private void MorphoBorderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int index = this.IndexActiviteForm;
            int error = Images.BorderProcessing(index);

            if (error == 0)
            {
                index = Images.GetCountImages();
                Bitmap    map      = Images.GetLastBitmap();
                FormImage newimage = new FormImage(index, this, map);
                newimage.Show();
                newimage.Focus();
                return;
            }
        }
        public void AutoBinarizationButton_Click(object sender, EventArgs e)
        {
            int activeimage = ReferenceToMainForm.IndexActiviteForm;
            int error       = ReferenceToProgramImage.MethodOtsu(activeimage);

            if (error == 0)
            {
                int       number         = ReferenceToProgramImage.GetCountImages();
                Bitmap    referencetomap = ReferenceToProgramImage.GetLastBitmap();
                FormImage result         = new FormImage(number, ReferenceToMainForm, referencetomap);
                result.Show();
                result.Focus();
                this.Dispose();
            }
        }
        public void SubmitButton_Click(object sender, EventArgs e)
        {
            int currentcontrastvalue   = this.ContrastTrackBar.Value;
            int currentbrightnessvalue = this.BrightnessTrackBar.Value;
            int activeimage            = ReferenceToMainForm.IndexActiviteForm;
            int error = ReferenceProgrammImage.Brightness(activeimage, currentbrightnessvalue);

            if (error == 0)
            {
                error = ReferenceProgrammImage.Contrast(activeimage, currentcontrastvalue);
                if (error == 0)
                {
                    int       number         = ReferenceProgrammImage.GetCountImages();
                    Bitmap    referencetomap = ReferenceProgrammImage.GetLastBitmap();
                    FormImage result         = new FormImage(number, ReferenceToMainForm, referencetomap);
                    result.Show();
                    result.Focus();
                }
            }
            //this.Dispose();
            return;
        }