def _calc_texture_gradient(img):
ret = numpy.zeros((img.shape[<NUM_LIT:0>], img.shape[<NUM_LIT:1>], img.shape[<NUM_LIT:2>]))<EOL>for colour_channel in (<NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:2>):<EOL><INDENT>ret[:, :, colour_channel] = skimage.feature.local_binary_pattern(<EOL>img[:, :, colour_channel], <NUM_LIT:8>, <NUM_LIT:1.0>)<EOL><DEDENT>return ret<EOL>
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(*)]