# US 2021/0286975 A1 · Image processing method, electronic device, and storage medium

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

- Number: US 2021/0286975 A1
- Document ID: US20210286975A1
- Status: Published application
- Kind: A1
- Application number: 17/332,520
- Filed: 2021-05-27
- Published: 2021-09-16
- Earliest claimed: 2020-08-20
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science and Technology Co., Ltd.
- Inventors: Hao SUN; Fu Li; Xin Li; Tianwei Lin
- Web page: https://patentgrep.com/patent/US20210286975A1

## CPC

- G06V 10/25: Determination of region of interest [ROI] or a volume of interest [VOI]
- G06T 3/60: Rotation of whole images or parts thereof
- G06T 7/11: Region-based segmentation
- G06T 7/90: Determination of colour characteristics
- G06V 10/758: {Involving statistics of pixels or of feature values, e.g. histogram matching}
- G06V 10/772: Determining representative reference patterns, e.g. averaging or distorting patterns; Generating dictionaries
- G06V 20/20: in augmented reality scenes
- G06V 40/162: {using pixel segmentation or colour matching}
- G06T 2207/30201: Face
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

The disclosure provides an image processing method, an image processing apparatus, an electronic device and a storage medium, which belongs to the field of computer technologies, and specifically relates to computing vision, image processing, face recognition, and deep learning technologies in artificial intelligence. The method includes: performing skin color recognition on a face image to be processed to determine a target skin color of a face contained in the face image; obtaining a reference transformation image corresponding to the face image by processing the face image using any style transfer model in response that a style transfer model set does not comprise a style transfer model corresponding to the target skin color; and obtaining a target transformation image matching the target skin color by adjusting a hue value, a saturation value, and a lightness value of each pixel in the target region based on the target skin color.

## Claims

### Claim 1

An image processing method, comprising:
performing skin color recognition on a face image to be processed to determine a target skin color of a face contained in the face image;
obtaining a reference transformation image corresponding to the face image by processing the face image using any style transfer model in response that a style transfer model set does not comprise a style transfer model corresponding to the target skin color;
obtaining a hue value, a saturation value, and a lightness value of each pixel in the reference transformation image by parsing the reference transformation image;
determining a target region in the reference transformation image based on the hue value, the saturation value, and the lightness value of each pixel in the reference transformation image; and
obtaining a target transformation image matching the target skin color by adjusting a hue value, a saturation value, and a lightness value of each pixel in the target region based on the target skin color.

### Claim 2 (depends on 1)

The method according to claim 1, wherein determining the target region in the reference transformation image based on the hue value, the saturation value, and the lightness value of each pixel in the reference transformation image, comprises:
determining a pixel in the reference transformation image, having a hue value in a first range, a saturation value in a second range, and a brightness value in a third range, as a pixel in the target region.

### Claim 3 (depends on 2)

The method according to claim 2, further comprising:
obtaining an averaged hue value, an averaged saturation value, and an averaged lightness value of pixels in the target region;
determining a target hue range, a target saturation range, and a target lightness range based on a preset error value, the averaged hue value, the averaged saturation value, and the averaged lightness value; and
performing pruning process on the pixels in the target region based on the target hue range, the target saturation range, and the target lightness range.

### Claim 4 (depends on 1)

The method according to claim 1, wherein obtaining the reference transformation image corresponding to the face image by processing the face image using any style transfer model, comprises:
preprocessing the face image to obtain a convex hull image corresponding to the face image; and
processing the convex hull image and the face image by using any style transfer model, to obtain the reference transformation image corresponding to the face image.

### Claim 5 (depends on 1)

The method according to claim 1, further comprising:
obtaining a face image set and a transformation image set, corresponding to the target skin color, in response that a number of target transformation images matching the target skin color is greater than a first threshold; and
training an initial style transfer model based on the face image set and the transformation image set, to obtain a target style transfer model corresponding to the target skin color.

### Claim 6 (depends on 1)

The method according to claim 1, further comprising:
performing face segmentation on an image to be processed by using a face segmentation model to obtain the face image to be processed.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising:
determining a rotation angle of a face contained in the face image; and
rotating the face in response that the rotation angle is greater than or equal to a second threshold, so that a rotation angle of the rotated face is smaller than the second threshold.

### Claim 8

An electronic device, comprising:
at least one processor; and
a memory communicatively connected to the at least one processor; wherein,
the memory is configured to store instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is caused to perform:
performing skin color recognition on a face image to be processed to determine a target skin color of a face contained in the face image;
obtaining a reference transformation image corresponding to the face image by processing the face image using any style transfer model in response that a style transfer model set does not comprise a style transfer model corresponding to the target skin color;
obtaining a hue value, a saturation value, and a lightness value of each pixel in the reference transformation image by parsing the reference transformation image;
determining a target region in the reference transformation image based on the hue value, the saturation value, and the lightness value of each pixel in the reference transformation image; and
obtaining a target transformation image matching the target skin color by adjusting a hue value, a saturation value, and a lightness value of each pixel in the target region based on the target skin color.

### Claim 9 (depends on 8)

The electronic device according to claim 8, wherein determining the target region in the reference transformation image based on the hue value, the saturation value, and the lightness value of each pixel in the reference transformation image, comprises:
determining a pixel in the reference transformation image, having a hue value in a first range, a saturation value in a second range, and a brightness value in a third range, as a pixel in the target region.

### Claim 10 (depends on 9)

The electronic device according to claim 9, wherein when the instructions are executed by the at least one processor, the at least one processor is further caused to perform:
obtaining an averaged hue value, an averaged saturation value, and an averaged lightness value of pixels in the target region;
determining a target hue range, a target saturation range, and a target lightness range based on a preset error value, the averaged hue value, the averaged saturation value, and the averaged lightness value; and
performing pruning process on the pixels in the target region based on the target hue range, the target saturation range, and the target lightness range.

### Claim 11 (depends on 8)

The electronic device according to claim 8, wherein obtaining the reference transformation image corresponding to the face image by processing the face image using any style transfer model, comprises:
preprocessing the face image to obtain a convex hull image corresponding to the face image; and
processing the convex hull image and the face image by using any style transfer model, to obtain the reference transformation image corresponding to the face image.

### Claim 12 (depends on 8)

The electronic device according to claim 8, wherein when the instructions are executed by the at least one processor, the at least one processor is further caused to perform:
obtaining a face image set and a transformation image set, corresponding to the target skin color, in response that a number of target transformation images matching the target skin color is greater than a first threshold; and
training an initial style transfer model based on the face image set and the transformation image set, to obtain a target style transfer model corresponding to the target skin color.

### Claim 13 (depends on 8)

The electronic device according to claim 8, wherein when the instructions are executed by the at least one processor, the at least one processor is further caused to perform:
performing face segmentation on an image to be processed by using a face segmentation model to obtain the face image to be processed.

### Claim 14 (depends on 13)

The electronic device according to claim 13, wherein when the instructions are executed by the at least one processor, the at least one processor is caused to perform:
determining a rotation angle of a face contained in the face image; and
rotating the face in response that the rotation angle is greater than or equal to a second threshold, so that a rotation angle of the rotated face is smaller than the second threshold.

### Claim 15

A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are configured to cause a computer to execute a image processing method comprising:
performing skin color recognition on a face image to be processed to determine a target skin color of a face contained in the face image;
obtaining a reference transformation image corresponding to the face image by processing the face image using any style transfer model in response that a style transfer model set does not comprise a style transfer model corresponding to the target skin color;
obtaining a hue value, a saturation value, and a lightness value of each pixel in the reference transformation image by parsing the reference transformation image;
determining a target region in the reference transformation image based on the hue value, the saturation value, and the lightness value of each pixel in the reference transformation image; and
obtaining a target transformation image matching the target skin color by adjusting a hue value, a saturation value, and a lightness value of each pixel in the target region based on the target skin color.

### Claim 16 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein determining the target region in the reference transformation image based on the hue value, the saturation value, and the lightness value of each pixel in the reference transformation image, comprises:
determining a pixel in the reference transformation image, having a hue value in a first range, a saturation value in a second range, and a brightness value in a third range, as a pixel in the target region.

### Claim 17 (depends on 16)

The non-transitory computer-readable storage medium according to claim 16, wherein the method further comprises:
obtaining an averaged hue value, an averaged saturation value, and an averaged lightness value of pixels in the target region;
determining a target hue range, a target saturation range, and a target lightness range based on a preset error value, the averaged hue value, the averaged saturation value, and the averaged lightness value; and
performing pruning process on the pixels in the target region based on the target hue range, the target saturation range, and the target lightness range.

### Claim 18 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein obtaining the reference transformation image corresponding to the face image by processing the face image using any style transfer model, comprises:
preprocessing the face image to obtain a convex hull image corresponding to the face image; and
processing the convex hull image and the face image by using any style transfer model, to obtain the reference transformation image corresponding to the face image.

### Claim 19 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein the method further comprises:
obtaining a face image set and a transformation image set, corresponding to the target skin color, in response that a number of target transformation images matching the target skin color is greater than a first threshold; and
training an initial style transfer model based on the face image set and the transformation image set, to obtain a target style transfer model corresponding to the target skin color.

### Claim 20 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein the method further comprises:
performing face segmentation on an image to be processed by using a face segmentation model to obtain the face image to be processed.
