code: def _calc_texture_hist(img):
      """
      calculate texture histogram for each region
  
      calculate the histogram of gradient for each colours
      the size of output histogram will be
          BINS * ORIENTATIONS * COLOUR_CHANNELS(3)
      """
      BINS = 10
  
      hist = numpy.array([])
  
      for colour_channel in (0, 1, 2):
          # mask by the colour channel
          fd = img[:, colour_channel]
  
          # calculate histogram for each orientation and concatenate them all
          # and join to the result
          hist = numpy.concatenate(
              [hist] + [numpy.histogram(fd, BINS, (0.0, 1.0))[0]]
          )
  
      # L1 Normalize
      hist = hist / len(img)
  
      return hist
  
imports: import sys
  from past.builtins import cmp
  import skimage.io
  import skimage.feature
  import skimage.color
  import skimage.transform
  import skimage.util
  import skimage.segmentation
  import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: _calc_texture_hist(img) and returns: hist