parameters: (img)
return_statement: return ret
docstring: 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(*)]
docstring_summary: calculate texture gradient for entire image
docstring_tokens: calculate texture gradient for entire image
function: def _calc_texture_gradient(img):
      """
          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(*)]
      """
      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
function_tokens: 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