为解决在复杂背景下,由于QR码无法定位而导致的识别率较低的问题,提出了一种新的QR条码定位方法。考虑到QR码的结构特征,先对QR码进行轮廓定位,确定QR码可能所在的区域,然后对QR码进行精确定位。QR码轮廓定位是用Hough变换检测近似正方形的区域,然后合并嵌套的正方形区域,最后进行区域调整。精确定位的过程利用了KMP算法的思想,提高了寻找满足特定比例线段的速度,从而提高了精确定位的速度。实验结果表明,相比于传统的QR码定位的方法,该方法可以准确快速地定位QR条码,整体的识别速度和识别率都有了较大的提高,同时具有很高的实用价值。
To solve the low recognition rate of QR code under complex background caused by the invalid localization,propose a new ap- proach for QR code localization. Taking the structure of QR code into account, the first step is contour localization that determines the possible regions of QR code and the second step is accurate localization. Contour localization applies Hough transform to detect regions approximate to square, then merge those squares which are nested and made region adjustment at last. The thought of KMP algorithm is used in the process of accurate localization to enhance the speed of finding the special ratio line,improving the speed of localization. The results of experiments show that this method is able to locate the QR code fast and precisely and the speed of recognition as well as recog- nition rate are greatly improved compared with the conventional method and has high practical value as well.