# US 2021/0334528 A1 · Text detection using global geometry estimators

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

- Number: US 2021/0334528 A1
- Document ID: US20210334528A1
- Status: Published application
- Kind: A1
- Application number: 16/607,057
- Filed: 2019-09-25
- Published: 2021-10-28
- Earliest claimed: 2019-09-25
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Cedric BRAY; Guangyu ZHONG
- Web page: https://patentgrep.com/patent/US20210334528A1

## CPC

- G06V 30/413: Classification of content, e.g. text, photographs or tables
- G06F 18/21: Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/08: Learning methods
- G06V 10/242: {by image rotation, e.g. by 90 degrees}
- G06V 30/153: {using recognition of characters or words}
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Systems, processes and methods for detecting rotated or angled text in an image based on global text geometry estimations are provided. A method includes, at an electronic device with memory and one or more processors, receiving an image including a plurality of pixels (802); determining, based on the image, one or more pixels of the plurality of pixels included in the image that contain text (804); identifying, based on the one or more pixels that contain text, a plurality of components in the image (810); determining a subset of components based on the plurality of components (814); determining, based on the pixels that contain text of the subset of components, one or more candidate text angles (816); determining a global text angle based on the determined one or more candidate text angles (824); and determining a first plurality of bounding boxes based on the global text angle (830).

## Claims

### Claim at position 1

1-23. (canceled)

### Claim 24

A non-transitory computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by one or more processors of an electronic device, cause the electronic device to:
receive an image including a plurality of pixels;
determine, based on the image, one or more pixels of the plurality of pixels included in the image that contain text;
identify, based on the one or more pixels that contain text, a plurality of components in the image, wherein each component of the plurality of components represents a grouping of pixels that contain text;
determine a subset of components based on the plurality of components, wherein the subset of components includes one or more components of the plurality of components that include a predetermined minimum number of pixels that contain text;
determine, based on the pixels that contain text of the subset of components, one or more candidate text angles, wherein each candidate text angle of the one or more candidate text angles is associated with a plurality of pixels that contain text;
determine a global text angle based on the one or more candidate text angles; and
determine a first plurality of bounding boxes based on the global text angle, wherein each bounding box of the first plurality of bounding boxes encloses a component of the plurality of components.

### Claim 25 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein the one or more pixels that contain text are determined using a text detection neural network.

### Claim 26 (depends on 25)

The non-transitory computer-readable storage medium of claim 25, wherein the one or more programs include further instructions, which when executed by the one or more processors of the electronic device, cause the electronic device to:
determine, using the text detection neural network, a text probability for each pixel of the plurality of pixels, wherein a pixel of the plurality of pixels contains text if the text probability corresponding to the pixel satisfies a predetermined threshold.

### Claim 27 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein the plurality of components are identified using a seed fill algorithm.

### Claim 28 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein determining the one or more candidate text angles based on the pixels that contain text of the subset of components comprises:
determining a text angle for each pixel of the pixels that contain text of the subset of components using a transform;
generating a transformation matrix based on the determined text angles; and determining the one or more candidate text angles based on one or more local maxima of the transformation matrix.

### Claim 29 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein the global text angle represents the candidate text angle of the one or more candidate text angles that is associated with a greatest number of pixels that contain text of the subset of components.

### Claim 30 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein the one or more programs include further instructions, which when executed by the one or more processors of the electronic device, cause the electronic device to:
prior to determining the first plurality of bounding boxes, determine whether the plurality of pixels associated with the global text angle satisfy a predetermined condition; and
in accordance with a determination that the plurality of pixels associated with the global text angle satisfy the predetermined condition, determine the first plurality of bounding boxes based on the global text angle.

### Claim 31 (depends on 30)

The non-transitory computer-readable storage medium of claim 30, wherein the predetermined condition comprises a requirement that the plurality of pixels associated with the global text angle outnumber or equal a threshold number of pixels.

### Claim 32 (depends on 31)

The non-transitory computer-readable storage medium of claim 31, wherein the threshold number of pixels is equal to a sum of all pixels associated with the one or more candidate text angles multiplied by a predetermined threshold constant.

### Claim 33 (depends on 30)

The non-transitory computer-readable storage medium of claim 30, wherein the one or more programs include further instructions, which when executed by the one or more processors of the electronic device, cause the electronic device to:
determine, based on the image, a local text angle for each pixel that contains text; and
in accordance with a determination that the plurality of pixels associated with the global text angle do not satisfy the predetermined condition, determine a second plurality of bounding boxes based on the local text angle for each pixel that contains text of the subset of components, wherein each bounding box of the second plurality of bounding boxes encloses a component of the plurality of components.

### Claim 34 (depends on 33)

The non-transitory computer-readable storage medium of claim 33, wherein the local text angles are determined using a text detection neural network.

### Claim 35 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein determining the first plurality of bounding boxes based on the global text angle comprises realigning a position of one or more preliminary bounding boxes based on the global text angle, and
wherein the one or more preliminary bounding boxes are determined using a text detection neural network.

### Claim 36 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein determining the first plurality of bounding boxes based on the global text angle comprises adjusting one or more dimensions of one or more preliminary bounding boxes based on the global text angle, and
wherein the one or more preliminary bounding boxes are determined using a text detection neural network.

### Claim 37 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein the one or more programs include further instructions, which when executed by the one or more processors of the electronic device, cause the electronic device to:
display the image at a display; and
display, at the display, the first plurality of bounding boxes overlaying the displayed image.

### Claim 38 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein the one or more programs include further instructions, which when executed by the one or more processors of the electronic device, cause the electronic device to:
determine whether a predetermined threshold number of pixels of the plurality of pixels associated with the global text angle are located in a first region of the image; and
in accordance with a determination that a predetermined threshold number of pixels of the plurality of pixels associated with the global text angle are located in the first region of the image:
determine whether a predetermined threshold number of pixels of the plurality of pixels associated with a candidate text angle of the one or more candidate text angles are located in a second region of the image; and
in response to determining that a predetermined threshold number of pixels of the plurality of pixels associated with the candidate text angle of the one or more candidate text angles are located in the second region of the image, determine a second global text angle based on the candidate text angle of the one or more candidate text angles.

### Claim 39 (depends on 38)

The non-transitory computer-readable storage medium of claim 38, wherein the one or more programs include further instructions, which when executed by the one or more processors of the electronic device, cause the electronic device to:
determine a third plurality of bounding boxes based on the second global text angle,
wherein each bounding box of the first plurality of bounding boxes encloses a component of the plurality of components located in the first region, and
wherein each bounding box of the third plurality of bounding boxes encloses a component of the plurality of components located in the second region.

### Claim 40 (depends on 38)

The non-transitory computer-readable storage medium of claim 38, wherein the first region of the image comprises a top half of the image, and
wherein the second region of the image comprises a bottom half of the image.

### Claim 41

A method, comprising:
receiving an image including a plurality of pixels;
determining, based on the image, one or more pixels of the plurality of pixels included in the image that contain text;
identifying, based on the one or more pixels that contain text, a plurality of components in the image, wherein each component of the plurality of components represents a grouping of pixels that contain text;
determining a subset of components based on the plurality of components, wherein the subset of components includes one or more components of the plurality of components that include a predetermined minimum number of pixels that contain text;
determining, based on the pixels that contain text of the subset of components, one or more candidate text angles, wherein each candidate text angle of the one or more candidate text angles is associated with a plurality of pixels that contain text;
determining a global text angle based on the determined one or more candidate text angles; and
determining a first plurality of bounding boxes based on the global text angle, wherein each bounding box of the first plurality of bounding boxes encloses a component of the plurality of components.

### Claim 42

An electronic device, comprising:
one or more processors;
a memory; and
one or more programs wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, wherein the one or more programs include instructions for:
receiving an image including a plurality of pixels;
determining, based on the image, one or more pixels of the plurality of pixels included in the image that contain text;
identifying, based on the one or more pixels that contain text, a plurality of components in the image, wherein each component of the plurality of components represents a grouping of pixels that contain text;
determining a subset of components based on the plurality of components, wherein the subset of components includes one or more components of the plurality of components that include a predetermined minimum number of pixels that contain text;
determining, based on the pixels that contain text of the subset of components, one or more candidate text angles, wherein each candidate text angle of the one or more candidate text angles is associated with a plurality of pixels that contain text;
determining a global text angle based on the determined one or more candidate text angles; and
determining a first plurality of bounding boxes based on the global text angle, wherein each bounding box of the first plurality of bounding boxes encloses a component of the plurality of components.
