//медианное размытие private void button15_Click(object sender, EventArgs e) { if (sourceImage == null) { MessageBox.Show("Выберите изображение", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { imageBox2.Image = Blur.BlurImg(sourceImage).Resize(320, 240, Inter.Linear); } }
public static Image <Bgr, byte> Wclr(string br, string co, string kk1, string kk2, Image <Bgr, byte> sourceImage, Image <Bgr, byte> sourceImage2) { var Imag1 = sourceImage.Copy().Resize(320, 240, Inter.Linear); var Imag2 = sourceImage2.Copy().Resize(320, 240, Inter.Linear); int b = int.Parse(br); double c = double.Parse(co); double k1 = double.Parse(kk1); double k2 = double.Parse(kk2); Imag1 = Bright.Brig(b, Imag1).Resize(320, 240, Inter.Linear); Imag1 = Contrast.Contr(c, Imag1).Resize(320, 240, Inter.Linear); Imag1 = Blur.BlurImg(Imag1).Resize(320, 240, Inter.Linear); Imag1 = Add.AddImg(k1, k2, Imag1, Imag2).Resize(320, 240, Inter.Linear); return(Imag1); }
public static Image <Bgr, byte> Ctn(Image <Bgr, byte> sourceImage) { var Imag1 = sourceImage.Copy().Resize(320, 240, Inter.Linear); var Imag2 = Imag1; double k = 1; Imag1 = BandW.BW(Imag1).Resize(320, 240, Inter.Linear).Convert <Bgr, byte>(); Imag1 = Blur.BlurImg(Imag1).Resize(320, 240, Inter.Linear); var edges = Imag1.Convert <Gray, byte>(); edges = edges.ThresholdAdaptive(new Gray(100), AdaptiveThresholdType.MeanC, ThresholdType.Binary, 3, new Gray(0.03)); Imag1 = Add.AddImg(k, k, Imag2, edges.Convert <Bgr, byte>()).Resize(320, 240, Inter.Linear); return(Imag1); }