Erosion operator from Mathematical Morphology.

The filter assigns minimum value of surrounding pixels to each pixel of the result image. Surrounding pixels, which should be processed, are specified by structuring element: 1 - to process the neighbor, -1 - to skip it.

The filter especially useful for binary image processing, where it removes pixels, which are not surrounded by specified amount of neighbors. It gives ability to remove noisy pixels (stand-alone pixels) or shrink objects.

For processing image with 3x3 structuring element, there are different optimizations available, like Erosion3x3 and BinaryErosion3x3.

The filter accepts 8 and 16 bpp grayscale images and 24 and 48 bpp color images for processing.

Sample usage:

// create filter Erosion filter = new Erosion( ); // apply the filter filter.Apply( image );

Initial image:

Result image:

Inheritance: BaseUsingCopyPartialFilter
示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Opening"/> class.
 /// </summary>
 /// 
 /// <param name="se">Structuring element.</param>
 /// 
 /// <remarks><para>See documentation to <see cref="Erosion"/> and <see cref="Dilatation"/>
 /// classes for information about structuring element constraints.</para></remarks>
 /// 
 public Opening( short[,] se )
 {
     errosion   = new Erosion( se );
     dilatation = new Dilatation( se );
 }
示例#2
0
 private void SetFilter()
 {
     ImageType = ImageTypes.Rgb48bpp;
     Af.Erosion newFilter = new Af.Erosion();
     imageFilter = newFilter;
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Closing"/> class.
 /// </summary>
 ///
 /// <param name="se">Structuring element.</param>
 ///
 /// <remarks><para>See documentation to <see cref="Erosion"/> and <see cref="Dilation"/>
 /// classes for information about structuring element constraints.</para></remarks>
 ///
 public Closing(short[,] se)
 {
     errosion = new Erosion(se);
     dilation = new Dilation(se);
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Opening"/> class.
 /// </summary>
 ///
 /// <param name="se">Structuring element.</param>
 ///
 /// <remarks><para>See documentation to <see cref="Erosion"/> and <see cref="Dilatation"/>
 /// classes for information about structuring element constraints.</para></remarks>
 ///
 public Opening(short[,] se)
 {
     errosion   = new Erosion(se);
     dilatation = new Dilatation(se);
 }