Table of Contents

Method Canny

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Canny(InputArray, OutputArray, double, double, int, bool)

Finds edges in an image using Canny algorithm.

public static void Canny(InputArray src, OutputArray edges, double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false)

Parameters

src InputArray

Single-channel 8-bit input image

edges OutputArray

The output edge map. It will have the same size and the same type as image

threshold1 double

The first threshold for the hysteresis procedure

threshold2 double

The second threshold for the hysteresis procedure

apertureSize int

Aperture size for the Sobel operator [By default this is ApertureSize.Size3]

L2gradient bool

Indicates, whether the more accurate L2 norm should be used to compute the image gradient magnitude (true), or a faster default L1 norm is enough (false). [By default this is false]

Canny(InputArray, InputArray, OutputArray, double, double, bool)

Finds edges in an image using the Canny algorithm with custom image gradient.

public static void Canny(InputArray dx, InputArray dy, OutputArray edges, double threshold1, double threshold2, bool L2gradient = false)

Parameters

dx InputArray

16-bit x derivative of input image (CV_16SC1 or CV_16SC3).

dy InputArray

16-bit y derivative of input image (same type as dx).

edges OutputArray

output edge map; single channels 8-bit image, which has the same size as image.

threshold1 double

first threshold for the hysteresis procedure.

threshold2 double

second threshold for the hysteresis procedure.

L2gradient bool

Indicates, whether the more accurate L2 norm should be used to compute the image gradient magnitude (true), or a faster default L1 norm is enough (false). [By default this is false]