'''Task:''' Write a program that performs so-called [[wp:Canny edge detector|canny edge detection]] on an image.
A possible algorithm consists of the following steps:
# '''Noise reduction.''' May be performed by [[wp:Gaussian blur|Gaussian filter]].
# Compute '''intensity gradient''' (matrices and ) and its '''magnitude''' .
May be performed by [[image convolution|convolution of an image]] with [[wp:Sobel operator|Sobel operators]].
# '''Non-maximum suppression.''' For each pixel compute the orientation of intensity gradient vector: . Transform angle to one of four directions: 0, 45, 90, 135 degrees. Compute new array : if