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
srcInputArraySingle-channel 8-bit input image
edgesOutputArrayThe output edge map. It will have the same size and the same type as image
threshold1doubleThe first threshold for the hysteresis procedure
threshold2doubleThe second threshold for the hysteresis procedure
apertureSizeintAperture size for the Sobel operator [By default this is ApertureSize.Size3]
L2gradientboolIndicates, 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
dxInputArray16-bit x derivative of input image (CV_16SC1 or CV_16SC3).
dyInputArray16-bit y derivative of input image (same type as dx).
edgesOutputArrayoutput edge map; single channels 8-bit image, which has the same size as image.
threshold1doublefirst threshold for the hysteresis procedure.
threshold2doublesecond threshold for the hysteresis procedure.
L2gradientboolIndicates, 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]