C# 클래스 Accord.Imaging.Filters.CannyEdgeDetector

Canny edge detector.

The filter searches for objects' edges by applying Canny edge detector. The implementation follows Bill Green's Canny edge detection tutorial.

The implemented canny edge detector has one difference with the above linked algorithm. The difference is in hysteresis step, which is a bit simplified (getting faster as a result). On the hysteresis step each pixel is compared with two threshold values: HighThreshold and LowThreshold. If pixel's value is greater or equal to HighThreshold, then it is kept as edge pixel. If pixel's value is greater or equal to LowThreshold, then it is kept as edge pixel only if there is at least one neighbouring pixel (8 neighbours are checked) which has value greater or equal to HighThreshold; otherwise it is none edge pixel. In the case if pixel's value is less than LowThreshold, then it is marked as none edge immediately.

The filter accepts 8 bpp grayscale images for processing.

Sample usage:

// create filter CannyEdgeDetector filter = new CannyEdgeDetector( ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

상속: BaseUsingCopyPartialFilter
파일 보기 프로젝트 열기: accord-net/framework 1 사용 예제들

공개 메소드들

메소드 설명
CannyEdgeDetector ( ) : System

Initializes a new instance of the CannyEdgeDetector class.

CannyEdgeDetector ( byte lowThreshold, byte highThreshold ) : System

Initializes a new instance of the CannyEdgeDetector class.

CannyEdgeDetector ( byte lowThreshold, byte highThreshold, double sigma ) : System

Initializes a new instance of the CannyEdgeDetector class.

보호된 메소드들

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

Process the filter on the specified image.

메소드 상세

CannyEdgeDetector() 공개 메소드

Initializes a new instance of the CannyEdgeDetector class.
public CannyEdgeDetector ( ) : System
리턴 System

CannyEdgeDetector() 공개 메소드

Initializes a new instance of the CannyEdgeDetector class.
public CannyEdgeDetector ( byte lowThreshold, byte highThreshold ) : System
lowThreshold byte Low threshold.
highThreshold byte High threshold.
리턴 System

CannyEdgeDetector() 공개 메소드

Initializes a new instance of the CannyEdgeDetector class.
public CannyEdgeDetector ( byte lowThreshold, byte highThreshold, double sigma ) : System
lowThreshold byte Low threshold.
highThreshold byte High threshold.
sigma double Gaussian sigma.
리턴 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