public Color[,] SobelMagintudeFilter(Color[,] Org_Buffer, int OriginX, int OriginY) { Sharpen sharpFilter = new Sharpen(); Color[,] Hor_Buffer = sharpFilter.SobelHorizontal(Org_Buffer, OriginX, OriginY); Color[,] Ver_Buffer = sharpFilter.SobelVertical(Org_Buffer, OriginX, OriginY); return sharpFilter.Magintude(Hor_Buffer, Ver_Buffer); }
private void button1_Click(object sender, EventArgs e) { Sharpen EdgeDetector = new Sharpen(); Color[,] input = p.Buffering(b); if (SharpenGB.Text == "Horizontal->Original Orign") { Color[,] Result = EdgeDetector.SobelHorizontal(input, int.Parse(Origin_X.Text), int.Parse(Origin_y.Text)); ControlTab.SelectedTab.BackgroundImage = p.convert_Buffer_to_Bitmap(Result, Result.GetLength(0), Result.GetLength(1)); } else if (SharpenGB.Text == "Vertical->Original Orign") { Color[,] Result = EdgeDetector.SobelVertical(input, int.Parse(Origin_X.Text), int.Parse(Origin_y.Text)); ControlTab.SelectedTab.BackgroundImage = p.convert_Buffer_to_Bitmap(Result, Result.GetLength(0), Result.GetLength(1)); } else if (SharpenGB.Text == "Magnitude->Original Orign") { Color[,] V = EdgeDetector.SobelVertical(input, int.Parse(Origin_X.Text), int.Parse(Origin_y.Text)); Color[,] H = EdgeDetector.SobelHorizontal(input, int.Parse(Origin_X.Text), int.Parse(Origin_y.Text)); Color[,] Result = EdgeDetector.Magintude(H, V); ControlTab.SelectedTab.BackgroundImage = p.convert_Buffer_to_Bitmap(Result, Result.GetLength(0), Result.GetLength(1)); } else if (SharpenGB.Text == "Laplacian Sharpening->Original Orign") { Color[,] Result = EdgeDetector.laplacian(input, int.Parse(Origin_X.Text), int.Parse(Origin_y.Text)); ControlTab.SelectedTab.BackgroundImage = p.convert_Buffer_to_Bitmap(Result, Result.GetLength(0), Result.GetLength(1)); } }
public Color[,] SobelHorizontalFilter(Color[,] Org_Buffer, int OriginX, int OriginY) { Sharpen sharpFilter = new Sharpen(); return sharpFilter.SobelHorizontal(Org_Buffer, OriginX, OriginY); }