# US 2022/0292774 A1 · Methods and systems for extracting color from facial image

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

- Number: US 2022/0292774 A1
- Document ID: US20220292774A1
- Status: Published application
- Kind: A1
- Application number: 17/202,116
- Filed: 2021-03-15
- Published: 2022-09-15
- Earliest claimed: 2021-03-15
- Assignees: Tencent America LLC
- Applicants: Tencent America LLC
- Inventors: Bo YANG; Songrun LIU; Bo WANG
- Web page: https://patentgrep.com/patent/US20220292774A1

## CPC

- G06T 17/00: Three-dimensional [3D] modelling for computer graphics
- G06T 17/20: Finite element generation, e.g. wire-frame surface description, {tesselation}
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/08: Learning methods
- G06N 3/0895: Weakly supervised learning, e.g. semi-supervised or self-supervised learning
- G06N 3/09: Supervised learning
- G06N 3/096: Transfer learning
- G06T 7/40: Analysis of texture (depth or shape recovery from texture G06T7/529)
- G06T 15/04: Texture mapping
- G06V 10/56: relating to colour
- G06V 40/161: {Detection; Localisation; Normalisation}
- G06V 40/162: {using pixel segmentation or colour matching}
- G06V 40/165: {using facial parts and geometric relationships}
- G06V 40/171: {Local features and components; Facial parts (eye characteristics G06V40/18); Occluding parts, e.g. glasses; Geometrical relationships}
- G06V 40/193: {Preprocessing; Feature extraction}
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06T 2207/20216: Image averaging
- G06T 2207/30196: Human being; Person
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

An electronic apparatus performs a method of extracting color from a two-dimensional (2D) facial image of a real-life person that includes: identifying a plurality of keypoints in the 2D facial image based on a keypoint prediction model; rotating the 2D facial image until the selected keypoints from the plurality of keypoints are aligned; locating a plurality of parts in the rotated 2D facial image, wherein each part is defined by a respective subset of the plurality of keypoints; extracting, from the pixel values of the 2D facial image, the average color for each of the plurality of the parts defined by a corresponding subset of keypoints; and generating a personalized three-dimensional (3D) model of the real-life person that mimics the respective facial feature color of the 2D facial image using the extracted colors of the plurality of the parts in the 2D facial image.

## Claims

### Claim 1

A method of extracting color from a two-dimensional (2D) facial image of a real-life person, comprising:
identifying a plurality of keypoints in the 2D facial image based on a keypoint prediction model;
rotating the 2D facial image until selected keypoints from the plurality of keypoints are aligned;
locating a plurality of parts in the rotated 2D facial image, each part defined by a respective subset of the plurality of keypoints;
extracting, from pixel values of the 2D facial image, an average color for each of the plurality of the parts defined by a corresponding subset of keypoints; and
generating a personalized three-dimensional (3D) model of the real-life person that mimics respective facial feature color of the 2D facial image using the extracted colors of the plurality of the parts in the 2D facial image.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the keypoint prediction model is formed based on machine learning from user manually annotated keypoints.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the selected keypoints used for alignment are located on symmetrical left and right sides of the 2D facial image.

### Claim 4 (depends on 1)

The method according to claim 1, wherein extracting the average color for each of the plurality of the parts comprises selecting median of R, G, B values of all pixels in a respective defined area within a corresponding part as a predicted average color.

### Claim 5 (depends on 1)

The method according to claim 1, wherein extracting the average color for each of the plurality of the parts comprises determining an area for skin color extraction within a skin part, and selecting median of R, G, B values of all pixels in the area for skin color extraction as a predicted average color of the skin part.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the area for skin color extraction within a skin part is determined as an area below eyes and above a lower edge of nose on a face.

### Claim 7 (depends on 1)

The method according to claim 1, wherein extracting the average color for each of the plurality of the parts comprises eyebrow color extraction within an eyebrow part that includes:
in accordance with a determination that an eyebrow is on a side closer to a viewer of the 2D facial image, selecting the eyebrow as a target eyebrow;
in accordance with a determination that both eyebrows are equally close to the viewer of the 2D facial image, selecting the both eyebrows as target eyebrows;
extracting middle eyebrow area(s) within the target eyebrow(s);
comparing each pixel value within the middle eyebrow area(s) with an average skin color;
collecting pixels within the middle eyebrow area(s) that have a pixel value difference from the average skin color beyond a threshold; and
selecting median of R, G, B values of the collected pixels for the eyebrow color extraction as a predicted average color of the eyebrow part.

### Claim 8 (depends on 1)

The method according to claim 1, wherein extracting the average color for each of the plurality of the parts comprises pupil color extraction within an eye part that includes:
in accordance with a determination that an eye is on a side closer to a viewer of the 2D facial image, selecting the eye as a target eye;
in accordance with a determination that both eyes are equally close to the viewer of the 2D facial image, selecting the both eyes as target eyes;
extracting area(s) within the target eye(s) without eyelashes;
comparing each pixel value within the extracted area(s) with a predetermined threshold;
collecting pixels within the extracted area(s) that have a pixel value beyond the predetermined threshold; and
selecting median of R, G, B values of the collected pixels for the pupil color extraction as a predicted average color of the pupil.

### Claim 9 (depends on 1)

The method according to claim 1, wherein extracting the average color for each of the plurality of the parts comprises lip color extraction within a lip part that includes:
collecting all pixels in an area surrounded by keypoints of a lower lip, and selecting median of R, G, B values of the collected pixels for the lip color extraction as a predicted average color of the lip part.

### Claim 10 (depends on 1)

The method according to claim 1, wherein extracting the average color for each of the plurality of the parts comprises hair color extraction within a hair part that includes:
identifying an area including a part of a forehead extending into hair part on both sides;
determining a pixel color change beyond a predetermined threshold from middle to a left boundary and a right boundary of the area;
dividing the area into hair area and skin area based on the pixel color change beyond the predetermined threshold; and
selecting median of R, G, B values of pixels for the hair area within the area as a predicted average color of the hair part.

### Claim 11 (depends on 10)

The method according to claim 10, wherein the area including the part of the forehead extending into the hair part on the both side is identified as a rectangular area with a lower boundary at both eyebrow corners, the left boundary and the right boundary at a fixed distance outward from keypoints located on symmetrical left and right sides of the 2D facial image, and a height at a distance from an upper edge of the eyebrow to a lower edge of an eye.

### Claim 12 (depends on 1)

The method according to claim 1, wherein extracting the average color for each of the plurality of the parts comprises eyeshadow color extraction within an eyeshadow part that includes:
in accordance with a determination that an eye is on a side closer to a viewer of the 2D facial image, selecting the eye as a target eye;
in accordance with a determination that both eyes are equally close to the viewer of the 2D facial image, selecting the both eyes as target eyes;
extracting middle area(s) within the eyeshadow part close to the target eye(s);
collecting pixels within the extracted middle area(s) with brightness above a predetermined brightness threshold to exclude eyelashes, and with a pixel hue value difference from an average skin hue value beyond a predetermined threshold;
in accordance with a determination that a number of collected pixels in one pixel column within the extracted middle area(s) is greater than a threshold, labeling the pixel column as an eyeshadow column; and
in accordance with a determination that a ratio of the eyeshadow columns to width of the extracted middle area is greater than a certain threshold, selecting median of R, G, B values of the collected pixels for the eyeshadow color extraction as a predicted eyeshadow color of the eyeshadow part.

### Claim 13 (depends on 1)

The method according to claim 1, further comprising converting a texture map based on the average color while retaining an original brightness and color differences of the texture map that includes:
converting the average color from RGB color space representation to HSV (hue, saturation, lightness) color space representation; and
adjusting color of the texture map to reduce difference between median HSV values of the average color and median HSV values pixels of the texture map.

### Claim 14

An electronic apparatus comprising one or more processing units, memory coupled to the one or more processing units, and a plurality of programs stored in the memory that, when executed by the one or more processing units, cause the electronic apparatus to perform a plurality of operations of extracting color from a two-dimensional (2D) facial image of a real-life person, comprising:
identifying a plurality of keypoints in the 2D facial image based on a keypoint prediction model;
rotating the 2D facial image until selected keypoints from plurality of keypoints are aligned;
locating a plurality of parts in the rotated 2D facial image, each part defined by a respective subset of the plurality of keypoints;
extracting, from pixel values of the 2D facial image, an average color for each of the plurality of the parts defined by a corresponding subset of keypoints; and
generating a personalized three-dimensional (3D) model of the real-life person that mimics respective facial feature color of the 2D facial image using the extracted colors of the plurality of the parts in the 2D facial image.

### Claim 15 (depends on 14)

The electronic apparatus according to claim 14, wherein the keypoint prediction model is formed based on machine learning from user manually annotated keypoints.

### Claim 16 (depends on 14)

The electronic apparatus according to claim 14, wherein extracting the average color for each of the plurality of the parts comprises selecting median of R, G, B values of all pixels in a respective defined area within a corresponding part as a predicted average color.

### Claim 17 (depends on 14)

The electronic apparatus according to claim 14, wherein extracting the average color for each of the plurality of the parts comprises hair color extraction within a hair part that includes:
identifying an area including a part of a forehead extending into hair part on both sides;
determining a pixel color change beyond a predetermined threshold from middle to the left boundary and right boundary of the area;
dividing the area into hair area and skin area based on the pixel color change beyond the predetermined threshold; and
selecting median of R, G, B values of pixels for the hair area within the area as a predicted average color of the hair part.

### Claim 18 (depends on 14)

The electronic apparatus according to claim 14, wherein extracting the average color for each of the plurality of the parts comprises eyeshadow color extraction within an eyeshadow part that includes:
in accordance with a determination that an eye is on a side closer to a viewer of the 2D facial image, selecting the eye as a target eye;
in accordance with a determination that both eyes are equally close to the viewer of the 2D facial image, selecting the both eyes as target eyes;
extracting middle area(s) within the eyeshadow part close to the target eye(s);
collecting pixels within the extracted middle area(s) with brightness above a predetermined brightness threshold to exclude eyelashes, and with a pixel hue value difference from an average skin hue value beyond a predetermined threshold;
in accordance with a determination that a number of collected pixels in one pixel column within the extracted middle area(s) is greater than a threshold, labeling the pixel column as an eyeshadow column; and
in accordance with a determination that a ratio of the eyeshadow columns to width of the extracted middle area is greater than a certain threshold, selecting median of R, G, B values of the collected pixels for the eyeshadow color extraction as a predicted eyeshadow color of the eyeshadow part.

### Claim 19 (depends on 14)

The electronic apparatus according to claim 14, wherein the plurality of operations further comprise converting a texture map based on the average color while retaining an original brightness and color differences of the texture map that includes:
converting the average color from RGB color space representation to HSV (hue, saturation, lightness) color space representation; and
adjusting color of the texture map to reduce difference between median HSV values of the average color and median HSV values pixels of the texture map.

### Claim 20

A non-transitory computer readable storage medium storing a plurality of programs for execution by an electronic apparatus having one or more processing units, wherein the plurality of programs, when executed by the one or more processing units, cause the electronic apparatus to perform a plurality of operations of extracting color from a two-dimensional (2D) facial image of a real-life person, comprising:
identifying a plurality of keypoints in the 2D facial image based on a keypoint prediction model;
rotating the 2D facial image until selected keypoints from plurality of keypoints are aligned;
locating a plurality of parts in the rotated 2D facial image, each part defined by a respective subset of the plurality of keypoints;
extracting, from pixel values of the 2D facial image, an average color for each of the plurality of the parts defined by a corresponding subset of keypoints; and
generating a personalized three-dimensional (3D) model of the real-life person that mimics respective facial feature color of the 2D facial image using the extracted colors of the plurality of the parts in the 2D facial image.
