Exemplo n.º 1
0
        private void button54_Click(object sender, EventArgs e)
        {
            try
            {
                anterior = MethodsImagenFilter.CopyBitmap(actual);

                for (int j = 0; j < 4; j++)
                {
                    actual = MethodsImagenFilter.BrightnessCorrection(actual);

                    for (int i = 0; i < 5; i++)
                    {
                        actual = MethodsImagenFilter.ContrastCorrection(actual);
                    }
                }
                actual            = MethodsImagenFilter.ContrastCorrection(actual);
                actual            = MethodsImagenFilter.TirarBordaTRF4(actual);
                actual            = MethodsImagenFilter.RetirarBolinha(actual);
                pictureBox1.Image = actual;
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Erro: {ex.Message}");
            }
        }
Exemplo n.º 2
0
 private void button52_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("Convolution");
         int[,] kernel =
         {
             {  2, -1,  2 },
             { -1, 10, -1 },
             {  2, -1,  2 }
         };
         int[,] kernel2 =
         {
             { 0,  0,  0,  0, 0 },
             { 0,  2,  0,  2, 0 },
             { 0, -1,  2, -1, 0 },
             { 0,  2, -1,  2, 0 },
             { 0,  0, -1,  0, 0 }
         };
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = MethodsImagenFilter.Convolution(actual, kernel, 4);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 3
0
 private void button47_Click(object sender, EventArgs e)
 {
     try
     {
         MethodsImagenFilter.CorrigirTransparencia(actual, fileName);
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 4
0
 private void button49_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("Median2");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = MethodsImagenFilter.Median2(actual);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 5
0
 private void button27_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("Colorido para Branco");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = MethodsImagenFilter.PintarPixelPretoDeBranco(actual);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 6
0
 private void button28_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("Tirar Pixel Branco Só");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = MethodsImagenFilter.PintarBrancoEntrePretos(actual);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 7
0
 private void button57_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("aumentar");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = MethodsImagenFilter.ResizeNearestNeighbor(actual, actual.Width * 2, actual.Height * 2);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 8
0
 private void button44_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("tirar 2");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = actual.Clone(new Rectangle(0, 0, actual.Width, actual.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
         actual            = FA_Tirar2PixelsPretosEntreBrancos(actual);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 9
0
 private void button35_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("TirarPretoSozinhoHorizontal");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = actual.Clone(new Rectangle(0, 0, actual.Width, actual.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
         actual            = MethodsImagenFilter.TirarPixelPretoSozinhoHorizontal(actual);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 10
0
 private void button33_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("Remover Cores");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = actual.Clone(new Rectangle(0, 0, actual.Width, actual.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
         actual            = MethodsImagenFilter.RetirarTodasAsCoresEColocarNaImagemFinal(actual);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 11
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (actual != null && original != null)
         {
             actual            = MethodsImagenFilter.CopyBitmap(original);
             pictureBox1.Image = actual;
             ZerarMudanca();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 12
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         if (actual != null && anterior != null)
         {
             actual            = MethodsImagenFilter.CopyBitmap(anterior);
             pictureBox1.Image = actual;
             RemoverMudanca();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 13
0
 private void button55_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("TRT21");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = MethodsImagenFilter.TirarBordaTRT21(actual);
         actual            = MethodsImagenFilter.PintarPixelPretoDeBranco(actual);
         actual            = MethodsImagenFilter.Opening(actual);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 14
0
 private void button75_Click(object sender, EventArgs e)
 {
     try
     {
         InsertarCambio("Pegar Azul");
         anterior          = MethodsImagenFilter.CopyBitmap(actual);
         actual            = actual.Clone(new Rectangle(0, 0, actual.Width, actual.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
         actual            = MethodsImagenFilter.PegarAzul(actual);
         actual            = MethodsImagenFilter.PintarPixelPretoDeBrancoTRT17(actual);
         actual            = MethodsImagenFilter.PintarBrancoEntrePretos(actual);
         actual            = MethodsImagenFilter.TirarPixelSozinho(actual);
         actual            = MethodsImagenFilter.Erosion(actual);
         actual            = MethodsImagenFilter.Median(actual);
         pictureBox1.Image = actual;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 15
0
 private void MethodsImagenFilterReceita()
 {
     try
     {
         int[,] kernel =
         {
             {  2, -1,  2 },
             { -1, 10, -1 },
             {  2, -1,  2 }
         };
         actual = MethodsImagenFilter.Closing(actual);
         actual = MethodsImagenFilter.Convolution(actual, kernel, 2);
         actual = MethodsImagenFilter.TirarBorda(actual);
         actual = MethodsImagenFilter.RetirarTodasAsCoresEColocarNaImagemFinal(actual);
         actual = MethodsImagenFilter.engrossarLinhaPreto(actual);
         actual = MethodsImagenFilter.FA_TirarPixelPretoSozinhoNaHorizontal(actual);
         actual = MethodsImagenFilter.FA_TirarPixelPretoSozinhoNaVertical(actual);
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }
Exemplo n.º 16
0
 private void openFileDialog_FileOk(object sender, CancelEventArgs e)
 {
     try
     {
         Bitmap image = new Bitmap(openFileDialog1.FileName);
         if (image != null)
         {
             ZerarMudanca();
             System.IO.FileInfo fi = new System.IO.FileInfo(openFileDialog1.FileName);
             fileName              = fi.FullName;
             original              = new Bitmap(openFileDialog1.FileName);
             anterior              = MethodsImagenFilter.CopyBitmap(original);
             actual                = MethodsImagenFilter.CopyBitmap(original);
             resultado.Text        = string.Empty;
             gbFiltros.Enabled     = true;
             gbTratamentos.Enabled = true;
         }
         pictureBox1.Image = image;
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Erro: {ex.Message}");
     }
 }