def _scharr(img): # Invert the image to ease edge detection. img = 1. - img grey = skc.rgb2grey(img) return skf.scharr(grey)