Feature detection of a two-dimensional code is a first critical step in two-dimensional data processing. This is because it is impossible to continue the processing once the detection is failed. However, a two-dimensional code generally has a large amount of data, hence whether the two-dimensional code feature can be quickly detected has a direct influence on the utilization performance of the two-dimensional code. Therefore, a quick and accurate detection of two-dimensional code feature has become an important demand in the two-dimensional code data processing.
A quick response (QR) code is a type of two-dimensional code. The QR code has three position detection patterns which are located at an upper-left corner, an upper-right corner and a lower-left corner of the QR code respectively. Each of the position detection patterns may be considered to be formed by three overlapped concentric squares which are a 7*7 dark color module, a 5*5 light color module and a 3*3 sized dark color module, respectively. Therefore, a proportion of lengths of black and white line segments divided by the center of the position detection pattern meets 1:1:3:1:1.
At present, in most two-dimensional code feature detection methods, scan and detection are performed row by row, and the detection speed is slow.
Chinese invention patent No. CN104517090A, discloses a method and system for detecting a QR code detection pattern. The method includes: detecting a QR code in a first direction, detecting a first line segment of which a proportion of lengths of black: white: black: white: black line segments meets a preset proportion so as to determine a center of the first line segment; detecting, in a second direction, a straight line passing a center point of the first line segment, to obtain a second line segment of which a proportion of lengths of black: white: black: white: black line segments meets a preset proportion, and determining a center point of the second line segment as a center point of the detection pattern. Although only a row-by-row full coverage detection is required in the first direction detection and the detection speed is improved, only the center point of the detection pattern can be found in detecting the detection pattern of a QR code image, and the boundary lines of the detection pattern of the complete QR code can not be determined. Particularly, the boundary lines of the detection pattern of the QR code can not be determined accurately in the case that the QR code is deformed and distorted.