# US 2021/0174043 A1 · Qr code positioning method and apparatus

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

- Number: US 2021/0174043 A1
- Document ID: US20210174043A1
- Status: Published application
- Kind: A1
- Application number: 17/180,414
- Filed: 2021-02-19
- Published: 2021-06-10
- Earliest claimed: 2017-09-27
- Assignees: Advanced New Technologies Co., Ltd.
- Applicants: Advanced New Technologies Co., Ltd.
- Inventors: Yinhai Tu
- Web page: https://patentgrep.com/patent/US20210174043A1

## CPC

- G06K 7/1439: {including a method step for retrieval of the optical code}
- G06K 7/1443: {locating of the code in an image}
- G06K 7/1417: {2D bar codes}
- G06K: GRAPHICAL DATA READING (image or video recognition or understanding G06V); PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS

## Abstract

Implementations of the present application provide a QR code positioning method and apparatus. Based on a predetermined pixel detection rule, centers of candidate position detection patterns in the QR code image are determined from a QR code image that includes first-type pixels and second-type pixels. The predetermined pixel detection rule includes that a consecutive arrangement ratio of the first-type pixels, the second-type pixels, and the first-type pixels satisfies a predetermined ratio. The candidate position detection patterns are identified based on the centers of the candidate position detection patterns. A set of patterns that satisfies a QR code image positioning rule are determined from the candidate position detection patterns. The set of patterns are used as position detection patterns of the QR code image.

## Claims

### Claim at position 1

-20. (canceled)

### Claim 21

A computer-implemented method, comprising:
determining, by a computing device, from row pixels in a QR code image that comprises first-type pixels and second-type pixels, a plurality of first pixel arrangements in which a first consecutive arrangement ratio of the first-type pixels, the second-type pixels, and the first-type pixels satisfies a first predetermined ratio;
determining, by the computing device, from column pixels in the QR code image that comprises the first-type pixels and the second-type pixels, a plurality of second pixel arrangements in which a second consecutive arrangement ratio of the first-type pixels, the second-type pixels, and the first-type pixels satisfies a second predetermined ratio;
determining, by the computing device, centers of a plurality of candidate position detection patterns based on centers of the plurality of first pixel arrangements and centers of the plurality of second pixel arrangements;
identifying, by the computing device, the plurality of candidate position detection patterns based on the centers of the candidate position detection patterns;
determining, by the computing device, from the plurality of candidate position detection patterns, a first set of position detection patterns that satisfies a first selection condition;
determining, by the computing device, from the first set of position detection patterns that satisfies the first selection condition, a second set of position detection patterns that satisfies a second selection condition; and
determining, by the computing device, from the second set of position detection patterns that satisfies the second selection condition, a final set of position detection patterns that satisfies a QR code positioning rule.

### Claim 22 (depends on 21)

The computer-implemented method of claim 21, wherein the first-type pixels are black pixels or blue pixels, and the second-type pixels are pixels whose color difference with the first-type pixels exceeds a specified threshold.

### Claim 23 (depends on 21)

The computer-implemented method of claim 21, wherein the first predetermined ratio is 1:n:1, and n is greater than 1, and the second predetermined ratio is 1:m:1, and m is greater than 1.

### Claim 24 (depends on 21)

The computer-implemented method of claim 21, wherein the first selection condition comprises a first requirement that at least one of a first-type pixel quantity and second-type pixel quantity within an area adjacent to the center of each candidate position detection pattern in the final set of position detection patterns satisfies a predetermined threshold range, and wherein the second selection condition comprises a second requirement that a third consecutive arrangement ratio of the first-type pixels, the second-type pixels, the first-type pixels, the second-type pixels, and the first-type pixels in a third pixel arrangement that passes through the center of each candidate position detection pattern satisfies a third predetermined ratio.

### Claim 25 (depends on 21)

The computer-implemented method of claim 21, wherein the QR code comprises three position detection patterns, wherein the three position detection patterns are located at any three of four corners of the QR code, wherein the QR code positioning rule comprises:
the shortest two lines among the three lines that connect the centers of the three position detection patterns are perpendicular with each other; and
the shortest two lines among the three lines that connect the centers of the three position detection patterns are equal in length.

### Claim 26 (depends on 21)

The computer-implemented method of claim 21, further comprising:
forming, from the first set of position detection patterns and the second set of position detection patterns, multiple groups of candidate position detection patterns;
determining that a first group of candidate position detection patterns of the multiple groups of candidate position detector patterns satisfies the QR code positioning rule; and
using at least the first group of candidate position detection patterns as the final set of position detection patterns.

### Claim 27 (depends on 26)

The computer-implemented method of claim 26, wherein the position detection patterns in the QR code are located at any three of four corners of the QR code, and determining that the first group of candidate position detection patterns satisfies the QR code positioning rule comprises:
forming a triangle by connecting lines of centers of each group of candidate position detection patterns;
determining an angle difference between 90 degree and a value of an angle between two short sides in the triangle;
determining that the angle difference is within a first predetermined range;
determining a length difference between the two short sides in the triangle;
determining that the length difference is within a second predetermined range; and
in response to determining that the angle difference is within the first predetermined range and the length difference is within the second predetermined range, determining that the group of candidate position detection patterns satisfies the QR code positioning rule.

### Claim 28

A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
determining, by a computing device, from row pixels in a QR code image that comprises first-type pixels and second-type pixels, a plurality of first pixel arrangements in which a first consecutive arrangement ratio of the first-type pixels, the second-type pixels, and the first-type pixels satisfies a first predetermined ratio;
determining, by the computing device, from column pixels in the QR code image that comprises the first-type pixels and the second-type pixels, a plurality of second pixel arrangements in which a second consecutive arrangement ratio of the first-type pixels, the second-type pixels, and the first-type pixels satisfies a second predetermined ratio;
determining, by the computing device, centers of a plurality of candidate position detection patterns based on centers of the plurality of first pixel arrangements and centers of the plurality of second pixel arrangements;
identifying, by the computing device, the plurality of candidate position detection patterns based on the centers of the candidate position detection patterns;
determining, by the computing device, from the plurality of candidate position detection patterns, a first set of position detection patterns that satisfies a first selection condition;
determining, by the computing device, from the first set of position detection patterns that satisfies the first selection condition, a second set of position detection patterns that satisfies a second selection condition; and
determining, by the computing device, from the second set of position detection patterns that satisfies the second selection condition, a final set of position detection patterns that satisfies a QR code positioning rule.

### Claim 29 (depends on 28)

The non-transitory, computer-readable medium of claim 28, wherein the first-type pixels are black pixels or blue pixels, and the second-type pixels are pixels whose color difference with the first-type pixels exceeds a specified threshold.

### Claim 30 (depends on 28)

The non-transitory, computer-readable medium of claim 28, wherein the first predetermined ratio is 1:n:1, and n is greater than 1, and the second predetermined ratio is 1:m:1, and m is greater than 1.

### Claim 31 (depends on 28)

The non-transitory, computer-readable medium of claim 28, wherein the first selection condition comprises a first requirement that at least one of a first-type pixel quantity and second-type pixel quantity within an area adjacent to the center of each candidate position detection pattern in the final set of position detection patterns satisfies a predetermined threshold range, and wherein the second selection condition comprises a second requirement that a third consecutive arrangement ratio of the first-type pixels, the second-type pixels, the first-type pixels, the second-type pixels, and the first-type pixels in a third pixel arrangement that passes through the center of each candidate position detection pattern satisfies a third predetermined ratio.

### Claim 32 (depends on 28)

The non-transitory, computer-readable medium of claim 28, wherein the QR code comprises three position detection patterns, wherein the three position detection patterns are located at any three of four corners of the QR code, wherein the QR code positioning rule comprises:
the shortest two lines among the three lines that connect the centers of the three position detection patterns are perpendicular with each other; and
the shortest two lines among the three lines that connect the centers of the three position detection patterns are equal in length.

### Claim 33 (depends on 28)

The non-transitory, computer-readable medium of claim 28, the operations further comprise:
forming, from the first set of position detection patterns and the second set of position detection patterns, multiple groups of candidate position detection patterns;
determining that a first group of candidate position detection patterns of the multiple groups of candidate position detector patterns satisfies the QR code positioning rule; and
using at least the first group of candidate position detection patterns as the final set of position detection patterns.

### Claim 34 (depends on 33)

The non-transitory, computer-readable medium of claim 33, wherein the position detection patterns in the QR code are located at any three of four corners of the QR code, and determining that the first group of candidate position detection patterns satisfies the QR code positioning rule comprises:
forming a triangle by connecting lines of centers of each group of candidate position detection patterns;
determining an angle difference between 90 degree and a value of an angle between two short sides in the triangle;
determining that the angle difference is within a first predetermined range;
determining a length difference between the two short sides in the triangle;
determining that the length difference is within a second predetermined range; and
in response to determining that the angle difference is within the first predetermined range and the length difference is within the second predetermined range, determining that the group of candidate position detection patterns satisfies the QR code positioning rule.

### Claim 35

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 operations comprising:
determining, by a computing device, from row pixels in a QR code image that comprises first-type pixels and second-type pixels, a plurality of first pixel arrangements in which a first consecutive arrangement ratio of the first-type pixels, the second-type pixels, and the first-type pixels satisfies a first predetermined ratio;
determining, by the computing device, from column pixels in the QR code image that comprises the first-type pixels and the second-type pixels, a plurality of second pixel arrangements in which a second consecutive arrangement ratio of the first-type pixels, the second-type pixels, and the first-type pixels satisfies a second predetermined ratio;
determining, by the computing device, centers of a plurality of candidate position detection patterns based on centers of the plurality of first pixel arrangements and centers of the plurality of second pixel arrangements;
identifying, by the computing device, the plurality of candidate position detection patterns based on the centers of the candidate position detection patterns;
determining, by the computing device, from the plurality of candidate position detection patterns, a first set of position detection patterns that satisfies a first selection condition;
determining, by the computing device, from the first set of position detection patterns that satisfies the first selection condition, a second set of position detection patterns that satisfies a second selection condition; and
determining, by the computing device, from the second set of position detection patterns that satisfies the second selection condition, a final set of position detection patterns that satisfies a QR code positioning rule.

### Claim 36 (depends on 35)

The computer-implemented system of claim 35, wherein the first-type pixels are black pixels or blue pixels, and the second-type pixels are pixels whose color difference with the first-type pixels exceeds a specified threshold.

### Claim 37 (depends on 35)

The computer-implemented system of claim 35, wherein the first predetermined ratio is 1:n:1, and n is greater than 1, and the second predetermined ratio is 1:m:1, and m is greater than 1.

### Claim 38 (depends on 35)

The computer-implemented system of claim 35, wherein the first selection condition comprises a first requirement that at least one of a first-type pixel quantity and second-type pixel quantity within an area adjacent to the center of each candidate position detection pattern in the final set of position detection patterns satisfies a predetermined threshold range, and wherein the second selection condition comprises a second requirement that a third consecutive arrangement ratio of the first-type pixels, the second-type pixels, the first-type pixels, the second-type pixels, and the first-type pixels in a third pixel arrangement that passes through the center of each candidate position detection pattern satisfies a third predetermined ratio.

### Claim 39 (depends on 35)

The computer-implemented system of claim 35, wherein the QR code comprises three position detection patterns, wherein the three position detection patterns are located at any three of four corners of the QR code, wherein the QR code positioning rule comprises:
the shortest two lines among the three lines that connect the centers of the three position detection patterns are perpendicular with each other; and
the shortest two lines among the three lines that connect the centers of the three position detection patterns are equal in length.

### Claim 40 (depends on 35)

The computer-implemented system of claim 35, the operations further comprise:
forming, from the first set of position detection patterns and the second set of position detection patterns, multiple groups of candidate position detection patterns;
determining that a first group of candidate position detection patterns of the multiple groups of candidate position detector patterns satisfies the QR code positioning rule; and
using at least the first group of candidate position detection patterns as the final set of position detection patterns.
