WO2017036265A1 - Qr 码位置探测图形破损时的解码方法及系统 - Google Patents

Qr 码位置探测图形破损时的解码方法及系统 Download PDF

Info

Publication number
WO2017036265A1
WO2017036265A1 PCT/CN2016/091971 CN2016091971W WO2017036265A1 WO 2017036265 A1 WO2017036265 A1 WO 2017036265A1 CN 2016091971 W CN2016091971 W CN 2016091971W WO 2017036265 A1 WO2017036265 A1 WO 2017036265A1
Authority
WO
WIPO (PCT)
Prior art keywords
patterns
pattern
position detection
positioning
dimensional code
Prior art date
Application number
PCT/CN2016/091971
Other languages
English (en)
French (fr)
Inventor
蒋声障
吴卫东
Original Assignee
福建联迪商用设备有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 福建联迪商用设备有限公司 filed Critical 福建联迪商用设备有限公司
Priority to EP16840694.0A priority Critical patent/EP3330885B1/en
Priority to BR112018003692-7A priority patent/BR112018003692B1/pt
Publication of WO2017036265A1 publication Critical patent/WO2017036265A1/zh
Priority to US15/895,199 priority patent/US10438038B2/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1456Methods for optical code recognition including a method step for retrieval of the optical code determining the orientation of the optical code with respect to the reader and correcting therefore

Definitions

  • the present invention relates to the field of two-dimensional code technology, and in particular, to a decoding method and system for QR code position detection pattern damage.
  • QR codes are more and more widely used, and due to environmental influences, QR code images may be damaged. Since the QR code itself contains the functional area and the coding area, with some features of the functional area, the QR code image information is still recoverable and recognizable after the QR code is damaged to a certain extent.
  • the functional area of the QR code includes a position detection pattern (1), a position detection pattern separator (2), a positioning pattern (3), a correction pattern (4), and an encoding area including a format information graphic (5), version Information graphics (6), data information graphics (7).
  • the positioning of the QR code is usually achieved by recognizing the three position detection patterns, but if the position detection pattern is broken, the QR code cannot be located in a conventional manner.
  • the Chinese invention patent No. CN104463059A discloses a reconstruction method for detecting a damaged pattern in a QR code recognition. According to the other two detection patterns and the positioning pattern of the lower right corner of the standard QR code pattern, The three detection patterns are reconstructed and reconstructed, and three sets of squares are reconstructed in the process of reconstruction. However, only one set of squares is relatively consistent with the actual figure, so the method has certain redundancy.
  • the positioning graphic in the lower right corner of the application file is actually a correction graphic, and the number of the same graphic image in the lower right corner is more than one in the QR code image, so the process is complicated and reconstructed by this method. The efficiency is relatively low.
  • the technical problem to be solved by the present invention is to provide a decoding method and system for a QR code position detection pattern damage ⁇ with high efficiency and small error.
  • a decoding method for QR code position detection pattern damage [0006] A decoding method for QR code position detection pattern damage , [0007] performing binarization on the received image including the two-dimensional code pattern, and searching for a position detection pattern;
  • the beneficial effects of the present invention are: determining the positional relationship between the two position detection patterns found by using the geometric relationship between the boundary lines and the vertices of the two position detection patterns, and determining the two-dimensional shape by combining the function graphics of the positioning patterns.
  • the area where the code pattern is located and the rotation angle of the two-dimensional code pattern, the area where the damaged position detection pattern is located can also be directly inferred.
  • the method of identifying the QR code is relatively straightforward and efficient; according to the black and white boundary line and the position detection pattern on the positioning pattern The two-dimensional code pattern is meshed, and the error of decoding the QR code is small.
  • a decoding system for QR code position detection pattern damage comprising: a binarization module, a first search module, a statistics module, a judgment module, a second search module, a determination module, a mesh division module, Decoding module,
  • a binarization module that binarizes the received image including the two-dimensional code pattern
  • a first searching module configured to search for a position detection pattern in an image that receives the included two-dimensional code graphic
  • a statistical module configured to calculate an equation of a line where the boundary lines of the two position detection patterns are located, a vertex coordinate, and calculate a data bit width of the two-dimensional code pattern
  • a judging module configured to determine, by using a geometric relationship between a boundary line and a vertex of the two position detecting patterns, whether the positional relationship between the two position detecting patterns is an adjacent relationship or a diagonal relationship;
  • the second searching module is configured to find a positioning pattern between the two position detecting patterns that determine the positional relationship according to the positional relationship of the two position detecting patterns, the positional features of the positioning patterns, and the black and white graphic features;
  • a determining module configured to determine an area where the two-dimensional code graphic is located according to the two position detecting patterns and the positioning graphic
  • a mesh dividing module configured to detect the graphic, the positioning graphic, and the two-dimensional code graphic according to the two positions The data bit width is meshed to the area where the two-dimensional code graphic is located
  • a decoding module configured to decode the meshed two-dimensional code pattern.
  • the beneficial effects of the present invention are: finding a position detection pattern in the received image containing the two-dimensional code pattern by the binary module and the first finding module, and the two position detection patterns pass the statistics module, the judgment module, The second searching module and the determining module determine the region where the two-dimensional code graphic is located, and divide and decode the region where the two-dimensional code graphic is located by using the mesh dividing module and the decoding module.
  • the system structure is reasonable, and the decoding has a position detecting graphic.
  • the damaged two-dimensional code pattern has high efficiency and small error.
  • 1 is a schematic structural diagram of a QR code functional area and a coding area
  • FIG. 2 is a flowchart of a method for decoding a QR code position detection pattern damage according to Embodiments 1 and 2 of the present invention
  • FIG. 3 is a second position detection pattern of a QR code according to Embodiments 1 and 2 of the present invention. Schematic diagram of the vertices and boundary lines of Q1;
  • FIG. 4 is a schematic diagram showing the structure of the vertices and boundary lines of the two position detecting patterns Q2 of the QR code according to the first and second embodiments of the present invention
  • FIG. 5 is a schematic structural diagram of a suspected positioning pattern area in which the positional relationship between two position detecting patterns is an adjacent relationship according to the first embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a positional relationship of two position detecting patterns in which the two-dimensional code pattern of the adjacent relationship ⁇ is divided along the first direction according to the first embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of a positional relationship of two position detection patterns in which the two-dimensional code patterns of the adjacent relationship ⁇ are divided along the first direction and then divided in the second direction according to the first embodiment of the present invention
  • 8 is a schematic structural diagram of a suspected positioning pattern area in which a positional relationship between two position detecting patterns is a diagonal relationship ⁇ according to a second embodiment of the present invention
  • FIG. 9 is a schematic structural diagram of a two-dimensional code pattern in which a positional relationship between two position detecting patterns is a diagonal relationship ⁇ according to a second embodiment of the present invention.
  • FIG. 10 is a system block diagram of a decoding system for QR code position detection pattern damage according to Embodiment 3 of the present invention.
  • format information graphics 6, version information graphics; 7, data information graphics;
  • Binarization module 12. First seeking module; 13. Statistics module; 14. Judging module;
  • Second finding module 16, determining module; 17, meshing module; 18, decoding module;
  • the most critical idea of the present invention is: according to the positioning pattern located between the position detection patterns, occupying a width of a data bit width, and having black and white phase, continuous black dots and continuous white points occupy a data bit width
  • the two-dimensional code pattern has high recognition efficiency and small error.
  • a specific embodiment of the invention is:
  • the method further includes:
  • the received image including the two-dimensional code pattern is not decoded by the above method.
  • the width of the side length of the position detecting pattern can be calculated according to the equation of the straight line where the boundary line of the two position detecting patterns is located, and the vertex coordinates;
  • the quotient obtained by dividing the width of the side length of the position detecting pattern by 7 is the data bit width of the two-dimensional code pattern.
  • the data bit width of the two-dimensional code pattern is calculated according to the feature that the side length of the position detection pattern includes seven data bit widths, and the side length of the position detection pattern passes through the line equation of the boundary line of the position detection pattern.
  • the fixed point coordinates can be directly calculated using the geometric relationship, and the method is reasonable.
  • the geometric relationship between the boundary line and the vertices of the two position detecting patterns is used to determine whether the positional relationship between the two position detecting patterns is an adjacent relationship or a diagonal relationship, specifically:
  • intersection of two straight lines on the first pair of boundary lines and the intersection of two straight lines on the second pair of boundary lines have the same vertex positions on the position detection pattern, and the first pair of boundary lines correspond to two
  • the straight lines are perpendicular to each other, and the two straight lines corresponding to the second pair of boundary lines are also perpendicular to each other, and the two slopes of the two straight lines corresponding to the first pair of boundary lines are the same as the two slopes of the two straight lines corresponding to the second pair of boundary lines.
  • the positional relationship of the two position detection patterns is an adjacent relationship, the two intersection points of the first pair of boundary lines and the second pair of boundary lines are respectively
  • the distance between the two intersection points and the first vertex or the second vertex is calculated, and as long as one of the two distance values is smaller than the point distance threshold, the two positions can be determined.
  • the positional relationship of the detection pattern is an adjacent relationship. In an ideal state, one of the two distance values is equal to 0. In order to eliminate the boundary line, the value of the vertex and the error generated by the calculation process, the setting is set.
  • the threshold value if the positional relationship of the two position detection patterns is relative, the distance between the two intersection points to any one of the vertices is greater than the width of the position detection pattern, so the maximum value of the point distance threshold can be set to the position
  • the width value of the pattern is detected, the method is reasonable and the calculation is simple, and the efficiency and accuracy of identifying the QR code are improved.
  • the geometric relationship between the boundary line and the vertex of the two position detection patterns is used to determine whether the positional relationship between the two position detection patterns is an adjacent relationship or a diagonal relationship, specifically:
  • [0071] preset a straight line distance threshold, and respectively calculate a distance between two boundary lines parallel to each other among the four boundary lines of the other position detecting pattern to a boundary line parallel to the two boundary lines in the first pair of boundary lines, Get four distance values;
  • one of the four distance values is equal to 0.
  • the linear distance threshold is set;
  • the positional relationship of the detection pattern is a relative relationship, and the four distance values are greater than the width of the position detection pattern, so the maximum value of the line distance threshold can be set to the width value of the position detection pattern, and the method is reasonable and simple to calculate. Improve the efficiency and accuracy of identifying QR codes.
  • the positioning pattern between the two position detecting patterns that determine the positional relationship is found according to the positional features of the positioning pattern and the black and white graphic features. , Specifically:
  • the positional relationship of the two position detecting patterns is an adjacent relationship
  • [0078] preset a numerical similarity threshold, and select, in the ratio of the two suspected positioning patterns, a proportion of the suspected positioning figure that satisfies the condition that the difference between the two values is less than the numerical similarity threshold condition as the positioning graphic area;
  • the graphic corresponding to the positioning graphic area is a positioning graphic.
  • the area between the two position detecting patterns has a positioning pattern, and the positioning pattern is between the two positions detecting patterns.
  • the length is equal to the distance between the two position detection patterns relative to the boundary line
  • the width is equal to one data bit width of the two-dimensional code pattern
  • the number of consecutive black points on the positioning pattern is similar to the number of consecutive white points
  • the continuous black point and the continuous white point occupy a data bit width
  • the two suspected positioning patterns are located between the two position detecting patterns, and coincide with one of the two position detecting pattern edges by one data bit width; Judging whether it is a positioning graphic in a suspected positioning graphic, only need to judge continuous black dots and continuous white Whether the difference between the number of points is within a preset numerical similarity threshold, the method data is relatively straightforward, and the efficiency of identifying the positioning pattern is high and the error is small.
  • the received two-dimensional code images are meshed according to the data bit widths of the two position detection patterns, the positioning patterns, and the two-dimensional code patterns. , Specifically:
  • the positional relationship of the two position detecting patterns is an adjacent relationship
  • a direction perpendicular to a longitudinal direction of the positioning pattern area is a first direction, and a direction parallel to a length direction of the positioning pattern area is a second direction;
  • the first direction of the area where the positioning pattern is located is divided according to the boundary line of the black and white pixel points in the positioning pattern, and the area where the position detecting pattern is located is divided according to the data bit width, and two position detecting patterns are known.
  • the two-dimensional code pattern can be inferred on the side of the positioning pattern sought, and the width of the two-dimensional code pattern in the first direction is in the second
  • the width in the direction is the same, that is, the square area
  • the width of the two-dimensional code pattern in the second direction is the distance between the outermost relative boundary lines of the two position detection patterns, and the distance can be obtained, and the two-dimensional code pattern is obtained.
  • the width in the first direction can be obtained, and the first direction of the two-dimensional code pattern is divided according to the data bit width. The method can accurately divide the two-dimensional code pattern, and the decoding error is small.
  • the positioning pattern between the two position detecting patterns that determine the positional relationship is found according to the positional features of the positioning pattern and the black and white graphic features. , Specifically:
  • the positional relationship of the two position detecting patterns is a diagonal relationship
  • [0093] preset a numerical similarity threshold, and select, in the ratio of the four suspected positioning patterns, a ratio of two suspected positioning patterns satisfying the difference between the two values and the numerical similarity threshold and the mutually perpendicular condition as two Positioning the graphics area;
  • the graphic corresponding to the two positioning graphic regions is a positioning graphic.
  • the positional relationship of the two position detecting patterns is a diagonal relationship
  • the two positioning patterns found have the characteristics of being perpendicular to each other. If the two positioning patterns found are not perpendicular to each other, the search for the positioning pattern fails, and the two-dimensional code pattern is not performed. Decoding; the number of consecutive black points on the positioning pattern is similar to the number of consecutive white points, and the continuous black point and the continuous white point occupy a data bit width, and determine whether the positioning is in the four suspect positioning patterns.
  • the figure only needs to judge whether the difference between the continuous black point and the number of consecutive white points is within a preset numerical similarity threshold, and the method data is relatively straightforward;
  • the two positioning graphic areas are mutually Vertical means that the length direction or the width direction is perpendicular to each other, and the corner where two mutually perpendicular positioning patterns intersect is the broken position.
  • the area where the pattern is detected is detected, and the method for identifying the positioning pattern in the two positioning pattern areas is high in efficiency and small in error.
  • the received two-dimensional code images are meshed according to the data bit widths of the two position detecting patterns, the positioning patterns, and the two-dimensional code patterns. , Specifically:
  • the positional relationship of the two position detecting patterns is a diagonal relationship
  • the area where the two-dimensional code pattern is located is a square area, and each of the positioning pattern areas is divided perpendicularly to the length direction of the positioning pattern according to the boundary line of the black and white pixel points in the positioning pattern, and then the data is widened according to the data.
  • the two position detection patterns are divided, and the mesh division of the two-dimensional code graphics can be completed.
  • the meshing method is accurate and effectively ensures the correct decoding of the two-dimensional code graphic.
  • the first embodiment of the present invention is:
  • the width of the side length of the position detecting pattern can be calculated according to the equation of the straight line where the boundary line of the two position detecting patterns is located, and the vertex coordinates;
  • the quotient obtained by dividing the width of the side length of the position detecting pattern by 7 is the data bit width W of the two-dimensional code pattern
  • the geometric relationship between the boundary line and the vertices of the two position detecting patterns is used to determine whether the positional relationship between the two position detecting patterns is an adjacent relationship or a diagonal relationship, specifically:
  • the two position detection patterns are respectively labeled as Q1 and Q2, and the vertices of the two position detection patterns Q1 and Q2 are separated into I1 as Ql.l, Q1.2, Q1.3, Q1.4 and Q2.1, Q2.2, Q2.3, Q2.4, the four boundary lines of the two position detection patterns Ql and Q2 are Ql.l, Ql.u, Ql.r, Ql.d and Q2.1,
  • the preset point distance threshold is W, and the distance between the two intersection points and the first vertex or the second vertex is calculated to obtain two distance values; in fact, the point distance threshold may be set to be greater than or equal to 0, and less than or equal to Any value within the range of values of W;
  • the positional relationship between the two position detection patterns is an adjacent relationship
  • the positional relationship between the two position detection patterns, the positional features of the positioning patterns, and the black and white graphic features are used to find a positional relationship.
  • the positioning pattern between the two position detection patterns is specifically as follows:
  • [0120] preset a numerical similarity threshold, and select, in the ratio of the two suspected positioning patterns, a proportion of the suspected positioning figure that satisfies the condition that the difference between the two values is less than the numerical similarity threshold condition as the positioning graphic area;
  • the graphic corresponding to the positioning graphic area is a positioning graphic
  • the area of the two-dimensional code patterns is meshed, specifically:
  • a direction perpendicular to a length direction of the positioning pattern area is a first direction, and a direction parallel to a length direction of the positioning pattern area is a second direction;
  • the first direction of the positioning pattern area is divided according to the boundary line of the black and white pixel points in the positioning pattern
  • the second bit direction of the area where the two-dimensional code pattern is located is divided according to the data bit width
  • FIG. 1 to FIG. 4, FIG. 8, and FIG. 9, the second embodiment of the present invention is:
  • the positional relationship between the two position detecting patterns is a diagonal relationship
  • two position detecting patterns for determining the positional relationship are found according to the positional relationship of the two position detecting patterns, the positional features of the positioning patterns, and the black and white graphic features.
  • the positioning pattern between them is as follows:
  • [0136] preset a numerical similarity threshold, and select, in the ratio of the four suspected positioning patterns, a ratio of two suspected positioning patterns satisfying any two numerical values that are smaller than the numerical similarity threshold and mutually perpendicular conditions as two Positioning the graphics area;
  • the graphic corresponding to the two positioning graphic regions is a positioning graphic
  • the data width of the two-dimensional code pattern is meshed according to the data width of the two position detection patterns, the positioning pattern, and the two-dimensional code pattern, specifically:
  • a decoding system for QR code position detection pattern damage includes a binarization module 11, a first search module 12, a statistics module 13, a determination module 14, a second search module 15, and a determination module. 16 , the meshing module 17, the decoding module 18,
  • the binarization module 11 binarizes the received image including the two-dimensional code pattern
  • the first searching module 12 is configured to search for a position detection graphic in the received image that includes the two-dimensional code graphic.
  • the statistics module 13 is configured to calculate an equation of a line where the boundary lines of the two position detection patterns are located, a vertex coordinate, and calculate a data bit width of the two-dimensional code pattern;
  • the determining module 14 is configured to determine, by using a geometric relationship between a boundary line and a vertex of the two position detecting patterns, whether the positional relationship between the two position detecting patterns is an adjacent relationship or a diagonal relationship;
  • the second searching module 15 is configured to find a positioning pattern between the two position detecting patterns that determine the positional relationship according to the positional relationship of the two position detecting patterns, the positional features of the positioning patterns, and the black and white graphic features;
  • the determining module 16 is configured to determine a region where the two-dimensional code graphic is located according to the two position detecting patterns and the positioning pattern
  • the meshing module 17 is configured to mesh the region where the two-dimensional code graphic is located according to the data bit widths of the two position detecting patterns, the positioning patterns, and the two-dimensional code patterns;
  • the decoding module 18 is configured to decode the meshed two-dimensional code pattern.
  • Embodiment 3 of the present invention is:
  • a decoding system for QR code position detection pattern damage comprising a binarization module 11, a first search module 12, a statistics module 13, a determination module 14, a second search module 15, a determination module 16, a mesh division Module 17, decoding module 18,
  • the binarization module 11 binarizes the received image including the two-dimensional code pattern
  • the first searching module 12 is configured to search for a position detection graphic in the received image that includes the two-dimensional code graphic.
  • the statistics module 13 is configured to calculate an equation of a line where the boundary lines of the two position detection patterns are located, a vertex coordinate, and calculate a data bit width of the two-dimensional code pattern;
  • the determining module 14 is configured to determine, by using a geometric relationship between a boundary line and a vertex of the two position detecting patterns, whether the positional relationship between the two position detecting patterns is an adjacent relationship or a diagonal relationship;
  • the second searching module 15 is configured to find a position between the two position detecting patterns that determine the positional relationship according to the positional relationship of the two position detecting patterns, the positional features of the positioning patterns, and the black and white graphic features.
  • the determining module 16 is configured to determine a region where the two-dimensional code graphic is located according to the two position detecting patterns and the positioning pattern
  • the meshing module 17 is configured to mesh the region where the two-dimensional code graphic is located according to the data bit widths of the two position detecting patterns, the positioning patterns, and the two-dimensional code patterns;
  • the decoding module 18 is configured to decode the meshed two-dimensional code pattern.
  • the present invention provides a decoding method and system for QR code position detection pattern damage.
  • the two position detection patterns are first determined by geometric relationship. The positional relationship between the two, then find the positioning pattern, determine the area where the two-dimensional code graphic is located, and finally decode the area where the two-dimensional code graphic is located, and the method does not have redundant calculation, and fully utilizes the position detection pattern and the positioning pattern.
  • the feature of identifying a two-dimensional code pattern is high in efficiency and small in error.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Image Processing (AREA)
  • Error Detection And Correction (AREA)

Abstract

本发明提供了一种QR码位置探测图形破损时的解码方法及系统,对接收到的包含二维码图形的图像进行二值化,并寻找位置探测图形;若寻找到的位置探测图形的个数为两个,则采用如下方法解码二维码图形:统计两个位置探测图形的边界线所在的直线的方程、顶点坐标并计算二维码图形的数据位宽,利用几何关系判断两个位置探测图形的位置关系为相邻关系还是对角关系;寻找出确定好位置关系的两个位置探测图形之间的定位图形;根据两个位置探测图形及定位图形确定二维码图形所在区域;对二维码图形所在区域进行网格划分;对网格划分后的二维码图形进行解码。对有一个位置探测图形破损的QR码图像具有解码效率高、误差小的优点。

Description

QR码位置探测图形破损时的解码方法及系统 技术领域
[0001] 本发明涉及二维码技术领域, 特别涉及一种 QR码位置探测图形破损吋的解码 方法及系统。
背景技术
[0002] QR码应用越来越广泛, 由于环境影响, 可能造成二维码图像破损。 由于 QR码 本身包含功能区域和编码区域, 利用功能区域的一些特征, 在 QR码破损一定程 度吋, QR码图像的信息仍是可恢复和识别的。 参见附图 1, QR码的功能区域包 括位置探测图形 (1) 、 位置探测图形分隔符 (2) 、 定位图形 (3) 、 校正图形 (4) , 编码区域包括格式信息图形 (5) 、 版本信息图形 (6) 、 数据信息图形 (7) 。 对 QR码的定位通常是通过对 3个位置探测图形的识别实现的, 但是如果 位置探测图形出现破损, 则不能用常规的方法对 QR码进行定位。
[0003] 公幵号为 CN104463059A的中国发明专利公幵了一种 QR码识别中一个探测图形 破损吋的重构方法, 依据另外两个探测图形和标准 QR码图形右下角的定位图形 , 对第三个探测图形进行恢复重构, 在重构的过程中重构了 3组正方形, 而实际 只有 1组正方形是与实际图形相对较吻合的, 因此该方法具有一定的冗余性, 另 夕卜, 此申请文件中的右下角的定位图形实际是校正图形, 且与右下角的定位图 形相同的图形在 QR码图像中的个数有吋不止一个, 因此采用这种方法过程比较 复杂, 重构效率比较低。
技术问题
[0004] 本发明所要解决的技术问题是: 提供一种效率高、 误差小的 QR码位置探测图 形破损吋的解码方法及系统。
问题的解决方案
技术解决方案
[0005] 为了解决上述技术问题, 本发明采用的技术方案为:
[0006] 一种 QR码位置探测图形破损吋的解码方法, [0007] 对接收到的包含二维码图形的图像进行二值化, 并寻找位置探测图形;
[0008] 若寻找到的位置探测图形的个数为两个, 则采用如下方法解码二维码图形: [0009] 统计两个位置探测图形的边界线所在的直线的方程、 顶点坐标并计算二维码图 形的数据位宽;
[0010] 利用两个位置探测图形的边界线和顶点的几何关系判断两个位置探测图形的位 置关系为相邻关系还是对角关系;
[0011] 根据两个位置探测图形的位置关系、 定位图形的位置特征及黑白相间的图形特 征寻找出确定好位置关系的两个位置探测图形之间的定位图形;
[0012] 根据两个位置探测图形及定位图形确定二维码图形所在区域;
[0013] 根据两个位置探测图形、 定位图形以及二维码图形的数据位宽对二维码图形所 在区域进行网格划分;
[0014] 对网格划分后的二维码图形进行解码。
[0015] 本发明的有益效果在于: 利用两个位置探测图形的边界线和顶点的几何关系来 判断寻找到的两个位置探测图形的位置关系, 并结合定位图形这一功能图形来 确定二维码图形所在区域及二维码图形的旋转角度, 破损的位置探测图形所在 区域也可以直接推理得到, 识别 QR码的方法比较直接, 效率高; 根据定位图形 上的黑白分界线以及位置探测图形对二维码图形进行网格划分, 解码 QR码的误 差小。
[0016]
[0017] 一种 QR码位置探测图形破损吋的解码系统, 其特征在于, 包括二值化模块、 第一寻找模块、 统计模块、 判断模块、 第二寻找模块、 确定模块、 网格划分模 块、 解码模块,
[0018] 二值化模块, 对接收到的包含二维码图形的图像进行二值化,
[0019] 第一寻找模块, 用于在接收到包含的二维码图形的图像中寻找位置探测图形;
[0020] 统计模块, 用于统计两个位置探测图形的边界线所在的直线的方程、 顶点坐标 并计算二维码图形的数据位宽;
[0021] 判断模块, 用于利用两个位置探测图形的边界线和顶点的几何关系判断两个位 置探测图形的位置关系为相邻关系还是对角关系; [0022] 第二寻找模块, 用于根据两个位置探测图形的位置关系、 定位图形的位置特征 及黑白相间的图形特征寻找出确定好位置关系的两个位置探测图形之间的定位 图形;
[0023] 确定模块, 用于根据两个位置探测图形及定位图形确定二维码图形所在区域; [0024] 网格划分模块, 用于根据两个位置探测图形、 定位图形以及二维码图形的数据 位宽对二维码图形所在区域进行网格划分;
[0025] 解码模块, 用于对网格划分后的二维码图形进行解码。
发明的有益效果
有益效果
[0026] 本发明的有益效果在于: 通过二值模块和第一寻找模块找出接收到的包含二维 码图形的图像中的位置探测图形, 由两个位置探测图形通过统计模块、 判断模 块、 第二寻找模块、 确定模块确定出二维码图形所在区域, 通过网格划分模块 和解码模块对二维码图形所在区域进行网格划分和解码, 所述系统结构合理, 解码有一个位置探测图形破损的二维码图形的效率高, 误差小。 对附图的简要说明
附图说明
[0027] 图 1为 QR码功能区域与编码区域结构示意图;
[0028] 图 2为本发明实施例一、 二的 QR码位置探测图形破损吋的解码方法的流程图; [0029] 图 3为本发明实施例一、 二的 QR码的两个位置探测图形 Q1的顶点及边界线的结 构示意图;
[0030] 图 4为本发明实施例一、 二的 QR码的两个位置探测图形 Q2的顶点及边界线的结 构示意图;
[0031] 图 5为本发明实施例一的两个位置探测图形的位置关系为相邻关系吋的疑似定 位图形区域的结构示意图;
[0032] 图 6为本发明实施例一的两个位置探测图形的位置关系为相邻关系吋的二维码 图形沿第一方向划分后的结构示意图;
[0033] 图 7为本发明实施例一的两个位置探测图形的位置关系为相邻关系吋的二维码 图形沿第一方向划分后再沿第二方向划分后的结构示意图; [0034] 图 8为本发明实施例二的两个位置探测图形的位置关系为对角关系吋的疑似定 位图形区域的结构示意图;
[0035] 图 9为本发明实施例二的两个位置探测图形的位置关系为对角关系吋的二维码 图形划分后的结构示意图;
[0036] 图 10为本发明实施例三的 QR码位置探测图形破损吋的解码系统的系统框图。
[0037] 标号说明:
[0038] 1、 位置探测图形; 2、 位置探测图形分隔符; 3、 定位图形; 4、 校正图形; 5
、 格式信息图形; 6、 版本信息图形; 7、 数据信息图形;
[0039] 11、 二值化模块; 12、 第一寻找模块; 13、 统计模块; 14、 判断模块; 15
、 第二寻找模块; 16、 确定模块; 17、 网格划分模块; 18、 解码模块;
[0040] 19、 疑似定位图形区域。
具体实施方式
[0041] 本发明最关键的构思在于: 根据定位图形位于位置探测图形之间, 占据一个数 据位宽的宽度, 且具有黑白相间, 连续的黑点和连续的白点均占据一个数据位 宽的特点, 利用几何关系通过两个位置探测图形确定出二维码图形所在区域, 二维码图形识别效率高、 误差小。
[0042] 本发明的具体实施方式为:
[0043] 请参照图 1至图 9, 一种 QR码位置探测图形破损吋的解码方法,
[0044] 对接收到的包含二维码图形的图像进行二值化, 并寻找位置探测图形;
[0045] 若寻找到的位置探测图形的个数为两个, 则采用如下方法解码二维码图形: [0046] 统计两个位置探测图形的边界线所在的直线的方程、 顶点坐标并计算二维码图 形的数据位宽;
[0047] 利用两个位置探测图形的边界线和顶点的几何关系判断两个位置探测图形的位 置关系为相邻关系还是对角关系;
[0048] 根据两个位置探测图形的位置关系、 定位图形的位置特征及黑白相间的图形特 征寻找出确定好位置关系的两个位置探测图形之间的定位图形;
[0049] 根据两个位置探测图形及定位图形确定二维码图形所在区域; [0050] 根据两个位置探测图形、 定位图形以及二维码图形的数据位宽对二维码图形所 在区域进行网格划分;
[0051] 对网格划分后的二维码图形进行解码。
[0052]
[0053] 进一步的, 还包括:
[0054] 若寻找到的位置探测图形的个数为一个, 则不对接收到的包含二维码图形的图 像进行解码;
[0055] 若寻找到的位置探测图形的个数为三个, 则不采用上述的方法对接收到的包含 二维码图形的图像进行解码。
[0056] 由上述描述可知, 若寻找到的位置探测图形的个数为一个, 则说明接收到的包 含二维码图形的图像破损严重, 不对其进行解码操作; 若寻找到的位置探测图 形的个数为三个, 则二维码图形所在区域可直接通过三个位置探测图形得到, 不需要通过寻找定位图形来确定二维码图形所在区域, 所述方法合理。
[0057] 进一步的, 计算二维码图形的数据位宽, 具体为:
[0058] 根据两个位置探测图形的边界线所在的直线的方程、 顶点坐标可以计算出位置 探测图形的边长的宽度;
[0059] 用位置探测图形的边长的宽度除以 7得到的商为二维码图形的数据位宽。
[0060] 由上述描述可知, 根据位置探测图形边长包含 7个数据位宽的特点来计算二维 码图形的数据位宽, 位置探测图形的边长通过位置探测图形的边界线所在的直 线方程及定点坐标利用几何关系可以直接计算出来, 所述方法合理。
[0061] 进一步的, 利用两个位置探测图形的边界线和顶点的几何关系判断两个位置探 测图形的位置关系为相邻关系还是对角关系, 具体为:
[0062] 取其中一个位置探测图形的一个顶点作为第一顶点, 并记录所述第一顶点在该 位置探测图形上的角点位置及与第一顶点相交且互相垂直的第一对边界线的直 线方程;
[0063] 取在另一个位置探测图形中与第一顶点的角点位置相同的第二顶点, 并记录与 第二顶点相交且互相垂直的第二对边界线的直线方程;
[0064] 计算第二对边界线与第一对边界线的两个交点; [0065] 预设点距离阀值, 计算两个交点与第一顶点或第二顶点的距离, 得到两个距离 值;
[0066] 若两个距离值中有一个距离值小于等于点距离阀值, 则判断两个位置探测图形 的位置关系为相邻关系; 否则, 判断两个位置探测图形的位置关系为对角关系
[0067] 由上述描述可知, 第一对边界线上两条直线的交点和第二对边界线上两条直线 的交点在位置探测图形上对应的顶点位置相同, 第一对边界线对应的两条直线 互相垂直, 第二对边界线对应的两条直线也互相垂直, 则第一对边界线对应的 两条直线的两个斜率与第二对边界线对应的两条直线的两个斜率相同, 因此第 一对边界线与第二对边界线的交点只有两个; 若两个位置探测图形的位置关系 为相邻关系, 则第一对边界线与第二对边界线的两个交点分别为第一顶点和第 二顶点, 为简化判断, 取两个交点与第一顶点或者第二顶点的距离进行计算, 只要两个距离值中有一个小于点距离阀值, 即可判定两个位置探测图形的位置 关系为相邻关系, 理想状态下两个距离值中有一个等于 0, 为了消除边界线、 顶 点取值及计算过程产生的误差, 设定点距离阀值; 若两个位置探测图形的位置 关系为相对关系, 则两个交点到其中任何一个顶点的距离均大于位置探测图形 的宽度, 因此所述点距离阀值的最大值可设置为位置探测图形的宽度值, 所述 方法合理且计算简便, 提高了识别 QR码的效率和准确率。
[0068] 进一步的, 利用两个位置探测图形的边界线和顶点的几何关系判断两个位置探 测图形的位置关系为相邻关系还是对角关系, 具体为:
[0069] 取其中一个位置探测图形的一对互相垂直的第一对边界线的直线方程;
[0070] 取另一个位置探测图形的四条边界线的直线方程;
[0071] 预设直线距离阀值, 分别计算另一个位置探测图形的四条边界线中相互平行的 两条边界线到第一对边界线中与这两条边界线平行的一条边界线的距离, 得到 四个距离值;
[0072] 若四个距离值中有一个距离值小于等于直线距离阀值, 则判断两个位置探测图 形的位置关系为相邻关系; 否则, 判断两个位置探测图形的位置关系为对角关 系。 [0073] 由上述描述可知, 另外一个位置探测图形的四条边界线中会有两条边界线互相 平行的同吋与第一对边界线中的一条互相平行, 计算另外一个位置探测图形的 四条边界线中两条互相平行的边界线分别到第一对边界线中与其平行的一条边 界线的距离, 共得到四个距离值; 若两个位置探测图形的位置关系为相邻关系 , 则这四个距离值中有一个小于直线距离阀值, 理想状态下这四个距离值中有 一个等于 0, 为了消除边界线取值及计算过程产生的误差, 设定直线距离阀值; 若两个位置探测图形的位置关系为相对关系, 则四个距离值均大于位置探测图 形的宽度, 因此所述直线距离阀值的最大值可设置为位置探测图形的宽度值, 所述方法合理且计算简便, 提高了识别 QR码的效率和准确率。
[0074] 进一步的, 若两个位置探测图形的位置关系为相邻关系, 则根据定位图形的位 置特征及黑白相间的图形特征寻找出确定好位置关系的两个位置探测图形之间 的定位图形, 具体为:
[0075] 两个位置探测图形的位置关系为相邻关系;
[0076] 根据两个位置探测图形的边界线及二维码图形的数据位宽划分出两个位置探测 图形之间的区域上与两个位置探测图形边缘重合的一个数据位宽的两个疑似定 位图形区域 19;
[0077] 分别统计两个疑似定位图形区域 19中连续的黑点和白点的像素点的个数, 组成 两个疑似定位图形比例;
[0078] 预设数值相似度阀值, 在两个疑似定位图形比例中筛选出满足任意两个数值的 差值均小于数值相似度阀值条件的疑似定位图形比例作为定位图形区域;
[0079] 所述定位图形区域所对应的图形为定位图形。
[0080] 由上述描述可知, 若两个位置探测图形的位置关系为相邻关系, 则在两个位置 探测图形之间的区域有一个定位图形, 且该定位图形在两个位置探测图形之间 的区域上, 长度等于两个位置探测图形相对边界线之间的距离, 宽度等于二维 码图形的一个数据位宽, 定位图形上的连续的黑点和连续的白点的个数相近, 且连续的黑点和连续的白点均占据的是一个数据位宽, 则两个疑似定位图形就 位于两个位置探测图形之间, 且与两个位置探测图形边缘重合一个数据位宽; 在两个疑似定位图形中判断是否为定位图形, 只需判断连续的黑点和连续的白 点的个数之间的差值是否在预设的数值相似度阀值内即可, 所述方法数据计算 比较直接, 识别定位图形的效率高且误差小。
[0081] 进一步的, 若两个位置探测图形的位置关系为相邻关系, 根据两个位置探测图 形、 定位图形以及二维码图形的数据位宽对接收到的二维码图像进行网格划分 , 具体为:
[0082] 两个位置探测图形的位置关系为相邻关系;
[0083] 根据两个位置探测图形和定位图形的位置确定二维码图形所在区域;
[0084] 以垂直于定位图形区域长度方向的方向为第一方向, 以平行于定位图形区域长 度方向的方向为第二方向;
[0085] 根据定位图形中黑白像素点的分界线对定位图形区域的第一方向上进行划分; [0086] 根据数据位宽对两个位置探测图形的第一方向上进行划分;
[0087] 根据数据位宽对二维码图形所在区域的第二方向上进行划分。
[0088] 由上述描述可知, 定位图形所在区域的第一方向按定位图形中的黑白像素点的 分界线来划分, 位置探测图形所在区域均按数据位宽来划分, 已知两个位置探 测图形是相邻的以及两个位置探测图形之间的定位图形, 则可推测出二维码图 形在所寻找出的定位图形一侧, 且二维码图形在第一方向上的宽度与在第二方 向上的宽度相同, 即为正方形区域, 二维码图形在第二方向上的宽度为两个位 置探测图形最外的相对边界线之间的距离, 这个距离可以求出, 则二维码图形 在第一方向上的宽度便可求出, 按照数据位宽对二维码图形的第一方向进行划 分, 所述方法可准确对二维码图形进行划分, 解码误差小。
[0089] 进一步的, 若两个位置探测图形的位置关系为对角关系, 则根据定位图形的位 置特征及黑白相间的图形特征寻找出确定好位置关系的两个位置探测图形之间 的定位图形, 具体为:
[0090] 两个位置探测图形的位置关系为对角关系;
[0091] 根据两个位置探测图形的边界线及二维码图像的数据位宽划分出两个位置探测 图形之间的区域上与两个位置探测图形内侧边缘重合的一个数据位宽的四个疑 似定位图形区域 19;
[0092] 分别统计四个疑似定位图形区域 19中连续的黑点和白点的像素点的个数, 组成 四个疑似定位图形比例;
[0093] 预设数值相似度阀值, 在四个疑似定位图形比例中筛选出满足任意两个数值的 差值均小于数值相似度阀值且互相垂直条件的两个疑似定位图形比例作为两个 定位图形区域;
[0094] 所述两个定位图形区域所对应的图形为定位图形。
[0095] 由上述描述可知, 若两个位置探测图形的位置关系为对角关系, 则疑似定位图 形区域 19有四个, 且位于两个位置探测图形内侧两个互相垂直的边缘占据一个 数据位宽的区域, 将四个疑似定位图形划分出后, 所找到的两个定位图形具有 互相垂直的特点, 如果找到的两个定位图形不是互相垂直, 则寻找定位图形失 败, 不对二维码图形进行解码; 定位图形上的连续的黑点和连续的白点的个数 相近, 且连续的黑点和连续的白点均占据的是一个数据位宽, 在四个疑似定位 图形中判断是否为定位图形, 只需判断连续的黑点和连续的白点的个数之间的 差值是否在预设的数值相似度阀值内即可, 所述方法数据计算比较直接; 两个 定位图形区域互相垂直是指长度方向或者宽度方向互相垂直, 则两个互相垂直 的定位图形相交的角落即为破损的位置探测图形所在的区域, 两个定位图形区 域所述方法识别定位图形效率高, 误差小。
[0096] 进一步的, 若两个位置探测图形的位置关系为对角关系, 根据两个位置探测图 形、 定位图形以及二维码图形的数据位宽对接收到的二维码图像进行网格划分 , 具体为:
[0097] 两个位置探测图形的位置关系为对角关系;
[0098] 根据两个位置探测图形和两个定位图形的位置确定二维码图形所在区域; [0099] 根据定位图形中黑白像素点的分界线对各个定位图形区域的垂直于定位图形区 域长度方向上进行划分;
[0100] 根据数据位宽对两个位置探测图形的平行于四个边界线的两个方向上进行划分
[0101] 由上述描述可知, 二维码图形所在区域为正方形区域, 根据定位图形中黑白像 素点的分界线对各个定位图形区域的垂直于定位图形长度方向上进行划分, 再 根据数据为宽对两个位置探测图形进行划分, 则可完成二维码图形的网格划分 , 网格划分方法准确, 有效保证二维码图形的正确解码。
[0102]
[0103] 请参照图 1至图 7, 本发明的实施例一为:
[0104] 对接收到的包含二维码图形的图像进行二值化, 并寻找位置探测图形;
[0105] 若寻找到的位置探测图形的个数为两个, 则采用如下方法解码二维码图形: [0106] 统计两个位置探测图形的边界线所在的直线的方程、 顶点坐标并计算二维码图 形的数据位宽 w, 具体为:
[0107] 根据两个位置探测图形的边界线所在的直线的方程、 顶点坐标可以计算出位置 探测图形的边长的宽度;
[0108] 用位置探测图形的边长的宽度除以 7得到的商为二维码图形的数据位宽 W;
[0109] 利用两个位置探测图形的边界线和顶点的几何关系判断两个位置探测图形的位 置关系为相邻关系还是对角关系, 具体为:
[0110] 请参见图 3和图 4, 将两个位置探测图形分别标记为 Ql、 Q2, 两个位置探测图 形 Q1和 Q2的顶点分另 IJ为 Ql.l、 Q1.2、 Q1.3、 Q1.4和 Q2.1、 Q2.2、 Q2.3、 Q2.4, 两个位置探测图形 Ql和 Q2的四条边界线分别为 Ql.l、 Ql.u、 Ql.r、 Ql.d和 Q2.1、
Q2.u、 Q2.r、 Q2.d;
[0111] 取其中一个位置探测图形 Ql的一个顶点 Q1.2作为第一顶点, 并记录所述第一顶 点 Q1.2在该位置探测图形上的角点位置及与第一顶点 Q1.2相交且互相垂直的第一 对边界线 Ql.u、 Ql.r的直线方程;
[0112] 取在另一个位置探测图形 Q2中与第一顶点 Q1.2的角点位置相同的第二顶点 Q2.2 , 并记录与第二顶点 Q2.2相交且互相垂直的第二对边界线 Q2.u、 Q2.r的直线方程
[0113] 计算第二对边界线 Q2.u、 Q2.r与第一对边界线 Ql.u、 Ql.r的两个交点;
[0114] 预设点距离阀值为 W, 计算两个交点与第一顶点或第二顶点的距离, 得到两个 距离值; 实际上, 点距离阀值可设置为大于等于 0, 且小于等于 W的数值范围内 的任意数值;
[0115] 若两个距离值中有一个距离值小于等于点距离阀值 W, 则判断两个位置探测图 形的位置关系为相邻关系; 否则, 判断两个位置探测图形的位置关系为对角关 系;
[0116] 假设判断后得到两个位置探测图形的位置关系为相邻关系, 则后续的二维码图 形的解码方法为:
[0117] 请参见图 5, 若两个位置探测图形的位置关系为相邻关系, 根据两个位置探测 图形的位置关系、 定位图形的位置特征及黑白相间的图形特征寻找出确定好位 置关系的两个位置探测图形之间的定位图形, 具体为:
[0118] 根据两个位置探测图形的边界线及二维码图形的数据位宽划分出两个位置探测 图形之间的区域上与两个位置探测图形边缘重合的一个数据位宽的两个疑似定 位图形区域 19;
[0119] 分别统计两个疑似定位图形区域 19中连续的黑点和白点的像素点的个数, 组成 两个疑似定位图形比例;
[0120] 预设数值相似度阀值, 在两个疑似定位图形比例中筛选出满足任意两个数值的 差值均小于数值相似度阀值条件的疑似定位图形比例作为定位图形区域;
[0121] 所述定位图形区域所对应的图形为定位图形;
[0122] 根据两个位置探测图形及定位图形确定二维码图形所在区域;
[0123] 根据两个位置探测图形、 定位图形以及二维码图形的数据位宽对二维码图形所 在区域进行网格划分, 具体为:
[0124] 根据两个位置探测图形和定位图形的位置确定二维码图形所在区域;
[0125] 以垂直于定位图形区域长度方向的方向为第一方向, 以平行于定位图形区域长 度方向的方向为第二方向;
[0126] 请参见图 6, 根据定位图形中黑白像素点的分界线对定位图形区域的第一方向 上进行划分;
[0127] 根据数据位宽对两个位置探测图形的第一方向上进行划分;
[0128] 请参见图 7, 根据数据位宽对二维码图形所在区域的第二方向上进行划分;
[0129] 对网格划分后的二维码图形进行解码。
[0130]
[0131] 请参照图 1至图 4、 图 8、 图 9, 本发明的实施例二为:
[0132] 前述判断两个位置探测图形的位置关系为相邻关系还是对角关系的方法与实施 例一中的相同, 假设判断后得到两个位置探测图形的位置关系为对角关系, 则 后续的二维码图形的解码方法为:
[0133] 若两个位置探测图形的位置关系为对角关系, 根据两个位置探测图形的位置关 系、 定位图形的位置特征及黑白相间的图形特征寻找出确定好位置关系的两个 位置探测图形之间的定位图形, 具体为:
[0134] 请参见图 8, 根据两个位置探测图形的边界线及二维码图像的数据位宽划分出 两个位置探测图形之间的区域上与两个位置探测图形内侧边缘重合的一个数据 位宽的四个疑似定位图形区域 19;
[0135] 分别统计四个疑似定位图形区域 19中连续的黑点和白点的像素点的个数, 组成 四个疑似定位图形比例;
[0136] 预设数值相似度阀值, 在四个疑似定位图形比例中筛选出满足任意两个数值的 差值均小于数值相似度阀值且互相垂直条件的两个疑似定位图形比例作为两个 定位图形区域;
[0137] 所述两个定位图形区域所对应的图形为定位图形;
[0138] 根据两个位置探测图形及定位图形确定二维码图形所在区域;
[0139] 请参见图 9, 根据两个位置探测图形、 定位图形以及二维码图形的数据位宽对 二维码图形所在区域进行网格划分, 具体为:
[0140] 根据两个位置探测图形和两个定位图形的位置确定二维码图形所在区域; [0141] 根据定位图形中黑白像素点的分界线对各个定位图形区域的垂直于定位图形区 域长度方向上进行划分;
[0142] 根据数据位宽对两个位置探测图形的平行于四个边界线的两个方向上进行划分
[0143] 对网格划分后的二维码图形进行解码。
[0144]
[0145] 请参照图 10, 一种 QR码位置探测图形破损吋的解码系统, 包括二值化模块 11 、 第一寻找模块 12、 统计模块 13、 判断模块 14、 第二寻找模块 15、 确定模块 16 、 网格划分模块 17、 解码模块 18,
[0146] 二值化模块 11, 对接收到的包含二维码图形的图像进行二值化, [0147] 第一寻找模块 12, 用于在接收到的包含二维码图形的图像中寻找位置探测图形
[0148] 统计模块 13, 用于统计两个位置探测图形的边界线所在的直线的方程、 顶点坐 标并计算二维码图形的数据位宽;
[0149] 判断模块 14, 用于利用两个位置探测图形的边界线和顶点的几何关系判断两个 位置探测图形的位置关系为相邻关系还是对角关系;
[0150] 第二寻找模块 15, 用于根据两个位置探测图形的位置关系、 定位图形的位置特 征及黑白相间的图形特征寻找出确定好位置关系的两个位置探测图形之间的定 位图形;
[0151] 确定模块 16, 用于根据两个位置探测图形及定位图形确定二维码图形所在区域
[0152] 网格划分模块 17, 用于根据两个位置探测图形、 定位图形以及二维码图形的数 据位宽对二维码图形所在区域进行网格划分;
[0153] 解码模块 18, 用于对网格划分后的二维码图形进行解码。
[0154]
[0155] 请参照图 10, 本发明的实施例三为:
[0156] 一种 QR码位置探测图形破损吋的解码系统, 包括二值化模块 11、 第一寻找模 块 12、 统计模块 13、 判断模块 14、 第二寻找模块 15、 确定模块 16、 网格划分模 块 17、 解码模块 18,
[0157] 二值化模块 11, 对接收到的包含二维码图形的图像进行二值化,
[0158] 第一寻找模块 12, 用于在接收到的包含二维码图形的图像中寻找位置探测图形
[0159] 统计模块 13, 用于统计两个位置探测图形的边界线所在的直线的方程、 顶点坐 标并计算二维码图形的数据位宽;
[0160] 判断模块 14, 用于利用两个位置探测图形的边界线和顶点的几何关系判断两个 位置探测图形的位置关系为相邻关系还是对角关系;
[0161] 第二寻找模块 15, 用于根据两个位置探测图形的位置关系、 定位图形的位置特 征及黑白相间的图形特征寻找出确定好位置关系的两个位置探测图形之间的定 位图形;
[0162] 确定模块 16, 用于根据两个位置探测图形及定位图形确定二维码图形所在区域
[0163] 网格划分模块 17, 用于根据两个位置探测图形、 定位图形以及二维码图形的数 据位宽对二维码图形所在区域进行网格划分;
[0164] 解码模块 18, 用于对网格划分后的二维码图形进行解码。
[0165]
[0166] 综上所述, 本发明提供的一种 QR码位置探测图形破损吋的解码方法及系统, 对于只有两个位置探测图形完整的 QR码, 先通过几何关系判断两个位置探测图 形之间的位置关系, 然后寻找定位图形, 确定二维码图形所在区域, 最后对二 维码图形所在区域进行网格划分后解码, 所述方法没有冗余的计算, 充分利用 位置探测图形及定位图形的特征, 识别二维码图形的效率高, 且误差小。

Claims

权利要求书
[权利要求 1] 一种 QR码位置探测图形破损吋的解码方法, 其特征在于,
对接收到的包含二维码图形的图像进行二值化, 并寻找位置探测图形 若寻找到的位置探测图形的个数为两个, 则采用如下方法解码二维码 图形:
统计两个位置探测图形的边界线所在的直线的方程、 顶点坐标并计算 二维码图形的数据位宽;
利用两个位置探测图形的边界线和顶点的几何关系判断两个位置探测 图形的位置关系为相邻关系还是对角关系;
根据两个位置探测图形的位置关系、 定位图形的位置特征及黑白相间 的图形特征寻找出确定好位置关系的两个位置探测图形之间的定位图 形;
根据两个位置探测图形及定位图形确定二维码图形所在区域; 根据两个位置探测图形、 定位图形以及二维码图形的数据位宽对二维 码图形所在区域进行网格划分;
对网格划分后的二维码图形进行解码。
[权利要求 2] 根据权利要求 1所述的 QR码位置探测图形破损吋的解码方法, 其特征 在于, 计算二维码图形的数据位宽, 具体为:
根据两个位置探测图形的边界线所在的直线的方程、 顶点坐标可以计 算出位置探测图形的边长的宽度;
用位置探测图形的边长的宽度除以 7得到的商为二维码图形的数据位 宽。
[权利要求 3] 根据权利要求 1所述的 QR码位置探测图形破损吋的解码方法, 其特征 在于, 利用两个位置探测图形的边界线和顶点的几何关系判断两个位 置探测图形的位置关系为相邻关系还是对角关系, 具体为: 取其中一个位置探测图形的一个顶点作为第一顶点, 并记录所述第一 顶点在该位置探测图形上的角点位置及与第一顶点相交且互相垂直的 第一对边界线的直线方程;
取在另一个位置探测图形中与第一顶点的角点位置相同的第二顶点, 并记录与第二顶点相交且互相垂直的第二对边界线的直线方程; 计算第二对边界线与第一对边界线的两个交点; 预设点距离阀值, 计算两个交点与第一顶点或第二顶点的距离, 得到 两个距离值;
若两个距离值中有一个距离值小于等于点距离阀值, 则判断两个位置 探测图形的位置关系为相邻关系; 否则, 判断两个位置探测图形的位 置关系为对角关系。
[权利要求 4] 根据权利要求 1所述的 QR码位置探测图形破损吋的解码方法, 其特征 在于, 利用两个位置探测图形的边界线和顶点的几何关系判断两个位 置探测图形的位置关系为相邻关系还是对角关系, 具体为: 取其中一个位置探测图形的一对互相垂直的第一对边界线的直线方程
取另一个位置探测图形的四条边界线的直线方程; 预设直线距离阀值, 分别计算另一个位置探测图形的四条边界线中相 互平行的两条边界线到第一对边界线中与这两条边界线平行的一条边 界线的距离, 得到四个距离值;
若四个距离值中有一个距离值小于等于直线距离阀值, 则判断两个位 置探测图形的位置关系为相邻关系; 否则, 判断两个位置探测图形的 位置关系为对角关系。
[权利要求 5] 根据权利要求 1所述的 QR码位置探测图形破损吋的解码方法, 其特征 在于, 若两个位置探测图形的位置关系为相邻关系, 则根据定位图形 的位置特征及黑白相间的图形特征寻找出确定好位置关系的两个位置 探测图形之间的定位图形, 具体为:
两个位置探测图形的位置关系为相邻关系;
根据两个位置探测图形的边界线及二维码图形的数据位宽划分出两个 位置探测图形之间的区域上与两个位置探测图形边缘重合的一个数据 位宽的两个疑似定位图形区域;
分别统计两个疑似定位图形区域中连续的黑点和白点的像素点的个数 , 组成两个疑似定位图形比例;
预设数值相似度阀值, 在两个疑似定位图形比例中筛选出满足任意两 个数值的差值均小于数值相似度阀值条件的疑似定位图形比例作为定 位图形区域;
所述定位图形区域所对应的图形为定位图形。
[权利要求 6] 根据权利要求 5所述的 QR码位置探测图形破损吋的解码方法, 其特征 在于, 若两个位置探测图形的位置关系为相邻关系, 根据两个位置探 测图形、 定位图形以及二维码图形的数据位宽对接收到的二维码图像 进行网格划分, 具体为:
两个位置探测图形的位置关系为相邻关系;
根据两个位置探测图形和定位图形的位置确定二维码图形所在区域; 以垂直于定位图形区域长度方向的方向为第一方向, 以平行于定位图 形区域长度方向的方向为第二方向;
根据定位图形中黑白像素点的分界线对定位图形区域的第一方向上进 行划分;
根据数据位宽对两个位置探测图形的第一方向上进行划分; 根据数据位宽对二维码图形所在区域的第二方向上进行划分。
[权利要求 7] 根据权利要求 1所述的 QR码位置探测图形破损吋的解码方法, 其特征 在于, 若两个位置探测图形的位置关系为对角关系, 则根据定位图形 的位置特征及黑白相间的图形特征寻找出确定好位置关系的两个位置 探测图形之间的定位图形, 具体为:
两个位置探测图形的位置关系为对角关系;
根据两个位置探测图形的边界线及二维码图像的数据位宽划分出两个 位置探测图形之间的区域上与两个位置探测图形内侧边缘重合的一个 数据位宽的四个疑似定位图形区域;
分别统计四个疑似定位图形区域中连续的黑点和白点的像素点的个数 , 组成四个疑似定位图形比例;
预设数值相似度阀值, 在四个疑似定位图形比例中筛选出满足任意两 个数值的差值均小于数值相似度阀值且互相垂直条件的两个疑似定位 图形比例作为两个定位图形区域;
所述两个定位图形区域所对应的图形为定位图形。
[权利要求 8] 根据权利要求 7所述的 QR码位置探测图形破损吋的解码方法, 其特征 在于, 若两个位置探测图形的位置关系为对角关系, 根据两个位置探 测图形、 定位图形以及二维码图形的数据位宽对接收到的二维码图像 进行网格划分, 具体为:
两个位置探测图形的位置关系为对角关系;
根据两个位置探测图形和两个定位图形的位置确定二维码图形所在区 域;
根据定位图形中黑白像素点的分界线对各个定位图形区域的垂直于定 位图形区域长度方向上进行划分;
根据数据位宽对两个位置探测图形的平行于四个边界线的两个方向上 进行划分。
[权利要求 9] 一种 QR码位置探测图形破损吋的解码系统, 其特征在于, 包括二值 化模块、 第一寻找模块、 统计模块、 判断模块、 第二寻找模块、 确定 模块、 网格划分模块、 解码模块,
二值化模块, 对接收到的包含二维码图形的图像进行二值化, 第一寻找模块, 用于在接收到的包含二维码图形的图像中寻找位置探 测图形;
统计模块, 用于统计两个位置探测图形的边界线所在的直线的方程、 顶点坐标并计算二维码图形的数据位宽;
判断模块, 用于利用两个位置探测图形的边界线和顶点的几何关系判 断两个位置探测图形的位置关系为相邻关系还是对角关系; 第二寻找模块, 用于根据两个位置探测图形的位置关系、 定位图形的 位置特征及黑白相间的图形特征寻找出确定好位置关系的两个位置探 测图形之间的定位图形;
确定模块, 用于根据两个位置探测图形及定位图形确定二维码图形所 在区域;
网格划分模块, 用于根据两个位置探测图形、 定位图形以及二维码图 形的数据位宽对二维码图形所在区域进行网格划分;
解码模块, 用于对网格划分后的二维码图形进行解码。
PCT/CN2016/091971 2015-09-02 2016-07-28 Qr 码位置探测图形破损时的解码方法及系统 WO2017036265A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP16840694.0A EP3330885B1 (en) 2015-09-02 2016-07-28 Decoding method and system for use when qr code position detection graph is damaged
BR112018003692-7A BR112018003692B1 (pt) 2015-09-02 2016-07-28 Método de decodificação e sistema para qr code com um padrão de detecção de posição danificada
US15/895,199 US10438038B2 (en) 2015-09-02 2018-02-13 Decoding method and system for QR code with one damaged position detection pattern

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510553171.1 2015-09-02
CN201510553171.1A CN105138943B (zh) 2015-09-02 2015-09-02 Qr码位置探测图形破损时的解码方法及系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/895,199 Continuation US10438038B2 (en) 2015-09-02 2018-02-13 Decoding method and system for QR code with one damaged position detection pattern

Publications (1)

Publication Number Publication Date
WO2017036265A1 true WO2017036265A1 (zh) 2017-03-09

Family

ID=54724287

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/091971 WO2017036265A1 (zh) 2015-09-02 2016-07-28 Qr 码位置探测图形破损时的解码方法及系统

Country Status (4)

Country Link
US (1) US10438038B2 (zh)
EP (1) EP3330885B1 (zh)
CN (1) CN105138943B (zh)
WO (1) WO2017036265A1 (zh)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138943B (zh) * 2015-09-02 2017-10-24 福建联迪商用设备有限公司 Qr码位置探测图形破损时的解码方法及系统
CN106127276B (zh) * 2016-06-27 2018-12-21 福建联迪商用设备有限公司 一种量化污损QRCode的方法及系统
CN106529636B (zh) * 2016-10-18 2019-08-13 上海觉感视觉科技有限公司 一种qr码的位置探测图形分组方法
CN112861560B (zh) 2017-09-27 2023-12-22 创新先进技术有限公司 二维码定位方法及装置
CN108021839B (zh) * 2017-12-08 2020-10-23 博众精工科技股份有限公司 一种qr码的纠错读取方法及系统
CN108491897B (zh) * 2018-01-30 2020-09-29 阿里巴巴集团控股有限公司 一种信息识别方法、服务器、客户端及系统
CN109101855B (zh) * 2018-07-21 2022-04-26 湖北易同科技发展有限公司 一种基于opencv的缺失定位框二维码识别方法
CN109325381B (zh) * 2018-08-13 2022-03-08 佛山市顺德区中山大学研究院 一种qr码定位和校正方法
CN109508573B (zh) * 2018-11-12 2020-10-30 上海商米科技集团股份有限公司 二维码的解码方法和装置
JP7021651B2 (ja) * 2019-03-01 2022-02-17 オムロン株式会社 シンボル境界特定装置、シンボル境界特定方法および画像処理プログラム
CN110020571B (zh) * 2019-03-18 2022-05-13 创新先进技术有限公司 二维码校正方法、装置及设备
CN109934036B (zh) * 2019-03-22 2022-01-04 福州符号信息科技有限公司 一种通过单一位置探测图形识读qr码的方法和系统
CN111860025B (zh) * 2019-04-30 2022-08-02 杭州海康机器人技术有限公司 二维码感兴趣区域定位方法及装置
CN110610112B (zh) * 2019-09-12 2021-05-07 珠海格力电器股份有限公司 识别码显示方法和装置
USD1015427S1 (en) * 2020-03-05 2024-02-20 Skincoach Inc. Two-dimensional tag
CN112800797B (zh) * 2020-12-30 2023-12-19 凌云光技术股份有限公司 一种dm码的区域定位方法及系统
CN113449534B (zh) * 2021-06-28 2023-03-28 歌尔股份有限公司 二维码图像处理方法和装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100155464A1 (en) * 2008-12-22 2010-06-24 Canon Kabushiki Kaisha Code detection and decoding system
US20120273563A1 (en) * 2011-04-27 2012-11-01 Kyocera Document Solutions, Inc. Image Processing Apparatus
CN103955663A (zh) * 2014-04-22 2014-07-30 广州宽度信息技术有限公司 一种qr码抗污损识别方法
CN104463059A (zh) * 2013-09-16 2015-03-25 航天信息股份有限公司 Qr码识别中一个探测图形破损时的重构方法
CN104809422A (zh) * 2015-04-27 2015-07-29 江苏中科贯微自动化科技有限公司 基于图像处理的qr码识别方法
CN105138943A (zh) * 2015-09-02 2015-12-09 福建联迪商用设备有限公司 Qr码位置探测图形破损时的解码方法及系统

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3541731B2 (ja) * 1999-06-18 2004-07-14 株式会社デンソー 偽造判定方法、偽造判定装置及び記録媒体
JP4301775B2 (ja) * 2002-07-18 2009-07-22 シャープ株式会社 2次元コード読み取り装置,2次元コード読み取り方法,2次元コード読み取りプログラム及び該プログラムの記録媒体
CN100481117C (zh) * 2004-03-15 2009-04-22 武汉矽感科技有限公司 一种二维条码编解码方法
EP1862944A1 (en) * 2005-03-25 2007-12-05 Global Value Corporation Color code symbol, method for creating color code symbol, and storage medium for creating color code symbol
JP4569382B2 (ja) * 2005-05-20 2010-10-27 ブラザー工業株式会社 印刷データ編集装置、印刷データ編集プログラム及び記録媒体
KR100828539B1 (ko) * 2005-09-20 2008-05-13 후지제롯쿠스 가부시끼가이샤 이차원 코드의 검출 방법, 검출 장치, 및 검출 프로그램을기억한 기억 매체
JP4106377B2 (ja) * 2005-12-16 2008-06-25 インターナショナル・ビジネス・マシーンズ・コーポレーション 不可視情報を抽出するための装置、方法、およびプログラム
CN100380393C (zh) * 2006-09-26 2008-04-09 福建榕基软件开发有限公司 复杂背景下qr码图像符号区域的精确定位方法
CN100464345C (zh) * 2006-11-07 2009-02-25 中国物品编码中心 二维条码符号转换为编码信息的方法
US8532299B2 (en) * 2007-05-29 2013-09-10 Denso Wave Incorporated Method for producing two-dimensional code and reader for reading the two-dimensional code
TW201113815A (en) * 2009-10-09 2011-04-16 Primax Electronics Ltd QR code processing method and apparatus thereof
DE102010014937B4 (de) * 2010-04-14 2013-10-17 Ioss Intelligente Optische Sensoren & Systeme Gmbh Verfahren zum Lesen eines Codes auf einem Substrat durch Zusammensetzen von Code-Fragmenten unter Verwendung eines bildgebenden Codelesers
US20130153662A1 (en) * 2011-12-19 2013-06-20 MindTree Limited Barcode Photo-image Processing System
US9684810B2 (en) * 2013-03-15 2017-06-20 D2L Corporation System and method for partite optically readable code
CN103294980A (zh) * 2013-06-18 2013-09-11 四川大学 基于图像处理的微型qr码识别方法
US9594993B2 (en) * 2013-11-07 2017-03-14 Scantrush Sa Two dimensional barcode and method of authentication of such barcode

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100155464A1 (en) * 2008-12-22 2010-06-24 Canon Kabushiki Kaisha Code detection and decoding system
US20120273563A1 (en) * 2011-04-27 2012-11-01 Kyocera Document Solutions, Inc. Image Processing Apparatus
CN104463059A (zh) * 2013-09-16 2015-03-25 航天信息股份有限公司 Qr码识别中一个探测图形破损时的重构方法
CN103955663A (zh) * 2014-04-22 2014-07-30 广州宽度信息技术有限公司 一种qr码抗污损识别方法
CN104809422A (zh) * 2015-04-27 2015-07-29 江苏中科贯微自动化科技有限公司 基于图像处理的qr码识别方法
CN105138943A (zh) * 2015-09-02 2015-12-09 福建联迪商用设备有限公司 Qr码位置探测图形破损时的解码方法及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3330885A4 *

Also Published As

Publication number Publication date
CN105138943B (zh) 2017-10-24
US20180165492A1 (en) 2018-06-14
EP3330885B1 (en) 2020-10-07
BR112018003692A2 (pt) 2018-09-25
CN105138943A (zh) 2015-12-09
EP3330885A1 (en) 2018-06-06
US10438038B2 (en) 2019-10-08
EP3330885A4 (en) 2018-09-05

Similar Documents

Publication Publication Date Title
WO2017036265A1 (zh) Qr 码位置探测图形破损时的解码方法及系统
EP3309704B1 (en) Two-dimensional code partitioning and decoding method and system
US10528781B2 (en) Detection method and system for characteristic patterns of Han Xin codes
US8215564B2 (en) Method and system for creating and using barcodes
US9449210B2 (en) Method and system for detecting a correction pattern in a QR code
EP2393037B1 (en) Data matrix decoding chip and decoding method thereof
CN102708351B (zh) 复杂工况背景下的Data Matrix二维条码快速识别方法
CN101930594A (zh) 一种扫描文档图像的快速纠偏方法
US20150129658A1 (en) Method for decoding matrix-type two-dimensional code
CN102254144A (zh) 一种鲁棒的图像中二维码区域提取方法
CN105096299A (zh) 多边形检测方法和多边形检测装置
CN103617625A (zh) 一种图像匹配方法及图像匹配装置
CN108763996B (zh) 一种基于二维码的平面定位坐标与方向角测量方法
CN109508573B (zh) 二维码的解码方法和装置
CN105138945A (zh) 一种钢筋表面二维码识别方法
CN102521559B (zh) 一种基于亚像素边缘检测的四一七条码识别方法
CN110969612B (zh) 二维码印刷缺陷检测方法
CN110929738A (zh) 证卡边缘检测方法、装置、设备及可读存储介质
CN111199163A (zh) 一种环形码的边缘检测与定位识别方法
CN112800797B (zh) 一种dm码的区域定位方法及系统
CN102867178A (zh) 汉字识别方法和装置
US20230196707A1 (en) Fiducial patterns
CN111191759B (zh) 一种二维码的生成方法和基于gpu的定位、解码方法
CN110097065B (zh) 一种基于FreeMan链码的直线检测方法及终端
CN109934036B (zh) 一种通过单一位置探测图形识读qr码的方法和系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16840694

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112018003692

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 112018003692

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20180226