pythonopencvimage-processinggradientsobel

Sobel and Laplace results appear in grayscale


I have been trying to follow the tutorial on image gradients found on this link https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_gradients/py_gradients.html

The results for Laplacian, Sobel x, and Sobel y appear in black and white according to the tutorial. But my results appear in gray. enter image description here

I cannot seem to find the reason since I am using the exact same code and the same sample image.


Solution

  • Very late, but if someone encounters the same problem, my guess is you forgot to take the absolute value of your results (so the 0 values appear in gray because they are the center between the negative and positive peaks)