Method and apparatus for generating blurred image, and mobile terminal
AssigneeGuangdong Oppo Mobile Telecommunications Corp., Ltd.
InventorYuanqing Zeng
Life of this patent
Estimating the term…
Abstract
A method and a device for generating a blurred image, and a mobile terminal are provided. The method includes the followings. According to preview image data acquired via two rear cameras of a dual-camera device, first depth-of-field information for a foreground region and second depth-of-field information for a background region in a current preview image are determined. In addition, a basic value of a blurring degree is acquired according to the first depth-of-field information and the second depth-of-field information. Furthermore, Gaussian blur process is performed on the background region according to the basic value of the blurring degree to generate the blurred image.
Claims20
A method for generating a blurred image, comprising:
- determining, according to preview image data acquired via two rear cameras of a dual-camera device, first depth-of-field information for a foreground region and second depth-of-field information for a background region in a current preview image;
- acquiring a basic value of a blurring degree according to the first depth-of-field information and the second depth-of-field information, the basic value of the blurring degree being a reference value of the blurring degree;
- and
- performing Gaussian blur process on the background region according to the basic value of the blurring degree to generate the blurred image;
- wherein, performing the Gaussian blur process on the background region according to the basic value of the blurring degree to generate the blurred image comprises:
- determining a blurring coefficient for each pixel in the background region according to the basic value of the blurring degree and the second depth-of-field information for the background region;
- and
- performing the Gaussian blur process on the background region according to the blurring coefficient for each pixel in the background region to generate the blurred image;
- wherein determining the blurring coefficient for each pixel in the background region according to the basic value of the blurring degree and the second depth-of-field information for the background region comprises:
- calculating a multiplied value by multiplying the basic value of the blurring degree by the second depth-of-field information of each pixel in the background region, to obtain the blurring coefficient for each pixel in the background region.
A device for generating a blurred image, comprising:
- a non-transitory computer-readable medium having computer-executable instructions stored thereon, and an instruction execution system which is configured by the computer-executable instructions to implement:
- a determining module, configured to determine, according to preview image data acquired via two rear cameras of a dual-camera device, first depth-of-field information for a foreground region and second depth-of-field information for a background region in a current preview image;
- an acquiring module, configured to acquire a basic value of a blurring degree according to the first depth-of-field information and the second depth-of-field information, the basic value of the blurring degree being a reference value of the blurring degree;
- and
- a generating module, configured to perform Gaussian blur process on the background region according to the basic value of the blurring degree to generate the blurred image;
- wherein the generating module comprises:
- a determining unit, configured to determine a blurring coefficient for each pixel in the background region according to the basic value of the blurring degree and the second depth-of-field information for the background region;
- and
- a generating unit, configured to perform the Gaussian blur process on the background region according to the blurring coefficient for each pixel in the background region to generate the blurred image;
- wherein the determining unit is configured to calculate a multiplied value by multiplying the basic value of the blurring degree by the second depth-of-field information of each pixel in the background region, to obtain the blurring coefficient for each pixel in the background region.
A mobile terminal, comprising a housing, a processor, a memory, a circuit board and a power supply circuit, wherein, the circuit board is enclosed by the housing;
- the processor and the memory are positioned on the circuit board;
- the power supply circuit is configured to provide power for respective circuits or components of the electronic device;
- the memory is configured to store executable program codes;
- and the processor is configured to run a program corresponding to the executable program codes by reading the executable program codes stored in the memory, to perform following operations:
- determining, according to preview image data acquired via two rear cameras of a dual-camera device, first depth-of-field information for a foreground region and second depth-of-field information for a background region in a current preview image;
- obtaining a basic value of a blurring degree according to the first depth-of-field information and the second depth-of-field information, the basic value of the blurring degree being a reference value of the blurring degree;
- and
- performing Gaussian blur process on the background region according to the basic value of the blurring degree to generate the blurred image;
- wherein, performing the Gaussian blur process on the background region according to the basic value of the blurring degree to generate the blurred image comprises:
- determining a blurring coefficient for each pixel in the background region according to the basic value of the blurring degree and the second depth-of-field information for the background region;
- and
- performing the Gaussian blur process on the background region according to the blurring coefficient for each pixel in the background region to generate the blurred image;
- wherein determining the blurring coefficient for each pixel in the background region according to the basic value of the blurring degree and the second depth-of-field information for the background region comprises:
- calculating a multiplied value by multiplying the basic value of the blurring degree by the second depth-of-field information of each pixel in the background region, to obtain the blurring coefficient for each pixel in the background region.
The mobile terminal according to 16, wherein the processor is configured to determine the first depth-of-field for the foreground region in the current preview image according to the third average value of the third depth-of-field information for the in-focused region and the predetermined adjustment value by acts of:
- adding the predetermined adjustment value to the third average value to obtain an upper limit of a depth-of-field range;
- subtracting the predetermined adjustment value from the third average value to obtain a lower limit of a depth-of-field range;
- and
- determining depth-of-field information between the upper limit of the depth-of-field range and the lower limit of the depth-of-field range as the first depth-of-field information for the foreground region in the current preview image.
Dependencies are inferred from the claim text.