AForge.Imaging.Filters.FiltersSequence.Apply C# (CSharp) Метод

Apply() публичный Метод

Apply filter to an image.
The filter accepts bitmap data as input and returns the result of image processing filter as new image. The source image data are kept unchanged.
No filters were added into the filters' sequence.
public Apply ( BitmapData imageData ) : Bitmap
imageData System.Drawing.Imaging.BitmapData Source image to apply filter to.
Результат System.Drawing.Bitmap
        public Bitmap Apply( BitmapData imageData )
        {
            // to increase performance the method passes execution to the method, which
            // operates with unmanaged images - this saves time, because redundant managed
            // locks/unlocks are eliminated

            // get result as an unmanaged image
            UnmanagedImage dstUnmanagedImage = Apply( new UnmanagedImage( imageData ) );
            // convert unmanaged image to managed
            Bitmap dstImage = dstUnmanagedImage.ToManagedImage( );
            // dispose unmanaged mage
            dstUnmanagedImage.Dispose( );

            return dstImage;
		}

Same methods

FiltersSequence::Apply ( Bitmap image ) : Bitmap
FiltersSequence::Apply ( UnmanagedImage image ) : UnmanagedImage
FiltersSequence::Apply ( UnmanagedImage sourceImage, UnmanagedImage destinationImage ) : void

Usage Example

Пример #1
1
 private string reconhecerCaptcha(Image img)
 {
     Bitmap imagem = new Bitmap(img);
     imagem = imagem.Clone(new Rectangle(0, 0, img.Width, img.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
     Erosion erosion = new Erosion();
     Dilatation dilatation = new Dilatation();
     Invert inverter = new Invert();
     ColorFiltering cor = new ColorFiltering();
     cor.Blue = new AForge.IntRange(200, 255);
     cor.Red = new AForge.IntRange(200, 255);
     cor.Green = new AForge.IntRange(200, 255);
     Opening open = new Opening();
     BlobsFiltering bc = new BlobsFiltering();
     Closing close = new Closing();
     GaussianSharpen gs = new GaussianSharpen();
     ContrastCorrection cc = new ContrastCorrection();
     bc.MinHeight = 10;
     FiltersSequence seq = new FiltersSequence(gs, inverter, open, inverter, bc, inverter, open, cc, cor, bc, inverter);
     pictureBox.Image = seq.Apply(imagem);
     string reconhecido = OCR((Bitmap)pictureBox.Image);
     return reconhecido;
 }
All Usage Examples Of AForge.Imaging.Filters.FiltersSequence::Apply