# US 11,120,535 B2 · Image processing method, apparatus, terminal, 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 11,120,535 B2
- Document ID: US11120535B2
- Status: Granted
- Kind: B2
- Application number: 16/583,025
- Filed: 2019-09-25
- Published: 2020-01-16
- Granted: 2021-09-14
- Earliest claimed: 2017-10-18
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Pei Cheng; Bin Fu; Mengren Qian
- Web page: https://patentgrep.com/patent/US11120535B2

## CPC

- G06V 40/171: {Local features and components; Facial parts (eye characteristics G06V40/18); Occluding parts, e.g. glasses; Geometrical relationships}
- G06F 18/253: {of extracted features}
- G06T 5/50: using two or more images, e.g. averaging or subtraction
- G06T 7/75: {involving models}
- G06T 11/00: Two-dimensional [2D] image generation
- G06V 40/164: {using holistic features}
- G06V 40/165: {using facial parts and geometric relationships}
- G06V 40/169: {Holistic features and representations, i.e. based on the facial image taken as a whole}
- G06V 40/20: Movements or behaviour, e.g. gesture recognition (recognition of facial expressions G06V40/16)
- G06T 2207/20221: Image fusion; Image merging
- 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

The present disclosure provides an image processing method, including: recognizing a source object in a source image, and determining, according to feature points of the source object, an orientation and a size of the source object; adjusting, according to matching relationships between the orientation and the size of the source object and the orientation and the size of the target object, the orientation and the size of the source object; adjusting a shape of the source object and a shape of the target object according to an average shape of the source object and an average shape of the target object; and fusing, in real time, the source image and the target image in a manner of aligning the shape of the source object with the shape of the target object.

## Claims

### Claim 1

An image processing method performed at a mobile terminal having one or more processors and memory storing programs to be executed by the one or more processors, the method comprising:
recognizing a source object in a source image;
determining, according to feature points of the source object, an orientation and a size of a formed image of the source object in the source image;
adjusting the orientation and the size of the formed image of the source object in the source image according to matching relationships between the orientation and the size of the formed image of the source object in the source image and an orientation and a size of a formed image of a target object in a target image;
adjusting a shape of the formed image of the source object in the source image by taking an average shape of the formed image of the source object and the formed image of the target object according to their corresponding feature points,
adjusting a shape of the formed image of the target object in the target image by taking the average shape of the formed image of the source object and the formed image of the target object according to their corresponding feature points; and
fusing, in real time, the adjusted source image and the adjusted target image into a fused image in a manner of aligning the shape of the formed image of the source object with the shape of the formed image of the target object.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the recognizing a source object in a source image comprises:
extracting a feature in at least one dimension from the source image, and matching the extracted feature with an object feature template; and
determining that a source object matching the feature template exists in the source image in a case that a similarity exceeds an object feature similarity threshold.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the adjusting the orientation and the size of the formed image of the source object in the source image according to matching relationships between the orientation and the size of the formed image of the source object in the source image and an orientation and a size of a formed image of a target object in a target image comprises:
performing a rotation operation on the formed image of the source object in the source image according to Euler angles of the formed image of the source object in the source image until the Euler angles of the formed image of the source object in the source image are consistent with Euler angles of the formed image of the target object in the target image; and
performing a scale-up or scale-down operation on the formed image of the source object in the source image according to the size of the formed image of the source object in the source image until the size is consistent with the size of the formed image of the target object in the target image.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the adjusting a shape of the formed image of the source object in the source image and a shape of the formed image of the target object in the target image comprises:
calculating an average position of feature points of a same type of the source object in the source image and the target object in the target image; and
adjusting a position of the feature point of the source object in the source image and a position of the feature point of the target object in the target image to match the average position.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the adjusting a position of the feature point of the source object in the source image and a position of the feature point of the target object in the target image to match the average position comprises:
constructing a polygon according to positions of the feature points of the source object in the source image and positions of the feature points of the target object in the target image, and adjusting the constructed polygon for matching.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the constructing a polygon according to positions of the feature points of the source object in the source image and positions of the feature points of the target object in the target image, and adjusting the constructed polygon for matching comprises:
forming an average polygon by connection according to average positions of the respective feature points;
forming a polygon by connection according to the feature points of the source object in the source image and forming a polygon by connection according to the feature points of the target object in the target image; and
adjusting shapes of the polygons formed by connection to be consistent with a shape of the average polygon.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the fusing the adjusted source image and the adjusted target image into the fused image in a manner of aligning the shape of the formed image of the source object with the shape of the formed image of the target object comprises:
superimposing a shape of the source object in an image layer of the source image and a shape of the target object in an image layer of the target image in an aligned manner, color values of pixels at different positions in a superimposed image layer being minimum color values of pixels at corresponding positions in the image layers that are superimposed.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the superimposing a shape of the source object in an image layer of the source image and a shape of the target object in an image layer of the target image in an aligned manner comprises:
generating a gray level image of the source image after the shape of the formed image of the source object in the source image is adjusted; and
superimposing a shape of the source object in an image layer of the gray level image, the shape of the source object in the image layer of the source image, and the shape of the target object in the image layer of the target image in an aligned manner.

### Claim 9 (depends on 1)

The method according to claim 1, further comprising:
determining a compensation value of a corresponding pixel according to a comparison result of an average color value of the source image and a color value of each to-be-compensated pixel; and
performing equalization on color values of respective pixels in the source image according to the compensation value.

### Claim 10 (depends on 9)

The method according to claim 9, wherein the determining a compensation value of a corresponding pixel according to a comparison result of an average color value of the source image and a color value of each to-be-compensated pixel comprises:
determining that a compensation value of the to-be-compensated pixel is a product of a reference value and a first compensation coefficient in a case that the color value of the to-be-compensated pixel is greater than the average color value of the source image; or
determining that a compensation value of the to-be-compensated pixel is a product of a reference value and a second compensation coefficient in a case that the color value of the to-be-compensated pixel is less than or equal to the average color value of the source image.

### Claim 11

A mobile terminal comprising one or more processors, memory coupled to the one or more processors and a plurality of programs stored in the memory that, when executed by the one or more processors, cause the mobile terminal to perform a plurality of operations comprising:
recognizing a source object in a source image;
determining, according to feature points of the source object, an orientation and a size of a formed image of the source object in the source image;
adjusting the orientation and the size of the formed image of the source object in the source image according to matching relationships between the orientation and the size of the formed image of the source object in the source image and an orientation and a size of a formed image of a target object in a target image;
adjusting a shape of the formed image of the source object in the source image by taking an average shape of the formed image of the source object and the formed image of the target object according to their corresponding feature points,
adjusting a shape of the formed image of the target object in the target image by taking the average shape of the formed image of the source object and the formed image of the target object according to their corresponding feature points; and
fusing, in real time, the adjusted source image and the adjusted target image into a fused image in a manner of aligning the shape of the formed image of the source object with the shape of the formed image of the target object.

### Claim 12 (depends on 11)

The mobile terminal according to claim 11, wherein the recognizing a source object in a source image comprises:
extracting a feature in at least one dimension from the source image, and matching the extracted feature with an object feature template; and
determining that a source object matching the feature template exists in the source image in a case that a similarity exceeds an object feature similarity threshold.

### Claim 13 (depends on 11)

The mobile terminal according to claim 11, wherein the adjusting the orientation and the size of the formed image of the source object in the source image according to matching relationships between the orientation and the size of the formed image of the source object in the source image and an orientation and a size of a formed image of a target object in a target image comprises:
performing a rotation operation on the formed image of the source object in the source image according to Euler angles of the formed image of the source object in the source image until the Euler angles of the formed image of the source object in the source image are consistent with Euler angles of the formed image of the target object in the target image; and
performing a scale-up or scale-down operation on the formed image of the source object in the source image according to the size of the formed image of the source object in the source image until the size is consistent with the size of the formed image of the target object in the target image.

### Claim 14 (depends on 11)

The mobile terminal according to claim 11, wherein the adjusting a shape of the formed image of the source object in the source image and a shape of the formed image of the target object in the target image comprises:
calculating an average position of feature points of a same type of the source object in the source image and the target object in the target image; and
adjusting a position of the feature point of the source object in the source image and a position of the feature point of the target object in the target image to match the average position.

### Claim 15 (depends on 11)

The mobile terminal according to claim 11, wherein the fusing the adjusted source image and the adjusted target image into the fused image in a manner of aligning the shape of the formed image of the source object with the shape of the formed image of the target object comprises:
superimposing a shape of the source object in an image layer of the source image and a shape of the target object in an image layer of the target image in an aligned manner, color values of pixels at different positions in a superimposed image layer being minimum color values of pixels at corresponding positions in the image layers that are superimposed.

### Claim 16 (depends on 11)

The mobile terminal according to claim 11, wherein the plurality of operations further comprise:
determining a compensation value of a corresponding pixel according to a comparison result of an average color value of the source image and a color value of each to-be-compensated pixel; and
performing equalization on color values of respective pixels in the source image according to the compensation value.

### Claim 17

A non-transitory computer readable storage medium storing a plurality of machine readable instructions in connection with a computing device having one or more processors, wherein the plurality of machine readable instructions, when executed by the one or more processors, cause the computing device to perform a plurality of operations including:
recognizing a source object in a source image;
determining, according to feature points of the source object, an orientation and a size of a formed image of the source object in the source image;
adjusting the orientation and the size of the formed image of the source object in the source image according to matching relationships between the orientation and the size of the formed image of the source object in the source image and an orientation and a size of a formed image of a target object in a target image;
adjusting a shape of the formed image of the source object in the source image by taking an average shape of the formed image of the source object and the formed image of the target object according to their corresponding feature points,
adjusting a shape of the formed image of the target object in the target image by taking the average shape of the formed image of the source object and the formed image of the target object according to their corresponding feature points; and
fusing, in real time, the adjusted source image and the adjusted target image into a fused image in a manner of aligning the shape of the formed image of the source object with the shape of the formed image of the target object.

### Claim 18 (depends on 17)

The non-transitory computer readable storage medium according to claim 17, wherein the recognizing a source object in a source image comprises:
extracting a feature in at least one dimension from the source image, and matching the extracted feature with an object feature template; and
determining that a source object matching the feature template exists in the source image in a case that a similarity exceeds an object feature similarity threshold.

### Claim 19 (depends on 17)

The non-transitory computer readable storage medium according to claim 17, wherein the adjusting the orientation and the size of the formed image of the source object in the source image according to matching relationships between the orientation and the size of the formed image of the source object in the source image and an orientation and a size of a formed image of a target object in a target image comprises:
performing a rotation operation on the formed image of the source object in the source image according to Euler angles of the formed image of the source object in the source image until the Euler angles of the formed image of the source object in the source image are consistent with Euler angles of the formed image of the target object in the target image; and
performing a scale-up or scale-down operation on the formed image of the source object in the source image according to the size of the formed image of the source object in the source image until the size is consistent with the size of the formed image of the target object in the target image.

### Claim 20 (depends on 17)

The non-transitory computer readable storage medium according to claim 17, wherein the adjusting a shape of the formed image of the source object in the source image and a shape of the formed image of the target object in the target image comprises:
calculating an average position of feature points of a same type of the source object in the source image and the target object in the target image; and
adjusting a position of the feature point of the source object in the source image and a position of the feature point of the target object in the target image to match the average position.
