def _compute_derivatives(image, mode='constant', cval=0):
 imy = ndi.sobel(image, axis=0, mode=mode, cval=cval)
 imx = ndi.sobel(image, axis=1, mode=mode, cval=cval)
 return (imx, imy)

def _compute_derivatives ( image , mode = 'constant' , cval = 0 ) : imy = ndi . sobel ( image , axis = 0 , mode = mode , cval = cval ) imx = ndi . sobel ( image , axis = 1 , mode = mode , cval = cval ) return ( imx , imy )
compute derivatives in x and y direction using the sobel operator .