CannyEdgeOptions Class
Immutable options of the Canny edge detector (ImageProcessingExtensions.DetectCannyEdges): the blur that removes the noise, and the two thresholds of the hysteresis.
public sealed class CannyEdgeOptionsRemarks
The thresholds are fractions of the sample range, compared with the magnitude of the gradient of the Sobel operator (ConvolutionKernel.SobelX, ConvolutionKernel.SobelY), which is not normalized: a step from black to white across a straight vertical edge has a magnitude of 4. OpenCV's cv2.Canny takes the same thresholds multiplied by 255 for 8-bit images, and scikit-image's canny the same values for floating-point images.
Constructors
| Name | Description |
|---|---|
| CannyEdgeOptions() |
CannyEdgeOptions()
CannyEdgeOptions.cspublic CannyEdgeOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| Default | Gets the default options: a blur of standard deviation 1, and the thresholds 0.1 and 0.2 (the defaults of scikit-image). |
| HighThreshold | Gets the upper threshold, a fraction of the sample range: a pixel whose gradient is a local maximum and greater than it is an edge. Defaults to 0.2. It must not be lower than CannyEdgeOptions.LowThreshold. |
| LowThreshold | Gets the lower threshold, a fraction of the sample range: a pixel whose gradient is a local maximum and greater than it is an edge when it is connected to a pixel greater than CannyEdgeOptions.HighThreshold by such pixels. Defaults to 0.1. |
| Sigma | Gets the standard deviation of the Gaussian blur applied to the luminance before its gradient is computed, in pixels: the weights of ImageProcessingExtensions.GaussianBlur, with the pixels outside the image read as the nearest edge pixel. Defaults to 1. A larger value ignores more noise and finer details; 0 does not blur, as OpenCV's cv2.Canny. |
Default
CannyEdgeOptions.csGets the default options: a blur of standard deviation 1, and the thresholds 0.1 and 0.2 (the defaults of scikit-image).
public static CannyEdgeOptions Default { get; }Property value
HighThreshold
CannyEdgeOptions.csGets the upper threshold, a fraction of the sample range: a pixel whose gradient is a local maximum and greater than it is an edge. Defaults to 0.2. It must not be lower than CannyEdgeOptions.LowThreshold.
public double HighThreshold { get; init; }Property value
Exceptions
ArgumentException- The value is not a finite number.
ArgumentOutOfRangeException- The value is negative.
LowThreshold
CannyEdgeOptions.csGets the lower threshold, a fraction of the sample range: a pixel whose gradient is a local maximum and greater than it is an edge when it is connected to a pixel greater than CannyEdgeOptions.HighThreshold by such pixels. Defaults to 0.1.
public double LowThreshold { get; init; }Property value
Exceptions
ArgumentException- The value is not a finite number.
ArgumentOutOfRangeException- The value is negative.
Sigma
CannyEdgeOptions.csGets the standard deviation of the Gaussian blur applied to the luminance before its gradient is computed, in pixels: the weights of ImageProcessingExtensions.GaussianBlur, with the pixels outside the image read as the nearest edge pixel. Defaults to 1. A larger value ignores more noise and finer details; 0 does not blur, as OpenCV's cv2.Canny.
public double Sigma { get; init; }Property value
Exceptions
ArgumentException- The value is not a finite number.
ArgumentOutOfRangeException- The value is negative or exceeds 10000.