def _get_image_entropy(self, image):
hist = image.histogram()<EOL>hist_size = sum(hist)<EOL>hist = [float(h) / hist_size for h in hist]<EOL>return -sum([p * math.log(p, <NUM_LIT:2>) for p in hist if p != <NUM_LIT:0>])<EOL>
calculate the entropy of an image