Apply filter according to the specified mask.
Namespace:
AForge.Imaging.FiltersAssembly: AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.4.0 (2.2.4.0)
Syntax
| C# |
|---|
public class MaskedFilter : BaseInPlacePartialFilter |
Remarks
The image processing routine applies the specified BaseFilter to a source image according to the specified mask - if a pixel/value in the specified mask image/array is set to 0, then the original pixel's value is kept; otherwise the pixel is filtered using the specified base filter.
Mask can be specified as .NET's managed Bitmap, as UnmanagedImage or as byte array. In the case if mask is specified as image, it must be 8 bpp grayscale image. In all case mask size must be the same as size of the image to process.
Sample usage:
// create the filter MaskedFilter maskedFilter = new MaskedFilter( new Sepia( ), maskImage ); // apply the filter maskedFilter.ApplyInPlace( image );
Initial image:
Mask image:
Result image:
Inheritance Hierarchy
System..::.Object
AForge.Imaging.Filters..::.BaseInPlacePartialFilter
AForge.Imaging.Filters..::.MaskedFilter
AForge.Imaging.Filters..::.BaseInPlacePartialFilter
AForge.Imaging.Filters..::.MaskedFilter