7.3.17.0. Color Clustering
(lsh/libimage/color-quantize.lsh)


Functions to find representative colors from a precomputed color histogram. these functions just find the colors, they do not actually quantize the images. This is done in rgbaimage, and rgbafimage.

7.3.17.0.0. (cqu-init-proto ppal proto)
(lsh/libimage/color-quantize.lsh)


initialize prototypes for K-means. assumes that ppal contains the color values sorted by luminosity (as returned by rgbaim-histo32). puts the prototypes regularly spaced along a line between the darkest and lightest color. ppal : Nx3 matrix of floats containing a list of RGB color cells proto : Px3 matrix of floats, contains the initalized prototypes on output

7.3.17.0.1. (cqu-kmeans ppal count assign split proto label weight variance)
(lsh/libimage/color-quantize.lsh)


performs a Kmeans algorithms on the color values contained in ppal . INPUT: ppal : Nx3 matrix of floats containing a list of RGB color present in the picture count : N matrix of floats, number of pixels with the corresponding RGB color assign : N matrix of floats containing the label of the prototype to which the color cell is currently assigned. split : an int: only those color cells whose initial assigned label is equal to split will be taken into account. proto : Px3 matrix of floats, contains initialized RGB prototypes label : P matrix of ints, contains labels for the prototypes OUTPUT: proto : contains the updated prototypes on output assign : the color cells whose assigned value was split will be assigned the value in label correspinding to their closest prototype. weight : P matrix of float, contains the number of pixels assigned to each prototype variance : P matrix of float, contains the variance associated with the prototypes