摘要
针对K-Means色彩量化方法在运行时间上过于冗长的问题,提出一种用平均误差向量加速的色彩量化方法。随机生成K种色彩作为初始的调色盘,用该调色盘对欲量化的图像进行一次量化。根据量化后的版本,计算其每个颜色分量的量化误差,获得平均误差向量。用该平均误差向量对调色盘进行更新,获得另一更优的调色盘。通过若干次迭代运算,获得最终收敛的调色盘,并用该调色盘进行最后的色彩量化。实验结果表明,该加速算法能对K-Means量化方法平均加速70~150倍,同时,原有K-Means方法的量化效果还得到了保持。
Focusing on the issue that K-Means costs lots of CPU time when reducing colors, a fast K-Means method accelerated by the mean quantization error vectors for color reduction is proposed. In this method, a palette is generated randomly with K colors as initialization firstly, and then a quantized version is obtained by the color table. According to the mean quantization error vectors between the current quantized version and the input image, a better color table is evolved.Through several iterations of updating, the evolving process converge to the last color table, correspondingly, the final quantized image by the palette is obtained. Experimental results show that the accelerated algorithm can speed up to 70-150 times as much as the K-Means used to, meanwhile, the quality of quantization is kept.
引文
[1]吕建平,黄英.几种图像色彩量化方法的分析比较[J].计算机应用,2002,22(5):86-88.
[2]耿国华,周明全.常用色彩量化算法的性能分析[J].小型微型计算机系统,1998(9):47-50.
[3]Emre C M.Effective initialization of K-means for color quantization[C]//Proceedings of the IEEE International Conference on Image Processing,2009:1649-1652.
[4]赵燕伟,王万良.基于聚类分析的色彩量化新算法及其应用[J].计算机辅助设计与图形学学报,2000(5):340-343.
[5]林宇洪,陈清耀,邱荣祖.基于K-means聚类的木材运输行为的可视化监管[J].青海师范大学学报(自然科学版),2016,32(1):54-59.
[6]邹秋霞,杨林楠,彭琳,等.基于Lab空间和K-Means聚类的叶片分割算法研究[J].农机化研究,2015,37(9):222-226.
[7]许永峰,张书玲.色彩量化的模糊粒子群优化技术[J].计算机工程与应用,2011,47(10):169-170.
[8]Emre C M.Improving the performance of k-means for color quantization[J].Image and Vision Computing,2010,29(4):260-271.
[9]Frackiewicz M,Palus H.In search of a new initialization of k-means clustering for color quantization[C]//Proceedings of the Eighth International Conference on Machine Vision,2015.
[10]Franzen R.Kodak lossless true color image suite[EB/OL].[2017-07-26].http://r0k.us/graphics/kodak/.
[11]Gervautz M,Purgathofer W.A simple method for color quantization:octree quantization[M]//New trends in computer graphics.Berlin Heidelberg:Springer,1988:287-293.
[12]Heckbert P.Color image quantization for frame buffer display[J].ACM SIGGRAPH Computer Graphics,1982,16(3):297-307.
[13]Wu X.Color quantization by dynamic programming and principal analysis[J].ACM Transactions on Graphics,1992,11(4):348-372.
[14]Ozdemirand D,Akarun L.Fuzzy algorithm for color quantization of images[J].Pattern Recognition,2002,35(8):1785-1791.
[15]Hu Y C,Lee M G.K-means based color palette design scheme with the use of stable flags[J].Journal of Electronic Imaging,2007,16(3).