A two-dimensional code, a positioning method, system and storage medium thereof

By designing a new QR code structure and positioning method, and utilizing a center-finding image positioning graphic block and a clock positioning graphic block, the problems of low space utilization of traditional QR codes and low positioning efficiency of Micro QR codes are solved, and efficient big data storage and transmission are achieved.

CN120725048BActive Publication Date: 2025-11-04HUNAN QINHAI DIGITAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511214843.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-11-04
Estimated Expiration
2045-08-28

AI Technical Summary

Technical Problem

Traditional QR codes have low space utilization, and the positioning method of Micro QR codes is computationally intensive and inefficient, making it difficult to meet the needs of big data storage and transmission.

Method used

Design a QR code with a symbol size of M×M, composed of two graphics of different brightness, including a center-finding graphic block and a data graphic. The center-finding graphic block is used to quickly locate the code surface range, and the center point is used to accurately locate the coordinates. The clock positioning graphic block and the correction graphic are used to assist in positioning.

Benefits of technology

It improves the space utilization and recognition efficiency of QR codes, especially in the design of multiple QR codes laid out in a flat manner. The larger the data volume, the higher the space utilization and the higher the recognition rate, making it suitable for big data storage and transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120725048B_ABST
    Figure CN120725048B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of two-dimensional codes, in particular to a two-dimensional code, a positioning method and system thereof and a computer readable storage medium. In the application, a pattern block for searching and positioning is arranged in a central region of the two-dimensional code, the central pattern block for searching and positioning is composed of a first large square of a first brightness filled with a pattern and a central small dot, when identification is performed, the first large square of the first brightness can be used to quickly lock the code surface range, and then the central small dot is used to accurately position the coordinates. Especially for the design of multiple two-dimensional codes in a tiled mode for data storage, the positioning effect of the central pattern block for searching and positioning in the application is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of QR code technology, and in particular to a QR code, its positioning method, system, and computer-readable storage medium. Background Technology

[0002] The widely used QR code (Quick Response Code) is a type of two-dimensional code. It boasts large storage capacity, low cost, and the ability to represent various textual information such as Chinese characters and images. Its strong security and anti-counterfeiting features, coupled with its ease of use, have led to its widespread adoption across various industries. It offers advantages such as high information density and fast reading speed, resulting in its application in numerous fields. However, with the advent of the big data era and the ever-increasing demand for storing and transmitting massive amounts of data, the limitations of traditional QR codes in terms of capacity and space utilization are becoming increasingly apparent.

[0003] Traditional QR codes only support a maximum module size of 177×177, limiting data capacity. Furthermore, QR codes have fixed large positioning patterns at three corners and multiple auxiliary positioning blocks in the center, plus version information, occupying approximately 10%-15% of the code surface space, thus limiting space utilization. Figure 1 As shown, each QR code symbol is composed of nominally square modules forming a square array. This array consists of an encoding region and functional patterns including a finder pattern, separators, positioning patterns, and correction patterns. The functional patterns cannot be used for data encoding, and the symbol is surrounded by a blank area. The finder pattern comprises three identical position probe patterns located at the top left, top right, and bottom left corners of the symbol. Each position probe pattern can be viewed as consisting of three overlapping concentric squares: 7×7 dark modules, 5×5 light modules, and 3×3 dark modules. The module width ratio of the position probe patterns is 1:1:3:1:1. The probability of encountering similar patterns elsewhere in the symbol is extremely low; therefore, these patterns are used to quickly identify possible QR code symbols within the field of view. Then, identifying the three position probe patterns that make up the finder pattern allows for a clear determination of the symbol's position and orientation within the field of view, thus achieving localization.

[0004] In addition, to make the QR codes embedded in objects more "miniaturized", such as Figure 2 As shown, the industry has proposed a Micro QR code. Compared to the QR code, the Micro QR code only requires a lookup symbol, has a smaller size and lower header overhead, and can store data ranging from 20 bits to 128 bits. This capacity does not overlap with the storage capacity of the QR code. Figure 2The Micro QR code shown only has a single rectangular positioning block graphic, with the clock area used to store the QR code's encoded content located at the edge of the entire code area. Micro QR codes are only suitable for small-capacity codes, storing only 15 bytes. For image finding, due to their small size, only a single rectangular positioning block is used. However, the aforementioned positioning block graphic identifies the rectangular connected components of the rectangular positioning block, then locates the center of the rectangular positioning block, and subsequently needs to obtain the boundary points starting from the center point of the positioning block. Finally, during tilt correction, it is still necessary to convert the obtained boundary points into three positioning points for positioning. This positioning method involves a large amount of data processing and is slow to compute; the image finding effect of the rectangular positioning block QR code is poor, and the amount of data used still has room for optimization. Summary of the Invention

[0005] The main objective of this invention is to provide a QR code and its positioning method, system, and computer-readable storage medium to solve the aforementioned technical problems.

[0006] To achieve the above objectives, the present invention provides a QR code with a symbol size of M×M, composed of two graphics of different brightness. The QR code includes functional graphics and data graphics. The functional graphics include a center finder graphic block with a size of N×N, and the data graphics include data blocks surrounding the center finder graphic block. N=8×n1+1, M=N+8×n2, where n1 is a positive integer and n2 is a positive integer greater than or equal to 2.

[0007] The center image-finding and positioning graphic block includes:

[0008] A central module consisting of graphics of size N1×N1 and first brightness, the center of which coincides with the center of the QR code.

[0009] A central rectangular border module of size 3N1×3N1, composed of graphics of second brightness with size N1×N1, is concentrically arranged around the central module.

[0010] A rectangular outer frame module of size N×N, composed of N1×N1 second-brightness graphics, is concentrically arranged around the central module.

[0011] A rectangular corner module, consisting of a second-brightness graphic of size aN1×bN1, is positioned at one of the inner corners of the rectangular outer frame module.

[0012] The remaining portion surrounded by the rectangular outer frame module is composed of large squares of first brightness filled with graphics of size N1×N1 of first brightness.

[0013] Where N1+aN1+N1≤(N-1) / 2, N1+bN1+N1≤N / 2, a and b are integers greater than or equal to 1, and a≠b.

[0014] Preferably, the first brightness is white or transparent, the second brightness is black, N1 is a minimum size unit of the QR code, and M is 25-529.

[0015] Preferably, n1 is 2, a=3, and b=2.

[0016] Preferably, the functional graphic further includes a clock positioning graphic block; the clock positioning graphic block is a crosshair positioning line, and the center of the clock positioning graphic block coincides with the center of the center lookup positioning graphic block; the clock positioning graphic block includes horizontal positioning graphics and vertical positioning graphics extending from the four sides of the center lookup positioning graphic block respectively; the horizontal positioning graphics are located at the horizontal center of the QR code, and the vertical positioning graphics are located at the vertical center of the QR code, and both the horizontal positioning graphics and the vertical positioning graphics are formed by alternating graphics of first brightness and second brightness with a size of N1×N1.

[0017] Preferably, the functional graphic also includes correction graphics located at at least three corners of the QR code.

[0018] Preferably, the correction pattern includes a first correction block located at the inner corner of the QR code, consisting of a second brightness pattern of size N1×N1; a second correction block consisting of a first brightness pattern of size N1×N1 that surrounds the first correction block together with the outer edge of the QR code; and a third correction block consisting of a second brightness pattern of size N1×N1 that surrounds the second correction block together with the outer edge of the QR code.

[0019] Preferably, the data graphic area of ​​the QR code is processed by XOR operation through a mask graphic.

[0020] The present invention provides a method for locating a QR code as described above, comprising the following steps:

[0021] S1, acquire the captured image S, and after downscaling and converting the captured image to grayscale, obtain the binary image B;

[0022] S2, by finding the point with the highest first brightness in image B, the position P of the center image-finding positioning graphic block is initially determined;

[0023] S3, crop the image D of the corresponding position P in the image S, which is a region of a preset size;

[0024] S4, identify the central rectangular border module, or the central rectangular border module and the central module in the image D, and locate the center point C;

[0025] S5, identify the rectangular corner module and the rectangular outer border module in the image D to identify the entire center image-finding positioning graphic block and calculate the tilt angle A and size Z of the center image-finding positioning graphic block, thereby locating the QR code.

[0026] Preferably, step S4 includes locating the central rectangular border module in the image D, and then locating the central module in the image area of ​​the central rectangular border module to locate the center point C.

[0027] Preferably, step S5 includes,

[0028] The rectangular corner module in the image D is located, and the tilt angle A of the center image positioning graphic block is calculated based on the orientation between the rectangular corner module and the center point C.

[0029] The rectangular outer border module in the image D is identified to identify the center image-finding graphic block and the size Z of the center image-finding graphic block is calculated.

[0030] Based on the tilt angle A and the orientation of the diagonal of the center image-finding positioning graphic block and the rectangular corner module, the rotation direction and mirror direction of the QR code are obtained, thereby locating the QR code.

[0031] Preferably, the functional graphic further includes correction graphics located at at least three corners of the QR code; the method further includes step S9:

[0032] S90, obtain the size information R of the QR code, and locate the boundary of the QR code according to the tilt angle A and the size information R;

[0033] S91, based on the boundary, locate and identify the correction pattern within a preset range of the boundary;

[0034] S92, the center point C is corrected according to the correction pattern.

[0035] Preferably, when the QR code is a single code, step S90 includes: reading the header information of the QR code, obtaining the size information R of the QR code, and locating the boundary of the QR code according to the tilt angle A and the size information R;

[0036] When the QR code is designed as a multi-code tiled design, step S90 includes: connecting adjacent center points C, and the center perpendicular line of the connecting line is the boundary of the QR code.

[0037] Preferably, step S92 includes: recalculating the center point C' of the QR code based on the correction pattern; if the center point C' is consistent with the center point C, the positioning is considered successful; if the center point C' is inconsistent with the center point C, the center point C' is used as the new center point C, and the process returns to step S5.

[0038] Preferably, the functional graphic further includes a clock positioning graphic block; the clock positioning graphic block is a crosshair positioning line, and the center of the clock positioning graphic block coincides with the center of the center lookout positioning graphic block; the clock positioning graphic block includes horizontal positioning graphics and vertical positioning graphics extending from the four sides of the center lookout positioning graphic block respectively; the horizontal positioning graphics are located at the horizontal center of the QR code, and the vertical positioning graphics are located at the vertical center of the QR code, and both the horizontal and vertical positioning graphics are formed by alternating graphics of size N1×N1 with first brightness and second brightness; the method further includes step S10:

[0039] S101, based on the center point C and the center image positioning graphic block, locate the position of the crosshair positioning line, read the graphic at the position of the crosshair positioning line, and determine whether it is a graphic formed by alternating graphics of the first brightness and the second brightness with a size of N1×N1. If the recognition is successful, it is determined that the QR code positioning is successful; if the recognition is unsuccessful, proceed to step S102.

[0040] S102, within a preset range around the position of the crosshair positioning line, find a pattern formed by alternating patterns of first brightness and second brightness that extend in a single direction and have a size of N1×N1, and fit them to form a new crosshair positioning line.

[0041] S103, using the new crosshair positioning line, fit the center intersection of the crosshair positioning line as the new center point C, and return to step S5.

[0042] Preferably, the step also includes removing the mask pattern.

[0043] The present invention also provides a QR code positioning system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the QR code positioning method as described above.

[0044] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the QR code positioning method described above.

[0045] To address the shortcomings and improvement needs of existing technologies, this invention provides a QR code and its positioning method. The central image-finding positioning graphic block is located in the central area of ​​the QR code. This central image-finding positioning graphic block consists of a large outer square of secondary brightness (e.g., a 17×17 pixel basic unit) and a small central dot. During decoding, based on the human visual recognition logic of "from whole to part," the large white square is used to quickly locate the code surface area, and then the central black dot is used to accurately locate the coordinates. For the multi-QR code tiling design for data storage, the positioning effect of the central image-finding positioning graphic block in this embodiment is better. With the multi-QR code tiling design, the larger the data volume, the more surrounding positioning points can be used to fill in any missing positioning points. Therefore, the larger the data volume, the higher the space utilization and the higher the recognition rate. Attached Figure Description

[0046] The accompanying drawings, as part of this invention, are provided to further illustrate the invention. The illustrative embodiments and descriptions of the invention are used to explain the invention, but do not constitute an undue limitation thereof. Clearly, the drawings described below are merely some embodiments, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0047] Figure 1 This is a schematic diagram of a QR code in the prior art.

[0048] Figure 2 This is a schematic diagram of a Micro QR code in the prior art.

[0049] Figure 3 This is a schematic diagram of a QR code in one embodiment of the present invention.

[0050] Figure 4 This is a schematic diagram illustrating the size and function of a QR code in one embodiment of the present invention.

[0051] Figure 5 This is a schematic diagram of a 25×25 QR code in one embodiment of the present invention.

[0052] Figure 6 This is a functional graphic diagram of a QR code in one embodiment of the present invention.

[0053] Figure 7 This is a schematic diagram of a center-finding and positioning graphic block according to an embodiment of the present invention, wherein, Figure 7 (a) A schematic diagram of the dimensions of the center-finding image positioning graphic block. Figure 7 (b) A detailed structural diagram of the center-based image-finding graphic block.

[0054] Figure 8 This is a schematic diagram of the structure of a QR code composed of multiple single QR codes laid out in one embodiment of the present invention.

[0055] Figure 9 This is a schematic diagram of the region image D captured during the positioning process in one embodiment of the present invention.

[0056] Figure 10 This is a schematic diagram illustrating QR code boundary positioning in a multi-code tiling example according to an embodiment of the present invention, wherein... Figure 10 (a) is a schematic diagram of the boundary of the QR code by connecting adjacent center points. Figure 10 (b) is a schematic diagram of the correction graphics for locating the four corners of the QR code.

[0057] Figure 11 This is a schematic diagram illustrating the calculation of the QR code tilt angle and the recognition of the crosshair positioning line in one embodiment of the present invention, wherein... Figure 11 (a) is a schematic diagram for calculating the tilt angle of the QR code. Figure 11 (b) is a schematic diagram of crosshair identification.

[0058] Figure 12 This is a schematic diagram illustrating the calculation of the QR code tilt angle in a single-code example of an embodiment of the present invention.

[0059] Figure 13 This is a flowchart illustrating a QR code positioning method according to an embodiment of the present invention.

[0060] Figure 14 This is a schematic diagram of the hardware structure of a positioning method for running QR codes in one embodiment of the present invention.

[0061] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0062] The technical problems solved by the embodiments of the present invention, the technical solutions adopted, and the technical effects achieved will be clearly and completely described below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other equivalent or obvious variations of embodiments obtained by those skilled in the art without creative effort fall within the protection scope of the present invention. The embodiments of the present invention can be embodied in various different ways as defined and covered by the claims.

[0063] It should be noted that many specific details are given in the following description for ease of understanding. However, it is obvious that the present invention may be implemented without these specific details.

[0064] It should be noted that, in the absence of explicit limitations or conflicts, the various embodiments and their technical features in this invention can be combined with each other to form a technical solution.

[0065] This invention proposes a QR code with a central image-finding graphic block. During decoding, based on the human visual recognition logic of "from whole to part," the code surface range can be quickly locked by first using the central image-finding graphic block, and then the coordinates can be accurately located by using the center point.

[0066] Please refer to Figures 3-12 In this embodiment, the QR code 100 has a symbol size of M×M and is composed of two graphics with different brightness levels. The QR code includes functional graphics and data graphics.

[0067] Similar to QR codes in existing technologies, data graphics can be XORed using mask graphics. The purpose of this operation is to balance the ratio of dark to light modules in the symbol and reduce the appearance of graphics that would hinder fast image processing.

[0068] In this embodiment, the functional graphic includes a center image-finding graphic block 10 with a size of N×N, and the data graphic 200 includes data blocks surrounding the center image-finding graphic block. Wherein, N = 8×n1 + 1, M = N + 8×n2, n1 is a positive integer, and n2 is a positive integer greater than or equal to 2.

[0069] Specifically, in this embodiment of the QR code, in a preferred instance, N=17 and n1 is 2. For example, Figure 4 As shown, the QR code in this embodiment can support sizes from 25×25 to 529×529. Figure 5 The image shows a 25×25 QR code as a specific example where N=17 and M=25.

[0070] It is understandable that the larger the QR code size, the smaller the proportion of the center image-finding graphic block in the QR code, and the lower the speed and accuracy of locating the center image-finding graphic block in the image. Therefore, those skilled in the art can design N and M as needed to set the largest possible center image-finding graphic block while ensuring sufficient data storage bits for the data graphic. When n1 is 1, the supported QR code size will be reduced, suitable for QR codes with small data volumes; when n1 is 3, the supported QR code size can be larger (greater than 529×529), suitable for situations where a single QR code needs to store larger data. However, since larger QR codes will have larger errors during recognition and scanning, the probability of recognition errors will increase significantly; therefore, in a preferred embodiment, N=17 and n1=2, which balances both the storage capacity of the data graphic and the accuracy of scanning and recognition.

[0071] Please combine them together Figure 7 In this embodiment, the center image-finding and positioning graphic block 10 includes: a center module 11, a center rectangular border module 12, a rectangular outer border module 13, a rectangular corner module 14, and a first brightness large square 15.

[0072] Specifically, a central module 11 is composed of graphics of a first brightness with a size of N1×N1, and the center of the central module 11 coincides with the center of the QR code 100. For example, in this example, the first brightness is white, the second brightness is black, and N1 is one of the smallest size units of the QR code. The first and second brightness can also use grayscale or color, as long as they have sufficient distinguishability and can be quickly identified; this is the same as the recognition technology of black and white QR codes, color QR codes, and grayscale QR codes in the prior art, and will not be described in detail here. N1 is one of the smallest size units of the QR code, that is, a size of 1×1; of course, in other embodiments, it can also be 2×2, 3×3, etc.

[0073] Specifically, a central rectangular border module 12, with a size of 3N1×3N1, is concentrically arranged around the central module 11 and consists of graphics of the second brightness with a size of N1×N1. Since the center of the central module 11 is the center of the QR code 100, when it is necessary to locate the central module 11, the central rectangular border module 12, which has a larger size and a strong contrast with the central module 11, can be located first to roughly locate the center, and then the central module 11 at the center of the central rectangular border module 12 can be located.

[0074] Specifically, a rectangular outer border module 13 of size N×N is concentrically arranged around the central module 11, consisting of N1×N1 second-brightness graphics. The rectangular outer border module 13 is the outer border of the center image-finding graphic block 10, separating the center image-finding graphic block 10 from the data graphics.

[0075] Specifically, a rectangular corner module 14, consisting of a second brightness graphic with a size of aN1×bN1, is positioned at one of the inner corners of the rectangular outer frame module 13. The rectangular corner module 14 is located at one of the inner corners of the rectangular outer frame module 13. By positioning the rectangular corner module 14 in conjunction with the center point, the tilt angle of the QR code can be calculated.

[0076] Specifically, the remaining portion surrounded by the rectangular outer frame module is composed of large squares 15 of first brightness, filled with graphics of first brightness with a size of N1×N1.

[0077] Where N1+aN1+N1≤(N-1) / 2, N1+bN1+N1≤N / 2, a and b are integers greater than or equal to 1, and a≠b. Through the above size constraints of a and b, the rectangular corner module 14 is sufficiently far from the central rectangular border module 12, and the space between the rectangular corner module 14 and the central rectangular border module 12 belonging to the first brightness large square 15 is sufficiently large.

[0078] For example, in this embodiment, a=3 and b=2. It is understood that in other embodiments, when N=17, a and b can take values ​​from 1 to 4, all of which can achieve the same effect.

[0079] The center finder graphic block 10 has a sufficiently large first brightness square 15 (relative to data = graphic). In a typical QR code, it is rare for such a large first brightness graphic to appear in the data graphic. Furthermore, since the data graphic is XORed with a mask graphic, it is impossible for a large first brightness graphic to appear in the QR code. Therefore, the center finder graphic block 10 can be quickly located by positioning the size of the first brightness graphic.

[0080] For example, please combine them together Figure 8 It is a combination of multiple QR codes, formed by stitching together 100 of each other, which can be accessed through... Figure 8 and Figure 9As can be seen intuitively, the white dots on the image are very obvious during image recognition, and can be quickly located and identified even with the naked eye. By rapidly scanning the image, the white dots can be located, thus pinpointing the approximate location P of the center image-finding localization block 10. Then, the image near location P is magnified to perform finer recognition of the other modules of the center image-finding localization block 10. The specific recognition steps will be described in detail later.

[0081] Please combine them together Figures 8-10 The specific image-finding principle of the center image-finding positioning graphic block 10 is as follows: After downscaling and converting the captured image to grayscale, the point with the highest first brightness (white) is found in the image and initially positioned as the location P of the center image-finding positioning graphic block; the corresponding area image D of the image at location P is extracted; the center rectangular border module 12 and the center module 11 in the image D are identified to locate the center point C; then the rectangular corner module and the rectangular outer border module in the image D are identified to identify the entire center image-finding positioning graphic block and calculate the tilt angle A and size Z of the center image-finding positioning graphic block 10, thereby locating the QR code.

[0082] like Figure 9 In the recognition method, if the center point (red cross position) is obtained through coarse contour positioning, the error is relatively large; the green X point is precisely located by using the black block (central rectangular border module 12) and the central white point (central module 11), and the error is relatively small. Selecting the center image-finding graphic block 10 in image D and using distance transformation to find the center position of the black block (central rectangular border module 12) has a much higher accuracy than contour positioning and stronger anti-interference ability (but the computational load is larger); the central white point (central module 11) can be used for center point correction or for precise positioning.

[0083] The size Z of the center image-finding graphic block 10 can be calculated based on the outline of the white block when performing fine recognition of the region image D.

[0084] Please combine again Figures 4-6 The functional graphic also includes correction graphics 30 located at at least three corners of the QR code 100.

[0085] In this embodiment, there are four correction graphics, located at the four corners of the QR code 100.

[0086] The correction pattern 30 includes a first correction block located at the inner corner of the QR code, consisting of a second brightness pattern of size N1×N1; a second correction block consisting of a first brightness pattern of size N1×N1 that surrounds the first correction block together with the outer edge of the QR code; and a third correction block consisting of a second brightness pattern of size N1×N1 that surrounds the second correction block together with the outer edge of the QR code.

[0087] QR code boundary recognition methods are divided into two modes: single code and multiple code.

[0088] Please combine them together Figure 10 If it is a tiled QR code pattern, such as Figure 10 (a) Connect adjacent center points; the perpendicular line from the center of the connecting line is the boundary of the QR code. The intersection of the perpendicular lines (red cross) can be used to initially locate the four corners of the QR code; for example... Figure 10 (b) Then find the accurate four corner positioning blocks (green cross points) near the intersection (red cross) (correction figure 30);

[0089] If it is a single, independent QR code, the boundaries of the QR code are determined by reading the header information of the QR code to obtain the size information R of the QR code. Based on the center point C, the tilt angle A, and the size information R, the boundaries and four corners of the QR code are roughly located. Then, the accurate four-corner positioning blocks (correction graphic 30) are found near the positions of the four corners that were roughly located, and finally the four corners and boundaries of the QR code are obtained.

[0090] In addition, the four corner positioning blocks (correction graphics 30) can also be used to recalculate the center point to verify or correct the center point C identified and located by the center rectangular border module 12 and the center module 11.

[0091] Please combine them together Figure 11 and Figure 12 The recognition of the tilt angle A of the center image-finding and positioning graphic block 10 is divided into two methods: single code and multi-code.

[0092] If it is a tiled QR code pattern, such as Figure 11 (a) Connect the adjacent center points, and the angle of the connecting line segment is the tilt angle A of the QR code;

[0093] If it is a single, independent QR code, such as Figure 12The rotation and mirror direction of the QR code are determined by the diagonal of the center image-finding graphic block 10 and the orientation of the rectangular corner module 14, thereby locating the QR code. Specifically, the rotation angles of the center image-finding graphic block 10 are determined by the orientation of the rectangular corner module 14, which are 90°, 180°, and 270°. The rectangular corner module 14 is divided into left and right parts by the diagonal of the center image-finding graphic block 10. Since a≠b, the left and right parts are different sizes after the diagonal is cut, so it is possible to identify whether the image is mirrored and thus determine whether mirroring is required.

[0094] Please combine them together Figures 4-6 The functional graphic also includes a clock positioning graphic 20; the clock positioning graphic 20 is a crosshair positioning line, and the center of the clock positioning graphic 20 is consistent with the center of the center image-finding positioning graphic block 10.

[0095] The clock positioning pattern 20 includes horizontal and vertical positioning patterns extending from the four sides of the central image-finding positioning pattern block 10. The horizontal positioning pattern is located at the horizontal center of the QR code, and the vertical positioning pattern is located at the vertical center of the QR code. Both the horizontal and vertical positioning patterns are formed by alternating patterns of first and second brightness with a size of N1×N1. Preferably, the beginning and end of the horizontal and vertical positioning patterns are both dark modules (second brightness).

[0096] The clock positioning pattern 20 extends from the four sides of the center image positioning pattern block 10, without obstructing the center image positioning pattern block 10, and will not affect the positioning of the center image positioning pattern block 10.

[0097] The horizontal and vertical positioning graphics serve to determine the density and version of the symbols, which is the same as in the prior art and will not be repeated here; at the same time, they also provide a reference position for determining the module coordinates, which can be used for auxiliary positioning.

[0098] Please combine them together Figure 11The principle of clock positioning pattern 20 for assisted positioning is as follows: the center point C located by the center image-finding positioning pattern block 10 is used to locate the position of the crosshair positioning line. The pattern at the position of the crosshair positioning line is read, and it is determined whether it is a pattern formed by alternating patterns of first brightness and second brightness with a size of N1×N1. If the recognition is successful, the QR code positioning is considered successful. If the recognition is unsuccessful, the center point can be corrected by recognizing the actual crosshair positioning line. Specifically, a pattern formed by alternating patterns of first brightness and second brightness with a size of N1×N1 extending in a single direction can be found within a preset range around the position of the crosshair positioning line, and a new crosshair positioning line can be fitted to form it. The center intersection of the crosshair positioning lines is fitted using the new crosshair positioning line as the new center point.

[0099] Specifically, please refer to Figure 10 If the center point C is not deviated, the clock line is a black and white dot value that is certain. Therefore, the center point located by the center image positioning graphic block 10, and the position of the crosshair positioning line is the black and white dot.

[0100] If the positioning point is off, the center point is re-established based on the clock line. Since the clock line consists of alternating black and white points with fixed values, the extreme points of the image are found around the original clock line: for example, the coordinates of the darkest point near the black points and the coordinates of the brightest point with the highest grayscale near the white points. Then, based on the new and old coordinates, a new clock line is fitted using the least squares method, along with the intersection point (i.e., the center point) and angle (i.e., the angle between the clock line and the Cartesian coordinate system). The two clock lines correspond to alternating black and white points on the X and Y axes, respectively. Therefore, during the calculation, only the X-coordinate fitting equation is used for the clock line on the X-axis, and only the Y-coordinate fitting equation is used for the clock line on the Y-axis. The details are as follows:

[0101] 1) Based on the original clock line positioning, calculate the coordinates of each point on the clock line on the X-axis and Y-axis respectively;

[0102] 2) Find the extreme point P1 within a module distance around each point's coordinates. For bright spots on the clock line, find the coordinates of the brightest point. For dark spots on the clock line, find the coordinates of the darkest point nearby.

[0103] 3) Fit straight lines to the new points on the clock line using the least squares method, and remove points with large deviations based on the distance to obtain the point set P2 with smaller errors;

[0104] 4) Define four unknowns: center point coordinates (x, y), slope k, and module point distance d. Calculate the parameter coordinates P3 of each point on the clock line.

[0105] 5) For each point coordinate P2 and parameter coordinate point P3 found, the least squares method is used to fit the data based on the minimum distance between P2 and P3. Finally, the four unknowns in 4) are calculated, where (x,y) is the new coordinate center point, k is the tilt angle of the clock line (i.e., the tilt angle of the QR code), and d is the average point distance of the module.

[0106] exist Figure 11 (a) and Figure 11 In (b), the clock lines are arranged adjacent to each other in a regular black-and-white sequence on the central green line.

[0107] In this embodiment, the QR code 100 further includes at least one header information graphic block 40, which is located above, below, or simultaneously above and below the central image positioning graphic block 10.

[0108] The header information graphic block includes version information, error correction level, and code size level information.

[0109] Preferably, the data graphic area of ​​the QR code is processed by XOR operation through a mask graphic.

[0110] Please combine them together Figures 3-13 This embodiment also provides a QR code positioning method as described above, including steps S1-S5.

[0111] S1. Acquire the captured image S. After downscaling and converting the captured image to grayscale, obtain a binary image B. Reduce the length of image S by 5 to 20 times and convert it to grayscale image M (downscaling can speed up the pattern search and location time by tens or hundreds of times). Select the median value between the maximum and minimum reflectance of the image to determine the threshold. Use the threshold to convert the image into a series of dark and light pixels to obtain the binary image B.

[0112] S2, by finding the point with the highest first brightness in image B, the position P of the center image-finding and positioning graphic block is initially determined.

[0113] S3, crop the image D of the corresponding position P in the image S, which is a region of a preset size.

[0114] In steps S1-S3, please combine them together Figure 8 and Figure 9 It is a combination of multiple QR codes, formed by stitching together 100 of each other, which can be accessed through... Figure 8 and Figure 9As can be seen intuitively, the white dots on the image are very obvious when the image is being recognized, and can be quickly located and identified even with the naked eye. By quickly scanning the image, the white dots on the image can be located, thereby locating the approximate position P of the center image-finding positioning graphic block 10. Then, the image near position P is magnified to perform fine recognition of the other modules of the center image-finding positioning graphic block 10.

[0115] S4, identify the central rectangular border module, or the central rectangular border module and the central module in the image D, and locate the center point C.

[0116] Preferably, step S4 includes locating the central rectangular border module in the image D, and then locating the central module within the image area of ​​the central rectangular border module to determine the center point C. Alternatively, the center point can be coarsely located directly from the central rectangular border module, followed by precise location of the central module in the center to determine the center point C. In specific implementations, the final precise location of the center module can serve as a verification of the coarsely determined center point or as a supplement to the precise location.

[0117] Please combine them together Figure 9 The specific image-finding principle of the center image-finding positioning graphic block 10 is as follows: after the captured image is reduced and grayscale value is converted, the point with the highest first brightness (white) is found in the image and initially determined as the position P of the center image-finding positioning graphic block; the corresponding area image D of the image at position P is extracted; the center rectangular border module 12 and the center module 11 in the image D are identified to locate the center point C.

[0118] like Figure 9 In the recognition method, the center image-finding and positioning graphic block 10 is selected in image D, and the center position of the black block (center rectangular border module 12) is found by using distance transformation. The accuracy is much higher than that of contour positioning, and the anti-interference ability is stronger (but the amount of calculation is larger). The center white point (center module 11) can be used for center point correction or for precise positioning.

[0119] The size Z of the center image-finding graphic block 10 can be calculated based on the outline of the white block when performing fine recognition of the region image D.

[0120] S5, identify the rectangular corner module and the rectangular outer border module in the image D to identify the entire center image-finding positioning graphic block and calculate the tilt angle A and size Z of the center image-finding positioning graphic block, thereby locating the QR code.

[0121] Preferably, step S5 includes,

[0122] The rectangular corner module in the image D is located, and the tilt angle A of the center image positioning graphic block is calculated based on the orientation between the rectangular corner module and the center point C.

[0123] The rectangular outer border module in the image D is identified to identify the center image-finding graphic block and the size Z of the center image-finding graphic block is calculated.

[0124] Based on the tilt angle A and the orientation of the diagonal of the center image-finding positioning graphic block and the rectangular corner module, the rotation direction and mirror direction of the QR code are obtained, thereby locating the QR code.

[0125] Please combine again Figures 4-6 as well as Figure 10 The functional graphic also includes correction graphics 30 located at at least three corners of the QR code 100.

[0126] In this embodiment, there are four correction graphics, located at the four corners of the QR code 100.

[0127] The correction pattern 30 includes a first correction block located at the inner corner of the QR code, consisting of a second brightness pattern of size N1×N1; a second correction block consisting of a first brightness pattern of size N1×N1 that surrounds the first correction block together with the outer edge of the QR code; and a third correction block consisting of a second brightness pattern of size N1×N1 that surrounds the second correction block together with the outer edge of the QR code.

[0128] Please combine them together Figure 10 The boundary recognition method for QR codes is divided into two modes: single code and multiple code.

[0129] If it is a tiled QR code pattern, such as Figure 10 (a) Connect adjacent center points; the perpendicular line from the center of the connecting line is the boundary of the QR code. The intersection of the perpendicular lines (red cross) can be used to initially locate the four corners of the QR code; for example... Figure 10 (b) Then find the accurate four corner positioning blocks (green cross points) near the intersection (red cross) (correction figure 30);

[0130] If it is a single, independent QR code, the boundaries of the QR code are determined by reading the header information of the QR code to obtain the size information R of the QR code. Based on the tilt angle A and the size information R, the boundaries and four corners of the QR code are roughly located. Then, the accurate four-corner positioning blocks (correction figure 30) are found near the positions of the four corners that were roughly located.

[0131] In addition, the four corner positioning blocks (correction graphics 30) can also be used to recalculate the center point to verify or correct the center point C identified and located by the center rectangular border module 12 and the center module 11.

[0132] Please combine them together Figure 11 and Figure 12 The recognition of the tilt angle A of the center image-finding and positioning graphic block 10 is divided into two methods: single code and multi-code.

[0133] If it is a tiled QR code pattern, such as Figure 11 (a) Connect the adjacent center points, and the angle of the connecting line segment is the tilt angle A of the QR code;

[0134] If it is a single, independent QR code, such as Figure 12 The rotation and mirror direction of the QR code are determined by the diagonal of the center image-finding graphic block 10 and the orientation of the rectangular corner module 14, thereby locating the QR code. Specifically, the rotation angles of the center image-finding graphic block 10 are determined by the orientation of the rectangular corner module 14, which are 90°, 180°, and 270°. The rectangular corner module 14 is divided into left and right parts by the diagonal of the center image-finding graphic block 10. Since a≠b, the left and right parts are different sizes after the diagonal is cut, so it is possible to identify whether the image is mirrored and thus determine whether mirroring is required.

[0135] Preferably, the functional graphic further includes correction graphics located at at least three corners of the QR code; the method further includes step S9:

[0136] S90, obtain the size information R of the QR code, and locate the boundary of the QR code according to the center point C, the tilt angle A and the size information R;

[0137] S91, based on the boundary, locate and identify the correction pattern within a preset range of the boundary;

[0138] S92, the center point C is corrected according to the correction pattern.

[0139] Preferably, when the QR code is a single code, step S90 includes: reading the header information of the QR code, obtaining the size information R of the QR code, and locating the boundary of the QR code according to the tilt angle A and the size information R;

[0140] When the QR code is designed as a multi-code tiled design, step S90 includes: connecting adjacent center points C, and the center perpendicular line of the connecting line is the boundary of the QR code.

[0141] Preferably, step S92 includes: recalculating the center point C' of the QR code based on the correction pattern; if the center point C' is consistent with the center point C, the positioning is considered successful; if the center point C' is inconsistent with the center point C, the center point C' is used as the new center point C, and the process returns to step S5.

[0142] Preferably, the functional graphic further includes a clock positioning graphic block; the clock positioning graphic block is a crosshair positioning line, and the center of the clock positioning graphic block coincides with the center of the center lookout positioning graphic block; the clock positioning graphic block includes horizontal positioning graphics and vertical positioning graphics extending from the four sides of the center lookout positioning graphic block respectively; the horizontal positioning graphics are located at the horizontal center of the QR code, and the vertical positioning graphics are located at the vertical center of the QR code, and both the horizontal and vertical positioning graphics are formed by alternating graphics of size N1×N1 with first brightness and second brightness; the method further includes step S10:

[0143] S101, based on the center point C and the center image positioning graphic block, locate the position of the crosshair positioning line, read the graphic of the crosshair positioning line, and determine whether it is a graphic formed by alternating graphics of the first brightness and the second brightness with a size of N1×N1. If the recognition is successful, it is determined that the QR code positioning is successful; if the recognition is unsuccessful, proceed to step S102.

[0144] S102, within a preset range around the position of the crosshair positioning line, find a pattern formed by alternating patterns of first brightness and second brightness that extend in a single direction and have a size of N1×N1, and fit them to form a new crosshair positioning line.

[0145] S103, using the new crosshair positioning line, fit the center intersection of the crosshair positioning line as the new center point C, and return to step S5.

[0146] Please combine them together Figure 11The principle of clock positioning pattern 20 for assisted positioning is as follows: the center point located by the center image-finding positioning pattern block 10 is used to locate the position of the crosshair positioning line. The pattern at the position of the crosshair positioning line is read, and it is determined whether it is a pattern formed by alternating patterns of first brightness and second brightness with a size of N1×N1. If the recognition is successful, the QR code positioning is considered successful. If the recognition is unsuccessful, the center point can be corrected by recognizing the actual crosshair positioning line. Specifically, a pattern formed by alternating patterns of first brightness and second brightness with a size of N1×N1 extending in a single direction can be found within a preset range around the position of the crosshair positioning line, and a new crosshair positioning line can be fitted to form it. The center intersection of the crosshair positioning lines is fitted to the new crosshair positioning line and used as the new center point.

[0147] Specifically, please refer to Figure 10 If the center point is not deviated, the clock line is a black and white dot value that is certain. Therefore, the center point located by the center image positioning graphic block 10, and the position of the crosshair positioning line is the black and white dot.

[0148] If the positioning point is off, the center point is re-established based on the clock line. Since the clock line consists of alternating black and white points with fixed values, the extreme points of the image are found around the original clock line: for example, the coordinates of the darkest point near the black points and the coordinates of the brightest point with the highest grayscale near the white points. Then, based on the new and old coordinates, a new clock line is fitted using the least squares method, along with the intersection point (i.e., the center point) and angle (i.e., the angle between the clock line and the Cartesian coordinate system). The two clock lines correspond to alternating black and white points on the X and Y axes, respectively. Therefore, during the calculation, only the X-coordinate fitting equation is used for the clock line on the X-axis, and only the Y-coordinate fitting equation is used for the clock line on the Y-axis. The details are as follows:

[0149] 1) Based on the original clock line positioning, calculate the coordinates of each point on the clock line on the X-axis and Y-axis respectively;

[0150] 2) Find the extreme point P1 within a module distance around each point's coordinates. For bright spots on the clock line, find the coordinates of the brightest point. For dark spots on the clock line, find the coordinates of the darkest point nearby.

[0151] 3) Fit straight lines to the new points on the clock line using the least squares method, and remove points with large deviations based on the distance to obtain the point set P2 with smaller errors;

[0152] 4) Define four unknowns: center point coordinates (x, y), slope k, and module point distance d. Calculate the parameter coordinates P3 of each point on the clock line.

[0153] 5) For each point coordinate P2 and parameter coordinate point P3 found, the least squares method is used to fit the data based on the minimum distance between P2 and P3. Finally, the four unknowns in 4) are calculated, where (x,y) is the new coordinate center point, k is the tilt angle of the clock line (i.e., the tilt angle of the QR code), and d is the average point distance of the module.

[0154] exist Figure 10 (a) and Figure 10 In (b), the clock lines are arranged adjacent to each other in a regular black-and-white sequence on the central green line.

[0155] Compared to traditional triangular positioning, the QR code and its positioning method in this embodiment can reduce the space occupied by the positioning pattern by more than 80%, freeing up the code surface for data storage.

[0156] In the design of multiple QR codes 100-fold tiling, after step S2, by finding the point with the highest first brightness in image B, the set Ps of the position P of the center image-finding graphic block and the set Rs of the QR code size are initially determined; then, the minimum distance between each pair of points in set Ps is identified, and erroneous positions P can be filtered out based on the average distance; simultaneously, a linear coordinate system is constructed based on the lines connecting the points in set Ps, and the intersection of the lines can be used as the corrected position P, and then step S3 is introduced. For the multi-QR code tiling design for data storage, the positioning effect of the center image-finding graphic block in this embodiment is better. With the multi-QR code tiling design, the larger the data volume, the more surrounding positioning points can be used to fill in the missing positioning points, so the larger the data, the higher the space utilization and the higher the recognition rate.

[0157] Figure 14 This is a schematic diagram of the hardware structure for a QR code positioning method provided in an embodiment of the present invention. Figure 14 As shown, this embodiment / computer 6 includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a program for running a QR code positioning method. When the processor 60 executes the computer program 62, it implements the steps in the various method embodiments described above. Alternatively, when the processor 60 executes the computer program 62, it implements the functions of each module / unit in the various device embodiments described above.

[0158] For example, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 62 in the computer 6.

[0159] The computer 6 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The computer 6 may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will understand that... Figure 10 This is merely an example of computer 6 and does not constitute a limitation on computer 6. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer 6 may also include input / output devices, network access devices, buses, etc.

[0160] The processor 60 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0161] The memory 61 can be an internal storage unit of the computer 6, such as a hard drive or memory. The memory 61 can also be an external storage device of the computer 6, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card (FC) equipped on the computer 6. Furthermore, the memory 61 can include both internal and external storage units of the computer 6. The memory 61 is used to store the computer program 62 and other programs and data required by the computer 6. The memory 61 can also be used to temporarily store data that has been output or will be output.

[0162] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0163] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0164] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0165] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0166] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0167] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0168] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0169] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for locating a QR code, characterized in that, The QR code has a symbol size of M×M and is composed of two graphics with different brightness. The QR code includes a functional graphic and a data graphic. The functional graphic includes a center finder graphic block with a size of N×N, and the data graphic includes data blocks surrounding the center finder graphic block. Wherein, N=8×n1+1, M=N+8×n2, n1 is a positive integer, and n2 is a positive integer greater than or equal to 2. The center image-finding and positioning graphic block includes: A central module consisting of graphics of size N1×N1 and first brightness, the center of which coincides with the center of the QR code. A central rectangular border module of size 3N1×3N1, composed of graphics of second brightness with size N1×N1, is concentrically arranged around the central module. A rectangular outer frame module of size N×N, composed of N1×N1 second-brightness graphics, is concentrically arranged around the central module. A rectangular corner module, consisting of a second-brightness graphic of size aN1×bN1, is positioned at one of the inner corners of the rectangular outer frame module. The remaining portion surrounded by the rectangular outer frame module is composed of large squares of first brightness filled with graphics of size N1×N1 of first brightness. Where N1+aN1+N1≤(N-1) / 2, N1+bN1+N1≤N / 2, a and b are integers greater than or equal to 1, and a≠b; The method includes the following steps: S1, acquire the captured image S, and after downscaling and converting the captured image to grayscale, obtain the binary image B; S2, by finding the point with the highest first brightness in image B, the position P of the center image-finding positioning graphic block is initially determined; S3, crop the image D of the corresponding position P in the image S, which is a region of a preset size; S4, identify the central rectangular border module, or the central rectangular border module and the central module in the image D, and locate the center point C; S5, identify the rectangular corner module and the rectangular outer border module in the image D to identify the entire center image-finding positioning graphic block and calculate the tilt angle A and size Z of the center image-finding positioning graphic block, thereby locating the QR code.

2. The QR code positioning method according to claim 1, characterized in that, Step S4 includes locating the central rectangular border module in the image D, and then locating the central module in the image area of ​​the central rectangular border module to locate the center point C.

3. The QR code positioning method according to claim 1, characterized in that, Step S5 includes, The rectangular corner module in the image D is located, and the tilt angle A of the center image positioning graphic block is calculated based on the orientation between the rectangular corner module and the center point C. The rectangular outer border module in the image D is identified to identify the center image-finding graphic block and the size Z of the center image-finding graphic block is calculated. Based on the tilt angle A and the orientation of the diagonal of the center image-finding positioning graphic block and the rectangular corner module, the rotation direction and mirror direction of the QR code are obtained, thereby locating the QR code.

4. The method for locating a QR code according to any one of claims 1-3, characterized in that, The functional graphic also includes correction graphics located at at least three corners of the QR code; the method further includes step S9: S90, obtain the size information R of the QR code, and locate the boundary of the QR code according to the tilt angle A and the size information R; S91, based on the boundary, locate and identify the correction pattern within a preset range of the boundary; S92, the center point C is corrected according to the correction pattern.

5. The QR code positioning method according to claim 4, characterized in that, When the QR code is a single code, step S90 includes: reading the header information of the QR code, obtaining the size information R of the QR code, and locating the boundary of the QR code according to the center point C, the tilt angle A and the size information R; When the QR code is designed as a multi-code tiled design, step S90 includes: connecting adjacent center points C, and the center perpendicular line of the connecting line is the boundary of the QR code.

6. The QR code positioning method according to claim 4, characterized in that, Step S92 includes: recalculating the center point C' of the QR code based on the correction pattern; if the center point C' is consistent with the center point C, the positioning is considered successful; if the center point C' is inconsistent with the center point C, the center point C' is used as the new center point C, and the process returns to step S5.

7. The method for locating a QR code according to any one of claims 1-3, characterized in that, The functional graphic also includes a clock positioning graphic block; the clock positioning graphic block is a crosshair positioning line, and the center of the clock positioning graphic block coincides with the center of the center lookout positioning graphic block; the clock positioning graphic block includes horizontal and vertical positioning graphics extending from the four sides of the center lookout positioning graphic block; the horizontal positioning graphic is located at the horizontal center of the QR code, and the vertical positioning graphic is located at the vertical center of the QR code; both the horizontal and vertical positioning graphics are formed by alternating graphics of size N1×N1 with first brightness and second brightness; the method further includes step S10: S101, based on the center point C and the center image positioning graphic block, locate the position of the crosshair positioning line, read the graphic of the crosshair positioning line, and determine whether it is a graphic formed by alternating graphics of the first brightness and the second brightness with a size of N1×N1. If the recognition is successful, it is determined that the QR code positioning is successful; if the recognition is unsuccessful, proceed to step S102. S102, within a preset range around the position of the crosshair positioning line, find a pattern formed by alternating patterns of first brightness and second brightness that extend in a single direction and have a size of N1×N1, and fit them to form a new crosshair positioning line. S103, using the new crosshair positioning line, fit the center intersection of the crosshair positioning line as the new center point C, and return to step S5.

8. A QR code positioning system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the QR code positioning method as described in any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the QR code positioning method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Micro-QR (Quick Response) code recognition method based on picture processing

    CN103294980A

  • A QR code positioning and correction algorithm of missing an image seeking pattern

    CN109325381A