# US 2023/0410260 A1 · Method and apparatus for processing image

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

- Number: US 2023/0410260 A1
- Document ID: US20230410260A1
- Status: Published application
- Kind: A1
- Application number: 17/956,187
- Filed: 2022-09-29
- Published: 2023-12-21
- Earliest claimed: 2022-06-20
- Assignees: Beijing Xiaomi Mobile Software Co., Ltd.
- Applicants: Beijing Xiaomi Mobile Software Co., Ltd.
- Inventors: Qiang RAO; Jiakang DENG; Hao JIANG; Shuangshuang YIN; Meiya CHEN; Yangchenxu LIU; Jiaxu DONG
- Web page: https://patentgrep.com/patent/US20230410260A1

## CPC

- G06T 5/70: Denoising; Smoothing
- H04N 23/63: by using electronic viewfinders
- G06T 5/20: using local operators
- G06T 7/194: involving foreground-background segmentation
- H04N 5/262: Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects {; Cameras specially adapted for the electronic generation of special effects}
- H04N 23/632: {for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters}
- H04N 23/64: {Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image}
- H04N 23/667: Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
- H04N 23/80: Camera processing pipelines; Components thereof
- G06T 2207/10024: Color image
- G06T 2207/20021: Dividing image into blocks, subimages or windows
- G06T 2207/20221: Image fusion; Image merging
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A method for processing an image and a mobile terminal. The method includes: obtaining a lens effect instruction, and determining a target blurring algorithm from a plurality of preset blurring algorithms based on the lens effect instruction, in which the blurring algorithms are algorithms for simulating optical lens effects; and obtaining a target image by blurring an image to be processed based on the target blurring algorithm.

## Claims

### Claim 1

A method for processing an image, comprising:
obtaining a lens effect instruction, and determining a target blurring algorithm from a plurality of preset blurring algorithms based on the lens effect instruction, wherein the plurality of preset blurring algorithms are algorithms for simulating optical lens effects; and
obtaining a target image by blurring an image to be processed based on the target blurring algorithm.

### Claim 2 (depends on 1)

The method of claim 1, wherein obtaining the lens effect instruction comprises:
in response to a mobile terminal turning on an optical lens mode, obtaining current photographing environment parameters, wherein the photographing environment parameters comprise at least one of a focus distance parameter, an ambient brightness parameter, a subject detection parameter, and a light spot detection parameter; and
determining the lens effect instruction based on the current photographing environment parameters.

### Claim 3 (depends on 2)

The method of claim 2, wherein determining the lens effect instruction based on the current photographing environment parameters comprises:
determining the lens effect instruction corresponding to a target optical lens effect based on a relation between at least one parameter included in the photographing environment parameters and corresponding preset conditions.

### Claim 4 (depends on 3)

The method of claim 3, wherein determining the lens effect instruction corresponding to the target optical lens effect based on the relation between the at least one parameter included in the photographing environment parameters and the corresponding preset conditions, comprises:
in response to the focus distance parameter satisfying a first preset condition, determining an instruction corresponding to no bokeh effect as the lens effect instruction;
in response to the ambient brightness parameter satisfying a second preset condition, determining an instruction corresponding to soft-focus bokeh effect as the lens effect instruction;
in response to the subject detection parameter satisfying a third preset condition, determining an instruction corresponding to black and white bokeh effect as the lens effect instruction;
in response to the light spot detection parameter satisfying a fourth preset condition, determining an instruction corresponding to swirly bokeh effect as the lens effect instruction; and
in response to the focus distance parameter not satisfying the first preset condition, the ambient brightness parameter not satisfying the second preset condition, the subject detection parameter not satisfying the third preset condition, and the light spot detection parameter not satisfying the fourth preset condition, determining an instruction corresponding to standard bokeh effect as the lens effect instruction.

### Claim 5 (depends on 1)

The method of claim 1, wherein the optical lens effects comprise at least one of:
no bokeh effect, soft-focus bokeh effect, black and white bokeh effect, swirly bokeh effect and standard bokeh effect.

### Claim 6 (depends on 1)

The method of claim 1, wherein obtaining the lens effect instruction comprises:
in response to a mobile terminal turning on an optical lens mode, outputting a selection interface displaying the optical lens effects; and
receiving a user input instruction on the selection interface, and generating the corresponding lens effect instruction based on the user input instruction.

### Claim 7 (depends on 1)

The method of claim 1, wherein in response to the target blurring algorithm being a standard bokeh algorithm, obtaining the target image by blurring the image to be processed based on the target blurring algorithm, comprises:
dividing the image to be processed into at least two layers to be blurred;
obtaining respective blurred layers by filtering each layer to be blurred; and
obtaining the target image by fusing the respective blurred layers.

### Claim 8 (depends on 1)

The method of claim 1, wherein in response to the target blurring algorithm being a swirly bokeh algorithm, obtaining the target image by blurring the image to be processed based on the target blurring algorithm, comprises:
obtaining a light spot layer and a background layer by dividing the image to be processed;
obtaining a background result layer by filtering the background layer, and obtaining a light spot result layer by filtering the light spot layer based on a preset aperture etching mask layer; and
obtaining the target image by fusing the background result layer and the light spot result layer.

### Claim 9 (depends on 1)

The method of claim 1, wherein in response to the target blurring algorithm being a black and white bokeh algorithm, obtaining the target image by blurring the image to be processed based on the target blurring algorithm, comprises:
converting the image to be processed from a color image to a black-white image;
dividing the black-white image into at least two layers to be blurred;
obtaining respective blurred layers by filtering each layer to be blurred; and
obtaining the target image by fusing the respective blurred layers.

### Claim 10 (depends on 1)

The method of claim 1, wherein in response to the target blurring algorithm being a soft-focus bokeh algorithm, obtaining the target image by blurring the image to be processed based on the target blurring algorithm, comprises:
dividing the image to be processed into at least two layers to be blurred;
obtaining respective blurred layers by filtering each layer to be blurred;
obtaining an intermediate image by fusing the respective blurred layers; and
obtaining the target image by performing highlight enhancement processing on the intermediate image.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
in response to a mobile terminal turning on an optical lens mode and switching from a first optical lens effect to a second optical lens effect, obtaining processing data of the image to be processed in a first blurring algorithm processing process corresponding to the first optical lens effect; and
performing image processing on the image to be processed based on the processing data by using a second blurring algorithm corresponding to the second optical lens effect.

### Claim 12

A mobile terminal, comprising:
a processor; and
a memory having computer instructions stored thereon,
wherein the processor is configured to:
obtain a lens effect instruction, and determine a target blurring algorithm from a plurality of preset blurring algorithms based on the lens effect instruction, wherein the plurality of preset blurring algorithms are algorithms for simulating optical lens effects; and
obtain a target image by blurring an image to be processed based on the target blurring algorithm.

### Claim 13 (depends on 12)

The mobile terminal of claim 12, wherein the processor is configured to:
in response to a mobile terminal turning on an optical lens mode, obtain current photographing environment parameters, wherein the photographing environment parameters comprise at least one of a focus distance parameter, an ambient brightness parameter, a subject detection parameter, and a light spot detection parameter; and
determine the lens effect instruction based on the current photographing environment parameters.

### Claim 14 (depends on 13)

The mobile terminal of claim 13, wherein the processor is configured to:
determine the lens effect instruction corresponding to a target optical lens effect based on a relation between at least one parameter included in the photographing environment parameters and corresponding preset conditions;
wherein determining the processor is configured to:
in response to the focus distance parameter satisfying a first preset condition, determine an instruction corresponding to no bokeh effect as the lens effect instruction;
in response to the ambient brightness parameter satisfying a second preset condition, determine an instruction corresponding to soft-focus bokeh effect as the lens effect instruction;
in response to the subject detection parameter satisfying a third preset condition, determine an instruction corresponding to black and white bokeh effect as the lens effect instruction;
in response to the light spot detection parameter satisfying a fourth preset condition, determine an instruction corresponding to swirly bokeh effect as the lens effect instruction; and
in response to the focus distance parameter not satisfying the first preset condition, the ambient brightness parameter not satisfying the second preset condition, the subject detection parameter not satisfying the third preset condition, and the light spot detection parameter not satisfying the fourth preset condition, determine an instruction corresponding to standard bokeh effect as the lens effect instruction.

### Claim 15 (depends on 12)

The mobile terminal of claim 12, wherein the processor is configured to:
in response to a mobile terminal turning on an optical lens mode, output a selection interface displaying the optical lens effects; and
receive a user input instruction on the selection interface, and generate the corresponding lens effect instruction based on the user input instruction.

### Claim 16 (depends on 12)

The mobile terminal of claim 12, wherein in response to the target blurring algorithm being a standard blurring algorithm, the processor is configured to:
divide the image to be processed into at least two layers to be blurred;
obtain respective blurred layers by filtering each layer to be blurred; and
obtain the target image by fusing the respective blurred layers.

### Claim 17 (depends on 12)

The mobile terminal of claim 12, wherein in response to the target blurring algorithm being a swirly bokeh algorithm, the processor is configured to:
obtain a light spot layer and a background layer by dividing the image to be processed;
obtain a background result layer by filtering the background layer, and obtain a light spot result layer by filtering the light spot layer based on a preset aperture etching mask layer; and
obtain the target image by fusing the background result layer and the light spot result layer.

### Claim 18 (depends on 12)

The mobile terminal of claim 12, wherein in response to the target blurring algorithm being a black and white bokeh algorithm, the processor is configured to:
convert the image to be processed from a color image to a black-white image;
divide the black-white image into at least two layers to be blurred;
obtain respective blurred layers by filtering each layer to be blurred; and
obtain the target image by fusing the respective blurred layers.

### Claim 19 (depends on 12)

The mobile terminal of claim 12, wherein in response to the target blurring algorithm being a soft-focus bokeh algorithm, the processor is configured to:
divide the image to be processed into at least two layers to be blurred;
obtain respective blurred layers by filtering each layer to be blurred;
obtain an intermediate image by fusing the respective blurred layers; and
obtain the target image by performing highlight enhancement processing on the intermediate image.

### Claim 20

A non-transitory storage medium having computer instructions stored thereon, wherein the computer instructions are configured to cause a computer to implement a method for processing an image, the method comprising:
obtaining a lens effect instruction, and determining a target blurring algorithm from a plurality of preset blurring algorithms based on the lens effect instruction, wherein the plurality of preset blurring algorithms are algorithms for simulating optical lens effects; and
obtaining a target image by blurring an image to be processed based on the target blurring algorithm.
