WO2020186900A1 - 窄条二维码、窄条二维码的生成、识别方法、装置及设备 - Google Patents

窄条二维码、窄条二维码的生成、识别方法、装置及设备 Download PDF

Info

Publication number
WO2020186900A1
WO2020186900A1 PCT/CN2020/070641 CN2020070641W WO2020186900A1 WO 2020186900 A1 WO2020186900 A1 WO 2020186900A1 CN 2020070641 W CN2020070641 W CN 2020070641W WO 2020186900 A1 WO2020186900 A1 WO 2020186900A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
positioning
narrow
dimensional code
color block
Prior art date
Application number
PCT/CN2020/070641
Other languages
English (en)
French (fr)
Inventor
屠寅海
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to SG11202104387YA priority Critical patent/SG11202104387YA/en
Priority to EP20773181.1A priority patent/EP3859608A4/en
Priority to JP2021523397A priority patent/JP2022524675A/ja
Publication of WO2020186900A1 publication Critical patent/WO2020186900A1/zh
Priority to US17/244,691 priority patent/US11250230B2/en
Priority to US17/671,412 priority patent/US11699053B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record 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/06009Record 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/06037Record 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record 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/06009Record 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/06046Constructional details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image

Definitions

  • One or more embodiments of this specification relate to the field of image processing technology, and in particular to a method, device and equipment for generating and identifying a narrow-bar two-dimensional code and a narrow-bar two-dimensional code.
  • a two-dimensional code (2-dimensional bar code) is a bar code that records information through a pattern distributed in the two-dimensional direction of a plane according to a certain rule.
  • QR code QR code for short
  • Traditional QR codes usually have 3 large-scale stake structures for positioning.
  • the black and white length ratio of the line segment of the large pile point structure satisfies 1:1:3:1:1.
  • the traditional two-dimensional code is not convenient to use.
  • One or more embodiments of this specification describe a method, device and equipment for generating, identifying, and identifying a narrow-bar QR code and a narrow-bar QR code, which can generate a small-scale QR code, which is convenient for comparison in use space Use in small cases.
  • a method for generating a narrow barcode QR code including:
  • Determining a rectangular area the rectangular area including blocks to be filled arranged in a grid
  • each positioning graphics includes a square structure at the center and formed by a first color block, and surrounds the square structure for a whole circle , Frame structure formed by the second color block;
  • each positioning pattern fill the area surrounding the positioning pattern with a first color block to form a corresponding isolation area;
  • the data area is filled with the first color block and the second color block corresponding to the two-dimensional code data, and the data area is an area in the rectangular area excluding the two positioning patterns and the corresponding isolation area.
  • a method for identifying a narrow barcode QR code including:
  • the positioning pattern includes a square structure formed by a first color block at the center, and a frame structure formed by a second color block surrounding the square structure, and An isolation area formed by the first color block is provided on the periphery of the positioning pattern;
  • a narrow bar QR code including:
  • each positioning graphics includes a square structure at the center formed by the first color block, and a circle surrounding the square structure, The frame structure formed by the second color block;
  • each isolated area is formed by a first color block surrounding one positioning pattern in the rectangular area;
  • the data area used to form the two-dimensional code data includes an area in the rectangular area excluding the two positioning patterns and the corresponding isolation area.
  • a device for generating a narrow barcode two-dimensional code including:
  • a determining unit configured to determine a rectangular area, the rectangular area including blocks to be filled arranged in a grid
  • the filling unit is used to fill the two square areas at the two vertices of the rectangular area determined by the determining unit with two positioning graphics respectively, wherein each positioning graphics includes a first color block located in the center The square structure of, and the frame structure that surrounds the square structure and is formed by the second color block;
  • the filling unit is further configured to, in the rectangular area determined by the determining unit, for each positioning pattern, fill the area surrounding the positioning pattern with a first color block to form a corresponding isolation area;
  • the filling unit is also used to fill the first color block and the second color block corresponding to the two-dimensional code data in a data area, and the data area is the rectangular area except for the two positioning graphics and the corresponding isolation The area outside the area.
  • a device for identifying a narrow-bar two-dimensional code including:
  • the acquiring unit is used to acquire the image of the narrow bar QR code
  • the detection unit is configured to detect a positioning pattern in the image acquired by the acquisition unit, the positioning pattern including a square structure formed by a first color patch at the center, and a square structure surrounded by a second color block.
  • a frame structure formed by color blocks, and an isolated area formed by a first color block is provided on the periphery of the positioning pattern;
  • the determining unit is configured to, when the detection unit detects the two positioning graphics, determine in the image the rectangle corresponding to the narrow two-dimensional code based on the center positions of the two positioning graphics Target area of the area;
  • the determining unit is further configured to determine the data area to be identified from the target area;
  • the identifying unit is used to identify the two-dimensional code data of the data area determined by the determining unit.
  • a device for generating a narrow-bar QR code including:
  • One or more processors are One or more processors.
  • One or more programs wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the following steps are implemented when the programs are executed by the processor:
  • Determining a rectangular area the rectangular area including blocks to be filled arranged in a grid
  • each positioning graphics includes a square structure at the center and formed by a first color block, and surrounds the square structure for a whole circle , Frame structure formed by the second color block;
  • each positioning pattern fill the area surrounding the positioning pattern with a first color block to form a corresponding isolation area;
  • the data area is filled with the first color block and the second color block corresponding to the two-dimensional code data, and the data area is an area in the rectangular area excluding the two positioning patterns and the corresponding isolation area.
  • a device for identifying a narrow barcode QR code including:
  • One or more processors are One or more processors.
  • One or more programs wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the following steps are implemented when the programs are executed by the processor:
  • the positioning pattern includes a square structure formed by a first color block at the center, and a frame structure formed by a second color block surrounding the square structure, and An isolation area formed by the first color block is provided on the periphery of the positioning pattern;
  • One or more embodiments of this specification provide a narrow-bar two-dimensional code, a method, device and equipment for generating, identifying, and identifying a narrow-bar two-dimensional code to determine a rectangular area, which includes blocks to be filled arranged in a grid.
  • each positioning graphic includes a square structure at the center and composed of the first color block, and a circle surrounding the square structure, consisting of a second Frame structure formed by color blocks.
  • fill the area surrounding the positioning pattern with the first color block to form a corresponding isolation area.
  • the data area is filled with the first color block and the second color block corresponding to the two-dimensional code data, and the data area is the area in the rectangular area excluding the two positioning patterns and the corresponding isolation area.
  • FIG. 1 is a flowchart of a method for generating a narrow barcode two-dimensional code provided by an embodiment of this specification
  • Figure 2a is one of the schematic diagrams of positioning graphics provided in this manual
  • Figure 2b is the second schematic diagram of the positioning graphics provided in this manual
  • Figure 3 is a schematic diagram of the isolation area of the positioning graphics provided in this manual
  • Figure 4 is a schematic diagram of the narrow bar QR code provided in this manual.
  • FIG. 5 is a flowchart of a method for identifying a narrow two-dimensional code provided by an embodiment of this specification
  • FIG. 6 is a schematic diagram of a device for generating a narrow barcode two-dimensional code provided by an embodiment of this specification
  • Fig. 7 is a schematic diagram of a device for identifying a narrow two-dimensional code provided by an embodiment of this specification.
  • FIG. 8 is a schematic diagram of a device for generating a narrow barcode two-dimensional code provided by an embodiment of this specification
  • Fig. 9 is a schematic diagram of a device for identifying a narrow two-dimensional code provided by an embodiment of this specification.
  • Fig. 1 is a flow chart of a method for generating a narrow two-dimensional code provided by an embodiment of this specification.
  • the execution subject of the method may be a device with processing capability: a server or a system or a device. As shown in Figure 1, the method may specifically include:
  • Step 102 Determine a rectangular area.
  • the rectangular area may include blocks to be filled arranged in a grid.
  • the block here can correspond to several pixels. It should be noted that in the initially determined rectangular area, the pixel values of these pixels are still uncertain, so the color value of each block in the rectangular area is empty.
  • the size (or area) of the rectangular region generated above may be N*M, where N is the width of the rectangular region, and M is the length of the rectangular region.
  • the above M may be greater than N.
  • N can be 6, and M can be 23.
  • N may be 7, and M may be 20.
  • the size of the rectangular area can be set to be greater than 120, that is, N*M>120.
  • Step 104 Fill two square areas at two vertices in the rectangular area with two positioning graphics respectively.
  • the two vertices here can be the two vertices at both ends of the diagonal of the rectangular area. Or, it may be the two vertices at both ends of the long side of the rectangle of the rectangular area.
  • Each of the above positioning patterns may include a square structure formed by the first color block at the center, and a frame structure formed by the second color block surrounding the square structure.
  • the first color block here can refer to a white block or a black block. It can be understood that when the first color block is a white block, then the second color block is a black block; and when the first color block is a black block, then the second color block is a white block.
  • the ratio of the width of the square structure and the frame structure of the positioning graphic can be 1:1, that is, the width of the second color block, the first color block, and the second color block of the positioning graphic in the horizontal and/or vertical direction.
  • the ratio can be 1:1:1.
  • the above positioning graphics may be as shown in Figure 2a.
  • the square structure in the center of the positioning figure is composed of 1 white block
  • the frame structure surrounding the square structure is composed of 8 black blocks.
  • the ratio of the widths of the black blocks, white blocks, and black blocks of the positioning graphics is 1:1:1.
  • the above positioning graph may be as shown in Fig. 2b.
  • the square structure in the center of the positioning figure is composed of 4 white blocks
  • the frame structure surrounding the square structure is composed of 32 black blocks.
  • the width ratio of the black blocks, white blocks, and black blocks of the positioning graphics is 2:2:2, that is, the width ratio is also 1:1:1.
  • the white blocks in FIGS. 2a and 2b can also be replaced with black blocks, and the black blocks can also be replaced with white blocks, which is not limited in this specification.
  • the positioning graphics in the narrow-bar two-dimensional code generated in this specification occupies a smaller area than the traditional large-scale pile point structure.
  • this manual only generates two positioning graphics, which can reserve more area for the data area, that is, the narrow barcode can store more two-dimensional code data.
  • Step 106 In the rectangular area, for each positioning pattern, fill the area surrounding the positioning pattern with the first color block to form a corresponding isolation area.
  • the width of the isolation area may be the width of one block. Taking the positioning pattern in FIG. 2a as an example, the corresponding isolation area can be as shown in FIG. 3.
  • Step 108 Fill the data area with the first color block and the second color block corresponding to the two-dimensional code data.
  • the data area here may be an area other than the two positioning graphics and the corresponding isolation area in the rectangular area.
  • the generated narrow barcode two-dimensional code may be as shown in FIG. 4.
  • the length of the narrow two-dimensional code is greater than the width, and it may include: two positioning graphics, the two positioning graphics are respectively located at the two vertices at both ends of the diagonal of the rectangular area, wherein each positioning graphics Including a white square in the center made of white blocks, and a black frame made of black blocks surrounding the white square.
  • the width ratio of the black block, white block and black block in the horizontal and/or vertical direction is 1:1:1.
  • the narrow two-dimensional code may also include two isolated areas and a data area for forming two-dimensional code data. Each isolation area is formed by a white block surrounding a positioning pattern in a rectangular area. The data area includes the area in the rectangular area excluding the two positioning patterns and the corresponding isolation area.
  • FIG. 4 only shows one shape and structure of a narrow two-dimensional code.
  • the two positioning graphics may also be located at the vertex at the lower left corner and the vertex at the upper right corner of the rectangular area; or at two vertices at both ends of the long side of the rectangle of the rectangular area.
  • the length of the narrow two-dimensional code can also be smaller than the width, which is not limited in this specification.
  • the narrow-bar two-dimensional code generated by the embodiment of the present specification can occupy a small area while ensuring the data capacity, so that it can be conveniently used in the case of relatively small use space.
  • Fig. 5 is a flowchart of a method for identifying a narrow two-dimensional code provided by an embodiment of this specification.
  • the execution subject of the method may be a device with processing capability: a server or a system or a device. As shown in FIG. 5, the method may specifically include:
  • Step 502 Obtain an image of the narrow two-dimensional code.
  • the narrow two-dimensional code here may refer to a two-dimensional code whose length is greater than its width, or a two-dimensional code whose length is less than its width.
  • Step 504 Detect positioning patterns in the image.
  • the positioning graphic may include a square structure formed by the first color block at the center, and a frame structure formed by the second color block surrounding the square structure.
  • the periphery of the positioning pattern may have an isolation area formed by the first color block.
  • the positioning pattern and the corresponding isolation area may be as shown in FIG. 3.
  • the width ratio of the second color block, the first color block, and the second color block in the horizontal and/or vertical direction of the positioning pattern may be 1:1:1. Therefore, based on this structural feature, the positioning pattern can be detected in the image.
  • Step 506 When two positioning graphics are detected, based on the center positions of the two positioning graphics, a target area containing a rectangular area corresponding to the narrow two-dimensional code is determined in the image.
  • the determination process of the above-mentioned target area may be: based on the center positions of the two positioning graphics, determining the narrow bar QR code The diagonal of the corresponding rectangular area. According to the diagonal, the target area containing the rectangular area is determined in the image.
  • the target area can be determined based on the center positions of the two positioning graphics and other positioning graphics.
  • the other positioning graphics here can be, for example, two black blocks in the lower left corner and the upper right corner in FIG. 4.
  • Step 508 Determine the data area to be identified from the target area.
  • the target area determined in step 508 is only the approximate position of the narrow two-dimensional code in the image.
  • the corresponding rectangular area can be further located in the target area.
  • the contour of the rectangular area can be extracted from the target area based on the erosion algorithm. Then the data area to be recognized is determined based on the extracted contour.
  • the process of determining the data area to be recognized based on the extracted contour may be: scanning the extracted contour, and during the scanning process, repeating the following steps: selecting two from the contour Points, and calculate the slope of the line constructed through the two points. After scanning a circle of the extracted contour, the number of occurrences of each calculated slope is counted. Based on the slope with the most occurrences, the lateral direction of the narrow two-dimensional code is determined. Then, based on the center position of the two positioning graphics, the center line is constructed. Determine the angle between the center line and the horizontal direction. Determine the four vertices of the narrow two-dimensional code according to the center position and the included angle of the two positioning graphics. Based on the four vertices, the data area to be identified is determined.
  • Step 510 Identify the two-dimensional code data in the data area.
  • the recognition process may specifically include: determining the perspective transformation relationship based on the determined coordinates of the four vertices and the preset standard code coordinates. Then, based on the perspective transformation relationship, the two-dimensional code data in the data area is sampled. Finally, decode the sampled two-dimensional code data.
  • the two-dimensional code recognition method provided in the embodiment of this specification only detects two positioning patterns, and the recognized narrow two-dimensional code has a small area, the solution provided in this specification has a higher recognition efficiency .
  • an embodiment of this specification also provides a device for generating a narrow-bar two-dimensional code.
  • the device may include:
  • the determining unit 602 is configured to determine a rectangular area, which includes blocks to be filled arranged in a grid.
  • the length of the rectangular area may be greater than the width.
  • the filling unit 604 is used to fill the two square areas at the two vertices of the rectangular area determined by the determining unit 602 with two positioning graphics respectively, wherein each positioning graphic includes a square at the center and formed by the first color block The structure, and the frame structure that surrounds the square structure and is composed of the second color block.
  • the two vertices may be two vertices at both ends of the diagonal of the rectangular area.
  • the two vertices may also be two vertices at both ends of the long side of the rectangle of the rectangular area.
  • the filling unit 604 is also used to fill the area surrounding the positioning graphics with the first color block in the rectangular area determined by the determining unit 602 for each positioning graphics to form a corresponding isolation area.
  • the filling unit 604 is also used to fill the first color block and the second color block corresponding to the two-dimensional code data in the data area, which is the area in the rectangular area excluding the two positioning graphics and the corresponding isolation area.
  • the ratio of the width of the square structure to the frame structure is 1:1.
  • the device for generating a narrow two-dimensional code provided in an embodiment of the present specification can generate a small two-dimensional code, which can be conveniently used when the space is small.
  • an embodiment of this specification also provides a narrow-bar two-dimensional code recognition device.
  • the device may include:
  • the acquiring unit 702 is configured to acquire an image of a narrow two-dimensional code.
  • the detection unit 704 is used to detect a positioning pattern in the image acquired by the acquisition unit 702.
  • the positioning pattern may include a square structure formed by the first color block at the center, and a square structure surrounded by the square structure and formed by the second color block.
  • the surrounding frame structure has an isolation area formed by the first color block on the periphery of the positioning graphic.
  • the detection unit 704 may be specifically used for:
  • a positioning pattern with a ratio of the width of the square structure and the frame structure of 1:1 is detected.
  • the determining unit 706 is configured to, when the detecting unit 704 detects two positioning graphics, determine the target area in the image that contains the rectangular area corresponding to the narrow two-dimensional code based on the center positions of the two positioning graphics.
  • the determining unit 706 may be specifically used for:
  • the diagonal of the rectangular area corresponding to the narrow two-dimensional code is determined.
  • the target area containing the rectangular area is determined in the image.
  • the determining unit 706 is further configured to determine the data area to be identified from the target area.
  • the determining unit 706 may be specifically used for:
  • the outline of the rectangular area is extracted from the target area.
  • the data area to be recognized is determined.
  • the identifying unit 708 is configured to identify the two-dimensional code data in the data area determined by the determining unit 706.
  • the determining unit 706 may also be specifically configured to:
  • the lateral direction of the narrow two-dimensional code is determined.
  • the data area to be identified is determined.
  • the determining unit 706 may also be specifically configured to:
  • the device for identifying a narrow two-dimensional code provided in an embodiment of this specification can quickly and accurately identify a narrow two-dimensional code.
  • an embodiment of this specification also provides a device for generating a narrow barcode.
  • the device may include: a memory 802, one or more processing 804 and one or more programs.
  • the one or more programs are stored in the memory 802 and are configured to be executed by one or more processors 804, and the following steps are implemented when the programs are executed by the processor 804:
  • a rectangular area is determined, and the rectangular area includes blocks to be filled arranged in a grid.
  • each positioning graphic includes a square structure at the center and composed of the first color block, and a circle surrounding the square structure, consisting of a second Frame structure formed by color blocks.
  • each positioning pattern fill the area surrounding the positioning pattern with the first color block to form a corresponding isolation area.
  • the data area is filled with the first color block and the second color block corresponding to the two-dimensional code data, and the data area is the area in the rectangular area excluding the two positioning patterns and the corresponding isolation area.
  • the device for generating a narrow two-dimensional code provided in an embodiment of this specification can generate a small two-dimensional code, which is convenient for users to use.
  • the embodiment of this specification also provides a narrow-bar QR code recognition device.
  • the device may include: a memory 902, one or more processing 904 and one or more programs.
  • the one or more programs are stored in the memory 902 and configured to be executed by one or more processors 904, and the following steps are implemented when the programs are executed by the processor 904:
  • a positioning pattern is detected in the image.
  • the positioning pattern includes a square structure at the center composed of a first color block, and a frame structure surrounding the square structure and composed of a second color block. An isolated area formed by a color block.
  • a target area containing a rectangular area corresponding to the narrow two-dimensional code is determined in the image.
  • the identification device for a narrow two-dimensional code provided in an embodiment of this specification can quickly and accurately identify a narrow two-dimensional code.
  • the steps of the method or algorithm described in conjunction with the disclosure of this specification can be implemented in hardware, or implemented by a processor executing software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form known in the art Storage medium.
  • An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and can write information to the storage medium.
  • the storage medium may also be an integral part of the processor.
  • the processor and the storage medium may be located in the ASIC.
  • the ASIC may be located in the server.
  • the processor and the storage medium may also exist in the server as separate components.
  • Computer readable media include computer storage media and communication media, where communication media includes any media that facilitates the transfer of computer programs from one place to another.
  • the storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

本说明书实施例提供一种窄条二维码、窄条二维码的生成、识别方法、装置及设备,在生成方法中,确定矩形区域,该矩形区域包括网格状排列的待填充块。用两个定位图形分别填充矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围方形结构一周、由第二色块构成的围框结构。在矩形区域中,对于每个定位图形,用第一色块填充围绕定位图形的区域,以形成相应的隔离区域。在数据区域填充与二维码数据相应的第一色块和第二色块,数据区域为矩形区域中除两个定位图形以及相应的隔离区域之外的区域。

Description

窄条二维码、窄条二维码的生成、识别方法、装置及设备 技术领域
本说明书一个或多个实施例涉及图像处理技术领域,尤其涉及一种窄条二维码、窄条二维码的生成、识别方法、装置及设备。
背景技术
二维码(2-dimensional bar code)是通过按一定规律在平面的二维方向上分布的图形来记录信息的条码。其中,以QR二维码(简称QR码)最为常见。传统的QR码通常会设置3个用于定位的大型桩点结构。在二值化的二维码中,该大型桩点结构的线段黑白长度比例满足1:1:3:1:1。然而在部分场景下,比如,当二维码用于记录图书编号相关信息时,由于用于张贴二维码的空间比较小,所以传统的二维码不便于使用。
因此,需要生成一种二维码,以方便于在使用空间比较小的情况下使用。
发明内容
本说明书一个或多个实施例描述了一种窄条二维码、窄条二维码的生成、识别方法、装置及设备,可以生成一种小型二维码,从而可以方便于在使用空间比较小的情况下使用。
第一方面,提供了一种窄条二维码的生成方法,包括:
确定矩形区域,所述矩形区域包括网格状排列的待填充块;
用两个定位图形分别填充所述矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构;
在所述矩形区域中,对于每个定位图形,用第一色块填充围绕所述定位图形的区域,以形成相应的隔离区域;
在数据区域填充与二维码数据相应的第一色块和第二色块,所述数据区域为所述矩形区域中除所述两个定位图形以及相应的隔离区域之外的区域。
第二方面,提供了一种窄条二维码的识别方法,包括:
获取窄条二维码的图像;
在所述图像中检测定位图形,所述定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构,并且所述定位图形外围具有第一色块形成的隔离区域;
当检测到两个所述定位图形时,基于两个所述定位图形的中心位置,在所述图像中确定出包含所述窄条二维码所对应的矩形区域的目标区域;
从目标区域中确定待识别的数据区域;
对所述数据区域的二维码数据进行识别。
第三方面,提供了一种窄条二维码,包括:
两个定位图形,所述两个定位图形位于矩形区域的两个顶点处,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构;
两个隔离区域,每个隔离区域由所述矩形区域中围绕1个所述定位图形的第一色块而形成;
用于形成二维码数据的数据区域,包括所述矩形区域中除所述两个定位图形和相应的隔离区域之外的区域。
第四方面,提供了一种窄条二维码的生成装置,包括:
确定单元,用于确定矩形区域,所述矩形区域包括网格状排列的待填充块;
填充单元,用于用两个定位图形分别填充所述确定单元确定的所述矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构;
所述填充单元,还用于在所述确定单元确定的所述矩形区域中,对于每个定位图形,用第一色块填充围绕所述定位图形的区域,以形成相应的隔离区域;
所述填充单元,还用于在数据区域填充与二维码数据相应的第一色块和第二色块,所述数据区域为所述矩形区域中除所述两个定位图形以及相应的隔离区域之外的区域。
第五方面,提供了一种窄条二维码的识别装置,包括:
获取单元,用于获取窄条二维码的图像;
检测单元,用于在所述获取单元获取的所述图像中检测定位图形,所述定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构,并且所述定位图形外围具有第一色块形成的隔离区域;
确定单元,用于当所述检测单元检测到两个所述定位图形时,基于两个所述定位图形的中心位置,在所述图像中确定出包含所述窄条二维码所对应的矩形区域的目标区域;
所述确定单元,还用于从目标区域中确定待识别的数据区域;
识别单元,用于对所述确定单元确定的所述数据区域的二维码数据进行识别。
第六方面,提供了一种窄条二维码的生成设备,包括:
存储器;
一个或多个处理器;以及
一个或多个程序,其中所述一个或多个程序存储在所述存储器中,并且被配置成由所述一个或多个处理器执行,所述程序被所述处理器执行时实现以下步骤:
确定矩形区域,所述矩形区域包括网格状排列的待填充块;
用两个定位图形分别填充所述矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构;
在所述矩形区域中,对于每个定位图形,用第一色块填充围绕所述定位图形的区域,以形成相应的隔离区域;
在数据区域填充与二维码数据相应的第一色块和第二色块,所述数据区域为所述矩形区域中除所述两个定位图形以及相应的隔离区域之外的区域。
第七方面,提供了一种窄条二维码的识别设备,包括:
存储器;
一个或多个处理器;以及
一个或多个程序,其中所述一个或多个程序存储在所述存储器中,并且被配置成由所述一个或多个处理器执行,所述程序被所述处理器执行时实现以下步骤:
获取窄条二维码的图像;
在所述图像中检测定位图形,所述定位图形包括位于中心的、由第一色块构成的方 形结构,和包围所述方形结构一周、由第二色块构成的围框结构,并且所述定位图形外围具有第一色块形成的隔离区域;
当检测到两个所述定位图形时,基于两个所述定位图形的中心位置,在所述图像中确定出包含所述窄条二维码所对应的矩形区域的目标区域;
从目标区域中确定待识别的数据区域;
对所述数据区域的二维码数据进行识别。
本说明书一个或多个实施例提供的窄条二维码、窄条二维码的生成、识别方法、装置及设备,确定矩形区域,该矩形区域包括网格状排列的待填充块。用两个定位图形分别填充矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围方形结构一周、由第二色块构成的围框结构。在矩形区域中,对于每个定位图形,用第一色块填充围绕定位图形的区域,以形成相应的隔离区域。在数据区域填充与二维码数据相应的第一色块和第二色块,数据区域为矩形区域中除两个定位图形以及相应的隔离区域之外的区域。由此可以看出,本说明书生成的窄条二维码可以只包含两个定位图形,从而可以大大减少窄条二维码的面积,这可以方便于在使用空间比较小的情况下的使用。
附图说明
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为本说明书一个实施例提供的窄条二维码的生成方法流程图;
图2a为本说明书提供的定位图形示意图之一;
图2b为本说明书提供的定位图形示意图之二;
图3为本说明书提供的定位图形的隔离区域示意图;
图4为本说明书提供的窄条二维码示意图;
图5为本说明书一个实施例提供的窄条二维码的识别方法流程图;
图6为本说明书一个实施例提供的窄条二维码的生成装置示意图;
图7为本说明书一个实施例提供的窄条二维码的识别装置示意图;
图8为本说明书一个实施例提供的窄条二维码的生成设备示意图;
图9为本说明书一个实施例提供的窄条二维码的识别设备示意图。
具体实施方式
下面结合附图,对本说明书提供的方案进行描述。
图1为本说明书一个实施例提供的窄条二维码的生成方法流程图。所述方法的执行主体可以为具有处理能力的设备:服务器或者系统或者装置。如图1所示,所述方法具体可以包括:
步骤102,确定矩形区域。
该矩形区域可以包括网格状排列的待填充块。这里的块可以与若干个像素点相对应。需要说明的是,在初始确定的矩形区域中,这些像素点的像素值还不确定,从而该矩形区域中各个块的颜色值为空。
需要说明的是,上述生成的矩形区域的大小(或者面积)可以为N*M,其中,N为矩形区域的宽度,M为矩形区域的长度。在本说明书中,上述M可以大于N。如,在一个例子中,N可以为6,M可以为23。在另一例子中,N可以为7,M可以为20。需要说明的是,为保证后续生成的窄条二维码能够存储足够多的数据,可以设置矩形区域的大小大于120,即N*M>120。
步骤104,用两个定位图形分别填充矩形区域中两个顶点处的两个方形区域。
这里的两个顶点可以为矩形区域的对角线两端的两个顶点。或者,也可以为矩形区域的矩形长边两端的两个顶点。
上述每个定位图形可以包括位于中心的、由第一色块构成的方形结构,和包围方形结构一周、由第二色块构成的围框结构。这里的第一色块可以是指白色块,也可以是指黑色块。可以理解的是,当第一色块为白色块时,那么第二色块为黑色块;而当第一色块为黑色块时,那么第二色块为白色块。
此外,上述定位图形的方形结构和围框结构的宽度比例可以为1:1,也即在横向和/或纵向上,定位图形的第二色块、第一色块以及第二色块的宽度比例可以为:1:1:1。
在一个例子中,上述定位图形可以如图2a所示。图2a中,该定位图形的位于中心 的方形结构由1个白色块构成,包围方形结构一周的围框结构由8个黑色块构成。另外,在横向和/或纵向上,定位图形的黑色块、白色块以及黑色块的宽度比例为:1:1:1。
在另一个例子中,上述定位图形可以如图2b所示。图2b中,该定位图形的位于中心的方形结构由4个白色块构成,包围方形结构一周的围框结构由32个黑色块构成。另外,在横向和/或纵向上,定位图形的黑色块、白色块以及黑色块的宽度比例为:2:2:2,也即其宽度比例也为1:1:1。
当然,在实际应用中,图2a和图2b中的白色块也可以替换为黑色块,同时黑色块也可以替换为白色块,本说明书对此不作限定。
由此可以看出,本说明书生成的窄条二维码中的定位图形相比于传统的大型桩点结构占用较小的面积。此外,本说明书只生成两个定位图形,这可以为数据区域预留更多的区域,也即可以使窄条二维码存储更多的二维码数据。
步骤106,在矩形区域中,对于每个定位图形,用第一色块填充围绕定位图形的区域,以形成相应的隔离区域。
该隔离区域的宽度可以为一个块的宽度。在以图2a中的定位图形为例来说,与其相应的隔离区域可以如图3所示。
步骤108,在数据区域填充与二维码数据相应的第一色块和第二色块。
这里的数据区域可以为矩形区域中除两个定位图形以及相应的隔离区域之外的区域。
在执行完成上述填充的步骤之后,就可以得到窄条二维码。在一个例子中,所生成的窄条二维码可以如图4所示。图4中,该窄条二维码的长度大于宽度,其可以包括:两个定位图形,该两个定位图形分别位于矩形区域的对角线两端的两个顶点处,其中,每个定位图形包括位于中心的、由白色块构成的白色方形,和包围白色方形一周、由黑色块构成的黑色围框。对于上述每个定位图形,其在横向和/或纵向上黑色块、白色块以及黑色块的宽度比例为:1:1:1。另外,该窄条二维码还可以包括两个隔离区域以及用于形成二维码数据的数据区域。每个隔离区域由矩形区域中围绕1个定位图形的白色块而形成。数据区域包括矩形区域中除两个定位图形和相应的隔离区域之外的区域。
需要说明的是,图4只示出了窄条二维码的一种形状结构。在其它例子中,两个定位图形也可以位于矩形区域的左下角的顶点和右上角的顶点处;或者,位于矩形区域的矩形长边两端的两个顶点处。此外,窄条二维码的长度也可以小于宽度,本说明书对此不作限定。
综上,通过本说明书实施例生成的窄条二维码在保证数据容量的情况下,可以占用较小的面积,从而可以方便于在使用空间比较小的情况下使用。
需要说明的是,针对上述生成的窄条二维码,本说明书还提供了其相应的识别方法,具体如下。
图5为本说明书一个实施例提供的窄条二维码的识别方法流程图。所述方法的执行主体可以为具有处理能力的设备:服务器或者系统或者装置。如图5所示,所述方法具体可以包括:
步骤502,获取窄条二维码的图像。
这里的窄条二维码可以是指长度大于宽度的二维码,或者长度小于宽度的二维码。
步骤504,在图像中检测定位图形。
该定位图形可以包括位于中心的、由第一色块构成的方形结构,和包围方形结构一周、由第二色块构成的围框结构。该定位图形外围可以具有第一色块形成的隔离区域。在一个例子中,该定位图形以及相应的隔离区域可以如图3所示。
此外,上述定位图形在横向和/或纵向上第二色块、第一色块以及第二色块的宽度比例可以为:1:1:1。因此,可以基于该结构特点,在图像中检测定位图形。
步骤506,当检测到两个定位图形时,基于两个定位图形的中心位置,在图像中确定出包含窄条二维码所对应的矩形区域的目标区域。
具体地,对于两个定位图形分别位于矩形区域的对角线两端的两个顶点处的情况,上述目标区域的确定过程可以为:基于两个定位图形的中心位置,确定窄条二维码所对应的矩形区域的对角线。根据对角线,在图像中确定出包含矩形区域的目标区域。
而对于两个定位图形分别位于矩形区域的矩形长边两端的两个顶点处的情况,则可以基于两个定位图形的中心位置以及其它定位图形,来确定上述目标区域。这里的其它定位图形例如可以为图4中左下角和右上角的两个黑色块。
步骤508,从目标区域中确定待识别的数据区域。
需要说明的是,通过步骤508确定的目标区域只是窄条二维码在图像中的大概位置。为提升窄条二维码的识别效率,还可以在目标区域中进一步地对所对应的矩形区域进行定位。如,可以基于腐蚀算法,从目标区域中提取矩形区域的轮廓。之后基于所提取的轮廓来确定待识别的数据区域。
在一种实现方式中,上述基于所提取的轮廓来确定待识别的数据区域的过程可以为:对所提取的轮廓进行扫描,且在扫描的过程中,重复执行以下步骤:从轮廓中选取两个点,并计算通过该两个点所构建连线的斜率。在对所提取的轮廓扫描一圈之后,对所计算得到的各个斜率的出现次数进行统计。基于出现次数最多的斜率,确定窄条二维码的横向方向。之后,基于两个定位图形的中心位置,构建中心连线。确定中心连线相对于横向方向的夹角。根据两个定位图形的中心位置以及夹角,确定窄条二维码的四个顶点。基于四个顶点,确定待识别的数据区域。
步骤510,对数据区域的二维码数据进行识别。
该识别过程具体可以为:基于已确定出的四个顶点的坐标以及预设的标准码坐标,确定透视变换关系。之后,基于透视变换关系,对数据区域的二维码数据进行采样。最后,对采样得到的二维码数据进行解码。
需要说明的是,由于本说明书实施例提供的二维码的识别方法只检测两个定位图形,且所识别的窄条二维码面积较小,从而本说明书提供的方案具有较高的识别效率。
与上述窄条二维码的生成方法对应地,本说明书一个实施例还提供的一种窄条二维码的生成装置,如图6所示,该装置可以包括:
确定单元602,用于确定矩形区域,该矩形区域包括网格状排列的待填充块。
该矩形区域的长度可以大于宽度。
填充单元604,用于用两个定位图形分别填充确定单元602确定的矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围方形结构一周、由第二色块构成的围框结构。
该两个顶点可以为矩形区域的对角线两端的两个顶点。或者,该两个顶点也可以为矩形区域的矩形长边两端的两个顶点。
填充单元604,还用于在确定单元602确定的矩形区域中,对于每个定位图形,用第一色块填充围绕定位图形的区域,以形成相应的隔离区域。
填充单元604,还用于在数据区域填充与二维码数据相应的第一色块和第二色块,该数据区域为矩形区域中除两个定位图形以及相应的隔离区域之外的区域。
可选地,方形结构和围框结构的宽度之比为1:1。
本说明书上述实施例装置的各功能模块的功能,可以通过上述方法实施例的各 步骤来实现,因此,本说明书一个实施例提供的装置的具体工作过程,在此不复赘述。
本说明书一个实施例提供的窄条二维码的生成装置,可以生成一种小型二维码,从而可以方便于在使用空间较小的情况下使用。
与上述窄条二维码的识别方法对应地,本说明书一个实施例还提供的一种窄条二维码的识别装置,如图7所示,该装置可以包括:
获取单元702,用于获取窄条二维码的图像。
检测单元704,用于在获取单元702获取的图像中检测定位图形,该定位图形可以包括位于中心的、由第一色块构成的方形结构,和包围方形结构一周、由第二色块构成的围框结构,并且定位图形外围具有第一色块形成的隔离区域。
检测单元704具体可以用于:
在图像中检测方形结构和围框结构的宽度之比为1:1的定位图形。
确定单元706,用于当检测单元704检测到两个定位图形时,基于两个定位图形的中心位置,在图像中确定出包含窄条二维码所对应的矩形区域的目标区域。
确定单元706具体可以用于:
基于两个定位图形的中心位置,确定窄条二维码所对应的矩形区域的对角线。
根据对角线,在图像中确定出包含矩形区域的目标区域。
确定单元706,还用于从目标区域中确定待识别的数据区域。
确定单元706具体可以用于:
基于腐蚀算法,从目标区域中提取矩形区域的轮廓。
基于所提取的轮廓,确定待识别的数据区域。
识别单元708,用于对确定单元706确定的数据区域的二维码数据进行识别。
可选地,确定单元706还具体可以用于:
迭代地从所提取的轮廓中选取两个点,并计算通过该两个点所构建连线的斜率。
在对所提取的轮廓扫描一圈之后,统计各个斜率的出现次数。
基于出现次数最多的斜率,确定窄条二维码的横向方向。
根据两个定位图形的中心位置以及横向方向,确定窄条二维码的四个顶点。
基于确定的四个顶点,确定待识别的数据区域。
可选地,确定单元706还具体可以用于:
基于两个定位图形的中心位置,构建中心连线。
确定中心连线相对于横向方向的夹角。
根据两个定位图形的中心位置以及夹角,确定窄条二维码的四个顶点。
本说明书一个实施例提供的窄条二维码的识别装置,可以快速而准确地对窄条二维码进行识别。
与上述窄条二维码的生成方法对应地,本说明书实施例还提供了一种窄条二维码的生成设备,如图8所示,该设备可以包括:存储器802、一个或多个处理器804以及一个或多个程序。其中,该一个或多个程序存储在存储器802中,并且被配置成由一个或多个处理器804执行,该程序被处理器804执行时实现以下步骤:
确定矩形区域,该矩形区域包括网格状排列的待填充块。
用两个定位图形分别填充矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围方形结构一周、由第二色块构成的围框结构。
在矩形区域中,对于每个定位图形,用第一色块填充围绕定位图形的区域,以形成相应的隔离区域。
在数据区域填充与二维码数据相应的第一色块和第二色块,数据区域为矩形区域中除两个定位图形以及相应的隔离区域之外的区域。
本说明书一个实施例提供的窄条二维码的生成设备,可以生成一种小型二维码,从而可以方便于用户的使用。
与上述窄条二维码的识别方法对应地,本说明书实施例还提供了一种窄条二维码的识别设备,如图9所示,该设备可以包括:存储器902、一个或多个处理器904以及一个或多个程序。其中,该一个或多个程序存储在存储器902中,并且被配置成由一个或多个处理器904执行,该程序被处理器904执行时实现以下步骤:
获取窄条二维码的图像。
在图像中检测定位图形,该定位图形包括位于中心的、由第一色块构成的方形 结构,和包围所述方形结构一周、由第二色块构成的围框结构,并且定位图形外围具有第一色块形成的隔离区域。
当检测到两个定位图形时,基于两个定位图形的中心位置,在图像中确定出包含窄条二维码所对应的矩形区域的目标区域。
从目标区域中确定待识别的数据区域。
对数据区域的二维码数据进行识别。
本说明书一个实施例提供的窄条二维码的识别设备,可以快速而准确地对窄条二维码进行识别。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
结合本说明书公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块个成,软件模块可以被存放于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的个成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于服务器中。当然,处理器和存储介质也可以作为分立个件存在于服务器中。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意个合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特 定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
以上所述的具体实施方式,对本说明书的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本说明书的具体实施方式而已,并不用于限定本说明书的保护范围,凡在本说明书的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本说明书的保护范围之内。

Claims (26)

  1. 一种窄条二维码的生成方法,包括:
    确定矩形区域,所述矩形区域包括网格状排列的待填充块;
    用两个定位图形分别填充所述矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构;
    在所述矩形区域中,对于每个定位图形,用第一色块填充围绕所述定位图形的区域,以形成相应的隔离区域;
    在数据区域填充与二维码数据相应的第一色块和第二色块,所述数据区域为所述矩形区域中除所述两个定位图形以及相应的隔离区域之外的区域。
  2. 根据权利要求1所述的方法,所述两个顶点为所述矩形区域的对角线两端的两个顶点。
  3. 根据权利要求1所述的方法,所述方形结构和所述围框结构的宽度之比为1:1。
  4. 根据权利要求1所述的方法,所述矩形区域的长度大于宽度。
  5. 一种窄条二维码的识别方法,包括:
    获取窄条二维码的图像;
    在所述图像中检测定位图形,所述定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构,并且所述定位图形外围具有第一色块形成的隔离区域;
    当检测到两个所述定位图形时,基于两个所述定位图形的中心位置,在所述图像中确定出包含所述窄条二维码所对应的矩形区域的目标区域;
    从目标区域中确定待识别的数据区域;
    对所述数据区域的二维码数据进行识别。
  6. 根据权利要求5所述的方法,所述从目标区域中确定待识别的数据区域,包括:
    基于腐蚀算法,从所述目标区域中提取所述矩形区域的轮廓;
    基于所提取的轮廓,确定待识别的数据区域。
  7. 根据权利要求6所述的方法,所述基于所提取的轮廓,确定待识别的数据区域,包括:
    迭代地从所提取的轮廓中选取两个点,并计算通过所述两个点所构建连线的斜率;
    在对所提取的轮廓扫描一圈之后,统计各个斜率的出现次数;
    基于出现次数最多的斜率,确定所述窄条二维码的横向方向;
    根据两个所述定位图形的中心位置以及所述横向方向,确定所述窄条二维码的四个顶点;
    基于所述四个顶点,确定待识别的数据区域。
  8. 根据权利要求7所述的方法,所述根据两个所述定位图形的中心位置以及所述横向方向,确定所述窄条二维码的四个顶点,包括:
    基于两个所述定位图形的中心位置,构建中心连线;
    确定所述中心连线相对于所述横向方向的夹角;
    根据两个所述定位图形的中心位置以及所述夹角,确定所述窄条二维码的四个顶点。
  9. 根据权利要求5所述的方法,所述在所述图像中检测定位图形,包括:
    在所述图像中检测所述方形结构和所述围框结构的宽度之比为1:1的定位图形。
  10. 根据权利要求5所述的方法,所述基于两个所述定位图形的中心位置,在所述图像中确定出包含所述窄条二维码所对应的矩形区域的目标区域,包括:
    基于两个所述定位图形的中心位置,确定所述窄条二维码所对应的矩形区域的对角线;
    根据所述对角线,在所述图像中确定出包含所述矩形区域的目标区域。
  11. 一种窄条二维码,包括:
    两个定位图形,所述两个定位图形位于矩形区域的两个顶点处,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构;
    两个隔离区域,每个隔离区域由所述矩形区域中围绕1个所述定位图形的第一色块而形成;
    用于形成二维码数据的数据区域,包括所述矩形区域中除所述两个定位图形和相应的隔离区域之外的区域。
  12. 根据权利要求11所述的窄条二维码,所述两个顶点为所述矩形区域的对角线两端的两个顶点。
  13. 根据权利要求11所述的窄条二维码,所述方形结构和所述围框结构的宽度之比为1:1。
  14. 根据权利要求11所述的窄条二维码,所述矩形区域的长度大于宽度。
  15. 一种窄条二维码的生成装置,包括:
    确定单元,用于确定矩形区域,所述矩形区域包括网格状排列的待填充块;
    填充单元,用于用两个定位图形分别填充所述确定单元确定的所述矩形区域中两个 顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构;
    所述填充单元,还用于在所述确定单元确定的所述矩形区域中,对于每个定位图形,用第一色块填充围绕所述定位图形的区域,以形成相应的隔离区域;
    所述填充单元,还用于在数据区域填充与二维码数据相应的第一色块和第二色块,所述数据区域为所述矩形区域中除所述两个定位图形以及相应的隔离区域之外的区域。
  16. 根据权利要求15所述的装置,所述两个顶点为所述矩形区域的对角线两端的两个顶点。
  17. 根据权利要求15所述的装置,所述方形结构和所述围框结构的宽度之比为1:1。
  18. 根据权利要求15所述的装置,所述矩形区域的长度大于宽度。
  19. 一种窄条二维码的识别装置,包括:
    获取单元,用于获取窄条二维码的图像;
    检测单元,用于在所述获取单元获取的所述图像中检测定位图形,所述定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构,并且所述定位图形外围具有第一色块形成的隔离区域;
    确定单元,用于当所述检测单元检测到两个所述定位图形时,基于两个所述定位图形的中心位置,在所述图像中确定出包含所述窄条二维码所对应的矩形区域的目标区域;
    所述确定单元,还用于从目标区域中确定待识别的数据区域;
    识别单元,用于对所述确定单元确定的所述数据区域的二维码数据进行识别。
  20. 根据权利要求19所述的装置,所述确定单元具体用于:
    基于腐蚀算法,从所述目标区域中提取所述矩形区域的轮廓;
    基于所提取的轮廓,确定待识别的数据区域。
  21. 根据权利要求20所述的装置,所述确定单元还具体用于:
    迭代地从所提取的轮廓中选取两个点,并计算通过所述两个点所构建连线的斜率;
    在对所提取的轮廓扫描一圈之后,统计各个斜率的出现次数;
    基于出现次数最多的斜率,确定所述窄条二维码的横向方向;
    根据两个所述定位图形的中心位置以及所述横向方向,确定所述窄条二维码的四个顶点;
    基于所述四个顶点,确定待识别的数据区域。
  22. 根据权利要求21所述的装置,所述确定单元还具体用于:
    基于两个所述定位图形的中心位置,构建中心连线;
    确定所述中心连线相对于所述横向方向的夹角;
    根据两个所述定位图形的中心位置以及所述夹角,确定所述窄条二维码的四个顶点。
  23. 根据权利要求19所述的装置,所述检测单元具体用于:
    在所述图像中检测所述方形结构和所述围框结构的宽度之比为1:1的定位图形。
  24. 根据权利要求19所述的装置,所述确定单元具体用于:
    基于两个所述定位图形的中心位置,确定所述窄条二维码所对应的矩形区域的对角线;
    根据所述对角线,在所述图像中确定出包含所述矩形区域的目标区域。
  25. 一种窄条二维码的生成设备,包括:
    存储器;
    一个或多个处理器;以及
    一个或多个程序,其中所述一个或多个程序存储在所述存储器中,并且被配置成由所述一个或多个处理器执行,所述程序被所述处理器执行时实现以下步骤:
    确定矩形区域,所述矩形区域包括网格状排列的待填充块;
    用两个定位图形分别填充所述矩形区域中两个顶点处的两个方形区域,其中,每个定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构;
    在所述矩形区域中,对于每个定位图形,用第一色块填充围绕所述定位图形的区域,以形成相应的隔离区域;
    在数据区域填充与二维码数据相应的第一色块和第二色块,所述数据区域为所述矩形区域中除所述两个定位图形以及相应的隔离区域之外的区域。
  26. 一种窄条二维码的识别设备,包括:
    存储器;
    一个或多个处理器;以及
    一个或多个程序,其中所述一个或多个程序存储在所述存储器中,并且被配置成由所述一个或多个处理器执行,所述程序被所述处理器执行时实现以下步骤:
    获取窄条二维码的图像;
    在所述图像中检测定位图形,所述定位图形包括位于中心的、由第一色块构成的方形结构,和包围所述方形结构一周、由第二色块构成的围框结构,并且所述定位图形外围具有第一色块形成的隔离区域;
    当检测到两个所述定位图形时,基于两个所述定位图形的中心位置,在所述图像中 确定出包含所述窄条二维码所对应的矩形区域的目标区域;
    从目标区域中确定待识别的数据区域;
    对所述数据区域的二维码数据进行识别。
PCT/CN2020/070641 2019-03-18 2020-01-07 窄条二维码、窄条二维码的生成、识别方法、装置及设备 WO2020186900A1 (zh)

Priority Applications (5)

Application Number Priority Date Filing Date Title
SG11202104387YA SG11202104387YA (en) 2019-03-18 2020-01-07 Narrow-strip 2-dimensional bar codes, methods, apparatuses, and devices for generating and identifying narrow-strip 2-dimensional bar codes
EP20773181.1A EP3859608A4 (en) 2019-03-18 2020-01-07 TWO-DIMENSIONAL NARROW BAND BARCODE, AND METHOD, APPARATUS AND DEVICE FOR GENERATING AND RECOGNIZING A TWO-DIMENSIONAL NARROW BAND BARCODE
JP2021523397A JP2022524675A (ja) 2019-03-18 2020-01-07 細長い二次元バーコード、細長い二次元バーコードを生成および識別するための方法、装置、およびデバイス
US17/244,691 US11250230B2 (en) 2019-03-18 2021-04-29 Narrow-strip 2-dimensional bar codes, methods, apparatuses, and devices for generating and identifying narrow-strip 2-dimensional bar codes
US17/671,412 US11699053B2 (en) 2019-03-18 2022-02-14 Narrow-strip 2-dimensional bar codes, methods, apparatuses, and devices for generating and identifying narrow-strip 2-dimensional bar codes

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910205310.X 2019-03-18
CN201910205310.XA CN110033065B (zh) 2019-03-18 2019-03-18 窄条二维码、窄条二维码的生成、识别方法、装置及设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/244,691 Continuation US11250230B2 (en) 2019-03-18 2021-04-29 Narrow-strip 2-dimensional bar codes, methods, apparatuses, and devices for generating and identifying narrow-strip 2-dimensional bar codes

Publications (1)

Publication Number Publication Date
WO2020186900A1 true WO2020186900A1 (zh) 2020-09-24

Family

ID=67236219

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/070641 WO2020186900A1 (zh) 2019-03-18 2020-01-07 窄条二维码、窄条二维码的生成、识别方法、装置及设备

Country Status (7)

Country Link
US (2) US11250230B2 (zh)
EP (1) EP3859608A4 (zh)
JP (1) JP2022524675A (zh)
CN (2) CN113420859A (zh)
SG (1) SG11202104387YA (zh)
TW (1) TWI756568B (zh)
WO (1) WO2020186900A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420859A (zh) * 2019-03-18 2021-09-21 创新先进技术有限公司 二维码、二维码的生成、识别方法、装置及设备
US11636279B1 (en) * 2020-06-10 2023-04-25 Digimarc Corporation Color driven localization of 1D and 2D barcodes in digital capture systems

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000276564A (ja) * 1999-03-26 2000-10-06 Denso Corp 2次元コード
CN108875874A (zh) * 2018-06-28 2018-11-23 合肥浪金防伪科技有限公司 一种简化网络商品防伪二维码冗余设计的方法
CN108960000A (zh) * 2018-07-17 2018-12-07 深圳市零点零科技有限公司 一种长条小型二维码识别方法
CN109325381A (zh) * 2018-08-13 2019-02-12 佛山市顺德区中山大学研究院 一种寻像图形缺失一处的qr码定位和校正算法
CN109657513A (zh) * 2017-10-06 2019-04-19 电装波动株式会社 二维码
CN110033065A (zh) * 2019-03-18 2019-07-19 阿里巴巴集团控股有限公司 窄条二维码、窄条二维码的生成、识别方法、装置及设备

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3668275B2 (ja) * 1995-03-15 2005-07-06 シャープ株式会社 デジタル情報記録方法、解読方法および解読装置
JP4301775B2 (ja) 2002-07-18 2009-07-22 シャープ株式会社 2次元コード読み取り装置,2次元コード読み取り方法,2次元コード読み取りプログラム及び該プログラムの記録媒体
US20060043189A1 (en) * 2004-08-31 2006-03-02 Sachin Agrawal Method and apparatus for determining the vertices of a character in a two-dimensional barcode symbol
CN100369059C (zh) * 2006-01-18 2008-02-13 冯文伦 一种矩阵式二维条码及其编码解码方法
CN101430768B (zh) * 2007-11-07 2013-05-15 成都市思博睿科技有限公司 一种二维条码的定位方法
JP5121685B2 (ja) * 2008-12-12 2013-01-16 株式会社東芝 バーコード読取装置、バーコード読取プログラム、バーコード読取方法
KR101801217B1 (ko) * 2012-11-13 2017-11-24 교도 인사쯔 가부시키가이샤 이차원 코드
CN102999772B (zh) * 2012-11-14 2016-02-10 韩偲铭 一种新型矩阵式二维码的编解码方法
WO2015174191A1 (ja) * 2014-05-14 2015-11-19 共同印刷株式会社 二次元コード、二次元コードの解析システム
US9367782B2 (en) * 2014-05-29 2016-06-14 Konica Minolta Laboratory U.S.A., Inc. High capacity 2D color barcode and method for decoding the same
CN104700062B (zh) * 2015-03-20 2017-06-27 中国联合网络通信集团有限公司 一种识别二维码的方法及设备
CN106067054A (zh) * 2016-05-30 2016-11-02 上海斐讯数据通信技术有限公司 一种基于qr码的二维码
KR101979295B1 (ko) * 2017-04-27 2019-05-17 (주) 성지정보기술 2 차원 바코드 처리
CN107748908A (zh) * 2017-09-18 2018-03-02 中国农业大学 一种个性化二维码构造方法
JP7167553B2 (ja) * 2017-10-06 2022-11-09 株式会社デンソーウェーブ 二次元コード
CN109063806A (zh) * 2018-07-17 2018-12-21 深圳市零点零科技有限公司 一种长条小型二维码编码方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000276564A (ja) * 1999-03-26 2000-10-06 Denso Corp 2次元コード
CN109657513A (zh) * 2017-10-06 2019-04-19 电装波动株式会社 二维码
CN108875874A (zh) * 2018-06-28 2018-11-23 合肥浪金防伪科技有限公司 一种简化网络商品防伪二维码冗余设计的方法
CN108960000A (zh) * 2018-07-17 2018-12-07 深圳市零点零科技有限公司 一种长条小型二维码识别方法
CN109325381A (zh) * 2018-08-13 2019-02-12 佛山市顺德区中山大学研究院 一种寻像图形缺失一处的qr码定位和校正算法
CN110033065A (zh) * 2019-03-18 2019-07-19 阿里巴巴集团控股有限公司 窄条二维码、窄条二维码的生成、识别方法、装置及设备

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
US11250230B2 (en) 2022-02-15
CN113420859A (zh) 2021-09-21
CN110033065B (zh) 2021-04-27
US11699053B2 (en) 2023-07-11
EP3859608A1 (en) 2021-08-04
US20210248337A1 (en) 2021-08-12
US20220164559A1 (en) 2022-05-26
JP2022524675A (ja) 2022-05-10
SG11202104387YA (en) 2021-05-28
CN110033065A (zh) 2019-07-19
TW202036380A (zh) 2020-10-01
EP3859608A4 (en) 2021-12-15
TWI756568B (zh) 2022-03-01

Similar Documents

Publication Publication Date Title
CN106897648B (zh) 识别二维码位置的方法及其系统
CN110738273B (zh) 图像特征点的匹配方法、装置、设备及存储介质
CN107577979B (zh) DataMatrix型二维码快速识别方法、装置及电子设备
US11699053B2 (en) Narrow-strip 2-dimensional bar codes, methods, apparatuses, and devices for generating and identifying narrow-strip 2-dimensional bar codes
WO2018059365A9 (zh) 图形码处理方法及装置、存储介质
CN109101855B (zh) 一种基于opencv的缺失定位框二维码识别方法
US20240020923A1 (en) Positioning method based on semantic information, device and computer-readable storage medium
CN112307786A (zh) 一种多个不规则二维码批量定位识别方法
CN109784328B (zh) 定位条码的方法、终端及计算机可读存储介质
WO2024012463A1 (zh) 一种定位方法及装置
CN111523331B (zh) 一种二维码识别方法及装置
CN112001352A (zh) 基于Apriltag标签的纺织作业工作台识别定位方法及装置
CN105373793A (zh) 一种qr码图像几何校正的顶点定位方法
US20230196707A1 (en) Fiducial patterns
CN115221910A (zh) 二维码识别方法、装置、设备及计算机可读存储介质
CN109472741B (zh) 三维拼接方法及装置
CN114529922A (zh) 一种无线框表格图像表格结构识别方法
CN115731256A (zh) 一种顶点坐标的检测方法、装置、设备及存储介质
CN113283262A (zh) 一种二维码定位方法、装置、电子设备、机器可读介质
US20200286248A1 (en) Structured light subpixel accuracy isp pipeline/fast super resolution structured light
CN111191759A (zh) 一种二维码的生成方法和基于gpu的定位、解码方法
JP2011170554A (ja) 物体認識装置、物体認識方法及び物体認識プログラム
CN114494443B (zh) 正弦波星图自动定位方法、装置、电子设备及存储介质
CN110926370B (zh) 测量方法和系统
KR102248885B1 (ko) 복수의 2차원 코드 인식 및 정보 표시 방법

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: 20773181

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021523397

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2020773181

Country of ref document: EP

Effective date: 20210426

NENP Non-entry into the national phase

Ref country code: DE