I’m searching for an implementation of the matlab gradient function in python. An example output of the is illustrated below.
The way I use it in Matlab is:
img = rgb2gray(imread('img.png'));
[dx,dy] = gradient(img);

How do I solve this problem? Is there any library or package for it?
I believe you are looking for the Numpy.gradient
I found it via google searching for “Python scipy gradient”