OpenCV exercises: the gradient of an image