'Project descriptors on the vocabulary
to create a histogram of words.'

def project(self, descriptors):

    imhist = zeros(self.nbr_words)
    (words, distance) = vq(descriptors, self.voc)
    for w in words:
        imhist[w] += 1
    return imhist
