Abstract:In order to reduce aliasing effects in color QR decoding and improve the accuracy of color QR code decoding, a k-Means clustering algorithm based on HSV color space was proposed. Experiments were conducted to verify the effect of k-Means clustering algorithm in three color spaces of RGB, Lab and HSV for choosing the right color space for color QR codes. In HSV color space, the color matching model of color coding module was established according to the principle of equal Euclidean distance, so as to minimize the aliasing effect of color in decoding. In the preprocessing phase of color QR code decoding, k-Means clustering algorithm based on ray compensation in HSV color spaces was used to separate color coding module and to improve the decoding accuracy. The result showed that in HSV color space, the k-Means clustering effect was the best, with the image region classification effect being the clearest. The color matching model could optimally match the color coding module. Therefore k-Means clustering algorithm based on ray compensation could be used in HSV color space to improve the accuracy of color QR decoding. Establishing a reasonable model was to set color encoding modules, and to use k-Means clustering algorithm based on ray compensation in HSV color space to achieve color segmentation. It could greatly reduce the aliasing effect between QR color encoding modules and significantly improve the accuracy of color decoding QR.