# US 2022/0036511 A1 · Method and device for image processing, terminal 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 2022/0036511 A1
- Document ID: US20220036511A1
- Status: Published application
- Kind: A1
- Application number: 17/212,993
- Filed: 2021-03-25
- Published: 2022-02-03
- Earliest claimed: 2020-07-31
- Assignees: Beijing Xiaomi Mobile Software Co., Ltd.
- Applicants: Beijing Xiaomi Mobile Software Co., Ltd.
- Inventors: Chiaho PAN; Lin LIU
- Web page: https://patentgrep.com/patent/US20220036511A1

## CPC

- G06T 5/75: Unsharp masking
- G06T 5/50: using two or more images, e.g. averaging or subtraction
- G06T 5/60: using machine learning, e.g. neural networks
- G06T 7/90: Determination of colour characteristics
- G06T 2207/10004: Still image; Photographic image
- G06T 2207/10024: Color image
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

Provided are a method and device for image processing, a terminal device and a storage medium. The method includes: a high-brightness region is determined based on brightness of pixels in a first image, the brightness of the pixels in the high-brightness region being higher than the brightness of the pixels around the high-brightness region; a diffraction region in the first image is determined based on the high-brightness region, the diffraction region being an image region around the high-brightness region; and brightness of the diffraction region is reduced to obtain a second image. Through the method, after the brightness of the diffraction region is reduced, an overlap image formed by diffraction is alleviated, and the image is more real.

## Claims

### Claim 1

A method for image processing, comprising:
determining a high-brightness region based on brightness of pixels in a first image, wherein brightness of pixels in the high-brightness region is higher than brightness of pixels around the high-brightness region;
determining a diffraction region in the first image based on the high-brightness region, wherein the diffraction region is an image region around the high-brightness region; and
reducing brightness of the diffraction region to obtain a second image.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining the diffraction region in the first image based on the high-brightness region comprises:
determining a light field distribution of the brightness of the pixels in the first image;
determining whether an image region meeting a diffraction phenomenon exists in a brightness reduction direction of the high-brightness region in the first image or not based on the light field distribution; and
when the image region meeting the diffraction phenomenon exists, determining the image region as the diffraction region.

### Claim 3 (depends on 2)

The method of claim 2, wherein determining whether the image region meeting the diffraction phenomenon exists in the brightness reduction direction of the high-brightness region in the first image or not based on the light field distribution comprises:
determining whether a high-order position exists or not based on the light field distribution and a brightness characteristic of the diffraction phenomenon, wherein the high-order position is a position of pixels of a first partial region in a region of the first image other than the high-brightness region when a difference value between pixel brightness of the first partial region and pixel brightness of a second partial region is greater than a first threshold, and the pixel brightness of the first partial region is higher than the pixel brightness of the second partial region; and
when the high-order position exists, determining that the image region meeting the diffraction phenomenon exists.

### Claim 4 (depends on 3)

The method of claim 3, wherein determining that the image region meeting the diffraction phenomenon exists when the high-order position exists comprises:
determining whether a similarity between a shape formed by the pixels at the high-order position and a shape of the high-brightness region is greater than a first similarity threshold or not; and
when the similarity is greater than the first similarity threshold, determining that the image region meeting the diffraction phenomenon exists.

### Claim 5 (depends on 3)

The method of claim 3, wherein the first image comprises high-order positions of K orders, K being larger than or equal to 2, and pixel brightness at the high-order position of a Kth order is equal to pixel brightness at the high-order position of a (K−1)th order or is negatively correlated with a value of K.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
determining whether a dispersion phenomenon exists in the diffraction region or not based on a color difference between pixels in the diffraction region and pixels outside the diffraction region, and
wherein reducing the brightness of the diffraction region to obtain the second image comprises: when the dispersion phenomenon exists in the diffraction region, reducing color saturation and the brightness of the diffraction region to obtain the second image.

### Claim 7 (depends on 6)

The method of claim 6, wherein determining whether the dispersion phenomenon exists in the diffraction region or not based on the color difference between the pixels in the diffraction region and the pixels outside the diffraction region comprises:
acquiring a color difference value between the pixels in the diffraction region and the pixels outside the diffraction region; and
when the color difference value is greater than a preset color threshold, determining that the dispersion phenomenon exists in the diffraction region.

### Claim 8 (depends on 1)

The method of claim 1, wherein reducing the brightness of the diffraction region to obtain the second image comprises:
determining a brightness value to be regulated based on a brightness value of each pixel in the diffraction region and a positive relationship with the brightness value of the each pixel; and
subtracting the brightness value to be regulated corresponding to the each pixel from the brightness value of the each pixel in the diffraction region to obtain the second image with a Gaussian distribution of brightness values.

### Claim 9 (depends on 1)

The method of claim 1, wherein reducing the brightness of the diffraction region to obtain the second image comprises:
reducing the brightness of the diffraction region based on an inverse Gamma function to obtain the second image with regulated brightness.

### Claim 10 (depends on 1)

The method of claim 1, wherein reducing the brightness of the diffraction region to obtain the second image comprises:
inputting the first image comprising the diffraction region to a preset image quality compensation model to obtain the second image with regulated brightness, wherein the preset image quality compensation model is obtained by training through a neural network.

### Claim 11 (depends on 1)

The method of claim 1, wherein determining the high-brightness region based on the brightness of the pixels in the first image comprises:
performing clustering based on a brightness value of each pixel in the first image to obtain different regions, wherein a brightness difference between pixels in any region is within a preset difference range; and
determining a region with a maximum average brightness value from the obtained different regions as the high-brightness region.

### Claim 12

A device for image processing, comprising:
a processor; and
a memory, storing instructions executable by the processor;
wherein the processor is configured to:
determine a high-brightness region based on brightness of pixels in a first image, wherein brightness of pixels in the high-brightness region is higher than brightness of pixels around the high-brightness region;
determine a diffraction region in the first image based on the high-brightness region, wherein the diffraction region is an image region around the high-brightness region; and
reduce brightness of the diffraction region to obtain a second image.

### Claim 13 (depends on 12)

The device of claim 12, wherein the processor is further configured to:
determine a light field distribution of the brightness of the pixels in the first image;
determine whether an image region meeting a diffraction phenomenon exists in a brightness reduction direction of the high-brightness region in the first image or not based on the light field distribution and;
when the image region meeting the diffraction phenomenon exists, determine the image region as the diffraction region.

### Claim 14 (depends on 13)

The device of claim 13, wherein the processor is further configured to:
determine whether a high-order position exists or not based on the light field distribution and a brightness characteristic of the diffraction phenomenon, wherein the high-order position is a position of pixels of a first partial region in a region of the first image other than the high-brightness region when a difference value between pixel brightness of the first partial region and pixel brightness of a second partial region is greater than a first threshold, and the pixel brightness of the first partial region is higher than the pixel brightness of the second partial region.

### Claim 15 (depends on 14)

The device of claim 14, wherein the processor is further configured to:
determine whether a similarity between a shape formed by the pixels at the high-order position and a shape of the high-brightness region is greater than a first similarity threshold or not; and
when the similarity is greater than the first similarity threshold, determine that the image region meeting the diffraction phenomenon exists.

### Claim 16 (depends on 14)

The device of claim 14, wherein the first image comprises high-order positions of K orders, K being larger than or equal to 2, and pixel brightness at the high-order position of a Kth order is equal to pixel brightness at the high-order position of a (K−1)th order or is negatively correlated with a value of K.

### Claim 17 (depends on 12)

The device of claim 12, wherein the processor is further configured to:
determine whether a dispersion phenomenon exists in the diffraction region or not based on a color difference between pixels in the diffraction region and pixels outside the diffraction region; and
when the dispersion phenomenon exists in the diffraction region, reduce color saturation and the brightness of the diffraction region to obtain the second image.

### Claim 18 (depends on 17)

The device of claim 17, wherein the processor is further configured to:
acquire a color difference value between the pixels in the diffraction region and the pixels outside the diffraction region; and
when the color difference value is greater than a preset color threshold, determine that the dispersion phenomenon exists in the diffraction region.

### Claim 19 (depends on 12)

The device of claim 12, wherein the processor is further configured to:
determine a brightness value to be regulated based on a brightness value of each pixel in the diffraction region and a positive relationship with the brightness value of the each pixel; and subtract the brightness value to be regulated corresponding to the each pixel from the brightness value of the each pixel in the diffraction region to obtain the second image with a Gaussian distribution of brightness values; or
reduce the brightness of the diffraction region based on an inverse Gamma function to obtain the second image with regulated brightness; or
input the first image comprising the diffraction region to a preset image quality compensation model to obtain the second image with regulated brightness, the preset image quality compensation model being obtained by training through a neural network; or
perform clustering based on a brightness value of each pixel in the first image to obtain different regions, wherein a brightness difference between pixels in any region is within a preset difference range; and determine a region with a maximum average brightness value from the obtained different regions as the high-brightness region.

### Claim 20

A non-transitory computer-readable storage medium, storing instructions that, when executed by a processor of a computer, cause the computer to implement:
determining a high-brightness region based on brightness of pixels in a first image, wherein brightness of pixels in the high-brightness region is higher than brightness of pixels around the high-brightness region;
determining a diffraction region in the first image based on the high-brightness region, wherein the diffraction region is an image region around the high-brightness region; and reducing brightness of the diffraction region to obtain a second image.
