private void button3_Click(object sender, EventArgs e) { SaltAndPepperNoise noise = new SaltAndPepperNoise(100); noise.ApplyInPlace(bmp); pb_Original.Image = bmp; }
public static Bitmap SaltAndPepper(Bitmap bmp, int intensity) { SaltAndPepperNoise filter = new SaltAndPepperNoise(intensity); filter.ApplyInPlace(bmp); return(bmp); }
public Bitmap ToSaltAndPepperNoise(Bitmap Im) { AForge.Imaging.Filters.SaltAndPepperNoise Img = new SaltAndPepperNoise(); Bitmap bmImage = AForge.Imaging.Image.Clone(new Bitmap(Im), PixelFormat.Format24bppRgb); return(Img.Apply(bmImage)); }
/// <summary> /// 增加椒盐噪点 /// </summary> /// <param name="bmp">源位图</param> /// <param name="noiseamount">噪点量</param> public static void AddSaltNoise(Bitmap bmp, double noiseamount) { // create filter SaltAndPepperNoise filter = new SaltAndPepperNoise(noiseamount); // apply the filter filter.ApplyInPlace(bmp); }
public static Bitmap SetNoise(Bitmap image, int percent) { var filter = new SaltAndPepperNoise(percent); filter.ApplyInPlace(image); return(image); }
public mNoiseSandP(double NoiseAmount) { Amount = NoiseAmount; BitmapType = mFilter.BitmapTypes.None; filter = new SaltAndPepperNoise(Amount); }
private void button12_Click(object sender, EventArgs e) { SaltAndPepperNoise saltAndPapperNoiseTransformerStarterPackLimitedEditionByBillGates = new SaltAndPepperNoise(50); saltAndPapperNoiseTransformerStarterPackLimitedEditionByBillGates.ApplyInPlace(picture.bitmap); pictureBox1.Image = picture.bitmap; }
/// <summary> /// Performs a salt and pepper attack on the bmp. /// </summary> /// <param name="p">the intensity to perform the attack at</param> /// <returns>the resulting image</returns> internal AltariaImage SaltAndPepper(double p) { AltariaImage nai = new AltariaImage(new Bitmap(this.originalbmp), this.Name); SaltAndPepperNoise filter = new SaltAndPepperNoise(p); filter.ApplyInPlace(nai.originalbmp); return(nai); }
private void trackBar1_Scroll(object sender, EventArgs e) { SaltAndPepperNoise saltAndPapperNoiseTransformerStarterPackLimitedEditionByBillGates = new SaltAndPepperNoise((int)trackBar1.Value); bmp = new Bitmap(picture.bitmap); saltAndPapperNoiseTransformerStarterPackLimitedEditionByBillGates.ApplyInPlace(bmp); pictureBox1.Image = bmp; }
private void numericUpDown1_ValueChanged(object sender, EventArgs e) { SaltAndPepperNoise saltAndPapperNoiseTransformerStarterPackLimitedEditionByBillGates = new SaltAndPepperNoise((int)numericUpDown1.Value); bmp = new Bitmap(picture.bitmap); saltAndPapperNoiseTransformerStarterPackLimitedEditionByBillGates.ApplyInPlace(bmp); pictureBox1.Image = bmp; }
//default noiseAmount=10 public static Bitmap SaltAndPepper(Bitmap sourceImage, double noiseAmount) { var filter = new SaltAndPepperNoise(noiseAmount); return(filter.Apply(sourceImage)); }