private void button54_Click(object sender, EventArgs e) { try { anterior = MethodImagenFilter.CopyBitmap(actual); for (int j = 0; j < 4; j++) { actual = MethodImagenFilter.BrightnessCorrection(actual); for (int i = 0; i < 5; i++) { actual = MethodImagenFilter.ContrastCorrection(actual); } } actual = MethodImagenFilter.ContrastCorrection(actual); actual = MethodImagenFilter.TirarBordaTRF4(actual); actual = MethodImagenFilter.RetirarBolinha(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
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 = MethodImagenFilter.CopyBitmap(actual); actual = MethodImagenFilter.Convolution(actual, kernel, 4); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button49_Click(object sender, EventArgs e) { try { InsertarCambio("Median2"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = MethodImagenFilter.Median2(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button31_Click(object sender, EventArgs e) { try { InsertarCambio("EngrossarLinhas"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = MethodImagenFilter.engrossarLinhaPreto(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button27_Click(object sender, EventArgs e) { try { InsertarCambio("Colorido para Branco"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = MethodImagenFilter.PintarPixelPretoDeBranco(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button28_Click(object sender, EventArgs e) { try { InsertarCambio("Tirar Pixel Branco Só"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = MethodImagenFilter.PintarBrancoEntrePretos(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button57_Click(object sender, EventArgs e) { try { InsertarCambio("aumentar"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = MethodImagenFilter.ResizeNearestNeighbor(actual, actual.Width * 2, actual.Height * 2); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button44_Click(object sender, EventArgs e) { try { InsertarCambio("tirar 2"); anterior = MethodImagenFilter.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}"); } }
private void button35_Click(object sender, EventArgs e) { try { InsertarCambio("TirarPretoSozinhoHorizontal"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = actual.Clone(new Rectangle(0, 0, actual.Width, actual.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb); actual = MethodImagenFilter.TirarPixelPretoSozinhoHorizontal(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button33_Click(object sender, EventArgs e) { try { InsertarCambio("Remover Cores"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = actual.Clone(new Rectangle(0, 0, actual.Width, actual.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb); actual = MethodImagenFilter.RetirarTodasAsCoresEColocarNaImagemFinal(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button3_Click(object sender, EventArgs e) { try { if (actual != null && original != null) { actual = MethodImagenFilter.CopyBitmap(original); pictureBox1.Image = actual; ZerarMudanca(); } } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button2_Click(object sender, EventArgs e) { try { if (actual != null && anterior != null) { actual = MethodImagenFilter.CopyBitmap(anterior); pictureBox1.Image = actual; RemoverMudanca(); } } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button55_Click(object sender, EventArgs e) { try { InsertarCambio("TRT21"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = MethodImagenFilter.TirarBordaTRT21(actual); actual = MethodImagenFilter.PintarPixelPretoDeBranco(actual); actual = MethodImagenFilter.Opening(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
private void button75_Click(object sender, EventArgs e) { try { InsertarCambio("Pegar Azul"); anterior = MethodImagenFilter.CopyBitmap(actual); actual = actual.Clone(new Rectangle(0, 0, actual.Width, actual.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb); actual = MethodImagenFilter.PegarAzul(actual); actual = MethodImagenFilter.PintarPixelPretoDeBrancoTRT17(actual); actual = MethodImagenFilter.PintarBrancoEntrePretos(actual); actual = MethodImagenFilter.TirarPixelSozinho(actual); actual = MethodImagenFilter.Erosion(actual); actual = MethodImagenFilter.Median(actual); pictureBox1.Image = actual; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }
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 = MethodImagenFilter.CopyBitmap(original); actual = MethodImagenFilter.CopyBitmap(original); resultado.Text = string.Empty; gbFiltros.Enabled = true; gbTratamentos.Enabled = true; } pictureBox1.Image = image; } catch (Exception ex) { MessageBox.Show($"Erro: {ex.Message}"); } }