def chist(im):
 im = (im // 64)
 (r, g, b) = im.transpose((2, 0, 1))
 pixels = (((1 * r) + (4 * g)) + (16 * b))
 hist = np.bincount(pixels.ravel(), minlength=64)
 hist = hist.astype(float)
 return np.log1p(hist)

def chist ( im ) : im = ( im // 64 ) ( r , g , b ) = im . transpose ( ( 2 , 0 , 1 ) ) pixels = ( ( ( 1 * r ) + ( 4 * g ) ) + ( 16 * b ) ) hist = np . bincount ( pixels . ravel ( ) , minlength = 64 ) hist = hist . astype ( float ) return np . log1p ( hist )
compute color histogram of input image parameters im : ndarray should be an rgb image returns c : ndarray 1-d array of histogram values .