# US 2020/0349680 A1 · Image processing method and device, storage medium and electronic device

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

- Number: US 2020/0349680 A1
- Document ID: US20200349680A1
- Status: Published application
- Kind: A1
- Application number: 16/934,823
- Filed: 2020-07-21
- Published: 2020-11-05
- Earliest claimed: 2018-04-04
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Xin TAO; Hong Yun GAO; Xiao Yong SHEN; Yu Wing TAI; Jia Ya JIA
- Web page: https://patentgrep.com/patent/US20200349680A1

## CPC

- G06T 5/73: Deblurring; Sharpening
- G06T 3/4046: using neural networks
- G06T 5/50: using two or more images, e.g. averaging or subtraction
- G06T 5/60: using machine learning, e.g. neural networks
- H04N 23/683: {performed by a processor, e.g. controlling the readout of an image memory}
- G06T 2207/20016: Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06T 2207/20201: Motion blur correction
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

An image processing method and device, storage medium and electronic device for deblurring an image. The method includes obtaining an image processing instruction including an instruction to deblur a target blurred image; obtaining a target model by training an original model based on a plurality of sample images of different scales, one of the plurality of sample images being a blurred image composed of a plurality of clear images, and the obtained target model being used for deblurring the blurred image to obtain a clear image; based on the image processing instruction, using the target model to deblur the target blurred image to obtain a target clear image; and outputting the target clear image.

## Claims

### Claim 1

An image processing method, performed by a terminal device, the method comprising:
obtaining an image processing instruction including an instruction to deblur a target blurred image;
obtaining a target model by training an original model based on a plurality of sample images of different scales, one of the plurality of sample images being a blurred image composed of a plurality of clear images, and the obtained target model being used for deblurring the blurred image to obtain a clear image;
based on the image processing instruction, using the target model to deblur the target blurred image to obtain a target clear image; and
outputting the target clear image.

### Claim 2 (depends on 1)

The method according to claim 1, wherein, before the obtaining the target model by training the original model, the method comprises:
repeatedly training the original model until a scale of an intermediate image is the same as a scale of the one of the plurality of sample images, a current scale of the intermediate image being initialized as a scale of a first image of the plurality of sample images, a current model being initialized as the original model, the intermediate image being initialized as the first image, and the first image being the blurred image obtained by performing down-sampling on a target sample image among the plurality of sample images;
obtaining the first image having the current scale, from the plurality of sample images;
using the current model to deblur the intermediate image and the first image having the current scale to obtain a second image, the second image being a first clear image associated with the first image;
magnifying the second image to obtain a third image, the intermediate image being updated to the third image;
updating the current scale to a scale that is N times of the current scale, the N being greater than or equal to 2; and
updating the current model to a first model, the first model being obtained by training the original model according to the first image.

### Claim 3 (depends on 1)

The method according to claim 1, wherein, before the obtaining the target model by training the original model, the method further comprises:
obtaining a plurality of continuous frames of clear images from a frame image set, the frame image set being a set of all or some of frame images in a video; and
combining the plurality of frames of clear images to obtain the plurality of sample images, the plurality of sample images being blurred images.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the combining the plurality of frames of clear images to obtain the plurality of sample images comprises:
randomly selecting some clear images among the plurality of frames;
successively performing a summation processing and an averaging processing, respectively for each channel processing the some clear images to obtain the blurred image; and
using the blurred image as the one of the plurality of sample images.

### Claim 5 (depends on 2)

The method according to claim 2, wherein the current model comprises an encoding network and a decoding network, and
wherein the using the current model to deblur the intermediate image and the first image having the current scale to obtain the second image comprises:
using the encoding network to encode the first image and the intermediate image to obtain a first result, two layers of convolutions of the encoding network comprising a residual unit, and the residual unit being used for adding data before the two layers of convolutions are calculated and to add data after the two layers of convolutions are calculated; and
using the decoding network to decode the first result outputted by the encoding network to obtain the second image, two layers of convolutions of the decoding network comprising the residual unit.

### Claim 6 (depends on 2)

The method according to claim 2, wherein the using the current model to deblur the intermediate image and the first image having the current scale to obtain the second image further comprises:
obtaining inherent information of images of different scales, the inherent information being transmitted, through a recursive neural network (RNN) in the current model, between an encoding network and a decoding network, each processing different scales; and
using the encoding network and the decoding network to deblur the intermediate image and the first image having the current scale in combination with the inherent information to obtain the second image.

### Claim 7

An image processing device, comprising:
at least one memory configured to store computer program code; and
at least one processor configured to access the memory and operate as instructed by the computer program code, the computer program code comprising:
first obtaining code configured to cause the at least one processor to obtain an image processing instruction, the image processing instruction including an instruction to deblur a target blurred image;
second obtaining code configured to cause the at least one processor to obtain a target model by training an original model based on a plurality of sample images of different scales, one of the plurality of sample images being a blurred image composed of a plurality of clear images, and the obtained target model being used for deblurring the blurred image to obtain a clear image;
response code configured to cause the at least one processor to, based on the image processing instruction, use the target model to deblur the target blurred image to obtain a target clear image; and
output code configured to cause the at least one processor to output the target clear image.

### Claim 8 (depends on 7)

The image processing device according to claim 7, further comprising:
training code configured to cause the at least one processor to, before the target model being obtained, repeatedly train the original model until a scale of an intermediate image is the same as a scale of one of the plurality of sample images, a current scale of the intermediate image being initialized as a scale of a first image of the plurality of sample images, a current model being initialized as the original model, the intermediate image being initialized as the first image, and the first image being the blurred image obtained by performing down-sampling on a target sample image among the plurality of sample images;
first obtaining code configured to cause the at least one processor to obtain the first image having the current scale, from the plurality of sample images;
first processing code configured to cause the at least one processor to use the current model to deblur the intermediate image and the first image having the current scale to obtain a second image, the second image being a first clear image associated with the first image;
magnification code configured to cause the at least one processor to magnify the second image to obtain a third image, the intermediate image being updated to the third image;
first update code configured to cause the at least one processor to update the current scale to a scale that is N times of the current scale, the N being greater than or equal to 2; and
second update code configured to cause the at least one processor to update the current model to a first model, the first model being obtained by training the original model according to the first image.

### Claim 9 (depends on 7)

The image processing device according to claim 7, further comprising:
third obtaining code configured to cause the at least one processor to, before the target model being obtained, obtain a plurality of continuous frames of clear images from a frame image set, the frame image set being a set of all or some of frame images in a video; and
combination code configured to cause the at least one processor to combine the plurality of frames of clear images to obtain the plurality of sample images, the plurality of sample images being blurred images.

### Claim 10 (depends on 9)

The image processing device according to claim 9, wherein the combination code further comprises:
selection code configured to cause the at least one processor to randomly select some clear images among the plurality of frames;
second processing code configured to cause the at least one processor to successively perform a summation processing and an averaging processing, respectively for each channel processing the some clear images to obtain the blurred image; and
determining code configured to cause the at least one processor to use the blurred image as the one of the plurality of sample images.

### Claim 11 (depends on 8)

The image processing device according to claim 8, wherein the current model comprises an encoding network and a decoding network, and the first processing code further comprises:
encoding code configured to cause the at least one processor to use the encoding network to encode the first image and the intermediate image to obtain a first result, two layers of convolutions of the encoding network comprising a residual unit, and the residual unit being configured to add data before the two layers of convolutions are calculated and to add data after the two layers of convolutions are calculated; and
decoding code configured to cause the at least one processor to use the decoding network to decode the first result outputted by the encoding network to obtain the second image, two layers of convolutions of the decoding network comprising the residual unit.

### Claim 12 (depends on 8)

The image processing device according to claim 8, wherein the first processing code further comprises:
fourth obtaining code configured to cause the at least one processor to obtain inherent information of images of different scales, the inherent information being transmitted, through a recursive neural network (RNN) in the current model, between an encoding network and a decoding network, each processing different scales; and
third processing code configured to use the encoding network and the decoding network to deblur the intermediate image and the first image having the current scale in combination with the inherent information to obtain the second image.

### Claim 13

A non-transitory computer-readable storage medium, storing at least one computer program instruction, the at least one computer program instruction, when executed by a processor, causes the processor to:
obtain an image processing instruction including an instruction to deblur a target blurred image;
obtain a target model by training an original model based on a plurality of sample images of different scales, one of the plurality of sample images being a blurred image composed of a plurality of clear images, and the obtained target model being used for deblurring the blurred image to obtain a clear image;
based on the image processing instruction, use the target model to deblur the target blurred image to obtain a target clear image; and
output the target clear image.

### Claim 14 (depends on 13)

The non-transitory computer-readable storage medium according to claim 13, wherein the at least one computer program instruction is executed by the processor to:
before the target model being obtained, repeatedly train the original model until a scale of an intermediate image is the same as a scale of one of the plurality of sample images, a current scale of the intermediate image being initialized as a scale of a first image of the plurality of sample images, a current model being initialized as the original model, the intermediate image being initialized as the first image, and the first image being the blurred image obtained by performing down-sampling on a target sample image among the plurality of sample images;
obtain the first image having the current scale, from the plurality of sample images;
use the current model to deblur the intermediate image and the first image having the current scale to obtain a second image, the second image being a first clear image associated with the first image;
magnify the second image to obtain a third image, the intermediate image being updated to the third image;
update the current scale to a scale that is N times of the current scale, the N being greater than or equal to 2; and
update the current model to a first model, the first model being obtained by training the original model according to the first image.

### Claim 15 (depends on 13)

The non-transitory computer-readable storage medium according to claim 13, wherein the at least one computer program instruction is executed by the processor to:
before the target model being obtained, obtain a plurality of continuous frames of clear images from a frame image set, the frame image set being a set of all or some of frame images in a video; and
combine the plurality of frames of clear images to obtain the plurality of sample images, the plurality of sample images being blurred images.

### Claim 16 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein the at least one computer program instruction is executed by the processor to:
randomly select some clear images among the plurality of frames;
successively perform a summation processing and an averaging processing, respectively, for each channel processing the some clear images to obtain the blurred image; and
use the blurred image as the one of the plurality of sample images.

### Claim 17 (depends on 14)

The non-transitory computer-readable storage medium according to claim 14, wherein the current model comprises an encoding network and a decoding network, and
wherein the at least one computer program instruction is executed by the processor to:
use the encoding network to encode the first image and the intermediate image to obtain a first result, two layers of convolutions of the encoding network comprising a residual unit, and the residual unit being configured to add data before the two layers of convolutions are calculated and to add data after the two layers of convolutions are calculated; and
use the decoding network to decode the first result outputted by the encoding network to obtain the second image, two layers of convolutions of the decoding network comprising the residual unit.

### Claim 18 (depends on 14)

The non-transitory computer-readable storage medium according to claim 14, wherein the at least one computer program instruction is executed by the processor to:
obtain inherent information of images of different scales, the inherent information being transmitted, through a recursive neural network (RNN) in the current model, between an encoding network and a decoding network, each processing different scales; and
use the encoding network and the decoding network to deblur the intermediate image and the first image having the current scale in combination with the inherent information to obtain the second image.

### Claim 19 (depends on 5)

The method according to claim 5, wherein the two layers of convolutions of the encoding network and the two layers of convolutions of the decoding network each comprise a first convolution layer and a second convolution layer, and
wherein the residual unit is configured between the first convolution layer and the second convolution layer.

### Claim 20 (depends on 6)

The method according to claim 6, wherein the obtaining and transmitting the inherent information of the images of different scales further comprises transmitting the inherent information through a long short-term memory (LSTM) module, and
wherein the LSTM module is located between the encoding network and the decoding network.
