def _calc_texture_hist(img):
BINS = <NUM_LIT:10><EOL>hist = numpy.array([])<EOL>for colour_channel in (<NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:2>):<EOL><INDENT>fd = img[:, colour_channel]<EOL>hist = numpy.concatenate(<EOL>[hist] + [numpy.histogram(fd, BINS, (<NUM_LIT:0.0>, <NUM_LIT:1.0>))[<NUM_LIT:0>]])<EOL><DEDENT>hist = hist / len(img)<EOL>return hist<EOL>
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)