Implements Sobel operator.