code: def _calc_texture_hist(img):
      
      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
docs: 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)