Working Sobel edge detection