WO2018210077A1 - Method and apparatus for generating identification code - Google Patents
Method and apparatus for generating identification code Download PDFInfo
- Publication number
- WO2018210077A1 WO2018210077A1 PCT/CN2018/082400 CN2018082400W WO2018210077A1 WO 2018210077 A1 WO2018210077 A1 WO 2018210077A1 CN 2018082400 W CN2018082400 W CN 2018082400W WO 2018210077 A1 WO2018210077 A1 WO 2018210077A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- code
- shape
- logo
- identification code
- dimensional code
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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 OR CALCULATING; 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
Definitions
- the present invention relates to the field of Internet technologies, and in particular, to a method and an apparatus for generating an identification code.
- the two-dimensional code technology is a new technology for recording data symbol information by using geometrically arranged geometric shapes in a two-dimensional direction, and the automatic reading of the two-dimensional code carrying information can be completed by the image input device or the photoelectric scanning device, especially now With the increasing popularity of smart terminals, the use of QR code scanning to obtain product information, mobile payment, anti-counterfeiting and traceability has become a choice for many consumers.
- a general two-dimensional code has a fixed pattern mode around it for detecting a barcode, such as three "back” regions of a Quick Response (QR) code, and a Data Matrix (DM) code.
- QR Quick Response
- DM Data Matrix
- the invention provides a method and a device for generating an identification code, so as to solve the problem that the existing graphic logos are embedded in a small part of the middle of the two-dimensional code, and the form is very single, which cannot meet the requirements of the personalized customization of the user.
- an embodiment of the present invention provides a method for generating an identification code, including:
- the ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to a preset value.
- an embodiment of the present invention provides an apparatus for generating an identification code, including:
- a generating module configured to generate a grid matrix GM two-dimensional code according to preset information to be encoded
- a processing module configured to: cut a code pattern of the GM two-dimensional code according to a shape of a preset identifier logo, and generate an identifier that matches a shape of the logo;
- the ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to a preset value.
- the method and device for generating an identification code generates a grid matrix GM two-dimensional code according to a preset information to be encoded, and further, according to a shape of a preset identifier logo, a code of the GM two-dimensional code
- the figure is cropped to generate an identification code that matches the shape of the logo, that is, the user can generate an identification code according to the logo shape, and the logo shape can be visually seen according to the identification code, which greatly improves the user experience.
- FIG. 1 is a flowchart of an embodiment of a method for generating an identification code according to the present invention
- FIG. 2a is a schematic diagram 1 of an identification code of an embodiment of a method for generating an identification code according to the present invention
- FIG. 2b is a second schematic diagram of an identification code of an embodiment of a method for generating an identification code according to the present invention
- 2c is a third schematic diagram of an identification code of an embodiment of a method for generating an identification code according to the present invention.
- 2d is a fourth schematic diagram of an identification code of an embodiment of a method for generating an identification code according to the present invention.
- FIG. 3 is a flowchart of another embodiment of a method for generating an identification code according to the present invention.
- FIG. 4 is a flowchart of still another embodiment of a method for generating an identification code according to the present invention.
- FIG. 5 is a schematic structural diagram of an embodiment of an apparatus for generating an identification code according to the present invention.
- FIG. 6 is a schematic structural diagram of an embodiment of an apparatus for generating an identification code according to the present invention.
- the method for generating the identification code provided by the embodiment of the present invention satisfies the personalized customization requirement of the user, and improves the user experience.
- the technical solutions of the present application will be described in detail through specific embodiments.
- FIG. 1 is a flowchart of an embodiment of a method for generating an identification code according to the present invention, which may be performed by an apparatus for generating an identification code.
- the method for generating the identification code may include:
- Step 101 Generate a grid matrix GM two-dimensional code according to preset information to be encoded.
- Step 102 According to the shape of the preset logo, the code map of the GM two-dimensional code is cropped to generate an identifier that matches the shape of the logo.
- the ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to a preset value.
- the Grid Matrix (GM) two-dimensional code is generated according to the preset information to be encoded, such as the identification information of the user, for example, the name of the enterprise, the logo of the enterprise, the contact information, and the enterprise address.
- the code pattern of the GM two-dimensional code is cropped to generate an identification code that matches the shape of the logo.
- the logo shape is, for example, a "field" font, and after the code pattern of the GM two-dimensional code is cropped, the code pattern of the generated identification code matches the logo shape.
- the logo shape is, for example, a "work" font
- the code pattern of the generated identification code matches the logo shape.
- the logo shape is, for example, a "middle" font
- the code pattern of the generated identification code matches the logo shape.
- the logo shape is, for example, a "national" font
- the code pattern of the generated identification code matches the logo shape.
- a data code word generating step generating a coded binary number by using preset information to be encoded, and dividing the encoded binary number into a data code word having a specific binary bit length;
- An error correction code word generating step generating an error correction code word by using an RS error correction algorithm on the data code word;
- the code frame main frame generating step generating a main frame of the code image, that is, generating a frame portion and a layer number bit of each macro module, wherein the frame portion is distributed in the outermost week of the macro module, and the layer number bits are distributed in the frame portion
- the four corners are stored with layer number information, and the other part of the macro module is a code word storage part;
- Codeword filling to form a code map image step generating a code map according to a code word storage portion of each macroblock in the code pattern by filling the data code word and the error correction code word in a clockwise or counterclockwise spiral manner from the center outward
- the image file, the order in which the macro modules are arranged in the code image is also the order in which the code words are stored.
- the unit module in the code map is divided into a plurality of rectangular macro modules, and the macro module includes Num ⁇ Num unit modules, where Num is a natural number greater than 3, and each macro module includes storing data with a fixed data length.
- Reducing the code map to a binary data stream by a digital camera and a computer includes the following steps: I. acquiring a gray scale digital image of a pixel matrix of a code map including gray values of each pixel by photographing; II. The distribution of the gray values of different pixels in the digital image is counted, and the grayscale image is converted into a binary image according to the statistical value selection threshold; III. detecting each light color pixel in the binary image, if with it One or more of the nearest four pixels of the top, bottom, left, and right pixels are marked as boundary pixels to obtain a boundary image; detecting a straight line in the boundary image to obtain a line equation and solving the line equation to obtain each The four-corner coordinates of the macro modules; IV.
- the above decoding method only needs to ensure that the ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to the preset value, so that the GM two-dimensional code information can be correctly decoded.
- the preset value may be determined according to actual conditions, and the present invention is not limited thereto.
- This preset value is, for example, 0.6.
- the method for generating the identification code provided by the embodiment of the present invention generates a grid matrix GM two-dimensional code according to the preset information to be encoded, and further, according to the shape of the preset logo, the code pattern of the GM two-dimensional code is performed. Cropping, generating an identification code that matches the shape of the logo, that is, the user can generate an identification code according to the logo shape, and the logo shape can be visually seen according to the identification code, which greatly improves the user experience.
- FIG. 3 is a flowchart of another embodiment of a method for generating an identification code according to the present invention.
- step 102 can be specifically implemented by the following steps:
- Step 1021 Draw a crop shape on the code map of the GM two-dimensional code according to the shape of the logo;
- Step 1022 Perform a cropping of the code pattern of the GM two-dimensional code according to the cropped shape to generate an identification code that matches the shape of the logo.
- the crop shape is drawn on the code map of the GM two-dimensional code; that is, the crop shape matching the logo shape is drawn on the code map of the GM two-dimensional code according to the shape of the logo.
- the code image of the GM two-dimensional code is cropped according to the drawn crop shape, and the coded image after the cropping is the code pattern of the generated identification code, and the code map matches the shape of the logo.
- step 1021 can be specifically implemented by the following steps:
- Step 1021a according to the shape of the logo, draw a cropping trajectory on the code map of the GM two-dimensional code
- Step 1021b the closed area formed by the cropping track is taken as a cropped shape.
- the cropped shape is drawn on the code map of the GM two-dimensional code, which can be implemented as follows:
- the cropping trajectory is drawn on the code map of the GM two-dimensional code. As shown in FIG. 2b, the cropping trajectory is drawn according to the edge of the I-shaped shape, and then the closed region formed by the cropping trajectory is taken as the cropping shape.
- the code pattern of the identification code is a continuous graphic.
- FIG. 5 is a schematic structural diagram of an apparatus for generating an identification code according to an embodiment of the present invention. As shown in FIG. 5, the apparatus for generating the identification code may include:
- the generating module 501 is configured to generate a grid matrix GM two-dimensional code according to preset information to be encoded;
- the processing module 502 is configured to: cut a code image of the GM two-dimensional code according to a shape of the preset identifier logo, and generate an identifier that matches a shape of the logo.
- the ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to a preset value.
- processing module 502 is specifically configured to:
- the code pattern of the GM two-dimensional code is cropped according to the cropped shape, and an identification code matching the shape of the logo is generated.
- processing module 502 is specifically configured to:
- a closed area formed by the cutting trajectory is used as the cut shape.
- a ratio of an area of the code pattern of the identification code to an area of the GM two-dimensional code is greater than or equal to a preset value.
- the code pattern of the identification code is a continuous graphic.
- the device for generating the identification code shown in the embodiment of the present invention may perform the technical solution shown in the foregoing method embodiment, and the implementation principle and the beneficial effects are similar, and details are not described herein.
- FIG. 6 is a structural diagram of an apparatus for generating an identification code according to the present invention. As shown in FIG. 6, the apparatus for generating the identification code includes:
- the processor 601 is used to invoke the executable instruction to perform the corresponding method in the foregoing method embodiment.
- the specific implementation process refer to the foregoing method embodiment, and details are not described herein again.
- the aforementioned program can be stored in a computer readable storage medium.
- the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
本发明涉及互联网技术领域,尤其涉及一种标识码的生成方法及装置。The present invention relates to the field of Internet technologies, and in particular, to a method and an apparatus for generating an identification code.
二维码技术是利用二维方向上特定排列的几何图形来记录数据符号信息的一种新技术,通过图像输入设备或光电扫描设备可以完成二维码携带信息的自动读取,尤其是在现在智能终端越来越普及的情况下,利用二维码扫描来获取商品信息,进行手机支付、防伪溯源等已经成为很多消费者的选择。The two-dimensional code technology is a new technology for recording data symbol information by using geometrically arranged geometric shapes in a two-dimensional direction, and the automatic reading of the two-dimensional code carrying information can be completed by the image input device or the photoelectric scanning device, especially now With the increasing popularity of smart terminals, the use of QR code scanning to obtain product information, mobile payment, anti-counterfeiting and traceability has become a choice for many consumers.
然而,一般的二维码在其周围有固定的图形模式用于探测条码,例如快速反应(Quick Response,简称QR)码的三个“回”形区,数据矩阵(Data Matrix,简称DM)码的“L”边等,这些图形模式被污损将导致无法解码。因此,一般企业的标识logo均嵌入在二维码的中间一小部分区域中,形式十分的单一,无法满足用户的个性化定制要求。However, a general two-dimensional code has a fixed pattern mode around it for detecting a barcode, such as three "back" regions of a Quick Response (QR) code, and a Data Matrix (DM) code. The "L" edge, etc., these graphics patterns are defaced and will result in unrepeatable. Therefore, the logo of the general enterprise is embedded in a small part of the middle of the two-dimensional code, and the form is very single, which cannot meet the customization requirements of the user.
发明内容Summary of the invention
本发明提供一种标识码的生成方法及装置,以解决现有的图形logo均嵌入在二维码的中间一小部分区域中,形式十分的单一,无法满足用户的个性化定制要求的问题。The invention provides a method and a device for generating an identification code, so as to solve the problem that the existing graphic logos are embedded in a small part of the middle of the two-dimensional code, and the form is very single, which cannot meet the requirements of the personalized customization of the user.
第一方面,本发明实施例提供一种标识码的生成方法,包括:In a first aspect, an embodiment of the present invention provides a method for generating an identification code, including:
根据预设的待编码信息,生成网格矩阵GM二维码;Generating a grid matrix GM two-dimensional code according to preset information to be encoded;
根据预设的标识logo的形状,对所述GM二维码的码图进行裁剪,生成与所述logo的形状匹配的标识码;And cutting a code pattern of the GM two-dimensional code according to a shape of a preset identifier logo, and generating an identifier that matches a shape of the logo;
其中,所述标识码的码图的面积与所述GM二维码的面积的比例大于或等于预设值。The ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to a preset value.
第二方面,本发明实施例提供一种标识码的生成装置,包括:In a second aspect, an embodiment of the present invention provides an apparatus for generating an identification code, including:
生成模块,用于根据预设的待编码信息,生成网格矩阵GM二维码;a generating module, configured to generate a grid matrix GM two-dimensional code according to preset information to be encoded;
处理模块,用于根据预设的标识logo的形状,对所述GM二维码的码图 进行裁剪,生成与所述logo的形状匹配的标识码;a processing module, configured to: cut a code pattern of the GM two-dimensional code according to a shape of a preset identifier logo, and generate an identifier that matches a shape of the logo;
其中,所述标识码的码图的面积与所述GM二维码的面积的比例大于或等于预设值。The ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to a preset value.
本发明实施例提供的标识码的生成方法及装置,根据预设的待编码信息,生成网格矩阵GM二维码,进一步的,根据预设的标识logo的形状,对GM二维码的码图进行裁剪,生成与logo的形状匹配的标识码,即用户可以根据logo形状生成标识码,根据标识码可以直观的看出logo形状,极大的提升了用户的体验。The method and device for generating an identification code according to an embodiment of the present invention generates a grid matrix GM two-dimensional code according to a preset information to be encoded, and further, according to a shape of a preset identifier logo, a code of the GM two-dimensional code The figure is cropped to generate an identification code that matches the shape of the logo, that is, the user can generate an identification code according to the logo shape, and the logo shape can be visually seen according to the identification code, which greatly improves the user experience.
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.
图1为本发明标识码的生成方法一实施例的流程图;1 is a flowchart of an embodiment of a method for generating an identification code according to the present invention;
图2a为本发明标识码的生成方法一实施例的标识码示意图一;2a is a schematic diagram 1 of an identification code of an embodiment of a method for generating an identification code according to the present invention;
图2b为本发明标识码的生成方法一实施例的标识码示意图二;2b is a second schematic diagram of an identification code of an embodiment of a method for generating an identification code according to the present invention;
图2c为本发明标识码的生成方法一实施例的标识码示意图三;2c is a third schematic diagram of an identification code of an embodiment of a method for generating an identification code according to the present invention;
图2d为本发明标识码的生成方法一实施例的标识码示意图四;2d is a fourth schematic diagram of an identification code of an embodiment of a method for generating an identification code according to the present invention;
图3为本发明标识码的生成方法另一实施例的流程图;3 is a flowchart of another embodiment of a method for generating an identification code according to the present invention;
图4为本发明标识码的生成方法又一实施例的流程图;4 is a flowchart of still another embodiment of a method for generating an identification code according to the present invention;
图5为本发明标识码的生成装置一实施例的结构示意图;FIG. 5 is a schematic structural diagram of an embodiment of an apparatus for generating an identification code according to the present invention; FIG.
图6为本发明标识码的生成设备一实施例的结构示意图。FIG. 6 is a schematic structural diagram of an embodiment of an apparatus for generating an identification code according to the present invention.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“包括”和“具有”以及 他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "comprises" and "comprising", and any variants thereof, are intended to cover a non-exclusive inclusion, such as a process or method comprising a series of steps or units. The system, product, or device is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not explicitly listed or inherent to such processes, methods, products, or devices.
本发明实施例提供的标识码的生成方法,满足用户的个性化定制要求,提升了用户的体验感。下面,通过具体实施例,对本申请的技术方案进行详细说明。The method for generating the identification code provided by the embodiment of the present invention satisfies the personalized customization requirement of the user, and improves the user experience. Hereinafter, the technical solutions of the present application will be described in detail through specific embodiments.
需要说明的是,下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in some embodiments.
图1为本发明标识码的生成方法一实施例的流程图,该方法可以由标识码的生成装置执行。如图1所示,该标识码的生成方法可以包括:FIG. 1 is a flowchart of an embodiment of a method for generating an identification code according to the present invention, which may be performed by an apparatus for generating an identification code. As shown in FIG. 1, the method for generating the identification code may include:
步骤101、根据预设的待编码信息,生成网格矩阵GM二维码;Step 101: Generate a grid matrix GM two-dimensional code according to preset information to be encoded.
步骤102、根据预设的标识logo的形状,对GM二维码的码图进行裁剪,生成与logo的形状匹配的标识码。Step 102: According to the shape of the preset logo, the code map of the GM two-dimensional code is cropped to generate an identifier that matches the shape of the logo.
其中,所述标识码的码图的面积与所述GM二维码的面积的比例大于或等于预设值。The ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to a preset value.
具体的,根据预设的待编码信息,如用户的标识信息,例如包括:企业名称、企业的logo、联系方式、企业地址等,生成网格矩阵(Grid Matrix,简称GM)二维码。Specifically, the Grid Matrix (GM) two-dimensional code is generated according to the preset information to be encoded, such as the identification information of the user, for example, the name of the enterprise, the logo of the enterprise, the contact information, and the enterprise address.
然后,根据预设的图形logo的形状,对上述GM二维码的码图进行裁剪,生成与logo的形状匹配的标识码。Then, according to the shape of the preset graphic logo, the code pattern of the GM two-dimensional code is cropped to generate an identification code that matches the shape of the logo.
示例性的,如图2a所示,logo形状例如为“田”字型,则对GM二维码的码图进行裁剪后,生成的标识码的码图与该logo形状匹配。Exemplarily, as shown in FIG. 2a, the logo shape is, for example, a "field" font, and after the code pattern of the GM two-dimensional code is cropped, the code pattern of the generated identification code matches the logo shape.
如图2b所示,logo形状例如为“工”字型,则对GM二维码的码图进行裁剪后,生成的标识码的码图与该logo形状匹配。As shown in FIG. 2b, if the logo shape is, for example, a "work" font, after the code pattern of the GM two-dimensional code is cropped, the code pattern of the generated identification code matches the logo shape.
如图2c所示,logo形状例如为“中”字型,则对GM二维码的码图进行裁剪后,生成的标识码的码图与该logo形状匹配。As shown in FIG. 2c, if the logo shape is, for example, a "middle" font, after the code pattern of the GM two-dimensional code is cropped, the code pattern of the generated identification code matches the logo shape.
如图2d所示,logo形状例如为“囯”字型,则对GM二维码的码图进行裁剪后,生成的标识码的码图与该logo形状匹配。As shown in FIG. 2d, if the logo shape is, for example, a "national" font, after the code map of the GM two-dimensional code is cropped, the code pattern of the generated identification code matches the logo shape.
上述GM二维码的生成方法如下:The above GM two-dimensional code is generated as follows:
数据码词生成步骤:将预设的待编码信息生成被编码二进制数,分割被编码二进制数为具有特定二进制比特长度的数据码词;a data code word generating step: generating a coded binary number by using preset information to be encoded, and dividing the encoded binary number into a data code word having a specific binary bit length;
纠错码词生成步骤:对所述数据码词运用RS纠错算法生成纠错码词;An error correction code word generating step: generating an error correction code word by using an RS error correction algorithm on the data code word;
码图主框架生成步骤:生成码图的主框架,即生成各个宏模块的边框部分和层号位,所述边框部分分布在宏模块的最外一周,所述层号位分布在边框部分内的四个角,存储有层号信息,所述宏模块的其它部分为码词存储部分;The code frame main frame generating step: generating a main frame of the code image, that is, generating a frame portion and a layer number bit of each macro module, wherein the frame portion is distributed in the outermost week of the macro module, and the layer number bits are distributed in the frame portion The four corners are stored with layer number information, and the other part of the macro module is a code word storage part;
码词填充形成码图图像步骤:按照由中心向外以顺时针或逆时针螺旋方式填充所述数据码词和纠错码词到码图中每个宏模块的码词存储部分,生成码图图像文件,该码图图像中宏模块的排列顺序也即码词的存储顺序。Codeword filling to form a code map image step: generating a code map according to a code word storage portion of each macroblock in the code pattern by filling the data code word and the error correction code word in a clockwise or counterclockwise spiral manner from the center outward The image file, the order in which the macro modules are arranged in the code image is also the order in which the code words are stored.
其中,上述码图中的单元模块分割成多个矩形的宏模块,所述宏模块包括Num×Num个单元模块,其中Num为大于3的自然数,每个宏模块包括存储具有固定数据长度的数据码词的单元模块和存储代表该宏模块在码图中的位置的簇号的单元模块。The unit module in the code map is divided into a plurality of rectangular macro modules, and the macro module includes Num×Num unit modules, where Num is a natural number greater than 3, and each macro module includes storing data with a fixed data length. A unit module of a code word and a unit module that stores a cluster number representing a position of the macro module in the code map.
解码方法:Decoding method:
通过数字照相机和计算机将码图还原成二进制数据流,包括如下步骤:I.通过照相方式获取码图的、包括每一个像素的灰度值的像素矩阵的灰阶数字图像;II.对灰阶数字图像中不同像素的灰度值的分布进行统计,根据所述统计值选择阀值将灰阶图像转化成二值图像;III.检测上述二值图像中的每一个浅色像素,如果与它最临近的上下左右四个像素中有一个或者一个以上深色像素则该像素被标记为边界像素,获得边界图像;检测所述边界图像中的直线获得直线方程并且解所述直线方程求得每个宏模块的四角坐标;IV.根据每个宏模块的四角坐标插值计算宏模块内每个单元模块的坐标;V.对应所述单元模块的坐标到所述二值图像的数字信号中读取该单元模块存储的0或者1的比特值获得码词矩阵;VI.通过下述步骤判断码词矩阵的方向:A、对上述数据矩阵分别从四个不同的方向、按照已知的簇号模块的位置和单元取得每一个宏模块的每一个可能的簇号;B、分别对每一个方向,分别计算每个宏模块的可能簇号与它相邻右边、和相邻下边宏模块的相应可能簇号的差的绝对值,并将所得的绝对值累加作为该方向的得分;C、比较四个方向的得分,得分最少的方向为码图的正确方向;VII.按照码词矩阵的对称关系确定中心 码词;VIII.按照所述正确方向和中心码词,从中心码词开始按照顺时针方向将所述数据码词矩阵恢复为数据码词序列。Reducing the code map to a binary data stream by a digital camera and a computer includes the following steps: I. acquiring a gray scale digital image of a pixel matrix of a code map including gray values of each pixel by photographing; II. The distribution of the gray values of different pixels in the digital image is counted, and the grayscale image is converted into a binary image according to the statistical value selection threshold; III. detecting each light color pixel in the binary image, if with it One or more of the nearest four pixels of the top, bottom, left, and right pixels are marked as boundary pixels to obtain a boundary image; detecting a straight line in the boundary image to obtain a line equation and solving the line equation to obtain each The four-corner coordinates of the macro modules; IV. calculating the coordinates of each unit module in the macro module according to the quadrilateral coordinate interpolation of each macro module; V. reading the coordinates of the unit module to the digital signal of the binary image The bit value of 0 or 1 stored in the unit module obtains a code word matrix; VI. The direction of the code word matrix is determined by the following steps: A, respectively, for the above data matrix Obtain each possible cluster number of each macro module in four different directions according to the position and unit of the known cluster number module; B. Calculate the possible cluster number of each macro module and each of them separately for each direction The absolute value of the difference between the adjacent possible right and left adjacent macroblocks, and the resulting absolute value is added as the score of the direction; C, the scores in the four directions are compared, and the direction with the least score is the code map. The correct direction; VII. Determine the central codeword according to the symmetric relationship of the codeword matrix; VIII. According to the correct direction and the central codeword, recover the data codeword matrix from the central codeword in a clockwise direction to the data code Word sequence.
通过上述解码方法只需保证标识码的码图的面积与所述GM二维码的面积的比例大于或等于预设值,就可以正确解码,即复原全部GM二维码信息。The above decoding method only needs to ensure that the ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to the preset value, so that the GM two-dimensional code information can be correctly decoded.
该预设值可以根据实际情况确定,本发明对此并不限定。The preset value may be determined according to actual conditions, and the present invention is not limited thereto.
该预设值例如为0.6。This preset value is, for example, 0.6.
本发明实施例提供的标识码的生成方法,根据预设的待编码信息,生成网格矩阵GM二维码,进一步的,根据预设的标识logo的形状,对GM二维码的码图进行裁剪,生成与logo的形状匹配的标识码,即用户可以根据logo形状生成标识码,根据标识码可以直观的看出logo形状,极大的提升了用户的体验。The method for generating the identification code provided by the embodiment of the present invention generates a grid matrix GM two-dimensional code according to the preset information to be encoded, and further, according to the shape of the preset logo, the code pattern of the GM two-dimensional code is performed. Cropping, generating an identification code that matches the shape of the logo, that is, the user can generate an identification code according to the logo shape, and the logo shape can be visually seen according to the identification code, which greatly improves the user experience.
图3为本发明标识码的生成方法另一实施例的流程图。在图1对应的实施例的基础上,进一步地,如图3所示,步骤102,具体可以通过如下步骤实现:FIG. 3 is a flowchart of another embodiment of a method for generating an identification code according to the present invention. On the basis of the corresponding embodiment of FIG. 1, further, as shown in FIG. 3, step 102 can be specifically implemented by the following steps:
步骤1021、根据logo的形状,在GM二维码的码图上绘制裁剪形状;Step 1021: Draw a crop shape on the code map of the GM two-dimensional code according to the shape of the logo;
步骤1022、根据裁剪形状对GM二维码的码图进行裁剪,生成与logo的形状匹配的标识码。Step 1022: Perform a cropping of the code pattern of the GM two-dimensional code according to the cropped shape to generate an identification code that matches the shape of the logo.
具体的,根据logo的形状,在GM二维码的码图上绘制裁剪形状;即根据logo的形状,在GM二维码的码图上绘制与logo形状匹配的裁剪形状。Specifically, according to the shape of the logo, the crop shape is drawn on the code map of the GM two-dimensional code; that is, the crop shape matching the logo shape is drawn on the code map of the GM two-dimensional code according to the shape of the logo.
然后,根据绘制的裁剪形状对GM二维码的码图进行裁剪,裁剪之后的码图,即为生成的标识码的码图,该码图与logo的形状匹配。Then, the code image of the GM two-dimensional code is cropped according to the drawn crop shape, and the coded image after the cropping is the code pattern of the generated identification code, and the code map matches the shape of the logo.
图4为本发明标识码的生成方法又一实施例的流程图。在图3对应的实施例的基础上,进一步地,如图4所示,步骤1021,具体可以通过如下步骤实现:4 is a flow chart of still another embodiment of a method for generating an identification code according to the present invention. On the basis of the corresponding embodiment of FIG. 3, further, as shown in FIG. 4,
步骤1021a、根据logo的形状,在GM二维码的码图上绘制裁剪轨迹;
步骤1021b、将裁剪轨迹形成的封闭区域作为裁剪形状。
具体的,根据logo的形状,在GM二维码的码图上绘制裁剪形状,具体可以通过如下方式实现:Specifically, according to the shape of the logo, the cropped shape is drawn on the code map of the GM two-dimensional code, which can be implemented as follows:
首先,根据logo的形状,在GM二维码的码图上绘制裁剪轨迹,如图2b所示,根据工字形的边缘,绘制裁剪轨迹,然后将将裁剪轨迹形成的封闭区域作为裁剪形状。First, according to the shape of the logo, the cropping trajectory is drawn on the code map of the GM two-dimensional code. As shown in FIG. 2b, the cropping trajectory is drawn according to the edge of the I-shaped shape, and then the closed region formed by the cropping trajectory is taken as the cropping shape.
在上述实施例的基础上,进一步地,标识码的码图为连续图形。Based on the above embodiment, further, the code pattern of the identification code is a continuous graphic.
具体的,为了更加准确的复原全部二维码信息,则需要保证裁剪后生成的标识码的码图为连续图形。Specifically, in order to restore all the two-dimensional code information more accurately, it is necessary to ensure that the code pattern of the identification code generated after the cropping is a continuous graphic.
图5为本发明标识码的生成装置一实施例的结构示意图,请参见5所示,该标识码的生成装置可以包括:FIG. 5 is a schematic structural diagram of an apparatus for generating an identification code according to an embodiment of the present invention. As shown in FIG. 5, the apparatus for generating the identification code may include:
生成模块501和处理模块502;
其中,生成模块501,用于根据预设的待编码信息,生成网格矩阵GM二维码;The
处理模块502,用于根据预设的标识logo的形状,对所述GM二维码的码图进行裁剪,生成与所述logo的形状匹配的标识码。The
其中,所述标识码的码图的面积与所述GM二维码的面积的比例大于或等于预设值。The ratio of the area of the code pattern of the identification code to the area of the GM two-dimensional code is greater than or equal to a preset value.
可选地,所述处理模块502,具体用于:Optionally, the
根据所述logo的形状,在所述GM二维码的码图上绘制裁剪形状;Drawing a crop shape on a code map of the GM two-dimensional code according to a shape of the logo;
根据所述裁剪形状对所述GM二维码的码图进行裁剪,生成与所述logo的形状匹配的标识码。The code pattern of the GM two-dimensional code is cropped according to the cropped shape, and an identification code matching the shape of the logo is generated.
可选地,所述处理模块502,具体用于:Optionally, the
根据所述logo的形状,在所述GM二维码的码图上绘制裁剪轨迹;Drawing a cropping trajectory on the code map of the GM two-dimensional code according to the shape of the logo;
将所述裁剪轨迹形成的封闭区域作为所述裁剪形状。A closed area formed by the cutting trajectory is used as the cut shape.
可选地,所述标识码的码图的面积与所述GM二维码的面积的比例大于或等于预设值。Optionally, a ratio of an area of the code pattern of the identification code to an area of the GM two-dimensional code is greater than or equal to a preset value.
可选地,所述标识码的码图为连续图形。Optionally, the code pattern of the identification code is a continuous graphic.
本发明实施例所示的标识码的生成装置,可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。The device for generating the identification code shown in the embodiment of the present invention may perform the technical solution shown in the foregoing method embodiment, and the implementation principle and the beneficial effects are similar, and details are not described herein.
图6为本发明提供的标识码的生成设备一实施例的结构图,如图6所示,该标识码的生成设备包括:FIG. 6 is a structural diagram of an apparatus for generating an identification code according to the present invention. As shown in FIG. 6, the apparatus for generating the identification code includes:
处理器601,以及,用于存储处理器601的可执行指令的存储器602。A
其中,处理器601用于调用可执行指令,执行前述方法实施例中对应的方法,其具体实施过程可以参见前述方法实施例,此处不再赘述。The
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。One of ordinary skill in the art will appreciate that all or part of the steps to implement the various method embodiments described above may be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. range.
Claims (8)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710340418.0 | 2017-05-15 | ||
| CN201710340418.0A CN107292369A (en) | 2017-05-15 | 2017-05-15 | The generation method and device of identification code |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018210077A1 true WO2018210077A1 (en) | 2018-11-22 |
Family
ID=60095350
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/082400 Ceased WO2018210077A1 (en) | 2017-05-15 | 2018-04-09 | Method and apparatus for generating identification code |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107292369A (en) |
| WO (1) | WO2018210077A1 (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107292369A (en) * | 2017-05-15 | 2017-10-24 | 武汉矽感科技有限公司 | The generation method and device of identification code |
| CN108710932B (en) * | 2018-05-21 | 2019-05-21 | 周冰 | A kind of two-dimensional code generation method, device, electronic equipment and storage medium |
| CN109859290A (en) * | 2019-01-25 | 2019-06-07 | 武汉矽感科技有限公司 | It is a kind of number mark and its generation method, system, storage medium and device |
| CN114511055A (en) * | 2022-02-23 | 2022-05-17 | 深圳市中钞信达金融科技有限公司 | Method for generating and decoding bar-shaped spliced two-dimensional code |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101260499B1 (en) * | 2012-01-09 | 2013-05-06 | 주식회사 코아기술 | Method for manufacturing design qr-code |
| CN103295047A (en) * | 2013-06-25 | 2013-09-11 | 谢婧 | Image identifier capable of obtaining hidden information and manufacturing and reading method thereof |
| CN103559527A (en) * | 2013-11-21 | 2014-02-05 | 合一网络技术(北京)有限公司 | Method and system for generating two-dimension codes with graphic features |
| CN103606141A (en) * | 2013-12-09 | 2014-02-26 | 陈绳旭 | Method and system for realizing image display based on two-dimension code |
| CN104966115A (en) * | 2015-06-12 | 2015-10-07 | 吴伟和 | Method for filling two-dimensional code through image |
| CN105989389A (en) * | 2015-02-11 | 2016-10-05 | 北京鼎九信息工程研究院有限公司 | Two-dimensional code |
| CN107292369A (en) * | 2017-05-15 | 2017-10-24 | 武汉矽感科技有限公司 | The generation method and device of identification code |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4781892B2 (en) * | 2006-04-19 | 2011-09-28 | A・Tコミュニケーションズ株式会社 | Two-dimensional code with logo |
| JP4969403B2 (en) * | 2007-10-24 | 2012-07-04 | A・Tコミュニケーションズ株式会社 | Two-dimensional code with logo |
| CN101197004A (en) * | 2007-12-25 | 2008-06-11 | 深圳矽感科技有限公司 | Two-dimension bar code and its coding and decoding method |
| CN103617441A (en) * | 2013-11-27 | 2014-03-05 | 上海电机学院 | Generating system and pattern recognition method of seal based on two-dimension code |
| CN103927513A (en) * | 2014-03-26 | 2014-07-16 | 广州品唯软件有限公司 | Method and device for identifying Logo |
| CN106599961A (en) * | 2016-09-13 | 2017-04-26 | 江苏图码信息科技有限公司 | Two-dimensional product for hand-drawing pattern or word and the application component thereof |
-
2017
- 2017-05-15 CN CN201710340418.0A patent/CN107292369A/en active Pending
-
2018
- 2018-04-09 WO PCT/CN2018/082400 patent/WO2018210077A1/en not_active Ceased
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101260499B1 (en) * | 2012-01-09 | 2013-05-06 | 주식회사 코아기술 | Method for manufacturing design qr-code |
| CN103295047A (en) * | 2013-06-25 | 2013-09-11 | 谢婧 | Image identifier capable of obtaining hidden information and manufacturing and reading method thereof |
| CN103559527A (en) * | 2013-11-21 | 2014-02-05 | 合一网络技术(北京)有限公司 | Method and system for generating two-dimension codes with graphic features |
| CN103606141A (en) * | 2013-12-09 | 2014-02-26 | 陈绳旭 | Method and system for realizing image display based on two-dimension code |
| CN105989389A (en) * | 2015-02-11 | 2016-10-05 | 北京鼎九信息工程研究院有限公司 | Two-dimensional code |
| CN104966115A (en) * | 2015-06-12 | 2015-10-07 | 吴伟和 | Method for filling two-dimensional code through image |
| CN107292369A (en) * | 2017-05-15 | 2017-10-24 | 武汉矽感科技有限公司 | The generation method and device of identification code |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107292369A (en) | 2017-10-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102104219B1 (en) | Method and system for recognizing location information in 2D code | |
| CN101520849B (en) | Reality augmenting method and reality augmenting system based on image characteristic point extraction and random tree classification | |
| CN105989317B (en) | A two-dimensional code identification method and device | |
| EP2849115B1 (en) | Method for decoding matrix-type two-dimensional code | |
| CN104657768B (en) | A kind of color three dimension code generator and color three dimension code reading method | |
| CN112926715B (en) | A two-dimensional code generation and decoding method, device and equipment | |
| WO2018210077A1 (en) | Method and apparatus for generating identification code | |
| US9177188B2 (en) | Method and system for detecting detection patterns of QR code | |
| CN107566688A (en) | A kind of video anti-fluttering method and device based on convolutional neural networks | |
| CN110827371A (en) | Certificate photo generation method and device, electronic equipment and storage medium | |
| WO2021004414A1 (en) | Coding pattern, coding and reading methods for same, calibration board, and calibration method | |
| CN106096488A (en) | A kind of recognition methods of some horizontal and vertical parity check code | |
| TWI497420B (en) | Two-dimentional optical indetification device with same gray level for quickly decoding and method for decoding the same | |
| CN103336938A (en) | Recognition method based one-dimensional bar code image | |
| CN111291752A (en) | Invoice identification method, equipment and medium | |
| US10354353B2 (en) | Digital video content security authentication method and system | |
| KR102375325B1 (en) | Method for detection and recognition of distant high-density visual markers | |
| CN112187284A (en) | Encoding method, encoding pattern reading method, and imaging device | |
| CN111144411B (en) | A method and system for correcting and identifying irregular text based on saliency map | |
| CN106228103A (en) | A kind of recognition methods of double-deck code | |
| CN110070625B (en) | Identification for augmented reality equipment, identification method thereof and augmented reality equipment | |
| CN106951942A (en) | A kind of predistortion labeling and predistortion image in 2 D code generation method and system | |
| CN116822548B (en) | Method for generating high recognition rate AI two-dimensional code and computer readable storage medium | |
| CN110084349A (en) | A kind of method for drafting and geometry pixel two dimensional code of two dimensional code pixel | |
| CN118711195A (en) | Image data processing method and system for container identification |
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: 18801910 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18801910 Country of ref document: EP Kind code of ref document: A1 |