code: def _calc_texture_gradient(img):
      
      ret = numpy.zeros((img.shape[0], img.shape[1], img.shape[2]))
  
      for colour_channel in (0, 1, 2):
          ret[:, :, colour_channel] = skimage.feature.local_binary_pattern(
              img[:, :, colour_channel], 8, 1.0)
  
      return ret
docs: calculate texture gradient for entire image
  
          The original SelectiveSearch algorithm proposed Gaussian derivative
          for 8 orientations, but we use LBP instead.
  
          output will be [height(*)][width(*)]