WO2022199471A1 - 一种二维码生成、解码方法、装置及设备 - Google Patents
一种二维码生成、解码方法、装置及设备 Download PDFInfo
- Publication number
- WO2022199471A1 WO2022199471A1 PCT/CN2022/081625 CN2022081625W WO2022199471A1 WO 2022199471 A1 WO2022199471 A1 WO 2022199471A1 CN 2022081625 W CN2022081625 W CN 2022081625W WO 2022199471 A1 WO2022199471 A1 WO 2022199471A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- dimensional code
- image
- position information
- code
- information
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 88
- 230000004044 response Effects 0.000 title abstract description 14
- 238000012545 processing Methods 0.000 claims abstract description 53
- 238000005070 sampling Methods 0.000 claims description 90
- 230000003044 adaptive effect Effects 0.000 claims description 15
- 239000011159 matrix material Substances 0.000 claims description 13
- 230000009466 transformation Effects 0.000 claims description 10
- 239000003086 colorant Substances 0.000 claims description 7
- 230000000875 corresponding effect Effects 0.000 description 81
- 230000006870 function Effects 0.000 description 15
- 230000008569 process Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 14
- 238000003860 storage Methods 0.000 description 13
- 238000004590 computer program Methods 0.000 description 9
- 230000006872 improvement Effects 0.000 description 9
- 238000012937 correction Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 238000013461 design Methods 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 230000003373 anti-fouling effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000009826 distribution Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000000873 masking effect Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 241000700605 Viruses Species 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000006855 networking Effects 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 238000012952 Resampling Methods 0.000 description 1
- XUIMIQQOPSSXEZ-UHFFFAOYSA-N Silicon Chemical compound [Si] XUIMIQQOPSSXEZ-UHFFFAOYSA-N 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 239000006227 byproduct Substances 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000011109 contamination Methods 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 238000005034 decoration Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000009792 diffusion process Methods 0.000 description 1
- 239000004744 fabric Substances 0.000 description 1
- ZXQYGBMAQZUVMI-GCMPRSNUSA-N gamma-cyhalothrin Chemical compound CC1(C)[C@@H](\C=C(/Cl)C(F)(F)F)[C@H]1C(=O)O[C@H](C#N)C1=CC=CC(OC=2C=CC=CC=2)=C1 ZXQYGBMAQZUVMI-GCMPRSNUSA-N 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 239000010979 ruby Substances 0.000 description 1
- 229910001750 ruby Inorganic materials 0.000 description 1
- 229910052710 silicon Inorganic materials 0.000 description 1
- 239000010703 silicon Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
- 230000037303 wrinkles Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06037—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/06075—Constructional details the marking containing means for error correction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/06103—Constructional details the marking being embedded in a human recognizable image, e.g. a company logo with an embedded two-dimensional code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/06131—Constructional details the marking comprising a target pattern, e.g. for indicating the center of the bar code or for helping a bar code reader to properly orient the scanner or to retrieve the bar code inside of an image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods 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/1404—Methods for optical code recognition
- G06K7/1408—Methods for optical code recognition the method being specifically adapted for the type of code
- G06K7/1417—2D bar codes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods 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/1404—Methods for optical code recognition
- G06K7/1439—Methods for optical code recognition including a method step for retrieval of the optical code
- G06K7/1443—Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods 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/1404—Methods for optical code recognition
- G06K7/146—Methods for optical code recognition the method including quality enhancement steps
- G06K7/1473—Methods for optical code recognition the method including quality enhancement steps error correction
Definitions
- the present application relates to the field of Internet technologies, and in particular, to a method, device, and device for generating and decoding a two-dimensional code.
- QR codes have become more and more extensive, especially in the fields of mobile payment and online social networking. Due to its large information capacity and fast identification, it has been rapidly popularized in people's daily life.
- two-dimensional codes have been widely promoted, in traditional two-dimensional codes, the back of each two-dimensional code may represent a file, a page, or an application. Due to its openness, it is easy to become a hotbed of Trojan horse viruses.
- users scan the code they give up scanning the code out of fear that their mobile phone may be infected with viruses after scanning the code, and the traditional QR code cannot meet the brand promotion of the applet. need.
- the applet code came into being. Compared with the ordinary two-dimensional code, the applet code looks more beautiful. Moreover, for the applet code, the user can clearly know the scan code before scanning the applet code. Afterwards, you will experience an application of what kind of applet.
- the embodiments of this specification provide a method, device and device for generating and decoding a two-dimensional code, so as to solve the problem of low recognition rate existing in the existing two-dimensional code identification method.
- a method for generating a two-dimensional code includes: acquiring a two-dimensional code code of a two-dimensional code image to be generated;
- the coding adopts a coding algorithm with a preset error tolerance rate to perform error-tolerant coding, and obtains a two-dimensional code code after error-tolerant processing; it is determined that each data information bit of the two-dimensional code code after the fault-tolerant processing corresponds to the generation area of the two-dimensional code image.
- the shape of the code element includes a dot or an arc; according to the preset arrangement rule of the two-dimensional code, it is determined that each data information bit encoded by the two-dimensional code after the error-tolerant processing corresponds to the generation area determine the second position information of each positioning point in the generation area; based on the first position information, the symbol shape corresponding to each data information bit and the second position of each positioning point information to generate a QR code image.
- a two-dimensional code decoding method includes: acquiring image information of a two-dimensional code image to be recognized; determining, according to the image information of the two-dimensional code image to be recognized The positioning point position information of each positioning point in the image; based on the positioning point position information, determine the position information of each data information in the image; position information, determine the symbol shape corresponding to each data information bit; the symbol shape includes dots or arcs; according to preset arrangement rules; according to the symbol shape corresponding to each data information bit, generate a two-dimensional code encoding; using a preset decoding algorithm to decode the two-dimensional code encoding to obtain the content information stored in the data information bits.
- a two-dimensional code generation device includes: a two-dimensional code code acquisition module, used to obtain the two-dimensional code code of the two-dimensional code image to be generated; an error-tolerant encoding module, used for the two-dimensional code
- the coding adopts a coding algorithm with a preset error-tolerance rate to perform error-tolerant coding, and obtains a two-dimensional code code after error-tolerant processing; the symbol shape determination module is used to determine that each data information bit of the two-dimensional code code after the fault-tolerant processing is in the second position.
- the first position information determination module is used for determining the error-tolerant processing according to the preset arrangement rule of the two-dimensional code encoding The first position information corresponding to each data information bit encoded by the two-dimensional code is in the generation area; the second position information determination module is used to determine the second position information of each positioning point in the generation area; two-dimensional information A code image generation module, configured to generate a two-dimensional code image based on the first position information, the symbol shape corresponding to each data information bit, and the second position information of each positioning point.
- a two-dimensional code decoding device includes: an image information acquisition module for acquiring image information of a two-dimensional code image to be identified; a positioning point position information determination module for according to the two-dimensional code to be identified.
- the image information of the code image to determine the positioning point position information of each positioning point in the to-be-recognized two-dimensional code image; the data information bit position information determination module is used to determine the positioning point position information based on the positioning point information.
- a symbol shape determination module configured to determine the symbol shape corresponding to each data information bit based on the position information of each data information bit in the image;
- the code element shape includes dots or arcs;
- a two-dimensional code code generation module is used to generate a two-dimensional code code according to a preset arrangement rule; a two-dimensional code code is generated according to the code element shape corresponding to each of the data information bits;
- a decoding module with Decoding the two-dimensional code using a preset decoding algorithm to obtain the content information stored in the data information bits.
- a two-dimensional code generating device includes: at least one processor; and a memory connected in communication with the at least one processor; wherein, the memory stores data that can be used by the at least one processor
- the instruction to be executed, the instruction is executed by the at least one processor, so that the at least one processor can: obtain the two-dimensional code encoding of the two-dimensional code image to be generated; use a preset for the two-dimensional code encoding
- the coding algorithm of the error-tolerance rate performs error-tolerant coding to obtain the two-dimensional code code after the fault-tolerant processing; determining the corresponding symbol shape of each data information bit of the two-dimensional code code after the fault-tolerant processing in the generation area of the two-dimensional code image;
- the shape of the code element includes a dot or an arc; according to the preset arrangement rule of the two-dimensional code encoding, determine the first position information corresponding to each data information bit encoded by the two-dimensional code after the error-tolerant processing in the generation area Determine the second position information of each positioning
- a two-dimensional code decoding device includes: at least one processor; and a memory connected in communication with the at least one processor; wherein, the memory stores data that can be accessed by the at least one processor
- the instruction to be executed, the instruction is executed by the at least one processor, so that the at least one processor can: obtain the image information of the two-dimensional code image to be recognized; according to the image information of the two-dimensional code image to be recognized, Determine the location information of each location in the image to be identified for each location of the two-dimensional code image; determine the location information of each data information in the image based on the location information of the location;
- the position information of each data information bit in the image determines the symbol shape corresponding to each data information bit; the symbol shape includes dots or arcs; according to preset arrangement rules; according to each of the data
- the shape of the symbol corresponding to the information bit generates a two-dimensional code code; the two-dimensional code code is decoded by using a preset decoding algorithm to obtain the content information stored in the data information bit.
- a computer-readable medium provided by an embodiment of the present specification stores computer-readable instructions thereon, and the computer-readable instructions can be executed by a processor to implement a method for generating and decoding a two-dimensional code.
- An embodiment of the present specification achieves the following beneficial effects: by acquiring the two-dimensional code encoding of the two-dimensional code image to be generated, using an encoding algorithm with a preset error tolerance rate to perform error-tolerant encoding, and obtaining the two-dimensional code encoding after error-tolerant processing; Determine the symbol shape corresponding to each data information bit encoded by the fault-tolerant two-dimensional code in the generation area of the two-dimensional code image; determine the two-dimensional code after the fault-tolerant processing according to the preset arrangement rule of the two-dimensional code encoding The first position information corresponding to each data information bit encoded by the code in the generation area; then determine the second position information of each positioning point in the generation area; then based on the first position information, each data information The shape of the symbol corresponding to the bit and the second position information of each positioning point are used to generate a two-dimensional code image.
- the generated applet code is circular as a whole, and the data area is a circular ring composed of dots and arcs. And in the blank area with the same interval between the adjacent rings, the middle area and the lower right corner area are used as the logo display area, the data is evenly distributed, and the data error tolerance of each part is consistent. It can generate two-dimensional codes with strong anti-distortion ability and strong anti-pollution ability.
- FIG. 1 is a schematic flowchart of a method for generating a two-dimensional code according to an embodiment of the present specification
- FIG. 2 is a schematic structural diagram of a small program code provided by an embodiment of the present specification
- FIG. 3 is a schematic flowchart of a two-dimensional code decoding method provided by an embodiment of the present specification
- FIG. 5 is a schematic diagram of a two-dimensional code generation device provided by an embodiment of this specification.
- FIG. 6 is a schematic diagram of a two-dimensional code decoding device provided by an embodiment of this specification.
- FIG. 7 is a schematic diagram of generating and decoding a two-dimensional code provided by an embodiment of this specification.
- Two-dimensional code is also called two-dimensional barcode.
- the common two-dimensional code is QR Code.
- the full name of QR is Quick Response. It is a super popular coding method on mobile devices in recent years. It can store more than traditional Bar Code barcodes information, and can also represent more data types.
- the applet code is attached to the application program compared to the two-dimensional code.
- the applet code of some chat apps can only be generated and recognized by the chat app, which is more secure. High, and the lower right corner of each applet code is a fixed applet logo, so that more brand information can be transmitted transparently.
- the existing applet codes still have certain limitations.
- the anti-image distortion capability of the applet code is insufficient, and the applet code is printed on a flat plane. If the plane where the applet code is located is convex or concave, for example, the QR code is printed on a sphere, the recognition rate of the QR code will drop significantly.
- the recognition ability of QR codes is very limited.
- the contamination of a small block at any position may cause the applet code to fail to be recognized.
- FIG. 1 is a schematic flowchart of a method for generating a two-dimensional code according to an embodiment of the present specification. From a program perspective, the execution body of the process may be a program mounted on an application server or an application client.
- Step 110 Obtain the two-dimensional code code of the two-dimensional code image to be generated.
- the two-dimensional code encoding can represent the encoding used to generate the two-dimensional code image, for example, it can be a string of preset digits, such as binary sequence, ternary sequence, etc.
- a series of two-dimensional code sequences can be obtained.
- the two-dimensional code here may refer to a small program code, and the small program code may represent a two-dimensional code attached to an original application and used for a certain function.
- the applet code in instant messaging applications and the applet code in payment applications.
- the applet code can be used in many scenarios such as ordering, payment, ticket purchase, and medical registration.
- a two-dimensional code may refer to a two-dimensional code code or a two-dimensional code picture, which may be set according to actual needs, which is not specifically limited in this application.
- the two-dimensional code information refers to information with actual meaning carried in the two-dimensional code encoding, for example, user center identification information and the like.
- Step 120 Perform error-tolerant encoding on the two-dimensional code using an encoding algorithm with a preset error-tolerance rate, to obtain a two-dimensional code after error-tolerant processing.
- Error-tolerant coding can mean that a part of redundant information is added in the encoding process to enhance the anti-error ability, and strive to obtain the maximum gain with the least amount of redundancy, and its anti-error performance is at the expense of encoding efficiency. cost.
- error-tolerant coding techniques mainly include: Insertion of Synchronization Marks (RM), Data Partitioning (DP), Reversible Length Coding (RVLC), Parameter Sets, Intra-Frame Coding Update Technology, Hierarchical Coding (LC) technique, Multiple Description Coding (MDC) for correlated sub-stream transmission, etc.
- the fault tolerance rate of a QR code can refer to the fact that even if the generated QR code is partially blocked, or a part of it is not fully displayed, the user can scan it successfully. Rate.
- Fault-tolerant coding has multiple levels of fault-tolerant, which can also be understood as fault-tolerant coding with multiple levels of redundancy.
- the fault-tolerant coding of each version corresponds to four fault-tolerant levels of L, M, Q, and H, respectively.
- L-level fault-tolerant applet code about 10% of the characters can be corrected; for the M-level fault-tolerant applet, about 15% of the characters can be corrected; for the Q-level fault-tolerant applet, about 25% Word codes can be corrected; for H-level fault-tolerant small program codes, about 35% of the word codes can be corrected.
- H-level fault-tolerant small program codes about 35% of the characters can be corrected. This means that in the best case, when 35% of the small program code is blocked/damaged, the scanning engine can still recognize the information carried by the small program code.
- the 35% damaged area cannot be a positioning pattern or functional data, but must be a pure coding area, and the erroneous areas must be evenly distributed to be able to The entire QR code is recognized.
- the error tolerance rate is preset. Once the version and error correction level of the applet code are determined, the corresponding error correction code can be fixed. In the whole process, there is no need to add additional error tolerance information. This ensures that the data corresponding to the coding area is uniform. Therefore, no matter which part of the applet code is blocked, as long as the positioning point is not blocked and the blocked area is less than or equal to 35%, the applet code can still be identified. In addition, in the decoding stage, the error correction code can also be eliminated through corresponding rules to obtain corresponding content information.
- the data of the generated applet code is evenly distributed, and the data of each part is consistent in fault-tolerance.
- the use of fixed fault-tolerant fault-tolerant coding can ensure the fault-tolerant ability of the applet code, so that the generated applet code has anti-fouling, anti-distortion, anti-reflection and other capabilities.
- Step 130 Determine the symbol shape corresponding to each data information bit encoded by the error-tolerant two-dimensional code in the generation area of the two-dimensional code image; the symbol shape includes a dot or an arc.
- the generation area may represent an area for generating a two-dimensional code.
- the data information bits may represent points in the applet code used to represent the content information. Specifically, commodity information or other content information may be stored in the data information bit, and the scanning device may acquire the content information stored in the data information bit by scanning the applet code.
- the generation area of the two-dimensional code may refer to the contour area of the two-dimensional code.
- the contour area of the two-dimensional code is a circular area with a diameter of 6 cm.
- the shape of a symbol may refer to the shape of a code block used to carry content information in a two-dimensional code image, such as: dots, squares, rectangles, arcs, and so on.
- the shape of the symbol may include dots and arcs.
- the value of each code bit corresponds to the shape of the code element in the applet code.
- the "1" in the binary sequence indicates that the code element shape is a black dot.
- "0" in binary is represented as a white dot (the default background color is white at this time), if "1" appears continuously in the binary sequence, it constitutes a black arc.
- Step 140 According to the preset arrangement rule of the two-dimensional code encoding, determine the first position information corresponding to each data information bit encoded by the two-dimensional code after the error-tolerant processing in the generation area.
- the first position information may represent the corresponding position of each data information bit in the generation area.
- the preset arrangement rule may represent a preset ordering rule for QR code encoding.
- the preset arrangement rule can set the starting code element point in the QR code image corresponding to the QR code encoding, or Set the symbol point in the two-dimensional code image corresponding to each code bit in the two-dimensional code encoding, so that based on the two-dimensional code encoding, according to the preset arrangement rules, it can be determined that each data information bit is specifically in the generation area. s position.
- Step 150 Determine the second position information of each positioning point in the generation area.
- the second position information may indicate the corresponding position of each positioning point in the generation area.
- the positioning point can represent the point where the two-dimensional code is located. Generally, there are four positioning points, including the direction positioning point, and the direction positioning point can mark the direction of the two-dimensional code.
- the orientation positioning point can be set at the lower right corner of the QR code image, and other positioning points can be set at the upper left corner, the lower left corner and the upper right corner in the generation area of the QR code image, respectively.
- Step 160 Generate a two-dimensional code image based on the first position information, the symbol shape corresponding to each data information bit, and the second position information of each positioning point.
- each positioning point and the position information of the valid information bits may be represented by coordinates, or may be represented in the form of a matrix.
- each positioning point bit and valid information bit in the two-dimensional code can be correspondingly converted into corresponding elements in each row and each column in the matrix. For example: convert the positioning point of the upper left positioning area in the QR code to the element corresponding to the first row and first column in the matrix.
- a two-dimensional code image may include positioning points for positioning the two-dimensional code and data information bits for carrying content information, wherein the symbol shape of each positioning point is known. After the position information of the bit, the position information of each data information bit, and the symbol shape of each data information bit, the corresponding two-dimensional code image can be generated.
- each data information bit encoded by the two-dimensional code after the error-tolerant processing is determined corresponding first position information in the generation area; then determine the second position information of each positioning point in the generation area; then based on the first position information, the symbol shape corresponding to each data information bit, and The second position information of each positioning point generates a two-dimensional code image.
- the shape design of dots and arcs and the use of fixed error-tolerant coding algorithms for coding can generate QR codes with strong anti-distortion and anti-pollution capabilities.
- the determining the code element shape corresponding to each data information bit encoded by the fault-tolerant two-dimensional code in the generation area of the two-dimensional code image may specifically include: for the two-dimensional code after the fault-tolerant processing. each code bit in the code encoding, determine the order of the code bit in the two-dimensional code encoding after the error-tolerant processing; determine the position of the data information bit corresponding to the order in the two-dimensional code generation area; according to The value of the coded bit determines the shape of the symbol corresponding to the data information bit at the position.
- using a coding algorithm with a preset error tolerance rate for error-tolerant coding can be understood as using a fixed error-tolerant coding algorithm to convert the data corresponding to the content information into a character string with a preset number of digits, for example: using a fixed error-tolerant coding
- the algorithm converts the data corresponding to the content information into a binary sequence.
- the content information may represent the information that the two-dimensional code needs to carry. For example: product information, application function information, platform information, brand information, etc.
- the characters corresponding to the content information can be divided into groups of three bits, each group of data can be converted into 10-bit binary data, and the remaining one or two bits can be converted into 4- or 7-bit binary data data.
- each binary bit in a binary sequence has an order in the binary sequence.
- a binary sequence is 010110101, starting from left to right, the first binary digit in the binary sequence is 0, the second binary digit is 1, the third binary digit is 0...
- the ninth binary digit is 1.
- the first binary bit in the binary sequence corresponds to the preset starting point in the data information bits in the two-dimensional code
- the second binary bit in the binary sequence corresponds to the second point in the data information bits in the two-dimensional code Bit
- the binary bits in the binary sequence correspond to the corresponding positions in the data information bits in the two-dimensional code respectively.
- the number of dots corresponding to the arc can be set. For example, at least three black dots can be set to correspond to a segment of the arc, that is, when there are three consecutive arcs in the binary sequence When "1", an arc will be formed.
- the distance between adjacent dots and the distance between the dots and adjacent arcs can also be set. You can also set the arrangement angle of the dots and arcs, where the arrangement angle can refer to the angle value corresponding to the polar coordinate.
- the generating area further includes mask information; before the acquiring the two-dimensional code encoding of the two-dimensional code image to be generated, may further include: masking the two-dimensional code encoding according to the mask information. After mask processing, the two-dimensional code code after mask processing is obtained.
- the mask information can be stored in other points except the positioning point, and how many symbols are needed to store the mask information can be determined according to the capacity or size of the generated two-dimensional code. Two kinds of masks can be stored in a symbol.
- the area where the data information bits are located may be a digital area, and the area where the positioning point bits are located may be a functional area.
- Mask processing only masks the digital area where the data information bits are located, and does not affect the functional area where the positioning points are located.
- the function of the mask can be to make the dots and arcs in the two-dimensional code evenly distributed, so that the accuracy of the two-dimensional code recognition can be improved.
- the quality of the mask is determined by the mask.
- the mask may refer to a strategy for changing the values of symbols in the two-dimensional code area according to specific rules.
- the purpose of using the mask is to adjust the display of each symbol in the two-dimensional code. If a symbol in the two-dimensional code is masked, it can be understood that if the symbol is a white dot before masking, it can become a black dot after masking. In other words, the mask can be understood as modifying the pixel value of the symbol in the two-dimensional code.
- error-tolerant coding is performed by using a coding algorithm with a preset error-tolerance rate, which can ensure that the data in the generated applet code is evenly distributed, and the data mentioned here may include the content that needs to be carried Corresponding data and metadata of code basic information.
- the role of the mask is to ensure that the shape or color of the symbols in the generated applet code appears to be evenly distributed.
- the applet code generated in the above embodiment can be described with reference to FIG. 2 .
- FIG. 2 is a schematic structural diagram of a small program code provided by an embodiment of the present specification.
- the overall image of the applet code is a circular ring, and the image of the applet code may include a ring formed by the dots 240 and the arcs 250 , a middle area 220 , and a first positioning point. 210 and the orientation anchor point 230.
- the ring width of each ring is the same.
- the ring width of the ring can be understood as the width of the arc 250 , and can also be understood as the diameter length of the dot 240 .
- the diameter of each dot 240 is equal to the width of the arc 250 .
- the middle area 220 is concentric with the ring; the middle area 220 is used to display a first logo, and the first logo may be a brand logo; the adjacent rings have the same interval; The interval between the middle area 220 and the circles formed by adjacent symbol shapes is the same as the interval between the adjacent circles. As shown in Figure 1, the background color is white by default, and there are blank spaces between adjacent rings.
- the background color of the two-dimensional code image and the color of the identification area in the two-dimensional code can be set according to actual application scenarios.
- the two colors mentioned in the above steps may represent the two colors after binarization, rather than the two colors in the sense of color.
- the initially generated QR code has multiple colors, and after binarization, there are only two colors.
- the data area may be three circles composed of dots 240 or arcs 250 for carrying data.
- Use a fault-tolerant algorithm with a set fault-tolerance efficiency for fault-tolerant coding For example, use a fault-tolerant coding with an overall fault-tolerance rate of 25%.
- the specific fault-tolerant strategy is (16,8), that is, the valid data is 16 bytes, and a maximum of 8 bytes are supported for error correction.
- the total length of the data stream is 32 bytes.
- the direction positioning point 230 in the lower right corner can be used as an auxiliary positioning point to participate in the positioning and decoding of the code, and is also used to display the second mark. Further, the display area of the second mark in the lower right corner can be smaller than the second mark in the middle area. In the display area of one logo, the content in the two LOGO areas can be customized as needed, such as brand, activity logo, etc.
- the data area can be selected as 3 circles or 4 circles, and the outermost circle (the fourth circle) can be used to carry data, and can also be used as a modification of the applet code image.
- the generated applet code is in the shape of a circular ring as a whole, and the data area is a circular ring formed by dots and arcs. And in the blank area with the same interval between the adjacent rings, the middle area and the lower right corner area are used as the logo display area, which is coded with fixed fault tolerance, and there is no need to transparently transmit fault tolerance information, so that the data is distributed evenly. It can ensure that the generated two-dimensional code has strong anti-distortion ability, strong anti-fouling ability, and can transparently transmit more brand information.
- the generated two-dimensional code corresponds to a decoding method:
- FIG. 3 is a schematic flowchart of a two-dimensional code decoding method according to an embodiment of the present specification. From a program perspective, the execution body of the process may be a program mounted on an application server or an application client.
- the decoding process in Embodiment 2 corresponds to the encoding process in Embodiment 1.
- Step 310 Acquire image information of the two-dimensional code image to be recognized.
- the image information mentioned in this step may represent the information of the two-dimensional code itself that is not limited by the two-dimensional code carrier, such as the information of the two-dimensional code drawn on the computer.
- the size information of the two-dimensional code the position information of each positioning point, the position information of the data information bit, and the symbol shape and symbol color corresponding to each point in the two-dimensional code.
- Step 320 According to the image information of the two-dimensional code image to be identified, determine the positioning point position information in the image of each positioning point in the two-dimensional code image to be identified.
- Step 330 Based on the position information of the positioning point, determine the position information of each data information in the image.
- the position information of each positioning point can be determined from the image information of the two-dimensional code, the logo display area reserved in the middle is known, and the remaining points except the positioning point and the middle display area can be determined as data information bits .
- Content information may be stored in the data information bits.
- the scanning device can obtain the content information stored in the data information bits by scanning the two-dimensional code.
- Step 340 Based on the position information of each data information bit in the image, determine a symbol shape corresponding to each data information bit; the symbol shape includes a dot or an arc.
- the shape of the symbol corresponding to each data information bit can be determined from the image information.
- Step 350 According to a preset arrangement rule; generate a two-dimensional code code according to the shape of the symbol corresponding to each of the data information bits.
- the preset arrangement rule can be the arrangement rule used when the applet code is generated. When decoding, it is only necessary to perform corresponding analysis according to the arrangement rule used when generating the applet QR code, and then the information bits of each data information bit can be parsed. The symbol shape is parsed into a QR code encoding.
- Step 360 Decode the two-dimensional code using a preset decoding algorithm to obtain the content information stored in the data information bits.
- Embodiment 1 should correspond to the decoding algorithm in Embodiment 2. Assuming that the content information is encoded by a fault-tolerant algorithm with a fault tolerance of 25% to obtain a binary sequence, then, when decoding, a fault-tolerant 25% fault-tolerant algorithm should also be used. A fault-tolerant algorithm decodes the binary sequence. It should be noted that the specific selection of the fault-tolerant algorithm can be selected according to the actual application scenario.
- the image of the two-dimensional code to be identified may be a circular ring; the image includes a first positioning point and a direction positioning point; the upper left corner position, the upper right corner position and the lower left corner position distribution of the image. There is a first positioning point; a direction positioning point is distributed in the lower right corner of the image.
- the determining, according to the image information of the to-be-recognized two-dimensional code image, the location information of the location of each location in the to-be-recognized two-dimensional code image may specifically include: The positioning point position information, using an adaptive sampling algorithm to determine the position information of each positioning point in the to-be-recognized two-dimensional code image in the image and the position information of each data information in the image .
- an adaptive sampling algorithm is used to determine the position of the sampling point, and finally a bit stream is obtained by sampling, which can further improve the recognition rate of the nonlinear distortion scene.
- distortion is some common nonlinear transformations, such as the change of the wrinkle on the surface of the material, and the material is laid on an uneven surface, such as the surface of a cylinder, so that the code changes.
- the corresponding process is: find four positioning points in the incoming frame image, according to the four positioning points (prefabricated) of the coordinate system on the code and the four positioning points of the image coordinate system.
- Point calculate the transformation matrix from the coordinate system on the code to the coordinate system on the map; then based on the transformation matrix and the data points (prefab) of the coordinate system on the code, calculate the sampling position of the coordinate system on the map, directly at the corresponding point
- the 0/1 bit stream is obtained by sampling, and finally the original data is obtained by decoding the bit stream.
- the first point collected based on the sampling position is directly used as the final sampling point for sampling.
- the image of the applet code is easily compressed due to the nonlinear distortion scenario. Part of the image is compressed or stretched, causing the shape of some symbols in the applet code image to change, and it is easy to use the wrong sampling point as the final sampling point to collect the wrong bit stream. For example, it was originally an arc, but it was compressed. After that, the collected dots are dots, which leads to the final identification error of the applet code.
- the embodiment of this specification further improves the sampling method in the decoding method for the applet code on the basis of improving the applet code, and corrects the error based on the adaptive sampling, so as to obtain the correct sampling point position, and sample a bit stream with a higher accuracy rate, thereby improving the identification accuracy rate of the applet code.
- the determining the position information of each piece of data information in the image based on the position information of the positioning point and adopting an adaptive sampling algorithm may specifically include: determining the position information of the positioning point based on the position information of the positioning point. Identify the first position information of each positioning point in the image coordinate system in the two-dimensional code image; obtain the second position information of each positioning point in the coordinate system on the code; based on the first position information and the first position information Two position information, calculate the transformation matrix between the coordinate system on the code and the image coordinate system; obtain the third position information of each data information bit in the coordinate system on the code; based on the transformation matrix and the third position information position information, to determine the initial sampling point position of each data information in the image coordinate system; based on the adaptive sampling algorithm, correct the initial sampling point position to determine that each data information is located in the image coordinate system
- the position of the final sampling point in the image; based on the position of the final sampling point, sampling is performed in the to-be-identified image to obtain the position information of each data information bit in the image
- the coordinate system on the code can represent the coordinate system based on the viewing angle of the code, regardless of any changes.
- the upper left corner of the circumscribed square of the code is the origin, and a single data point is 1 unit.
- the coordinate system on the figure can represent the coordinate system based on the viewing angle of the incoming frame image, the coordinate system with the upper left corner of the image as the origin, and each pixel is 1 unit.
- the error generated by distortion has the following two characteristics: distortion is gradually accumulated, there is always a certain sampling point that is accurate, and then slowly shifts to the exact sampling position, the error of distortion is transitive, a sampling point and the surrounding sampling point The sampling points of , the errors are similar.
- the ideal sampling point is always at the center of the data point. For example, if it is a black dot, the sampling point should be at the center of the black dot, and if it is an arc, the sampling point should be at the arc. Half the width and half a unit or more on either side of the principle.
- FIG. 4 is a schematic flowchart of adaptive sampling in a two-dimensional code decoding method provided by an embodiment of the present specification.
- the historical error can be superimposed after the sampling is started; then initial sampling is performed according to the traditional sampling method, and the initial sampling result is obtained from the initial sampling.
- the initial sampling result may include black sampling result 1 or white sampling result 0.
- the sampling point can be corrected to the center of the black dot or to the position of half the width of the small arc and half a unit from the edge.
- the initial sampling value is 0
- search for the set distance on both sides in the diameter direction The set distance can be adjusted based on the actual application scenario. If a black block is found after moving the set distance, it can be explained that The sampling result here should be black. Correct the original white sampling point to the ideal sampling position corresponding to the black sampling point. For example, move to the center of the circle corresponding to the black sampling point.
- Error correction is performed based on historical errors, and after correction, resampling is performed based on new sampling points.
- error correction can mean correcting the result of the initial sampling. For example, when the initial sampling result is a black dot, the sampling point can be corrected to the center of the black dot or to the position of half the width of the small arc and half a unit from the edge.
- the initial sampling result is white
- search for the set distance on both sides in the diameter direction The set distance can be adjusted based on the actual application scenario. If a black block is found after moving the set distance, it means this The sampling point should be black, and the original white sampling point should be corrected to the ideal sampling position of the black sampling point. If it is still a white block after moving the set distance, it can be determined that the position of the initial sampling point does not need to be corrected, and all sampling ends.
- a final sampling point position is obtained, sampling is performed based on the final sampling point position, a bit stream is obtained, and finally corresponding content information is obtained by decoding.
- the self-adaptive sampling method is used for decoding, which can improve the recognition accuracy of the applet code.
- the generated applet code is a circular ring as a whole, and the data area is a circular ring composed of dots and arcs. And in the blank area with the same interval between the adjacent rings, the middle area and the lower right corner area are used as the logo display area, the data is evenly distributed, and the data error tolerance of each part is consistent.
- using 25% fault-tolerant error-tolerant coding ensures the error-tolerant ability of the code. It can ensure that the generated two-dimensional code has strong anti-distortion ability, strong anti-fouling ability, and can transparently transmit more brand information.
- the code elements of dark, high light and medium light are used to carry data, which will greatly reduce the cost of small program codes in complex offline environments (such as dark light, reflective scenes, etc.). Identify success rates.
- the data display of binary images has a higher recognition rate in low-light/high-light scenes.
- the middle area of the applet code and the direction positioning point area in the lower right corner are set as the area where the logo is displayed, which enriches the information content that the user can directly obtain.
- two LOGO areas are reserved, which can reveal the main brand and service type, function or activity (such as red envelopes, ordering, etc.) information at the same time. Using a specific design shape is conducive to cultivating the user's scanning habit.
- FIG. 5 is a schematic diagram of a two-dimensional code generating apparatus provided by an embodiment of the present specification.
- the device may include: a two-dimensional code encoding acquisition module 510 for acquiring the two-dimensional code encoding of the two-dimensional code image to be generated; an error-tolerant encoding module 520 for using a pre-determined two-dimensional code encoding for the two-dimensional code.
- the coding algorithm that sets the error-tolerance rate performs error-tolerant coding, and obtains the two-dimensional code encoding after the error-tolerant processing; the symbol shape determination module 530 is used to determine that each data information bit of the two-dimensional code encoding after the fault-tolerant processing is in the two-dimensional code.
- the corresponding symbol shape in the generation area of the image; the symbol shape includes a dot or an arc; the first position information determination module 540 is used to determine the error-tolerant processing according to the preset arrangement rule of the two-dimensional code encoding.
- the code element shape determination module 530 may be specifically configured to: for each code bit in the error-tolerant two-dimensional code encoding, determine the code bit in the two-dimensional code after the error-tolerant processing. The sequence in encoding; determining the position of the data information bit corresponding to the sequence in the two-dimensional code generation area; determining the symbol shape corresponding to the data information bit at the position according to the value of the encoding bit.
- the apparatus may further include: a mask module, configured to perform mask processing on the two-dimensional code according to the mask information to obtain a mask-processed two-dimensional code.
- a mask module configured to perform mask processing on the two-dimensional code according to the mask information to obtain a mask-processed two-dimensional code.
- the positioning points may include a first positioning point and a second positioning point; the first positioning points may be respectively distributed in the upper left corner, the upper right corner and the lower left corner of the generation area. ; The second positioning point may be distributed in the lower right corner of the generation area.
- the two-dimensional code image may include a ring formed by the dot and the arc; the ring width of each ring of the ring is the same.
- the two-dimensional code image may further include a middle area, and the middle area is concentric with the ring; the middle area may be used to display the first logo; there is a space between the adjacent rings. The same interval; the interval between the middle area and the circle formed by the adjacent symbol shapes is the same as the interval between the adjacent circles.
- the symbols in the two-dimensional code image may be encoded in two colors.
- the area corresponding to the direction positioning point may be used to display a second mark; the display area of the second mark is smaller than the display area of the first mark.
- FIG. 6 is a schematic diagram of a two-dimensional code decoding apparatus provided by an embodiment of the present specification.
- the device may include: an image information acquisition module 610 for acquiring the image information of the two-dimensional code image to be recognized; a positioning point position information determination module 620 for obtaining the image information of the two-dimensional code image to be recognized Image information, to determine the positioning point position information of each positioning point in the to-be-recognized two-dimensional code image in the image; the data information position information determination module 630 is used to determine each data based on the positioning point position information The position information of the information bits in the image; the symbol shape determination module 640 is configured to determine the symbol shape corresponding to the respective data information bits based on the position information of the respective data information bits in the image; The code element shape includes dots or arcs; the two-dimensional code code generation module 650 is used to generate a two-dimensional
- the image of the two-dimensional code to be recognized is an annular shape; the image may include a first positioning point and a direction positioning point; the position of the upper left corner, the upper right corner and the lower left corner of the image are distributed. There is a first positioning point; a direction positioning point is distributed in the lower right corner of the image.
- the data information bit position information determining module 630 may specifically include: a data information bit position information determining unit, configured to use an adaptive sampling algorithm based on the positioning point position information to determine the to-be-identified two-dimensional The position information in the image of each positioning point in the code image and the position information in the image of each data information bit.
- the data information bit position information determining unit may be specifically configured to: based on the positioning point position information, determine the first position in the image coordinate system of each positioning point in the to-be-recognized two-dimensional code image. position information; obtain the second position information of each positioning point in the coordinate system on the code; calculate the distance between the coordinate system on the code and the image coordinate system based on the first position information and the second position information obtain the third position information of each data information bit in the coordinate system on the code; determine the initial sampling point of each data information bit in the image coordinate system based on the transformation matrix and the third position information position; based on the adaptive sampling algorithm, correct the initial sampling point position to determine the final sampling point position of each data information bit in the image coordinate system; based on the final sampling point position, in the to-be-to-be Sampling is performed in the identification image to obtain the position information of each data information bit in the image.
- the embodiments of this specification also provide a device corresponding to the above method.
- FIG. 7 is a schematic diagram of generating and decoding a two-dimensional code provided by an embodiment of this specification.
- the device 700 may include: at least one processor 710 ; and a memory 730 communicatively connected to the at least one processor; wherein the memory 730 stores information executable by the at least one processor 710 Instruction 720.
- the instructions are executed by the at least one processor 710, so that the at least one processor 710 can: acquire the two-dimensional code code of the two-dimensional code image to be generated; encode the two-dimensional code Use a coding algorithm with a preset error-tolerance rate to perform error-tolerant coding to obtain a two-dimensional code code after error-tolerant processing; determine the corresponding data information bits of the two-dimensional code code after the fault-tolerant processing in the generation area of the two-dimensional code image.
- the shape of the code element includes a dot or an arc; according to the preset arrangement rule of the two-dimensional code encoding, it is determined that each data information bit encoded by the two-dimensional code after the error-tolerant processing corresponds to the generation area.
- first position information determining the second position information of each positioning point in the generation area; based on the first position information, the symbol shape corresponding to each data information bit, and the second position information of each positioning point , to generate a QR code image.
- the instructions are executed by the at least one processor 710, so that the at least one processor 710 can: acquire the image information of the two-dimensional code image to be recognized; the image information, determine the positioning point position information of each positioning point in the to-be-recognized two-dimensional code image in the image; based on the positioning point position information, determine the position information of each data information in the image ; Based on the position information of the respective data information bits in the image, determine the symbol shape corresponding to the respective data information bits; the symbol shape includes a dot or an arc; according to preset arrangement rules; A two-dimensional code code is generated from the symbol shape corresponding to each of the data information bits; the two-dimensional code code is decoded by using a preset decoding algorithm to obtain the content information stored in the data information bits.
- the embodiments of the present specification also provide a computer-readable medium corresponding to the above method.
- Computer readable instructions are stored on the computer readable medium.
- the computer-readable instructions can be executed by the processor to implement the following methods: obtaining the two-dimensional code encoding of the two-dimensional code image to be generated; using the encoding with a preset error tolerance rate for the two-dimensional code encoding
- the algorithm performs error-tolerant coding to obtain a two-dimensional code code after error-tolerant processing; determines the code element shape corresponding to each data information bit of the two-dimensional code code after the error-tolerant processing in the generation area of the two-dimensional code image; the code element The shape includes dots or arcs; according to the preset arrangement rules of the two-dimensional code encoding, determine the first position information corresponding to each data information bit encoded by the two-dimensional code after the error-tolerant processing in the generation area; determine the generating second position information of each positioning point in the area; generating a two-dimensional code image based on the first position information, the symbol shape corresponding to each data information bit, and the second position information of each positioning point.
- the computer-readable instructions can be executed by the processor to implement the following methods: acquiring image information of the two-dimensional code image to be recognized; Identify the positioning point position information of each positioning point in the two-dimensional code image in the image; based on the positioning point position information, determine the position information of each data information bit in the image; based on the each data information bit
- the position information in the image determines the symbol shape corresponding to each data information bit; the symbol shape includes dots or arcs; according to preset arrangement rules; according to the corresponding data information bits
- the code element shape generates a two-dimensional code code; the two-dimensional code code is decoded by using a preset decoding algorithm to obtain the content information stored in the data information bits.
- a Programmable Logic Device (such as a Field Programmable Gate Array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device.
- HDL Hardware Description Language
- ABEL Advanced Boolean Expression Language
- AHDL Altera Hardware Description Language
- HDCal JHDL
- Lava Lava
- Lola MyHDL
- PALASM RHDL
- VHDL Very-High-Speed Integrated Circuit Hardware Description Language
- Verilog Verilog
- the controller may be implemented in any suitable manner, for example, the controller may take the form of eg a microprocessor or processor and a computer readable medium storing computer readable program code (eg software or firmware) executable by the (micro)processor , logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers and embedded microcontrollers, examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicon Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory.
- the controller may take the form of eg a microprocessor or processor and a computer readable medium storing computer readable program code (eg software or firmware) executable by the (micro)processor , logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers and embedded microcontrollers
- ASICs application specific integrated circuits
- controllers include but are not limited to
- the controller in addition to implementing the controller in the form of pure computer-readable program code, the controller can be implemented as logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded devices by logically programming the method steps.
- the same function can be realized in the form of a microcontroller, etc. Therefore, such a controller can be regarded as a hardware component, and the devices included therein for realizing various functions can also be regarded as a structure within the hardware component. Or even, the means for implementing various functions can be regarded as both a software module implementing a method and a structure within a hardware component.
- a typical implementation device is a computer.
- the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device Or a combination of any of these devices.
- embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
- computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
- These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
- the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
- a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- Memory may include forms of non-persistent memory, random access memory (RAM) and/or non-volatile memory in computer readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
- RAM random access memory
- ROM read only memory
- flash RAM flash memory
- Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology.
- Information may be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD), or other optical storage , magnetic tape cartridges, magnetic tape-disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
- computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
- the embodiments of the present application may be provided as a method, a system or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
- computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
- the application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer.
- program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types.
- the application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network.
- program modules may be located in both local and remote computer storage media including storage devices.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Image Processing (AREA)
Abstract
Description
Claims (22)
- 一种二维码生成方法,包括:获取待生成二维码图像的二维码编码;对所述二维码编码采用预先设定容错率的编码算法进行容错编码,得到容错处理后的二维码编码;确定所述容错处理后的二维码编码的各个数据信息位在二维码图像的生成区域中对应的码元形状;所述码元形状包括圆点或圆弧;根据二维码编码预设排列规则,确定所述容错处理后的二维码编码的各个数据信息位在所述生成区域中对应的第一位置信息;确定所述生成区域中各个定位点位的第二位置信息;基于所述第一位置信息、每个数据信息位对应的码元形状以及每个定位点位的第二位置信息,生成二维码图像。
- 根据权利要求1所述的方法,所述确定所述容错处理后的二维码编码的各个数据信息位在二维码图像的生成区域中对应的码元形状,具体包括:对于所述容错处理后的二维码编码中的每个编码位,确定该编码位在所述容错处理后的二维码编码中的顺序;确定所述顺序在所述二维码生成区域中对应的数据信息位的位置;根据该编码位的值确定所述位置的数据信息位对应的码元形状。
- 根据权利要求1所述的方法,所述生成区域中还包括掩模信息;所述获取待生成二维码图像的二维码编码之前,还包括:根据所述掩模信息对所述二维码编码进行掩模处理,得到掩模处理后的二维码编码。
- 根据权利要求1所述的方法,所述定位点位包括第一定位点位和第二定位点位;所述第一定位点位分别分布在所述生成区域的左上角位置、右上角位置以及左下角位置;所述第二定位点位分布在所述生成区域的右下角位置。
- 根据权利要求1所述的方法,所述二维码图像中包括由所述圆点和所述圆弧构成的圆环;每一圈所述圆环的圆环环宽相同。
- 根据权利要求5所述的方法,所述二维码图像中还包括中间区域,所述中间区域与所述圆环同圆心;所述中间区域用于显示第一标识;相邻所述圆环之间具有相同间隔;所述中间区域与相邻的码元形状构成的圆环之间的间隔与相邻所述圆环之间的间隔相同。
- 根据权利要求1所述的方法,所述二维码图像中的码元采用两种颜色进行编码。
- 根据权利要求4所述的方法,所述方向定位点位所对应的区域用于显示第二标识;所述第二标识的显示面积小于所述第一标识的显示面积。
- 一种二维码解码方法,包括:获取待识别二维码图像的图像信息;根据所述待识别二维码图像的图像信息,确定所述待识别二维码图像中的每个定位点位在图像中的定位点位置信息;基于所述定位点位置信息,确定各个数据信息位在所述图像中的位置信息;基于所述各个数据信息位在所述图像中的位置信息,确定所述各个数据信息位对应的码元形状;所述码元形状包括圆点或圆弧;按照预设排列规则;根据每个所述数据信息位对应的码元形状生成二维码编码;采用预设的解码算法对所述二维码编码进行解码,得到所述数据信息位中储存的内容信息。
- 根据权利要求9所述的方法,所述待识别二维码图像为圆环状;所述图像中包含第一定位点位和方向定位点位;所述图像的左上角位置、右上角位置以及左下角位 置分布有第一定位点位;所述图像的右下角位置分布有方向定位点位。
- 根据权利要求9所述的方法,所述基于所述定位点位置信息,确定各个数据信息位在所述图像中的位置信息,具体包括:基于所述定位点位置信息,采用自适应采样算法,确定所述待识别二维码图像中的每个定位点位在所述图像中的位置信息以及每个数据信息位在所述图像中的位置信息。
- 根据权利要求11所述的方法,所述基于所述定位点位置信息,采用自适应采样算法,确定每个数据信息位在所述图像中的位置信息,具体包括:基于所述定位点位置信息,确定所述待识别二维码图像中每个定位点位在图像坐标系中的第一位置信息;获取各定位点位在码上坐标系中的第二位置信息;基于所述第一位置信息以及所述第二位置信息,计算所述码上坐标系与所述图像坐标系之间的变换矩阵;获取各数据信息位在码上坐标系中的第三位置信息;基于所述变换矩阵以及所述第三位置信息,确定各数据信息位在所述图像坐标系中的初始采样点位置;基于所述自适应采样算法,对所述初始采样点位置进行修正,确定各数据信息位在所述图像坐标系中的最终采样点位置;基于所述最终采样点位置,在所述待识别图像中进行采样,得到每个数据信息位在所述图像中的位置信息。
- 一种二维码生成装置,包括:二维码编码获取模块,用于获取待生成二维码图像的二维码编码;容错编码模块,用于对所述二维码编码采用预先设定容错率的编码算法进行容错编码,得到容错处理后的二维码编码;码元形状确定模块,用于确定所述容错处理后的二维码编码的各个数据信息位在二维码图像的生成区域中对应的码元形状;所述码元形状包括圆点或圆弧;第一位置信息确定模块,用于根据二维码编码预设排列规则,确定所述容错处理后的二维码编码的各个数据信息位在所述生成区域中对应的第一位置信息;第二位置信息确定模块,用于确定所述生成区域中各个定位点位的第二位置信息;二维码图像生成模块,用于基于所述第一位置信息、每个数据信息位对应的码元形状以及每个定位点位的第二位置信息,生成二维码图像。
- 根据权利要求13所述的装置,所述码元形状确定模块,具体用于:对于所述容错处理后的二维码编码中的每个编码位,确定该编码位在所述容错处理后的二维码编码中的顺序;确定所述顺序在所述二维码生成区域中对应的数据信息位的位置;根据该编码位的值确定所述位置的数据信息位对应的码元形状。
- 根据权利要求13所述的装置,所述二维码图像中包括由所述圆点和所述圆弧构成的圆环;每一圈所述圆环的圆环环宽相同。
- 根据权利要求15所述的装置,所述二维码图像中还包括中间区域,所述中间区域与所述圆环同圆心;所述中间区域用于显示第一标识;相邻所述圆环之间具有相同间隔;所述中间区域与相邻的码元形状构成的圆环之间的间隔与相邻所述圆环之间的间隔相同。
- 一种二维码解码装置,包括:图像信息获取模块,用于获取待识别二维码图像的图像信息;定位点位置信息确定模块,用于根据所述待识别二维码图像的图像信息,确定所述待识别二维码图像中的每个定位点位在图像中的定位点位置信息;数据信息位位置信息确定模块,用于基于所述定位点位置信息,确定各个数据信息位在所述图像中的位置信息;码元形状确定模块,用于基于所述各个数据信息位在所述图像中的位置信息,确定所述各个数据信息位对应的码元形状;所述码元形状包括圆点或圆弧;二维码编码生成模块,用于按照预设排列规则;根据每个所述数据信息位对应的码元形状生成二维码编码;解码模块,用于采用预设的解码算法对所述二维码编码进行解码,得到所述数据信息位中储存的内容信息。
- 根据权利要求17所述的装置,所述数据信息位位置信息确定模块,具体包括:数据信息位位置信息确定单元,用于基于所述定位点位置信息,采用自适应采样算法,确定所述待识别二维码图像中的每个定位点位在所述图像中的位置信息以及每个数据信息位在所述图像中的位置信息。
- 根据权利要求18所述的装置,所述数据信息位位置信息确定单元,具体用于:基于所述定位点位置信息,确定所述待识别二维码图像中每个定位点位在图像坐标系中的第一位置信息;获取各定位点位在码上坐标系中的第二位置信息;基于所述第一位置信息以及所述第二位置信息,计算所述码上坐标系与所述图像坐标系之间的变换矩阵;获取各数据信息位在码上坐标系中的第三位置信息;基于所述变换矩阵以及所述第三位置信息,确定各数据信息位在所述图像坐标系中的初始采样点位置;基于所述自适应采样算法,对所述初始采样点位置进行修正,确定各数据信息位在所述图像坐标系中的最终采样点位置;基于所述最终采样点位置,在所述待识别图像中进行采样,得到每个数据信息位在所述图像中的位置信息。
- 一种二维码生成设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:获取待生成二维码图像的二维码编码;对所述二维码编码采用预先设定容错率的编码算法进行容错编码,得到容错处理后的二维码编码;确定所述容错处理后的二维码编码的各个数据信息位在二维码图像的生成区域中对应的码元形状;所述码元形状包括圆点或圆弧;根据二维码编码预设排列规则,确定所述容错处理后的二维码编码的各个数据信息位在所述生成区域中对应的第一位置信息;确定所述生成区域中各个定位点位的第二位置信息;基于所述第一位置信息、每个数据信息位对应的码元形状以及每个定位点位的第二位置信息,生成二维码图像。
- 一种二维码解码设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:获取待识别二维码图像的图像信息;根据所述待识别二维码图像的图像信息,确定所述待识别二维码图像中的每个定位点位在图像中的定位点位置信息;基于所述定位点位置信息,确定各个数据信息位在所述图像中的位置信息;基于所述各个数据信息位在所述图像中的位置信息,确定所述各个数据信息位对应的码元形状;所述码元形状包括圆点或圆弧;按照预设排列规则;根据每个所述数据信息位对应的码元形状生成二维码编码;采用预设的解码算法对所述二维码编码进行解码,得到所述数据信息位中储存的内容信息。
- 一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现权利要求1至12中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110308114.2A CN112926715B (zh) | 2021-03-23 | 2021-03-23 | 一种二维码生成、解码方法、装置及设备 |
CN202110308114.2 | 2021-03-23 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022199471A1 true WO2022199471A1 (zh) | 2022-09-29 |
Family
ID=76175657
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/081625 WO2022199471A1 (zh) | 2021-03-23 | 2022-03-18 | 一种二维码生成、解码方法、装置及设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112926715B (zh) |
WO (1) | WO2022199471A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116796782A (zh) * | 2023-05-04 | 2023-09-22 | 北京百度网讯科技有限公司 | 二维码的生成方法、识别方法、装置、设备及存储介质 |
CN117032085A (zh) * | 2023-08-04 | 2023-11-10 | 安徽捷圆电子科技有限公司 | Aoi机连线自动化控制方法、系统及其应用 |
CN117094349A (zh) * | 2023-10-19 | 2023-11-21 | 中国物品编码中心 | 二维码图形的生成方法、装置、设备及介质 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114912475A (zh) * | 2021-02-07 | 2022-08-16 | 华为技术有限公司 | 二维码识别方法及相关装置 |
CN112926715B (zh) * | 2021-03-23 | 2024-02-02 | 支付宝(中国)网络技术有限公司 | 一种二维码生成、解码方法、装置及设备 |
CN113487001B (zh) * | 2021-09-08 | 2021-12-24 | 飞狐信息技术(天津)有限公司 | 二维码生成方法及装置、二维码识别方法及装置 |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104933387A (zh) * | 2015-06-24 | 2015-09-23 | 上海快仓智能科技有限公司 | 一种基于二维码解码的快速定位识别的方法 |
US20150324946A1 (en) * | 2014-05-09 | 2015-11-12 | Graphiclead LLC | System and method for embedding of a two dimensional code with an image |
CN105975894A (zh) * | 2016-05-11 | 2016-09-28 | 华中科技大学 | 一种基于自适应边缘检测和映射模型的一维码识别算法 |
CN106951812A (zh) * | 2017-03-31 | 2017-07-14 | 腾讯科技(深圳)有限公司 | 识别二维码的方法、装置和终端 |
CN108764420A (zh) * | 2018-04-24 | 2018-11-06 | 中国人民银行印制科学技术研究所 | 一种二维码及其编码、识别方法、具有防伪功能的产品 |
CN108960000A (zh) * | 2018-07-17 | 2018-12-07 | 深圳市零点零科技有限公司 | 一种长条小型二维码识别方法 |
CN110288069A (zh) * | 2019-06-26 | 2019-09-27 | 百度在线网络技术(北京)有限公司 | 二维码生成和解析的方法、装置、设备及可读存储介质 |
CN110969233A (zh) * | 2018-09-30 | 2020-04-07 | 北京微播视界科技有限公司 | 二维码的生成方法、装置、硬件装置 |
CN111209991A (zh) * | 2019-12-31 | 2020-05-29 | 徐波 | 一种环形码及其设计方法 |
CN112926715A (zh) * | 2021-03-23 | 2021-06-08 | 支付宝(杭州)信息技术有限公司 | 一种二维码生成、解码方法、装置及设备 |
CN113487001A (zh) * | 2021-09-08 | 2021-10-08 | 飞狐信息技术(天津)有限公司 | 二维码生成方法及装置、二维码识别方法及装置 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104851117B (zh) * | 2014-02-13 | 2018-11-23 | 腾讯科技(深圳)有限公司 | 图像与二维码的融合方法和装置 |
CN108038529B (zh) * | 2017-12-08 | 2020-10-09 | 北京中星仝创科技有限公司 | 一种带图像的圆形二维码生成及读取的方法 |
CN108776828B (zh) * | 2018-06-07 | 2021-04-13 | 中国联合网络通信集团有限公司 | 二维码生成方法、二维码生成装置和二维码 |
CN112163655B (zh) * | 2020-09-30 | 2021-05-07 | 上海麦广互娱文化传媒股份有限公司 | 一种动态隐式二维码及其生成和检测方法及设备 |
CN112215030B (zh) * | 2020-10-28 | 2022-06-10 | 天津大学 | 一种基于柱面二维码的复原和识别方法 |
-
2021
- 2021-03-23 CN CN202110308114.2A patent/CN112926715B/zh active Active
-
2022
- 2022-03-18 WO PCT/CN2022/081625 patent/WO2022199471A1/zh active Application Filing
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150324946A1 (en) * | 2014-05-09 | 2015-11-12 | Graphiclead LLC | System and method for embedding of a two dimensional code with an image |
CN104933387A (zh) * | 2015-06-24 | 2015-09-23 | 上海快仓智能科技有限公司 | 一种基于二维码解码的快速定位识别的方法 |
CN105975894A (zh) * | 2016-05-11 | 2016-09-28 | 华中科技大学 | 一种基于自适应边缘检测和映射模型的一维码识别算法 |
CN106951812A (zh) * | 2017-03-31 | 2017-07-14 | 腾讯科技(深圳)有限公司 | 识别二维码的方法、装置和终端 |
CN108764420A (zh) * | 2018-04-24 | 2018-11-06 | 中国人民银行印制科学技术研究所 | 一种二维码及其编码、识别方法、具有防伪功能的产品 |
CN108960000A (zh) * | 2018-07-17 | 2018-12-07 | 深圳市零点零科技有限公司 | 一种长条小型二维码识别方法 |
CN110969233A (zh) * | 2018-09-30 | 2020-04-07 | 北京微播视界科技有限公司 | 二维码的生成方法、装置、硬件装置 |
CN110288069A (zh) * | 2019-06-26 | 2019-09-27 | 百度在线网络技术(北京)有限公司 | 二维码生成和解析的方法、装置、设备及可读存储介质 |
CN111209991A (zh) * | 2019-12-31 | 2020-05-29 | 徐波 | 一种环形码及其设计方法 |
CN112926715A (zh) * | 2021-03-23 | 2021-06-08 | 支付宝(杭州)信息技术有限公司 | 一种二维码生成、解码方法、装置及设备 |
CN113487001A (zh) * | 2021-09-08 | 2021-10-08 | 飞狐信息技术(天津)有限公司 | 二维码生成方法及装置、二维码识别方法及装置 |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116796782A (zh) * | 2023-05-04 | 2023-09-22 | 北京百度网讯科技有限公司 | 二维码的生成方法、识别方法、装置、设备及存储介质 |
CN117032085A (zh) * | 2023-08-04 | 2023-11-10 | 安徽捷圆电子科技有限公司 | Aoi机连线自动化控制方法、系统及其应用 |
CN117094349A (zh) * | 2023-10-19 | 2023-11-21 | 中国物品编码中心 | 二维码图形的生成方法、装置、设备及介质 |
CN117094349B (zh) * | 2023-10-19 | 2024-01-09 | 中国物品编码中心 | 二维码图形的生成方法、装置、设备及介质 |
Also Published As
Publication number | Publication date |
---|---|
CN112926715A (zh) | 2021-06-08 |
CN112926715B (zh) | 2024-02-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022199471A1 (zh) | 一种二维码生成、解码方法、装置及设备 | |
JP6894005B2 (ja) | 識別コードを生成および識別するための方法および装置 | |
US9406010B2 (en) | Producing, capturing and using visual identification tags for moving objects | |
CN103793735B (zh) | 一种圆形二维条码及其编码解码方法 | |
CN101430768B (zh) | 一种二维条码的定位方法 | |
CN102880850B (zh) | 一种二维码批量扫描的方法及扫描设备 | |
JP3953501B1 (ja) | プログラム、情報記憶媒体、2次元コード生成システム、画像生成システム及び2次元コード | |
CN109285198A (zh) | 一种环形编码标记点的编码及识别方法 | |
CN107122816A (zh) | 一种自定义寻像图形二维码及生成方法 | |
CN106845593A (zh) | 一种矩形固定点阵信息编解码方法 | |
CN104992207A (zh) | 一种手机二维条码编解码方法 | |
CN105718980A (zh) | 一种生成二维码图片的方法 | |
CN106067054A (zh) | 一种基于qr码的二维码 | |
CN115511031A (zh) | 一种扩容二维码、三维码解码方法、系统、设备和介质 | |
CN111291846B (zh) | 一种二维码生成、解码、识别方法、装置及设备 | |
CN112926714B (zh) | 融合qr码、条形码和光学字符的视觉三维码及其编码方法 | |
CN105701529A (zh) | 一种在二维码上实现彩色图片显示的方法 | |
Wang et al. | Camera readable 2d bar codes design and decoding for mobile phones | |
US20240185016A1 (en) | Two-dimensional code generation and decoding methods, apparatuses, and devices | |
CN109635613B (zh) | 一种用于球体表面的二维码生成方法、系统及装置 | |
You et al. | Multi-style migration QR code | |
CN108229625A (zh) | 一种编码方法及装置 | |
CN110866578B (zh) | 一种二维纹理码及其编码和解码方法 | |
Wang et al. | Research on the Structure and Coding of a Novel Double Z Two-Dimensional Bar Code with Large Capacity | |
CN108229233A (zh) | 一种解码方法及装置 |
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: 22774132 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 18551997 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
WWE | Wipo information: entry into national phase |
Ref document number: 11202306453T Country of ref document: SG |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 22774132 Country of ref document: EP Kind code of ref document: A1 |