Based on these criteria, the canny edge detector first smoothes the image to eliminate
noise. It then finds the image gradient to highlight regions with high spatial
derivatives. The algorithm then tracks along these regions and suppresses any pixel
that is not at the maximum using non-maximum suppression. The gradient array is
now further reduced by hysteresis to remove streaking and thinning the edges.