Saturday, 19 October 2013

openCV and color quantization--00 : simple algorithm

There are two famous algorithms--pyrMeanShiftFiltering and kmeans could help us quantize the colors of the image.If you want to quantize the color without number of color, pick pyrMeanShiftFiltering, else pick kmeans.

If you don't need the power of kmeans or pyrMeanShiftFiltering, the openCV2 computer vision application programming cookbook introduce a simple algorithm which could reduce the color of the images.I do some refinemet to the codes(use cv::LUT to replace hand made loop).