# US 2020/0394388 A1 · Image processing method and apparatus, terminal, and computer-readable storage medium

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

- Number: US 2020/0394388 A1
- Document ID: US20200394388A1
- Status: Published application
- Kind: A1
- Application number: 17/006,071
- Filed: 2020-08-28
- Published: 2020-12-17
- Earliest claimed: 2018-07-23
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Wei Xiong; Fei Huang
- Web page: https://patentgrep.com/patent/US20200394388A1

## CPC

- G06V 10/764: using classification, e.g. of video objects
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/217: {Validation; Performance evaluation; Active pattern learning techniques}
- G06T 3/40: Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06V 10/774: Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06V 10/776: Validation; Performance evaluation
- G06V 10/82: using neural networks
- G06V 40/161: {Detection; Localisation; Normalisation}
- G06V 40/172: {Classification, e.g. identification}
- G06V 40/174: {Facial expression recognition}
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

Embodiments of the present disclosure disclose an image processing method and apparatus, a terminal, and a computer-readable storage medium, that are generally related to the field of computer technologies. The method can include obtaining a trained pixel classification model. The pixel classification model can be used for determining a classification identifier of each pixel in any image with the classification identifier including a head classification identifier. The head classification identifier can be used for indicating that a corresponding pixel is located in a head region. The method can further include classifying each pixel in the target image based on the pixel classification model to obtain a classification identifier of the pixel in the target image, and determining a head region in the target image according to pixels whose classification identifiers are a head classification identifier and editing the head region.

## Claims

### Claim 1

An image processing method that is performed by a terminal, the method comprising:
obtaining a trained pixel classification model that is used for determining a classification identifier of each pixel in an image, the classification identifier including a head classification identifier that is used for indicating that a corresponding pixel is located in a head region;
classifying each pixel in a target image based on the pixel classification model to obtain a classification identifier of the pixels in the target image; and
determining a head region in the target image according to a head classification identifier in the classification identifier and editing the head region.

### Claim 2 (depends on 1)

The method according to claim 1, wherein before the obtaining the trained pixel classification model, the method further comprises:
obtaining a plurality of sample images and a classification identifier of each pixel in a plurality of sample images; and
performing training according to the plurality of sample images and the classification identifier of each pixel in the plurality of sample images, until a classification accuracy of the trained pixel classification model reaches a first preset threshold.

### Claim 3 (depends on 1)

The method according to claim 1, wherein before classifying each pixel in the target image based on the pixel classification model, the method further comprises:
performing face detection on the target image to obtain a face region in the target image;
obtaining a trained expression recognition model;
performing recognition on the face region based on the trained expression recognition model to obtain an expression class of the face region; and
performing the operation of classifying each pixel in the target image based on the pixel classification model when the expression class of the face region is a target expression class.

### Claim 4 (depends on 3)

The method according to claim 3, wherein editing the head region further comprises:
determining, according to a preset correspondence between the expression class and a processing mode, a target processing mode corresponding to the target expression class; and
editing the head region by using the target processing mode.

### Claim 5 (depends on 3)

The method according to claim 3, wherein before obtaining the trained expression recognition model, the method further comprises:
obtaining a plurality of sample face images and an expression class of each sample face image; and
performing training according to the plurality of sample face images and the expression class of each sample face image until a recognition accuracy of the trained expression recognition model reaches a second preset threshold.

### Claim 6 (depends on 1)

The method according to claim 1, wherein before classifying each pixel in the target image based on the pixel classification model, the method further comprises:
obtaining a target video, the target video including a plurality of images arranged in sequence; and
using each of the plurality of images as the target image and performing the operation of classifying each pixel in the target image based on the pixel classification model.

### Claim 7 (depends on 1)

The method according to claim 1, wherein editing the head region further comprises:
scaling up the head region;
scaling down the head region;
adding material to the head region; or
displaying a dynamic effect of shaking the head region.

### Claim 8

An image processing apparatus, comprising:
processing circuitry configured to:
obtain a trained pixel classification model that is used for determining a classification identifier of each pixel in an image, the classification identifier including a head classification identifier that is used for indicating that a corresponding pixel is located in a head region;
classify each pixel in a target image based on the pixel classification model to obtain a classification identifier of the pixels in the target image; and
determine a head region in the target image according to a head classification identifier in the classification identifier and edit the head region.

### Claim 9 (depends on 8)

The apparatus according to claim 8, wherein the processing circuitry is further configured to:
obtain a plurality of sample images and a classification identifier of each pixel in the plurality of sample images; and
perform training according to the plurality of sample images and the classification identifier of each pixel in the plurality of sample images until a classification accuracy of the trained pixel classification model reaches a first preset threshold.

### Claim 10 (depends on 8)

The apparatus according to claim 8, wherein the processing circuitry is further configured to:
perform face detection on the target image to obtain a face region in the target image;
obtain a trained expression recognition model;
perform recognition on the face region based on the trained expression recognition model to obtain an expression class of the face region; and
perform the operation of classifying each pixel in the target image based on the pixel classification model, in a case that the expression class of the face region is a target expression class.

### Claim 11 (depends on 10)

The apparatus according to claim 10, wherein the processing circuitry is further configured to:
determine, according to a preset correspondence between the expression class and a processing mode, a target processing mode corresponding to the target expression class; and
edit the head region by using the target processing mode.

### Claim 12 (depends on 8)

The apparatus according to claim 8, wherein the processing circuitry is further configured to:
obtain a plurality of sample face images and an expression class of each sample face image; and
perform training according to the plurality of sample face images and the expression class of each sample face image, until a recognition accuracy of the trained expression recognition model reaches a second preset threshold.

### Claim 13 (depends on 8)

The apparatus according to claim 8, wherein the processing circuitry is further configured to:
obtain a target video including a plurality of images arranged in sequence, each of the plurality of images being used as the target image.

### Claim 14 (depends on 1)

An image processing terminal comprising a processor that is configured to cause the image processing terminal to implement the image processing method according to claim 1.

### Claim 15 (depends on 14)

The terminal according to claim 14, wherein the processor further performs:
obtaining a plurality of sample images and a classification identifier of each pixel in the plurality of sample images; and
performing training according to the plurality of sample images and the classification identifier of each pixel in the plurality of sample images, until a classification accuracy of the trained pixel classification model reaches a first preset threshold.

### Claim 16 (depends on 14)

The terminal according to claim 14, wherein the processor further performs:
performing face detection on the target image to obtain a face region in the target image;
obtaining a trained expression recognition model;
performing recognition on the face region based on the trained expression recognition model to obtain an expression class of the face region; and
performing the operation of classifying each pixel in a target image based on the pixel classification model in a case that the expression class of the face region is a target expression class.

### Claim 17 (depends on 16)

The terminal according to claim 16, wherein the processor further performs:
determining, according to a preset correspondence between the expression class and a processing mode, a target processing mode corresponding to the target expression class; and
editing the head region by using the target processing mode.

### Claim 18

A non-transitory computer-readable storage medium that stores at least one instruction that, when executed by a processor, causes the processor to perform:
obtaining a trained pixel classification model that is used for determining a classification identifier of each pixel in any image, the classification identifier including a head classification identifier that is used for indicating that a corresponding pixel is located in a head region;
classifying each pixel in a target image based on the pixel classification model to obtain a classification identifier of the pixels in the target image; and
determining a head region in the target image according to a head classification identifier in the classification identifier and editing the head region.

### Claim 19 (depends on 18)

The non-transitory computer-readable storage medium according to claim 18, wherein the processor further performs:
obtaining a plurality of sample images and a classification identifier of each pixel in the plurality of sample images; and
performing training according to the plurality of sample images and the classification identifier of each pixel in the plurality of sample images until a classification accuracy of the trained pixel classification model reaches a first preset threshold.

### Claim 20 (depends on 18)

The non-transitory computer-readable storage medium according to claim 18, wherein the processor further performs:
performing face detection on the target image to obtain a face region in the target image;
obtaining a trained expression recognition model;
performing recognition on the face region based on the expression recognition model to obtain an expression class of the face region; and
performing the operation of classifying each pixel in a target image based on the pixel classification model in a case that the expression class of the face region is a target expression class.
