pub fn canny<T: Into<DynamicImage>>(
image: T,
sigma: f32,
strong_threshold: f32,
weak_threshold: f32,
) -> DetectionExpand description
Computes the canny edges of an image.
The variable sigma determines the size of the filter kernel which affects the precision and
SNR of the computation:
- A small sigma (3.0<) creates a kernel which is able to discern fine details but is more prone to noise.
- Larger values result in detail being lost and are thus best used for detecting large features. Computation time also increases.
The weak_threshold and strong_threshold determine what detected pixels are to be regarded
as edges and which should be discarded. They are compared with the absolute magnitude of the
change in brightness.
§Panics:
- If either
strong_thresholdorweak_thresholdare outisde the range of 0 to 1 inclusive. - If
strong_thresholdis less thanweak_threshold. - If
imagecontains no pixels (either it’s width or height is 0).