Why not use skimage.filter.prewitt? Should be faster and builtin :-)