# US 10,956,696 B2 · Two-dimensional code identification and positioning

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,956,696 B2
- Document ID: US10956696B2
- Status: Granted
- Kind: B2
- Application number: 16/809,256
- Filed: 2020-03-04
- Published: 2020-12-03
- Granted: 2021-03-23
- Earliest claimed: 2019-05-31
- Assignees: Advanced New Technologies Co., Ltd.
- Applicants: Advanced New Technologies Co., Ltd.
- Inventors: Mingjie Liang; Jiada Chen; Shuang Chen; Pulin Wang
- Web page: https://patentgrep.com/patent/US10956696B2

## CPC

- G06K 7/1417: {2D bar codes}
- G06K 7/1443: {locating of the code in an image}
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/08: Learning methods
- G06N 3/09: Supervised learning
- G06N 20/00: Machine learning
- G06T 3/4007: based on interpolation, e.g. bilinear interpolation (image demosaicing G06T3/4015; edge-driven or edge-based scaling G06T3/403)
- H04N 23/61: based on recognised objects
- H04N 23/673: {based on contrast or high frequency components of image signals, e.g. hill climbing method}
- H04N 23/69: Control of means for changing angle of the field of view, e.g. optical zoom objectives or electronic zooming
- G06N 3/045: Combinations of networks
- G06K: GRAPHICAL DATA READING (image or video recognition or understanding G06V); PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

The present specification provides a two-dimensional code identification method and device, and a two-dimensional code positioning and identification model establishment method and device. The two-dimensional code identification method includes: obtaining a to-be-identified two-dimensional code, and performing global feature positioning detection on the to-be-identified two-dimensional code by using a pre-established two-dimensional code positioning and identification model; performing focus adjustment, based on a predetermined image resolution, on the to-be-identified two-dimensional code on which positioning detection is performed; and decoding the to-be-identified two-dimensional code on which focus adjustment is performed. The present specification can improve the identification accuracy of two-dimensional codes shot in complex scenarios.

## Claims

### Claim 1

A computer-implemented method, comprising:
obtaining an image of a reference two-dimensional code;
obtaining a first resolution of the image of the reference two-dimensional code;
obtaining a sample two-dimensional code based on a predetermined environment condition;
obtaining a second resolution of the sample two-dimensional code;
determining that the second resolution of the sample two-dimensional code matches the first resolution of the reference two-dimensional code;
positioning global features of the reference two-dimensional code based on the sample two-dimensional code and identifier information of the sample two-dimensional code, wherein the identifier information comprises one or more global features of the sample two-dimensional code;
providing the reference two-dimensional code and the global features of the reference two-dimensional code as training data to train a two-dimensional code positioning and identification model;
detecting a third two-dimensional code within a second obtained image by performing global feature positioning detection using the two-dimensional code positioning and identification model;
subsequent to detecting the third two-dimensional code, obtaining a focus-adjusted image of the third two-dimensional code based on a predetermined image resolution; and
decoding the third two-dimensional code from the focus-adjusted image of the third two-dimensional code.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein the method comprises:
determining that a resolution of the second obtained image of the third two-dimensional code fails to satisfy the predetermined image resolution; and obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution responsive to determining that the resolution of the third two-dimensional code fails to satisfy the predetermined image resolution.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution comprises applying an auto-focusing algorithm to obtain an updated image of the third two-dimensional code at a different resolution.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution comprises applying a zoom adjustment based on the predetermined image resolution to obtain an updated image of the third two-dimensional code at a different resolution.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, wherein applying the zoom adjustment comprises:
detecting whether a two-dimensional code scanning device comprises an optical zoom function; and
based on detecting that the two-dimensional code scanning device has the optical zoom function, adjusting the two-dimensional code scanning device to a new zoom level, and capturing a revised image of the third two-dimensional code at the new zoom level, or
based on detecting that the two-dimensional code scanning device does not have the optical zoom function, applying an image interpolation process to a captured pixel area of the second obtained image of the third two-dimensional code.

### Claim 6 (depends on 5)

The computer-implemented method of claim 5, wherein, after capturing the revised image of the third two-dimensional code, the method further comprises:
determining the third two-dimensional code does not satisfy the predetermined image resolution; and
applying an interpolation process to the captured pixel area of the revised image of the third two-dimensional code.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the two-dimensional code positioning and identification model comprises a machine learning network and the method comprises generating the machine learning network, wherein generating the machine learning network comprises:
labeling corresponding identifier information for a specified area of the sample two-dimensional code; and
performing training by using the sample two-dimensional code and the identifier information as input data for the machine learning network to obtain the two-dimensional code positioning and identification model.

### Claim 8 (depends on 7)

The computer-implemented method of claim 7, wherein the machine learning network is a convolution neural network, deep learning network, deep convolutional neural network, regions with convolutional neural networks (R-CNN), Faster R-CNN, regression-based detection methods, you only look once (YOLO), or single-shot detector (SSD).

### Claim 9 (depends on 7)

The method according to claim 7, wherein the specified area is a corner point of the sample two-dimensional code.

### Claim 10

A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
obtaining an image of a reference two-dimensional code;
obtaining a first resolution of the image of the reference two-dimensional code;
obtaining a sample two-dimensional code based on a predetermined environment condition;
obtaining a second resolution of the sample two-dimensional code;
determining that the second resolution of the sample two-dimensional code matches the first resolution of the reference two-dimensional code;
positioning global features of the reference two-dimensional code based on the sample two-dimensional code and identifier information of the sample two-dimensional code, wherein the identifier information comprises one or more global features of the sample two-dimensional code;
providing the reference two-dimensional code and the global features of the reference two-dimensional code as training data to train a two-dimensional code positioning and identification model;
detecting a third two-dimensional code within a second obtained image by performing global feature positioning detection using the two-dimensional code positioning and identification model;
subsequent to detecting the third two-dimensional code, obtaining a focus-adjusted image of the third two-dimensional code based on a predetermined image resolution; and
decoding the third two-dimensional code from the focus-adjusted image of the third two-dimensional code.

### Claim 11 (depends on 10)

The non-transitory, computer-readable medium of claim 10, wherein the operations comprise:
determining that a resolution of the second obtained image of the third two-dimensional code fails to satisfy the predetermined image resolution; and obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution responsive to determining that the resolution of the third two-dimensional code fails to satisfy the predetermined image resolution.

### Claim 12 (depends on 10)

The non-transitory, computer-readable medium of claim 10, wherein obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution comprises applying an auto-focusing algorithm to obtain an updated image of the third two-dimensional code at a different resolution.

### Claim 13 (depends on 10)

The non-transitory, computer-readable medium of claim 10, wherein obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution comprises applying a zoom adjustment based on the predetermined image resolution to obtain an updated image of the third two-dimensional code at a different resolution.

### Claim 14 (depends on 13)

The non-transitory, computer-readable medium of claim 13, wherein applying the zoom adjustment comprises:
detecting whether a two-dimensional code scanning device comprises an optical zoom function; and
based on detecting that the two-dimensional code scanning device has the optical zoom function, adjusting the two-dimensional code scanning device to a new zoom level, and capturing a revised image of the third two-dimensional code at the new zoom level, or
based on detecting that the two-dimensional code scanning device does not have the optical zoom function, applying an image interpolation process to a captured pixel area of the second obtained image of the third two-dimensional code.

### Claim 15 (depends on 14)

The non-transitory, computer-readable medium of claim 14, wherein, after capturing the revised image of the third two-dimensional code, the operations further comprise:
determining the third two-dimensional code does not satisfy the predetermined image resolution; and
applying an interpolation process to the captured pixel area of the revised image of the third two-dimensional code.

### Claim 16 (depends on 10)

The non-transitory, computer-readable medium of claim 10, wherein the two-dimensional code positioning and identification model comprises a machine learning network and operations comprise generating the machine learning network, wherein generating the machine learning network comprises:
labeling corresponding identifier information for a specified area of the sample two-dimensional code; and
performing training by using the sample two-dimensional code and the identifier information as input data for the machine learning network to obtain the two-dimensional code positioning and identification model.

### Claim 17 (depends on 16)

The non-transitory, computer-readable medium of claim 16, wherein the machine learning network is a form of convolution neural network, deep learning network, deep convolutional neural network, regions with convolutional neural networks (R-CNN), Faster R-CNN, regression-based detection methods, you only look once (YOLO), or single-shot detector (SSD).

### Claim 18 (depends on 16)

The non-transitory, computer-readable medium of claim 16, wherein the specified area is a corner point of the sample two-dimensional code.

### Claim 19

A computer-implemented system, comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:
obtaining an image of a reference two-dimensional code;
obtaining a first resolution of the image of the reference two-dimensional code;
obtaining a sample two-dimensional code based on a predetermined environment condition;
obtaining a second resolution of the sample two-dimensional code;
determining that the second resolution of the sample two-dimensional code matches the first resolution of the reference two-dimensional code;
positioning global features of the reference two-dimensional code based on the sample two-dimensional code and identifier information of the sample two-dimensional code, wherein the identifier information comprises one or more global features of the sample two-dimensional code;
providing the reference two-dimensional code and the global features of the reference two-dimensional code as training data to train a two-dimensional code positioning and identification model;
detecting a third two-dimensional code within a second obtained image by performing global feature positioning detection using the two-dimensional code positioning and identification model;
subsequent to detecting the third two-dimensional code, obtaining a focus-adjusted image of the third two-dimensional code based on a predetermined image resolution; and
decoding the third two-dimensional code from the focus-adjusted image of the third two-dimensional code.

### Claim 20 (depends on 19)

The computer-implemented system of claim 19, wherein the operations comprise:
determining that a resolution of the second obtained image of the third two-dimensional code fails to satisfy the predetermined image resolution; and obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution responsive to determining that the resolution of the third two-dimensional code fails to satisfy the predetermined image resolution.

### Claim 21 (depends on 19)

The computer-implemented system of claim 19, wherein obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution comprises applying an auto-focusing algorithm to obtain an updated image of the third two-dimensional code at a different resolution.

### Claim 22 (depends on 19)

The computer-implemented system of claim 19, wherein obtaining the focus-adjusted image of the third two-dimensional code based on the predetermined image resolution comprises applying a zoom adjustment based on the predetermined image resolution to obtain an updated image of the third two-dimensional code at a different resolution.

### Claim 23 (depends on 22)

The computer-implemented system of claim 22, wherein applying the zoom adjustment comprises:
detecting whether a two-dimensional code scanning device comprises an optical zoom function; and
based on detecting that the two-dimensional code scanning device has the optical zoom function, adjusting the two-dimensional code scanning device to a new zoom level, and capturing a revised image of the third two-dimensional code at the new zoom level, or
based on detecting that the two-dimensional code scanning device does not have the optical zoom function, applying an image interpolation process to a captured pixel area of the second obtained image of the third two-dimensional code.

### Claim 24 (depends on 23)

The computer-implemented system of claim 23, wherein, after capturing the revised image of the third two-dimensional code, the operations further comprise:
determining the third two-dimensional code does not satisfy the predetermined image resolution; and
applying an interpolation process to the captured pixel area of the revised image of the third two-dimensional code.

### Claim 25 (depends on 19)

The computer-implemented system of claim 19, wherein the two-dimensional code positioning and identification model comprises a machine learning network and the operations comprise generating the machine learning network, wherein generating the machine learning network comprises:
labeling corresponding identifier information for a specified area of the sample two-dimensional code; and
performing training by using the sample two-dimensional code and the identifier information as input data for the machine learning network to obtain the two-dimensional code positioning and identification model.

### Claim 26 (depends on 25)

The computer-implemented system of claim 25, wherein the machine learning network is a form of convolution neural network, deep learning network, deep convolutional neural network, regions with convolutional neural networks (R-CNN), Faster R-CNN, regression-based detection methods, you only look once (YOLO), or single-shot detector (SSD).

### Claim 27 (depends on 25)

The computer-implemented system of claim 25, wherein the specified area is a corner point of the sample two-dimensional code.
