C# 클래스 AForge.Imaging.Filters.Erosion

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:

상속: BaseUsingCopyPartialFilter
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
Erosion ( ) : System

Initializes a new instance of the Erosion class.

Initializes new instance of the Erosion class using default structuring element - 3x3 structuring element with all elements equal to 1.

Erosion ( short se ) : System

Initializes a new instance of the Erosion class.

Structuring elemement for the erosion morphological operator must be square matrix with odd size in the range of [3, 99].

보호된 메소드들

메소드 설명
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData, Rectangle rect ) : void

Process the filter on the specified image.

메소드 상세

Erosion() 공개 메소드

Initializes a new instance of the Erosion class.

Initializes new instance of the Erosion class using default structuring element - 3x3 structuring element with all elements equal to 1.

public Erosion ( ) : System
리턴 System

Erosion() 공개 메소드

Initializes a new instance of the Erosion class.

Structuring elemement for the erosion morphological operator must be square matrix with odd size in the range of [3, 99].

Invalid size of structuring element.
public Erosion ( short se ) : System
se short Structuring element.
리턴 System

ProcessFilter() 보호된 메소드

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData, Rectangle rect ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
리턴 void