Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            SaltAndPepperNoise noise = new SaltAndPepperNoise(100);

            noise.ApplyInPlace(bmp);
            pb_Original.Image = bmp;
        }
Пример #2
0
        public static Bitmap SaltAndPepper(Bitmap bmp, int intensity)
        {
            SaltAndPepperNoise filter = new SaltAndPepperNoise(intensity);

            filter.ApplyInPlace(bmp);
            return(bmp);
        }
Пример #3
0
        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));
        }
Пример #4
0
        /// <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);
        }
Пример #5
0
        public static Bitmap SetNoise(Bitmap image, int percent)
        {
            var filter = new SaltAndPepperNoise(percent);

            filter.ApplyInPlace(image);

            return(image);
        }
Пример #6
0
        public mNoiseSandP(double NoiseAmount)
        {
            Amount = NoiseAmount;

            BitmapType = mFilter.BitmapTypes.None;

            filter = new SaltAndPepperNoise(Amount);
        }
Пример #7
0
        private void button12_Click(object sender, EventArgs e)
        {
            SaltAndPepperNoise saltAndPapperNoiseTransformerStarterPackLimitedEditionByBillGates = new SaltAndPepperNoise(50);

            saltAndPapperNoiseTransformerStarterPackLimitedEditionByBillGates.ApplyInPlace(picture.bitmap);

            pictureBox1.Image = picture.bitmap;
        }
Пример #8
0
        /// <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);
        }
Пример #9
0
        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;
        }
Пример #10
0
        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;
        }
Пример #11
0
        //default noiseAmount=10
        public static Bitmap SaltAndPepper(Bitmap sourceImage, double noiseAmount)
        {
            var filter = new SaltAndPepperNoise(noiseAmount);

            return(filter.Apply(sourceImage));
        }