[go: up one dir, main page]

WO2019148996A1 - Image processing method and device, storage medium, and electronic apparatus - Google Patents

Image processing method and device, storage medium, and electronic apparatus Download PDF

Info

Publication number
WO2019148996A1
WO2019148996A1 PCT/CN2018/122861 CN2018122861W WO2019148996A1 WO 2019148996 A1 WO2019148996 A1 WO 2019148996A1 CN 2018122861 W CN2018122861 W CN 2018122861W WO 2019148996 A1 WO2019148996 A1 WO 2019148996A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target image
processing
pixels
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/122861
Other languages
French (fr)
Chinese (zh)
Inventor
杨涛
谭国辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of WO2019148996A1 publication Critical patent/WO2019148996A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/45Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from two or more image sensors being of different type or operating in different modes, e.g. with a CMOS sensor for moving images in combination with a charge-coupled device [CCD] for still images
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio

Definitions

  • the present application belongs to the field of image technologies, and in particular, to an image processing method, apparatus, storage medium, and electronic device.
  • the configuration of hardware installed on the terminal is also getting higher and higher.
  • many terminals are equipped with dual camera modules.
  • the camera's camera level can be greatly improved.
  • a dual camera module with a color camera and a black and white camera can make the terminal capture more details when taking pictures.
  • the dual camera module with two color cameras can make the terminal have double the amount of light entering when taking pictures.
  • Embodiments of the present application provide an image processing method, apparatus, storage medium, and electronic device, which can improve image quality of an image.
  • the embodiment of the present application provides an image processing method, which is applied to a terminal, where the terminal includes at least a wide-angle camera module and a telephoto camera module, and the method includes:
  • the first image is an image captured by the wide-angle camera module
  • the second image is an image captured by the telephoto camera module
  • An embodiment of the present application provides an image processing apparatus, which is applied to a terminal, where the terminal includes at least a wide-angle camera module and a telephoto camera module, and the device includes:
  • a first acquiring module configured to acquire a first image and a second image, where the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module ;
  • a first processing module configured to perform a preset first process on the first image, to obtain a first target image, where the number of pixels of the first target image is smaller than the number of pixels of the first image;
  • a second acquiring module configured to acquire depth information according to the first target image and the second image
  • the second processing module is configured to perform preset second processing on the first target image according to the depth information.
  • the embodiment of the present application provides a storage medium on which a computer program is stored.
  • the computer program is executed on a computer, the computer is caused to execute the flow in the image processing method provided by the embodiment of the present application.
  • the embodiment of the present application further provides an electronic device, including a memory, a processor, where the electronic device includes at least a wide-angle camera module and a telephoto camera module, and the processor uses a computer program stored in the memory to use For execution:
  • the first image is an image captured by the wide-angle camera module
  • the second image is an image captured by the telephoto camera module
  • FIG. 1 is a schematic flowchart diagram of a method for processing an image provided by an embodiment of the present application.
  • FIG. 2 is another schematic flowchart of a method for processing an image according to an embodiment of the present disclosure.
  • FIG. 3 is still another schematic flowchart of a method for processing an image provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an execution process of a Skipping algorithm according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of another execution process of the Skipping algorithm provided by the embodiment of the present application.
  • FIG. 6 is a schematic diagram of an execution process of a Binning algorithm provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a scenario of an image processing method according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of an image processing circuit of an electronic device according to an embodiment of the present application.
  • the executive body of the embodiment of the present application may be a terminal such as a smart phone or a tablet computer.
  • the embodiment provides an image processing method, which is applied to a terminal, and the terminal may include at least a wide-angle camera module and a telephoto camera module, and the method includes:
  • the first image is an image captured by the wide-angle camera module
  • the second image is an image captured by the telephoto camera module
  • the performing the preset second processing on the first target image may include: performing background blurring processing on the first target image.
  • the method may further include: performing a preset third process on the second image to obtain a second target image, wherein the second target image The number of pixels is smaller than the number of pixels of the second image.
  • the acquiring the depth information according to the first target image and the second image may include: acquiring depth information according to the first target image and the second target image.
  • the performing a preset third processing on the second image to obtain a second target image wherein the number of pixels of the second target image is smaller than the number of pixels of the second image
  • the method includes: performing a preset third process on the second image to obtain the second target image, wherein the number of pixels of the second target image is one quarter of the number of pixels of the second image.
  • the performing the third processing on the second image to obtain the second target image may include: processing the second image by using a Binning algorithm to obtain the second target image. .
  • the performing a preset first process on the first image to obtain a first target image wherein the number of pixels of the first target image is smaller than the number of pixels of the first image
  • the method includes: performing a preset first process on the first image to obtain the first target image, wherein the number of pixels of the first target image is one-half of the number of pixels of the first image.
  • the performing the first processing on the first image to obtain the first target image may include: performing a preset first processing on the first image to obtain the first target image,
  • the preset first process is an image reduction process, or an image cropping process, or a combination of image reduction processing and image cropping processing.
  • FIG. 1 is a schematic flowchart diagram of a method for processing an image according to an embodiment of the present application.
  • the processing method of the image can be applied to the terminal.
  • the terminal may be any terminal equipped with a dual camera module such as a smartphone or a tablet.
  • the dual camera module can be a combination of a wide-angle camera module and a telephoto camera module.
  • the flow of the image processing method may include:
  • a first image and a second image are acquired.
  • the first image is an image captured by a wide-angle camera module
  • the second image is an image captured by a telephoto camera module.
  • the configuration of hardware installed on the terminal is also getting higher and higher.
  • many terminals are equipped with dual camera modules.
  • the camera's camera level can be greatly improved.
  • a dual camera module with a color camera and a black and white camera can make the terminal capture more details when taking pictures.
  • the dual camera module with two color cameras can make the terminal have double the amount of light entering when taking pictures.
  • the imaging effect is poor.
  • the terminal may first acquire the first image and the second image.
  • the terminal may be a terminal equipped with a wide-angle camera module and a telephoto camera module.
  • the first image is captured by a wide-angle camera module on the terminal, and the second image is a telephoto camera module on the terminal. Collected by the group.
  • a preset first process is performed on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image.
  • the terminal may perform a preset first process on the first image, thereby obtaining a first target image.
  • the number of pixels of the first target image may be smaller than the number of pixels of the first image.
  • the terminal may perform a preset first process on the first image, where the preset first process may reduce the number of pixels of the first image. For example, by presetting the first process, the terminal reduces the number of pixels of the first image from 16 million pixels to 8 million pixels, that is, the number of pixels of the first target image obtained is 8 million.
  • depth information is acquired based on the first target image and the second image.
  • the terminal may acquire the depth information according to the first target image and the second image.
  • the depth of field information is relative to the in-focus object in the image, and is the depth of field information acquired after the in-focus object is determined.
  • a preset second process is performed on the first target image according to the depth of field information.
  • the terminal may perform a preset second processing on the first target image according to the depth information.
  • the preset second process may be a 3D application process such as background blurring and images.
  • the image acquired by the wide-angle camera module is used for imaging, and the imaging effect is better, especially in a dark environment.
  • the first image is an image acquired by the wide-angle camera module
  • the first target image is an image obtained by lowering the pixel point of the first image, so the imaging is performed according to the first target image, and the imaging effect is good. .
  • the imaging effect can be improved by using the technical solution in this embodiment.
  • the first target image for imaging is obtained by reducing the number of pixels of the first image, imaging is performed using the first target image, and the image processing speed is faster.
  • the depth information is more accurate. Therefore, using the depth of field information to process the first target image can make the processed image image better.
  • FIG. 3 is still another schematic flowchart of a method for processing an image according to an embodiment of the present disclosure.
  • the processing method of the image can be applied to the terminal.
  • the terminal may be any terminal equipped with a dual camera module such as a smartphone or a tablet.
  • the dual camera module can be a combination of a wide-angle camera module and a telephoto camera module.
  • the flow of the image processing method may include:
  • the terminal acquires the first image and the second image, the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module.
  • the terminal may first acquire the first image and the second image.
  • the terminal may be a terminal equipped with a wide-angle camera module and a telephoto camera module.
  • the first image is captured by a wide-angle camera module on the terminal, and the second image is a telephoto camera module on the terminal. Collected by the group.
  • the terminal performs a preset first process on the first image to obtain a first target image, where the number of pixels of the first target image is one-half of the number of pixels of the first image.
  • the terminal may perform a preset first process on the first image, thereby obtaining a first target image.
  • the number of pixels of the first target image is one-half of the number of pixels of the first image.
  • the terminal may perform a preset first process on the first image, where the preset first process may reduce the number of pixels of the first image by half. For example, by preset the first process, the terminal reduces the number of pixels of the first image from 16 million pixels to 8 million pixels, that is, the obtained number of pixels of the first target image is 8 million.
  • the process of the terminal performing the preset first processing on the first image in the 202 to obtain the first target image may include:
  • the terminal performs a preset first process on the first image to obtain a first target image, where the preset first process is image reduction process, or image cropping process, or a combination of image reduction process and image cropping process.
  • the preset first process is image reduction processing.
  • the terminal may perform image reduction processing on the first image by an image scaling algorithm, thereby reducing the resolution of the first image.
  • the image scaling algorithm may be a quadratic linear interpolation algorithm, a cubic linear interpolation algorithm, or a cubic convolution interpolation algorithm.
  • the terminal may perform pixel extraction processing on the first image by using a Skipping algorithm, thereby reducing the first image and reducing the resolution of the first image.
  • the execution process of the Skipping algorithm in this embodiment may include the following two methods: row extraction (Row Skip 2X) and column extraction (Column Skip 2X).
  • the Skipping algorithm extracts pixels in pairs.
  • the mode shown in FIG. 4 is a row drawing (Row Skip 2X) method in which pixels with a background color are existing pixels, and pixels without a background color are pixels to be extracted.
  • the mode shown in FIG. 5 is a column extraction (Column Skip 2X) in which pixels with a background color are existing pixels, and pixels without a background color are pixels to be extracted. 4 and FIG. 5, after performing pixel extraction on the first image according to row extraction (Row Skip 2X) or column extraction (Column Skip 2X), the number of pixels of the first target image obtained is the number of pixels of the first image. One-half.
  • the preset first process is an image cropping process (crop).
  • the terminal may only retain the area of the preset size (preset size) in the first image, and the other areas are cropped. It can be understood that by cutting a partial area of the first image, the number of pixels can be reduced, thereby reducing the amount of data processed by the image.
  • the terminal due to the image captured by the wide-angle camera module, there is a certain degree of distortion around the image, so the terminal can cut off the periphery of the first image, and retain the intermediate region with better imaging effect.
  • the size is the above preset size.
  • the preset size can be set according to actual usage requirements. For example, the preset size can be set or adjusted according to factors such as imaging parameters of the wide-angle camera module (such as the resolution of the camera module) and environmental parameters when the image is acquired.
  • the preset first process may also be a combination of image reduction processing and image cropping processing.
  • the terminal may first reduce the first image, and then crop the area around the first image that is distorted.
  • the terminal may first cut off the distorted area around the first image, and then reduce the cropped image to obtain the first target image.
  • the number of pixels of the first target image obtained in this embodiment may be one-half of the number of pixels of the first image.
  • the terminal processes the second image by using the Binning algorithm to obtain a second target image, wherein the number of pixels of the second target image is one quarter of the number of pixels of the second image.
  • the terminal may perform a preset third process on the second image to obtain a second target image.
  • the number of pixels of the second target image may be smaller than the number of pixels of the second image. In an embodiment, the number of pixels of the second target image may be one quarter of the number of pixels of the second image.
  • the terminal may process the second image by using a Binning algorithm to obtain a second target image.
  • the terminal may process the second image by using a Binning algorithm to obtain a second target image, where the number of pixels of the second target image is 5 million.
  • the Binning algorithm adds charges corresponding to adjacent pixel units of the same color and reads them in a one-pixel mode.
  • charges corresponding to four adjacent pixel units of the same color may be added together and read out in a pattern of one pixel. That is, each of four adjacent pixel units of the same color is combined into one pixel unit.
  • the process of pixel merging can be as shown in FIG. 6.
  • Gr00' (Gr00+Gr10+Gr01+Gr11)/4
  • Gr10' (Gr20+Gr30+Gr21+Gr31)/4
  • Gr01' (Gr02 + Gr12 + Gr03 + Gr13) / 4
  • Gr11' (Gr22 + Gr32 + Gr23 + Gr33) / 4.
  • the pixel values of the red and blue pixels are also the average of the pixel values of the adjacent pixel units of the same color.
  • the Binning algorithm reduces the number of pixels of the second image to obtain the second target image.
  • the imaging quality of the second target image is made better, so that the depth information acquired subsequently from the first target image and the second target image is more accurate.
  • the number of pixels of the second image can be reduced to one quarter of the number of original pixels by the Binning algorithm, so that the speed of image processing in the present embodiment can be accelerated.
  • the terminal acquires the depth information according to the first target image and the second target image.
  • the terminal may acquire the depth information according to the first target image and the second target image.
  • the depth of field information is relative to the in-focus object in the image, and is the depth of field information acquired after the in-focus object is determined.
  • the terminal performs background blurring processing on the first target image.
  • the terminal may perform background blur processing on the first target image according to the depth information.
  • the first target image is obtained by reducing the number of pixels of the first image
  • the second target image is obtained by reducing the number of pixels by the second image, thereby utilizing the first image.
  • the target image and the second target image acquire the depth of field information faster, and when the first target image is used for imaging, the image processing speed of the terminal is also faster.
  • the depth of field information acquired according to the first target image and the second target image is also more accurate, and the background blur is performed according to the depth information, and the blurring effect is better.
  • the embodiment can improve the image quality of an image.
  • the embodiment may further include the following process:
  • the terminal obtains the total running memory capacity and the currently occupied running memory capacity
  • the terminal obtains the proportion of the currently occupied running memory capacity in the total running memory capacity.
  • the process of the terminal performing the first processing on the first image to obtain the first target image may include: if the ratio is detected to reach the preset threshold, the terminal performs the preset first processing on the first image, to obtain The first target image. For example, if it is detected that the ratio reaches a preset threshold, the terminal performs image reduction processing on the first image, thereby obtaining a first target image.
  • the terminal can acquire the total running memory (RAM) capacity of the terminal and the currently occupied running memory capacity. Then, the terminal can calculate the proportion of the currently occupied running memory capacity in the total running memory capacity. After that, the terminal can detect whether the ratio reaches a preset threshold.
  • RAM total running memory
  • the terminal can perform other operations. For example, if the total running memory capacity of the terminal is 4 GB, and the currently occupied running memory capacity is 2 GB, the current occupied running memory capacity accounts for 50% of the total running memory capacity of the terminal. For example, the preset threshold is 80%. Then, the terminal can detect that the ratio is 50% less than the preset threshold of 80%. In this case, the terminal can perform other operations, such as the terminal collecting images according to a normal process.
  • the terminal detects that the ratio reaches a preset threshold, for example, the total running memory capacity of the terminal is 4 GB, and the currently occupied running memory capacity is 3.4 GB, the currently occupied running memory capacity accounts for the total running memory capacity of the terminal.
  • the ratio is 85%.
  • the preset threshold is 80%.
  • the terminal can detect that the ratio is 85% greater than the preset threshold of 80%. In this case, it can be considered that the remaining running memory of the current terminal is small.
  • the terminal can adopt the image processing method provided in this embodiment, thereby improving the image processing speed.
  • the terminal may perform image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image. Moreover, the terminal can reduce the number of pixels of the second image to obtain a second target image. Then, the terminal may acquire depth of field information according to the first target image and the second target image, and perform background blurring processing on the first target image according to the depth information.
  • the embodiment may further include the following process:
  • the terminal obtains the remaining power value.
  • the process of the terminal performing the first processing on the first image to obtain the first target image may include: if the remaining power value is lower than the preset power threshold, the terminal presets the first image. Upon processing, a first target image is obtained. For example, if it is detected that the remaining power value is lower than the preset power threshold, the terminal performs image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image.
  • the terminal can obtain the current remaining power value of the terminal. After that, the terminal can detect whether the remaining power value is lower than the preset power threshold.
  • the terminal can perform other operations.
  • the current remaining battery value of the terminal is 80%.
  • the default power threshold is 30%.
  • the terminal can perform other operations, such as the terminal collecting images according to a normal process.
  • the terminal can adopt the image processing method provided in this embodiment, thereby improving the image processing speed.
  • the terminal may perform image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image.
  • the terminal can reduce the number of pixels of the second image to obtain a second target image. Then, the terminal may acquire depth of field information according to the first target image and the second target image, and perform background blurring processing on the first target image according to the depth information.
  • the terminal may further obtain a difference between the remaining power value and the preset power threshold after detecting that the remaining power value is not lower than the preset power threshold. If the difference is less than the preset difference, the terminal can acquire the number of applications currently camping in the background.
  • the terminal can perform other operations.
  • the terminal can also adopt the image processing method provided in this embodiment, thereby improving image processing speed and lower power consumption.
  • the terminal may perform image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image.
  • the terminal can reduce the number of pixels of the second image to obtain a second target image. Then, the terminal may acquire depth of field information according to the first target image and the second target image, and perform background blurring processing on the first target image according to the depth information.
  • FIG. 7 to FIG. 9 are schematic diagrams of a scenario and a flow of an image processing method according to an embodiment of the present application.
  • a dual camera module 10 is mounted on the terminal, and the dual camera module 10 includes a first camera module 11 and a second camera module 12 .
  • the two cameras in the dual camera module may be arranged side by side in a lateral direction (as shown in FIG. 7).
  • the two cameras in the dual camera module may also be arranged side by side in the longitudinal direction.
  • the first camera module 11 is a wide-angle camera module
  • the second camera module 12 is a telephoto camera module. The first camera module 11 and the second camera module 12 can simultaneously acquire images.
  • the user opens the camera application and is ready to take a photo, at which point the terminal interface enters the image preview interface.
  • An image for preview by the user will be displayed on the display screen of the terminal.
  • the dual camera module of the terminal quickly collects the image, saves the image in a buffer queue of the memory, and displays the image on the screen for the user to preview.
  • the terminal buffer queue stores 6 frames of images recently acquired by the first camera module and 6 frames of images recently acquired by the second camera module.
  • the terminal can acquire the first image captured by the wide-angle camera module and acquire the second image captured by the telephoto camera module.
  • the first image may be an image collected before the user clicks the camera button, or may be an image collected after the user clicks the camera button.
  • the second image may be an image acquired before the user clicks the camera button, or may be an image acquired after the user clicks the camera button.
  • the first image and the second image are images that are synchronously acquired after the user clicks the photo button.
  • the terminal may perform image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image, where the pixel of the first target image The number is one-half the number of pixels of the first image.
  • the terminal can reduce the number of pixels of the second image by using a Binning algorithm to obtain a second target image.
  • the number of pixels of the first image is 16 million
  • the number of pixels of the first target image obtained by performing image reduction processing on the first image is 8 million.
  • the number of pixels of the second image is 20 million
  • the number of pixels of the second target image obtained by processing the second image by the Binning algorithm is 5 million.
  • the terminal may obtain the depth information according to the first target image and the second target image, and then the terminal may perform background blur processing on the first target image according to the depth information.
  • An output image is obtained, and a schematic diagram of the flow can be seen in FIG.
  • the embodiment provides an image processing device, which is applied to a terminal, and the terminal includes at least a wide-angle camera module and a telephoto camera module, and the device includes:
  • a first acquiring module configured to acquire a first image and a second image, where the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module ;
  • a first processing module configured to perform a preset first process on the first image, to obtain a first target image, where the number of pixels of the first target image is smaller than the number of pixels of the first image;
  • a second acquiring module configured to acquire depth information according to the first target image and the second image
  • the second processing module is configured to perform preset second processing on the first target image according to the depth information.
  • the second processing module may be configured to perform background blurring processing on the first target image.
  • the first processing module may be further configured to perform a preset third process on the second image to obtain a second target image, where the number of pixels of the second target image is smaller than The number of pixels of the second image.
  • the second acquiring module may be configured to: acquire depth information according to the first target image and the second target image.
  • the first processing module may be configured to: perform a preset third process on the second image to obtain the second target image, where the number of pixels of the second target image is The fourth image has a quarter of the number of pixels.
  • the first processing module may be configured to: process the second image by using a Binning algorithm to obtain the second target image.
  • the first processing module may be configured to: perform a preset first process on the first image to obtain a first target image, where the number of pixels of the first target image is the first One-half the number of pixels in the image.
  • the first processing module may be configured to: perform preset first processing on the first image to obtain a first target image, where the preset first processing is image reduction processing, or image cropping processing , or a combination of image reduction processing and image cropping processing.
  • FIG. 10 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure.
  • the processing device of the image can be applied to the terminal.
  • the terminal may be any electronic device such as a smartphone or tablet that is equipped with a dual camera module.
  • the dual camera module can be a combination of a wide-angle camera module and a telephoto camera module.
  • the image processing apparatus 300 may include: a first obtaining module 301, a first processing module 302, a second obtaining module 303, and a second processing module 304.
  • a first acquiring module 301 configured to acquire a first image and a second image, where the first image is an image captured by the wide-angle camera module, and the second image is collected by the telephoto camera module image.
  • the first obtaining module 301 may first acquire the first image and the second image.
  • the terminal may be a terminal equipped with a wide-angle camera module and a telephoto camera module.
  • the first image is captured by a wide-angle camera module on the terminal, and the second image is a telephoto camera module on the terminal. Collected by the group.
  • the first processing module 302 is configured to perform a preset first process on the first image to obtain a first target image, where the number of pixels of the first target image is smaller than the number of pixels of the first image.
  • the first processing module 302 may perform a preset first process on the first image, thereby obtaining a first target image.
  • the number of pixels of the first target image may be smaller than the number of pixels of the first image. .
  • the second obtaining module 303 is configured to obtain depth information according to the first target image and the second image.
  • the second obtaining module 303 can obtain the depth information according to the first target image and the second image. It should be noted that the depth of field information is relative to the in-focus object in the image, and is the depth of field information acquired after the in-focus object is determined.
  • the second processing module 304 is configured to perform a preset second process on the first target image according to the depth of field information.
  • the second processing module 304 may perform a preset second processing on the first target image according to the depth information.
  • the second processing module 304 is configured to perform background blurring processing on the first target image.
  • the first processing module 302 may be configured to perform a preset third process on the second image to obtain a second target image, where the number of pixels of the second target image is smaller than the first The number of pixels in the second image.
  • the second obtaining module 303 can be configured to: acquire depth information according to the first target image and the second target image.
  • the first processing module 302 may be configured to: perform a preset third process on the second image to obtain a second target image, where the number of pixels of the second target image is the The image has a quarter of the number of pixels.
  • the first processing module 302 can be configured to: process the second image by using a Binning algorithm to obtain a second target image.
  • the first processing module 302 may be configured to perform a preset first process on the first image to obtain a first target image, where the number of pixels of the first target image is the first One-fifth of the number of pixels in an image.
  • the first processing module 302 may be configured to: perform preset first processing on the first image to obtain a first target image, where the preset first processing is image reduction processing, or image cropping Processing, or a combination of image reduction processing and image cropping processing.
  • the embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, and when the computer program is executed on a computer, causing the computer to execute a process in the image processing method provided by the embodiment. .
  • the embodiment of the present application further provides an electronic device, including a memory, and a processor, by using a computer program stored in the memory, to execute a process in a method for processing an image provided by the embodiment.
  • the above electronic device may be a mobile terminal such as a tablet or a smart phone.
  • a mobile terminal such as a tablet or a smart phone.
  • FIG. 11 is a schematic structural diagram of a mobile terminal according to an embodiment of the present disclosure.
  • the mobile terminal 400 can include components such as a camera module 401, a memory 402, a processor 403, and the like. It will be understood by those skilled in the art that the mobile terminal structure illustrated in Figure 11 does not constitute a limitation to the mobile terminal, and may include more or less components than those illustrated, or some components may be combined, or different component arrangements.
  • the camera module 401 can include a dual camera module, and the dual camera module can include a wide-angle camera module and a telephoto camera module.
  • Memory 402 can be used to store applications and data.
  • the application stored in the memory 402 contains executable code.
  • Applications can form various functional modules.
  • the processor 403 executes various functional applications and data processing by running an application stored in the memory 402.
  • the processor 403 is a control center of the mobile terminal, connects various parts of the entire mobile mobile terminal using various interfaces and lines, performs operations by running or executing an application stored in the memory 402, and calling data stored in the memory 402. The various functions of the terminal and processing data to monitor the mobile terminal as a whole.
  • the processor 403 in the mobile terminal loads the executable code corresponding to the process of one or more applications into the memory 402 according to the following instructions, and is stored in the memory by the processor 403.
  • An embodiment of the present application further provides an electronic device.
  • the above electronic device includes an image processing circuit that can be implemented using hardware and/or software components, and can include various processing units that define an Image Signal Processing pipeline.
  • the image processing circuit may at least include: a camera, an image signal processor (ISP), a control logic, an image memory, a display, and the like.
  • the camera may include at least one or more lenses and an image sensor.
  • the image sensor can include a color filter array (such as a Bayer filter).
  • the image sensor can acquire light intensity and wavelength information captured with each imaging pixel of the image sensor and provide a set of raw image data that can be processed by the image signal processor.
  • the image signal processor can process the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the image signal processor may perform one or more image processing operations on the raw image data, collecting statistical information about the image data. Among them, image processing operations can be performed with the same or different bit depth precision.
  • the raw image data can be stored in the image memory after being processed by the image signal processor.
  • the image signal processor can also receive image data from the image memory.
  • the image memory can be part of a memory device, a storage device, or a separate dedicated memory within an electronic device, and can include DMA (Direct Memory Access) features.
  • DMA Direct Memory Access
  • the image signal processor can perform one or more image processing operations, such as time domain filtering.
  • the processed image data can be sent to the image memory for additional processing before being displayed.
  • the image signal processor can also receive processing data from the image memory and process the image data in the original domain and in the RGB and YCbCr color spaces.
  • the processed image data can be output to a display for viewing by a user and/or further processed by a graphics engine or a GPU (Graphics Processing Unit). Additionally, the output of the image signal processor can also be sent to an image memory, and the display can read image data from the image memory.
  • the image memory can be configured to implement one or more frame buffers.
  • the statistics determined by the image signal processor can be sent to the control logic.
  • the statistics may include statistical information of image sensors such as auto exposure, auto white balance, auto focus, flicker detection, black level compensation, lens shading correction, and the like.
  • the control logic can include a processor and/or a microcontroller that executes one or more routines, such as firmware.
  • One or more routines may determine the camera's control parameters and ISP control parameters based on the received statistics.
  • the camera's control parameters may include camera flash control parameters, lens control parameters (eg, focus or zoom focal length), or a combination of these parameters.
  • the ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (eg, during RGB processing), and the like.
  • FIG. 12 is a schematic structural diagram of an image processing circuit in the embodiment. As shown in FIG. 12, for convenience of explanation, only various aspects of the image processing technique related to the embodiment of the present application are shown.
  • the image processing circuit may include a first camera 510, a second camera 520, a first image signal processor 530, a second image signal processor 540, a control logic 550, an image memory 560, and a display 570.
  • the first camera 510 may include one or more first lenses 511 and a first image sensor 512.
  • the second camera 520 can include one or more second lenses 521 and a second image sensor 522.
  • the first camera can be any of a telephoto camera or a wide-angle camera.
  • the second camera can be any of a telephoto camera or a wide-angle camera.
  • the first camera is a wide-angle camera and the second camera is a telephoto camera.
  • the first image acquired by the first camera 510 is transmitted to the first image signal processor 530 for processing.
  • the statistical data of the first image (such as the brightness of the image, the contrast of the image, the color of the image, etc.) may be sent to the control logic 550.
  • the control logic 550 can determine the control parameters of the first camera 510 according to the statistical data, so that the first camera 510 can perform operations such as auto focus, auto exposure, and the like according to the control parameters.
  • the first image is processed by the first image signal processor 530 and stored in the image memory 560.
  • the first image signal processor 530 can also read the image stored in the image memory 560 for processing.
  • the first image is processed by the image signal processor 530 and sent directly to the display 570 for display. Display 570 can also read images in image memory 560 for display.
  • the second image acquired by the second camera 520 is transmitted to the second image signal processor 540 for processing.
  • the statistical data of the second image (such as the brightness of the image, the contrast of the image, the color of the image, etc.) may be sent to the control logic 550.
  • the control logic 550 can determine the control parameters of the second camera 520 according to the statistical data, so that the second camera 520 can perform operations such as auto focus, automatic exposure, and the like according to the control parameters.
  • the second image is processed by the second image signal processor 540 and stored in the image memory 560.
  • the second image signal processor 540 can also read the image stored in the image memory 560 for processing.
  • the second image is processed by the image signal processor 540 and sent directly to the display 570 for display. Display 570 can also read images in image memory 560 for display.
  • the first image signal processor and the second image signal processor may also be synthesized into a unified image signal processor that processes data of the first image sensor and the second image sensor, respectively.
  • the electronic device may further include a CPU and a power supply module.
  • the CPU and the logic controller, the first image signal processor, the second image signal processor, the image memory, and the display are all connected, and the CPU is used to implement global control.
  • the power supply module is used to power each module.
  • a mobile phone with a dual camera module works in both camera modes and dual camera modules.
  • the CPU controls the power supply module to supply power to the first camera and the second camera.
  • the image sensor in the first camera is powered on, and the image sensor in the second camera is powered up, so that image acquisition and conversion can be realized.
  • it can be a camera in a dual camera module.
  • the CPU controls the power supply module to supply power to the image sensor of the corresponding camera.
  • the installation distance of the dual camera module in the terminal can be determined according to the size determination of the terminal and the shooting effect.
  • the two camera modules may be mounted as close as possible, for example, within 10 mm.
  • the following is a flow of a method for processing an image provided by the embodiment in the image processing technology of FIG. 12, wherein the electronic device includes at least a wide-angle camera module and a telephoto camera module:
  • the electronic device when the electronic device performs the preset second processing on the first target image, performing: performing background blur processing on the first target image.
  • the electronic device may further perform: performing a preset third process on the second image to obtain a second target image, where the pixels of the second target image The number of dots is smaller than the number of pixels of the second image.
  • the electronic device when the electronic device performs the acquiring the depth information according to the first target image and the second image, it may be performed to acquire the depth information according to the first target image and the second target image.
  • the electronic device performs the preset third processing on the second image to obtain a second target image, wherein the number of pixels of the second target image is smaller than the pixel of the second image.
  • the quantity may be performed by performing a preset third process on the second image to obtain a second target image, wherein the number of pixels of the second target image is four quarters of the number of pixels of the second image.
  • the electronic image when the electronic device performs the preset third processing on the second image to obtain the second target image, the electronic image may be processed by using the Binning algorithm to obtain the second image. Target image.
  • the electronic device performs the preset first processing on the first image to obtain a first target image, where the number of pixels of the first target image is smaller than the pixel of the first image.
  • the quantity may be performed by performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is two-half of the number of pixels of the first image.
  • the electronic device when the electronic device performs the preset first processing on the first image to obtain the first target image, performing: performing preset first processing on the first image to obtain the first target.
  • An image wherein the preset first process is an image reduction process, or an image cropping process, or a combination of image reduction processing and image cropping processing.
  • the processing device of the image provided by the embodiment of the present application is the same as the processing method of the image in the above embodiment, and any one of the embodiments provided in the processing method of the image may be executed on the processing device of the image.
  • the specific implementation process of the method is described in the embodiment of the image processing method, and details are not described herein again.
  • the computer program can be stored in a computer readable storage medium, such as in a memory, and executed by at least one processor, and can include an implementation of a processing method such as the image during execution.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), a random access memory (RAM), or the like.
  • each functional module may be integrated into one processing chip, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated module if implemented in the form of a software functional module and sold or used as a standalone product, may also be stored in a computer readable storage medium, such as a read only memory, a magnetic disk or an optical disk, etc. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

Disclosed is an image processing method, comprising: acquiring a first image and a second image, the first image being captured by a wide-angle camera module, and the second image being captured by a long-focus camera module; performing preset first processing on the first image to obtain a first target image, wherein a quantity of pixels in the first target image is less than a quantity of pixels in the first image; acquiring depth of field information according to the first target image and the second image; and performing, according to the depth of field information, preset second processing on the first target image.

Description

图像的处理方法、装置、存储介质及电子设备Image processing method, device, storage medium and electronic device

本申请要求于2018年01月31日提交中国专利局、申请号为201810097883.0、申请名称为“图像的处理方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201810097883.0, filed on Jan. 31, 2018, the entire disclosure of which is incorporated herein by reference. Combined in this application.

技术领域Technical field

本申请属于图像技术领域,尤其涉及一种图像的处理方法、装置、存储介质及电子设备。The present application belongs to the field of image technologies, and in particular, to an image processing method, apparatus, storage medium, and electronic device.

背景技术Background technique

随着硬件技术的不断发展,终端上安装的硬件的配置也越来越高。当前,很多终端都搭载了双摄像模组。借助于双摄像模组,终端的拍照水平可以得到较大幅度的提升。比如,采用彩色摄像头与黑白摄像头搭配组成的双摄像模组,可以使终端在拍照时捕捉到更多的细节。而采用两颗彩色摄像头搭配组成的双摄像模组,可以使终端在拍照时拥有双倍的进光量等等。With the continuous development of hardware technology, the configuration of hardware installed on the terminal is also getting higher and higher. Currently, many terminals are equipped with dual camera modules. With the help of the dual camera module, the camera's camera level can be greatly improved. For example, a dual camera module with a color camera and a black and white camera can make the terminal capture more details when taking pictures. The dual camera module with two color cameras can make the terminal have double the amount of light entering when taking pictures.

发明内容Summary of the invention

本申请实施例提供一种图像的处理方法、装置、存储介质及电子设备,可以提高图像的成像质量。Embodiments of the present application provide an image processing method, apparatus, storage medium, and electronic device, which can improve image quality of an image.

本申请实施例提供一种图像的处理方法,应用于终端,所述终端至少包括广角摄像模组和长焦摄像模组,所述方法包括:The embodiment of the present application provides an image processing method, which is applied to a terminal, where the terminal includes at least a wide-angle camera module and a telephoto camera module, and the method includes:

获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;Acquiring the first image and the second image, the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module;

对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;Performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image;

根据所述第一目标图像和所述第二图像,获取景深信息;Obtaining depth information according to the first target image and the second image;

根据所述景深信息,对所述第一目标图像进行预设第二处理。And performing preset second processing on the first target image according to the depth information.

本申请实施例提供一种图像的处理装置,应用于终端,所述终端至少包括广角摄像模组和长焦摄像模组,所述装置包括:An embodiment of the present application provides an image processing apparatus, which is applied to a terminal, where the terminal includes at least a wide-angle camera module and a telephoto camera module, and the device includes:

第一获取模块,用于获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;a first acquiring module, configured to acquire a first image and a second image, where the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module ;

第一处理模块,用于对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;a first processing module, configured to perform a preset first process on the first image, to obtain a first target image, where the number of pixels of the first target image is smaller than the number of pixels of the first image;

第二获取模块,用于根据所述第一目标图像和所述第二图像,获取景深信息;a second acquiring module, configured to acquire depth information according to the first target image and the second image;

第二处理模块,用于根据所述景深信息,对所述第一目标图像进行预设第二处理。The second processing module is configured to perform preset second processing on the first target image according to the depth information.

本申请实施例提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上执行时,使得所述计算机执行本申请实施例提供的图像的处理方法中的流程。The embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer is caused to execute the flow in the image processing method provided by the embodiment of the present application.

本申请实施例还提供一种电子设备,包括存储器,处理器,所述电子设备至少包括广角摄像模组和长焦摄像模组,所述处理器通过调用所述存储器中存储的计算机程序,用于执行:The embodiment of the present application further provides an electronic device, including a memory, a processor, where the electronic device includes at least a wide-angle camera module and a telephoto camera module, and the processor uses a computer program stored in the memory to use For execution:

获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;Acquiring the first image and the second image, the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module;

对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;Performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image;

根据所述第一目标图像和所述第二图像,获取景深信息;Obtaining depth information according to the first target image and the second image;

根据所述景深信息,对所述第一目标图像进行预设第二处理。And performing preset second processing on the first target image according to the depth information.

附图说明DRAWINGS

下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其有益效果显而易见。The technical solutions of the present application and the beneficial effects thereof will be apparent from the detailed description of the specific embodiments of the present application.

图1是本申请实施例提供的图像的处理方法的流程示意图。FIG. 1 is a schematic flowchart diagram of a method for processing an image provided by an embodiment of the present application.

图2为本申请实施例提供的图像的处理方法的另一种流程示意图。FIG. 2 is another schematic flowchart of a method for processing an image according to an embodiment of the present disclosure.

图3是本申请实施例提供的图像的处理方法的又一流程示意图。FIG. 3 is still another schematic flowchart of a method for processing an image provided by an embodiment of the present application.

图4是本申请实施例提供的Skipping算法的执行过程示意图。FIG. 4 is a schematic diagram of an execution process of a Skipping algorithm according to an embodiment of the present application.

图5是本申请实施例提供的Skipping算法的另一执行过程示意图。FIG. 5 is a schematic diagram of another execution process of the Skipping algorithm provided by the embodiment of the present application.

图6是本申请实施例提供的Binning算法的执行过程示意图。FIG. 6 is a schematic diagram of an execution process of a Binning algorithm provided by an embodiment of the present application.

图7至图9是本申请实施例提供的图像的处理方法的场景示意图。FIG. 7 is a schematic diagram of a scenario of an image processing method according to an embodiment of the present application.

图10是本申请实施例提供的图像的处理装置的结构示意图。FIG. 10 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.

图11是本申请实施例提供的移动终端的结构示意图。FIG. 11 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.

图12是本申请实施例提供的电子设备的图像处理电路的结构示意图。FIG. 12 is a schematic structural diagram of an image processing circuit of an electronic device according to an embodiment of the present application.

具体实施方式Detailed ways

请参照图示,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Referring to the drawings, in which like reference numerals represent the same components, the principles of the present application are illustrated by way of example in a suitable computing environment. The following description is based on the specific embodiments of the present invention as illustrated, and should not be construed as limiting the specific embodiments that are not described herein.

可以理解的是,本申请实施例的执行主体可以是诸如智能手机或平板电脑等的终端。It can be understood that the executive body of the embodiment of the present application may be a terminal such as a smart phone or a tablet computer.

本实施例提供一种图像的处理方法,应用于终端,所述终端可以至少包括广角摄像模组和长焦摄像模组,所述方法包括:The embodiment provides an image processing method, which is applied to a terminal, and the terminal may include at least a wide-angle camera module and a telephoto camera module, and the method includes:

获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;Acquiring the first image and the second image, the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module;

对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;Performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image;

根据所述第一目标图像和所述第二图像,获取景深信息;Obtaining depth information according to the first target image and the second image;

根据所述景深信息,对所述第一目标图像进行预设第二处理。And performing preset second processing on the first target image according to the depth information.

在一种实施方式中,所述对所述第一目标图像进行预设第二处理,可以包括:对所述第一目标图像进行背景虚化处理。In an implementation manner, the performing the preset second processing on the first target image may include: performing background blurring processing on the first target image.

在一种实施方式中,在获取到所述第二图像之后,所述方法还可以包括:对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量。In an embodiment, after acquiring the second image, the method may further include: performing a preset third process on the second image to obtain a second target image, wherein the second target image The number of pixels is smaller than the number of pixels of the second image.

那么,所述根据所述第一目标图像和所述第二图像获取景深信息,可以包括:根据所述第一目标图像和所述第二目标图像,获取景深信息。Then, the acquiring the depth information according to the first target image and the second image may include: acquiring depth information according to the first target image and the second target image.

在一种实施方式中,所述对所述第二图像进行预设第三处理得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量,可以包括:对所述第二图像进行预设第三处理,得到所述第二目标图像,其中所述第二目标图像的像素点数量为所述第二图像的像素点数量的四分之一。In an embodiment, the performing a preset third processing on the second image to obtain a second target image, wherein the number of pixels of the second target image is smaller than the number of pixels of the second image, The method includes: performing a preset third process on the second image to obtain the second target image, wherein the number of pixels of the second target image is one quarter of the number of pixels of the second image.

在一种实施方式中,所述对所述第二图像进行预设第三处理得到第二目标图像,可以包括:通过Binning算法,对所述第二图像进行处理,得到所述第二目标图像。In an embodiment, the performing the third processing on the second image to obtain the second target image may include: processing the second image by using a Binning algorithm to obtain the second target image. .

在一种实施方式中,所述对所述第一图像进行预设第一处理得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量,可以包括:对所述第一图像进行预设第一处理,得到所述第一目标图像,其中所述第一目标图像的像素点数量为所述第一图像的像素点数量的二分之一。In an embodiment, the performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image, The method includes: performing a preset first process on the first image to obtain the first target image, wherein the number of pixels of the first target image is one-half of the number of pixels of the first image.

在一种实施方式中,所述对所述第一图像进行预设第一处理得到第一目标图像,可以包括:对所述第一图像进行预设第一处理得到所述第一目标图像,其中所述预设第一处理为图像缩小处理,或者图像裁剪处理,或者图像缩小处理和图像裁剪处理的结合。In an embodiment, the performing the first processing on the first image to obtain the first target image may include: performing a preset first processing on the first image to obtain the first target image, The preset first process is an image reduction process, or an image cropping process, or a combination of image reduction processing and image cropping processing.

请参阅图1和图2,图1是本申请实施例提供的图像的处理方法的流程示意图。该图像的处理方法可以应用于终端。该终端可以是诸如智能手机或平板电脑等搭载有双摄像模组的任何终端。其中该双摄像模组可以是广角摄像模组和长焦摄像模组的组合。该图像的处理方法的流程可以包括:Please refer to FIG. 1 and FIG. 2 . FIG. 1 is a schematic flowchart diagram of a method for processing an image according to an embodiment of the present application. The processing method of the image can be applied to the terminal. The terminal may be any terminal equipped with a dual camera module such as a smartphone or a tablet. The dual camera module can be a combination of a wide-angle camera module and a telephoto camera module. The flow of the image processing method may include:

在101中,获取第一图像和第二图像,该第一图像是由广角摄像模组采集的图像,该第二图像是由长焦摄像模组采集的图像。In 101, a first image and a second image are acquired. The first image is an image captured by a wide-angle camera module, and the second image is an image captured by a telephoto camera module.

随着硬件技术的不断发展,终端上安装的硬件的配置也越来越高。当前,很多终端都搭载了双摄像模组。借助于双摄像模组,终端的拍照水平可以得到较大幅度的提升。比如,采用彩色摄像头与黑白摄像头搭配组成的双摄像模组,可以使终端在拍照时捕捉到更多的细节。而采用两颗彩色摄像头搭配组成的双摄像模组,可以使终端在拍照时拥有双倍的进光量等等。相关技术中,利用长焦镜头采集到的图像进行成像时,其成像效果差。With the continuous development of hardware technology, the configuration of hardware installed on the terminal is also getting higher and higher. Currently, many terminals are equipped with dual camera modules. With the help of the dual camera module, the camera's camera level can be greatly improved. For example, a dual camera module with a color camera and a black and white camera can make the terminal capture more details when taking pictures. The dual camera module with two color cameras can make the terminal have double the amount of light entering when taking pictures. In the related art, when an image acquired by a telephoto lens is used for imaging, the imaging effect is poor.

在本申请实施例的101中,终端可以先获取第一图像和第二图像。其中该终端可以是搭载有广角摄像模组和长焦摄像模组的终端,该第一图像是由终端上的广角摄像模组采集到的,该第二图像是由终端上的长焦摄像模组采集到的。In the 101 of the embodiment of the present application, the terminal may first acquire the first image and the second image. The terminal may be a terminal equipped with a wide-angle camera module and a telephoto camera module. The first image is captured by a wide-angle camera module on the terminal, and the second image is a telephoto camera module on the terminal. Collected by the group.

在102中,对该第一图像进行预设第一处理,得到第一目标图像,其中该第一目标图像的像素点数量小于该第一图像的像素点数量。In 102, a preset first process is performed on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image.

比如,在获取到由广角摄像模组采集到的第一图像后,终端可以对该第一图像进行预设第一处理,从而得到第一目标图像。其中该第一目标图像的像素点数量可以小于该第一图像的像素点数量。For example, after acquiring the first image collected by the wide-angle camera module, the terminal may perform a preset first process on the first image, thereby obtaining a first target image. The number of pixels of the first target image may be smaller than the number of pixels of the first image.

例如,终端上的广角摄像模组为1600万像素的摄像模组,则该广角摄像模组采集到的第一图像的像素点数量为1600万。那么,在获取到该第一图像后,终端可以对该第一图像进行预设第一处理,该预设第一处理可以降低第一图像的像素点数量。例如,通过预设第一处理,终端将该第一图像的像素点数量由1600万像素降低到800万像素,即得到的第 一目标图像的像素点数量为800万。For example, if the wide-angle camera module on the terminal is a 16-megapixel camera module, the number of pixels of the first image collected by the wide-angle camera module is 16 million. Then, after acquiring the first image, the terminal may perform a preset first process on the first image, where the preset first process may reduce the number of pixels of the first image. For example, by presetting the first process, the terminal reduces the number of pixels of the first image from 16 million pixels to 8 million pixels, that is, the number of pixels of the first target image obtained is 8 million.

在103中,根据该第一目标图像和该第二图像,获取景深信息。In 103, depth information is acquired based on the first target image and the second image.

比如,在得到第一目标图像后,终端可以根据该第一目标图像和第二图像,获取景深信息。需要说明的是,该景深信息是相对于图像中的对焦物体而言的,是在确定出对焦物体后获取到的景深信息。For example, after obtaining the first target image, the terminal may acquire the depth information according to the first target image and the second image. It should be noted that the depth of field information is relative to the in-focus object in the image, and is the depth of field information acquired after the in-focus object is determined.

在104中,根据该景深信息,对该第一目标图像进行预设第二处理。In 104, a preset second process is performed on the first target image according to the depth of field information.

比如,在获取到景深信息后,终端可以根据该景深信息,对第一目标图像进行预设第二处理。For example, after acquiring the depth information, the terminal may perform a preset second processing on the first target image according to the depth information.

在一些实施方式中,该预设第二处理可以是诸如背景虚化以及图像的3D应用处理等。In some embodiments, the preset second process may be a 3D application process such as background blurring and images.

可以理解的是,相比于长焦摄像模组,利用广角摄像模组采集到的图像进行成像其成像效果更好,尤其是在暗光环境下。本实施例中,第一图像是由广角摄像模组采集到的图像,而第一目标图像是由第一图像降低像素点得到的图像,因此根据该第一目标图像进行成像,其成像效果好。特别是在暗光环境下,使用本实施例中的技术方案可以提高成像效果。It can be understood that compared with the telephoto camera module, the image acquired by the wide-angle camera module is used for imaging, and the imaging effect is better, especially in a dark environment. In this embodiment, the first image is an image acquired by the wide-angle camera module, and the first target image is an image obtained by lowering the pixel point of the first image, so the imaging is performed according to the first target image, and the imaging effect is good. . Especially in a dim light environment, the imaging effect can be improved by using the technical solution in this embodiment.

另外,由于用于成像的第一目标图像是由第一图像经过降低像素点数量得到的,因此利用该第一目标图像进行成像,其图像处理速度更快。In addition, since the first target image for imaging is obtained by reducing the number of pixels of the first image, imaging is performed using the first target image, and the image processing speed is faster.

同时,由于本实施例利用第一目标图像和第二图像获取景深信息,即利用双摄像模组采集到的图像获取景深信息,因此该景深信息更准确。因此,利用该景深信息对第一目标图像进行处理,可以使得处理得到的图像成像效果更好。At the same time, since the first target image and the second image are used to obtain the depth information, that is, the image acquired by the dual camera module is used to acquire the depth information, the depth information is more accurate. Therefore, using the depth of field information to process the first target image can make the processed image image better.

请参阅图3,图3为本申请实施例提供的图像的处理方法的又一流程示意图。该图像的处理方法可以应用于终端。该终端可以是诸如智能手机或平板电脑等搭载有双摄像模组的任何终端。其中该双摄像模组可以是广角摄像模组和长焦摄像模组的组合。该图像的处理方法的流程可以包括:Please refer to FIG. 3. FIG. 3 is still another schematic flowchart of a method for processing an image according to an embodiment of the present disclosure. The processing method of the image can be applied to the terminal. The terminal may be any terminal equipped with a dual camera module such as a smartphone or a tablet. The dual camera module can be a combination of a wide-angle camera module and a telephoto camera module. The flow of the image processing method may include:

在201中,终端获取第一图像和第二图像,该第一图像是由广角摄像模组采集的图像,该第二图像是由长焦摄像模组采集的图像。In 201, the terminal acquires the first image and the second image, the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module.

比如,终端可以先获取第一图像和第二图像。其中该终端可以是搭载有广角摄像模组和长焦摄像模组的终端,该第一图像是由终端上的广角摄像模组采集到的,该第二图像是由终端上的长焦摄像模组采集到的。For example, the terminal may first acquire the first image and the second image. The terminal may be a terminal equipped with a wide-angle camera module and a telephoto camera module. The first image is captured by a wide-angle camera module on the terminal, and the second image is a telephoto camera module on the terminal. Collected by the group.

在202中,终端对该第一图像进行预设第一处理,得到第一目标图像,其中该第一目标图像的像素点数量为该第一图像的像素点数量的二分之一。In 202, the terminal performs a preset first process on the first image to obtain a first target image, where the number of pixels of the first target image is one-half of the number of pixels of the first image.

比如,在获取到由广角摄像模组采集到的第一图像后,终端可以对该第一图像进行预设第一处理,从而得到第一目标图像。其中该第一目标图像的像素点数量为该第一图像的像素点数量的二分之一。For example, after acquiring the first image collected by the wide-angle camera module, the terminal may perform a preset first process on the first image, thereby obtaining a first target image. The number of pixels of the first target image is one-half of the number of pixels of the first image.

例如,终端上的广角摄像模组为1600万像素的摄像模组,则该广角摄像模组采集到的第一图像的像素点数量为1600万。那么,在获取到该第一图像后,终端可以对该第一图像进行预设第一处理,该预设第一处理可以将第一图像的像素点数量降低一半。例如,通过预设第一处理,终端将该第一图像的像素点数量由1600万像素降低到800万像素,即得到的第一目标图像的像素点数量为800万。For example, if the wide-angle camera module on the terminal is a 16-megapixel camera module, the number of pixels of the first image collected by the wide-angle camera module is 16 million. Then, after acquiring the first image, the terminal may perform a preset first process on the first image, where the preset first process may reduce the number of pixels of the first image by half. For example, by preset the first process, the terminal reduces the number of pixels of the first image from 16 million pixels to 8 million pixels, that is, the obtained number of pixels of the first target image is 8 million.

在一些实施方式中,202中终端对该第一图像进行预设第一处理,得到第一目标图像的流程,可以包括:In some embodiments, the process of the terminal performing the preset first processing on the first image in the 202 to obtain the first target image may include:

终端对该第一图像进行预设第一处理,得到第一目标图像,其中该预设第一处理为图像缩小处理,或者图像裁剪处理,或者图像缩小处理和图像裁剪处理的结合。The terminal performs a preset first process on the first image to obtain a first target image, where the preset first process is image reduction process, or image cropping process, or a combination of image reduction process and image cropping process.

比如,预设第一处理为图像缩小处理。终端可以通过图像缩放算法,对该第一图像进行图像缩小处理,从而降低该第一图像的分辨率。例如,图像缩放算法可以是二次线性插值算法、三次线性插值算法或者三次卷积插值算法等。For example, the preset first process is image reduction processing. The terminal may perform image reduction processing on the first image by an image scaling algorithm, thereby reducing the resolution of the first image. For example, the image scaling algorithm may be a quadratic linear interpolation algorithm, a cubic linear interpolation algorithm, or a cubic convolution interpolation algorithm.

在另一种实施方式中,终端也可以通过Skipping算法,对该第一图像进行像素抽取处理,从而缩小该第一图像,降低该第一图像的分辨率。In another implementation manner, the terminal may perform pixel extraction processing on the first image by using a Skipping algorithm, thereby reducing the first image and reducing the resolution of the first image.

请参阅图4和图5,本实施例中Skipping算法的执行过程可以包括如下两种方式:行抽取(Row Skip 2X)和列抽取(Column Skip 2X)。其中Skipping算法在抽取像素时,是成对抽取的。图4所示的方式为行抽取(Row Skip 2X)的方式,其中带背景色的像素为存在的像素,不带背景色的像素为将被抽取掉的像素。图5所示的方式为列抽取(Column Skip 2X)的方式,其中带背景色的像素为存在的像素,不带背景色的像素为将被抽取掉的像素。由图4和图5可知,按照行抽取(Row Skip 2X)或列抽取(Column Skip 2X),对第一图像进行像素抽取后,得到的第一目标图像的像素数量为第一图像的像素数量的二分之一。Referring to FIG. 4 and FIG. 5, the execution process of the Skipping algorithm in this embodiment may include the following two methods: row extraction (Row Skip 2X) and column extraction (Column Skip 2X). The Skipping algorithm extracts pixels in pairs. The mode shown in FIG. 4 is a row drawing (Row Skip 2X) method in which pixels with a background color are existing pixels, and pixels without a background color are pixels to be extracted. The mode shown in FIG. 5 is a column extraction (Column Skip 2X) in which pixels with a background color are existing pixels, and pixels without a background color are pixels to be extracted. 4 and FIG. 5, after performing pixel extraction on the first image according to row extraction (Row Skip 2X) or column extraction (Column Skip 2X), the number of pixels of the first target image obtained is the number of pixels of the first image. One-half.

比如,预设第一处理为图像裁剪处理(crop)。例如,在对第一图像进行图像裁剪处理时,终端可以仅保留第一图像中预设尺寸(预设大小)的区域,其它区域则裁剪掉。可以理解的是,将第一图像的部分区域裁剪掉,即可实现像素点数量的减少,从而减少图像处理的数据量。For example, the preset first process is an image cropping process (crop). For example, when performing image cropping processing on the first image, the terminal may only retain the area of the preset size (preset size) in the first image, and the other areas are cropped. It can be understood that by cutting a partial area of the first image, the number of pixels can be reduced, thereby reducing the amount of data processed by the image.

在一种实施方式中,由于广角摄像模组采集到的图像,其四周存在一定程度的畸变,因此终端可以将第一图像的四周裁减掉,而保留成像效果较佳的中间区域,该中间区域的大小为上述预设尺寸。其中该预设尺寸可以根据实际使用需求进行设定。例如,可以根据广角摄像模组的成像参数(如摄像模组的分辨率)以及采集图像时的环境参数等因素来设定或调整预设尺寸。In an embodiment, due to the image captured by the wide-angle camera module, there is a certain degree of distortion around the image, so the terminal can cut off the periphery of the first image, and retain the intermediate region with better imaging effect. The size is the above preset size. The preset size can be set according to actual usage requirements. For example, the preset size can be set or adjusted according to factors such as imaging parameters of the wide-angle camera module (such as the resolution of the camera module) and environmental parameters when the image is acquired.

比如,预设第一处理也可以是图像缩小处理和图像裁剪处理的结合。例如,终端可以先将的第一图像缩小,然后再将第一图像的四周存在畸变的区域裁剪掉。或者,终端也可以先将第一图像的四周存在畸变的区域裁减掉,再将裁剪后的图像缩小,从而得到第一目标图像。For example, the preset first process may also be a combination of image reduction processing and image cropping processing. For example, the terminal may first reduce the first image, and then crop the area around the first image that is distorted. Alternatively, the terminal may first cut off the distorted area around the first image, and then reduce the cropped image to obtain the first target image.

不论采取上述何种方式,本实施例中得到的第一目标图像的像素点数量可以为第一图像的像素点数量的二分之一。Regardless of the above manner, the number of pixels of the first target image obtained in this embodiment may be one-half of the number of pixels of the first image.

在203中,通过Binning算法,终端对该第二图像进行处理,得到第二目标图像,其中该第二目标图像的像素点数量为该第二图像的像素点数量的四分之一。In 203, the terminal processes the second image by using the Binning algorithm to obtain a second target image, wherein the number of pixels of the second target image is one quarter of the number of pixels of the second image.

比如,在获取到由长焦摄像模组采集到的第二图像后,终端可以对该第二图像进行预设第三处理,从而得到第二目标图像。其中,该第二目标图像的像素点数量可以小于该第二图像的像素点数量。在一种实施方式中,该第二目标图像的像素点数量可以为该第二图像的像素点数量的四分之一。For example, after acquiring the second image acquired by the telephoto camera module, the terminal may perform a preset third process on the second image to obtain a second target image. The number of pixels of the second target image may be smaller than the number of pixels of the second image. In an embodiment, the number of pixels of the second target image may be one quarter of the number of pixels of the second image.

在本实施例中,终端可以通过Binning算法,对该第二图像进行处理,得到第二目标 图像。In this embodiment, the terminal may process the second image by using a Binning algorithm to obtain a second target image.

例如,终端上的长焦摄像模组为2000万像素的摄像模组,则该长焦摄像模组采集到的第二图像的像素点数量为2000万。那么,在获取到该第二图像后,终端可以通过Binning算法对该第二图像进行处理,得到第二目标图像,其中该第二目标图像的像素点数量为500万。For example, if the telephoto camera module on the terminal is a 20 megapixel camera module, the number of pixels of the second image captured by the telephoto camera module is 20 million. Then, after acquiring the second image, the terminal may process the second image by using a Binning algorithm to obtain a second target image, where the number of pixels of the second target image is 5 million.

需要说明的是,Binning算法是将相同颜色的相邻像素单元对应的电荷加在一起,以一个像素的模式读出。本实施例中可以采用将四个相同颜色的相邻像素单元对应的电荷加在一起,以一个像素的模式读出。即,每四个相同颜色的相邻像素单元合并为一个像素单元。像素合并的过程可以如图6所示。It should be noted that the Binning algorithm adds charges corresponding to adjacent pixel units of the same color and reads them in a one-pixel mode. In this embodiment, charges corresponding to four adjacent pixel units of the same color may be added together and read out in a pattern of one pixel. That is, each of four adjacent pixel units of the same color is combined into one pixel unit. The process of pixel merging can be as shown in FIG. 6.

其中,在像素值大小方面,以绿色像素的像素值大小为例,Gr00’=(Gr00+Gr10+Gr01+Gr11)/4,Gr10’=(Gr20+Gr30+Gr21+Gr31)/4,Gr01’=(Gr02+Gr12+Gr03+Gr13)/4,Gr11’=(Gr22+Gr32+Gr23+Gr33)/4。同理,像素合并后,红色像素和蓝色像素的像素值大小也是相同颜色的相邻像素单元的像素值的均值。Wherein, in terms of the pixel value size, taking the pixel value of the green pixel as an example, Gr00'=(Gr00+Gr10+Gr01+Gr11)/4, Gr10'=(Gr20+Gr30+Gr21+Gr31)/4, Gr01' = (Gr02 + Gr12 + Gr03 + Gr13) / 4, Gr11' = (Gr22 + Gr32 + Gr23 + Gr33) / 4. Similarly, after the pixels are merged, the pixel values of the red and blue pixels are also the average of the pixel values of the adjacent pixel units of the same color.

需要说明的是,采用Binning算法降低图像的像素点数量可以使得处理后的图像具有信噪比高的优点,因此本实施例通过Binning算法降低第二图像的像素点数量得到第二目标图像,可以使得第二目标图像的成像质量更好,从而使得后续根据第一目标图像和第二目标图像获取到的景深信息更准确。It should be noted that reducing the number of pixels of the image by using the Binning algorithm can make the processed image have the advantage of high signal-to-noise ratio. Therefore, the Binning algorithm reduces the number of pixels of the second image to obtain the second target image. The imaging quality of the second target image is made better, so that the depth information acquired subsequently from the first target image and the second target image is more accurate.

此外,通过Binning算法可以使第二图像的像素点数量下降到原像素点数量的四分之一,因此可以加快本实施例中的图像处理的速度。In addition, the number of pixels of the second image can be reduced to one quarter of the number of original pixels by the Binning algorithm, so that the speed of image processing in the present embodiment can be accelerated.

在204中,根据该第一目标图像和该第二目标图像,终端获取景深信息。In 204, the terminal acquires the depth information according to the first target image and the second target image.

比如,在得到第一目标图像和第二目标图像后,终端可以根据该第一目标图像和第二目标图像,获取景深信息。需要说明的是,该景深信息是相对于图像中的对焦物体而言的,是在确定出对焦物体后获取到的景深信息。For example, after obtaining the first target image and the second target image, the terminal may acquire the depth information according to the first target image and the second target image. It should be noted that the depth of field information is relative to the in-focus object in the image, and is the depth of field information acquired after the in-focus object is determined.

在205中,根据该景深信息,终端对该第一目标图像进行背景虚化处理。In 205, according to the depth of field information, the terminal performs background blurring processing on the first target image.

比如,在获取到对应的景深信息后,终端可以根据该景深信息,对第一目标图像进行背景虚化处理。For example, after obtaining the corresponding depth of field information, the terminal may perform background blur processing on the first target image according to the depth information.

可以理解的是,本实施例中,第一目标图像是由第一图像经过降低像素点数量得到的,而第二目标图像是由第二图像经过降低像素点数量得到的,因此利用该第一目标图像和第二目标图像获取景深信息的速度更快,并且利用第一目标图像进行成像时,终端的图像处理速度也更快。此外,根据该第一目标图像和该第二目标图像获取到的景深信息也更加准确,根据该景深信息进行背景虚化,其虚化效果更好。综上,本实施例可以提高图像的成像质量。It can be understood that, in this embodiment, the first target image is obtained by reducing the number of pixels of the first image, and the second target image is obtained by reducing the number of pixels by the second image, thereby utilizing the first image. The target image and the second target image acquire the depth of field information faster, and when the first target image is used for imaging, the image processing speed of the terminal is also faster. In addition, the depth of field information acquired according to the first target image and the second target image is also more accurate, and the background blur is performed according to the depth information, and the blurring effect is better. In summary, the embodiment can improve the image quality of an image.

在一种实施方式中,在201中终端获取第一图像和第二图像之后,本实施例还可以包括如下流程:In an embodiment, after the terminal acquires the first image and the second image in 201, the embodiment may further include the following process:

终端获取运行内存总容量,以及当前被占用的运行内存容量;The terminal obtains the total running memory capacity and the currently occupied running memory capacity;

终端获取该当前被占用的运行内存容量在该运行内存总容量中所占的比例。The terminal obtains the proportion of the currently occupied running memory capacity in the total running memory capacity.

那么,终端对该第一图像进行预设第一处理得到第一目标图像的流程,可以包括:若检测到该比例达到预设阈值,则终端对该第一图像进行预设第一处理,得到第一目标图像。 比如,若检测到该比例达到预设阈值,则终端对该第一图像进行图像缩小处理,从而得到第一目标图像。Then, the process of the terminal performing the first processing on the first image to obtain the first target image may include: if the ratio is detected to reach the preset threshold, the terminal performs the preset first processing on the first image, to obtain The first target image. For example, if it is detected that the ratio reaches a preset threshold, the terminal performs image reduction processing on the first image, thereby obtaining a first target image.

比如,当检测到用户打开相机应用后,终端可以获取本终端的运行内存(RAM)总容量,以及当前被占用的运行内存容量。然后,终端可以计算该当前被占用的运行内存容量在该运行内存总容量中所占的比例。之后,终端可以检测该比例是否达到预设阈值。For example, when it is detected that the user opens the camera application, the terminal can acquire the total running memory (RAM) capacity of the terminal and the currently occupied running memory capacity. Then, the terminal can calculate the proportion of the currently occupied running memory capacity in the total running memory capacity. After that, the terminal can detect whether the ratio reaches a preset threshold.

如果终端检测到该比例未达到预设阈值,那么终端可以执行其它操作。例如,终端的运行内存总容量为4GB,而当前被占用的运行内存容量为2GB,则该当前被占用的运行内存容量占终端的运行内存总容量的比例为50%。例如,预设阈值为80%。那么,终端可以检测到该比例50%小于预设阈值80%。在这种情况下,终端可以执行其它操作,如终端按照正常的流程采集图像。If the terminal detects that the ratio does not reach the preset threshold, the terminal can perform other operations. For example, if the total running memory capacity of the terminal is 4 GB, and the currently occupied running memory capacity is 2 GB, the current occupied running memory capacity accounts for 50% of the total running memory capacity of the terminal. For example, the preset threshold is 80%. Then, the terminal can detect that the ratio is 50% less than the preset threshold of 80%. In this case, the terminal can perform other operations, such as the terminal collecting images according to a normal process.

如果终端检测到该比例达到预设阈值,例如,终端的运行内存总容量为4GB,而当前被占用的运行内存容量为3.4GB,则该当前被占用的运行内存容量占终端的运行内存总容量的比例为85%。例如,预设阈值为80%。那么,终端可以检测到该比例85%大于预设阈值80%。在这种情况下,可以认为当前终端剩余的运行内存较小。为了避免图像处理占用过多运行内存资源,终端可以采用本实施例中提供的图像处理方法,从而提高图像处理速度。比如,终端可以对该第一图像进行图像缩小处理,以降低该第一图像的像素点数量,得到第一目标图像。并且,终端可以降低第二图像的像素点数量,得到第二目标图像。然后终端可以根据第一目标图像和第二目标图像获取景深信息,并根据该景深信息对第一目标图像进行背景虚化处理。If the terminal detects that the ratio reaches a preset threshold, for example, the total running memory capacity of the terminal is 4 GB, and the currently occupied running memory capacity is 3.4 GB, the currently occupied running memory capacity accounts for the total running memory capacity of the terminal. The ratio is 85%. For example, the preset threshold is 80%. Then, the terminal can detect that the ratio is 85% greater than the preset threshold of 80%. In this case, it can be considered that the remaining running memory of the current terminal is small. In order to prevent the image processing from occupying too much running memory resources, the terminal can adopt the image processing method provided in this embodiment, thereby improving the image processing speed. For example, the terminal may perform image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image. Moreover, the terminal can reduce the number of pixels of the second image to obtain a second target image. Then, the terminal may acquire depth of field information according to the first target image and the second target image, and perform background blurring processing on the first target image according to the depth information.

在一种实施方式中,在201中终端获取第一图像和第二图像的流程之后,本实施例还可以包括如下流程:In an embodiment, after the process of acquiring the first image and the second image by the terminal in 201, the embodiment may further include the following process:

终端获取剩余电量值。The terminal obtains the remaining power value.

那么,终端对该第一图像进行预设第一处理得到第一目标图像的流程,可以包括:若检测到该剩余电量值低于预设电量阈值,则终端对该第一图像进行预设第一处理,得到第一目标图像。比如,若检测到该剩余电量值低于预设电量阈值,则终端对该第一图像进行图像缩小处理,以降低该第一图像的像素点数量,得到第一目标图像。Then, the process of the terminal performing the first processing on the first image to obtain the first target image may include: if the remaining power value is lower than the preset power threshold, the terminal presets the first image. Upon processing, a first target image is obtained. For example, if it is detected that the remaining power value is lower than the preset power threshold, the terminal performs image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image.

比如,当检测到用户打开相机应用后,终端可以获取本终端当前的剩余电量值。之后,终端可以检测该剩余电量值是否低于预设电量阈值。For example, when it is detected that the user opens the camera application, the terminal can obtain the current remaining power value of the terminal. After that, the terminal can detect whether the remaining power value is lower than the preset power threshold.

如果终端检测到该剩余电量值不会低于预设电量阈值,那么终端可以执行其它操作。例如,终端当前的剩余电量值为80%。而预设电量阈值为30%。在这种情况下,终端可以执行其它操作,如终端按照正常的流程采集图像。If the terminal detects that the remaining power value is not lower than the preset power threshold, the terminal can perform other operations. For example, the current remaining battery value of the terminal is 80%. The default power threshold is 30%. In this case, the terminal can perform other operations, such as the terminal collecting images according to a normal process.

如果终端检测到该剩余电量值低于预设电量阈值,例如,终端的剩余电量值为29%,而预设电量阈值为30%。在这种情况下,可以认为当前终端剩余电量较低。为了避免图像处理消耗过多的电量,终端可以采用本实施例中提供的图像处理方法,从而提高图像处理速度。比如,终端可以对该第一图像进行图像缩小处理,以降低该第一图像的像素点数量,得到第一目标图像。并且,终端可以降低第二图像的像素点数量,得到第二目标图像。然后终端可以根据第一目标图像和第二目标图像获取景深信息,并根据该景深信息对第一目标图像进行背景虚化处理。If the terminal detects that the remaining power value is lower than the preset power threshold, for example, the remaining power value of the terminal is 29%, and the preset power threshold is 30%. In this case, it can be considered that the current remaining capacity of the terminal is low. In order to prevent the image processing from consuming too much power, the terminal can adopt the image processing method provided in this embodiment, thereby improving the image processing speed. For example, the terminal may perform image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image. Moreover, the terminal can reduce the number of pixels of the second image to obtain a second target image. Then, the terminal may acquire depth of field information according to the first target image and the second target image, and perform background blurring processing on the first target image according to the depth information.

在另一些实施方式中,终端在检测到剩余电量值不低于预设电量阈值的情况下,还可以进一步获取剩余电量值与预设电量阈值之间的差值。如果该差值小于预设差值,那么终端可以获取当前驻留在后台的应用数量。In other implementations, the terminal may further obtain a difference between the remaining power value and the preset power threshold after detecting that the remaining power value is not lower than the preset power threshold. If the difference is less than the preset difference, the terminal can acquire the number of applications currently camping in the background.

若该数量未达到预设数值,那么终端可以执行其它操作。If the number does not reach the preset value, the terminal can perform other operations.

若该数量达到预设数值,那么可以认为终端的电量消耗会较快。此时,终端也可以采用本实施例中提供的图像处理方法,从而提高图像处理速度,较低功耗。比如,终端可以对该第一图像进行图像缩小处理,以降低该第一图像的像素点数量,得到第一目标图像。并且,终端可以降低第二图像的像素点数量,得到第二目标图像。然后终端可以根据第一目标图像和第二目标图像获取景深信息,并根据该景深信息对第一目标图像进行背景虚化处理。If the number reaches the preset value, then the power consumption of the terminal can be considered to be faster. At this time, the terminal can also adopt the image processing method provided in this embodiment, thereby improving image processing speed and lower power consumption. For example, the terminal may perform image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image. Moreover, the terminal can reduce the number of pixels of the second image to obtain a second target image. Then, the terminal may acquire depth of field information according to the first target image and the second target image, and perform background blurring processing on the first target image according to the depth information.

请参阅图7至图9,图7至图9为本申请实施例提供的图像的处理方法的场景及流程示意图。Please refer to FIG. 7 to FIG. 9 , which are schematic diagrams of a scenario and a flow of an image processing method according to an embodiment of the present application.

比如,如图7所示,终端上安装有双摄像模组10,该双摄像模组10包括第一摄像模组11和第二摄像模组12。在一种实施方式中,双摄像模组中的两颗摄像头可以是横向并排排列(如图7所示)。在另一种实施方式中,双摄像模组中的两颗摄像头也可以是纵向并列排列。例如,在本实施例中,该第一摄像模组11为广角摄像模组,该第二摄像模组12为长焦摄像模组。该第一摄像模组11和该第二摄像模组12可以同步采集图像。For example, as shown in FIG. 7 , a dual camera module 10 is mounted on the terminal, and the dual camera module 10 includes a first camera module 11 and a second camera module 12 . In one embodiment, the two cameras in the dual camera module may be arranged side by side in a lateral direction (as shown in FIG. 7). In another embodiment, the two cameras in the dual camera module may also be arranged side by side in the longitudinal direction. For example, in the embodiment, the first camera module 11 is a wide-angle camera module, and the second camera module 12 is a telephoto camera module. The first camera module 11 and the second camera module 12 can simultaneously acquire images.

比如,用户打开了相机应用,并准备拍摄照片,此时终端界面进入图像预览界面。在终端的显示屏幕上将显示用于供用户预览的图像。需要说明的是,在一种实施方式中,在用户点击拍照按钮前,终端的双摄像模组会快速采集图像,并将该图像保存在存储器的缓存队列中,以及显示在屏幕上供用户预览,如图8所示。例如,终端缓存队列中会保存第一摄像模组最近采集到的6帧图像,以及第二摄像模组最近采集到的6帧图像。For example, the user opens the camera application and is ready to take a photo, at which point the terminal interface enters the image preview interface. An image for preview by the user will be displayed on the display screen of the terminal. It should be noted that, in an implementation manner, before the user clicks the camera button, the dual camera module of the terminal quickly collects the image, saves the image in a buffer queue of the memory, and displays the image on the screen for the user to preview. As shown in Figure 8. For example, the terminal buffer queue stores 6 frames of images recently acquired by the first camera module and 6 frames of images recently acquired by the second camera module.

之后,用户点击了拍照按钮,如图8所示。在检测到用户点击拍照按钮后,终端可以获取由广角摄像模组采集的第一图像,并获取由长焦摄像模组采集的第二图像。在一种实施方式中,第一图像可以是在用户点击拍照按钮前采集到的图像,也可以是在用户点击拍照按钮后采集到的图像。而第二图像可以是在用户点击拍照按钮前采集到的图像,也可以是在用户点击拍照按钮后采集到的图像。例如,本实施例中,第一图像和第二图像均是在用户点击拍照按钮后同步采集到的图像。After that, the user clicks on the camera button as shown in FIG. After detecting that the user clicks the camera button, the terminal can acquire the first image captured by the wide-angle camera module and acquire the second image captured by the telephoto camera module. In an embodiment, the first image may be an image collected before the user clicks the camera button, or may be an image collected after the user clicks the camera button. The second image may be an image acquired before the user clicks the camera button, or may be an image acquired after the user clicks the camera button. For example, in this embodiment, the first image and the second image are images that are synchronously acquired after the user clicks the photo button.

在获取到第一图像和第二图像后,终端可以对该第一图像进行图像缩小处理,以降低该第一图像的像素点数量,得到第一目标图像,其中该第一目标图像的像素点数量为该第一图像的像素点数量的二分之一。并且,终端可以通过Binning算法,终端降低该第二图像的像素点数量,得到第二目标图像。例如,第一图像的像素点数量为1600万,对第一图像进行图像缩小处理后得到的第一目标图像的像素点数量为800万。第二图像的像素点数量为2000万,通过Binning算法对该第二图像进行处理后得到的第二目标图像的像素点数量为500万。After acquiring the first image and the second image, the terminal may perform image reduction processing on the first image to reduce the number of pixels of the first image to obtain a first target image, where the pixel of the first target image The number is one-half the number of pixels of the first image. Moreover, the terminal can reduce the number of pixels of the second image by using a Binning algorithm to obtain a second target image. For example, the number of pixels of the first image is 16 million, and the number of pixels of the first target image obtained by performing image reduction processing on the first image is 8 million. The number of pixels of the second image is 20 million, and the number of pixels of the second target image obtained by processing the second image by the Binning algorithm is 5 million.

在得到第一目标图像和第二目标图像后,终端可以根据该第一目标图像和该第二目标图像,获取景深信息,然后终端可以根据该景深信息对第一目标图像进行背景虚化处理,得到输出图像,其中的流程示意图可以参阅图9。After obtaining the first target image and the second target image, the terminal may obtain the depth information according to the first target image and the second target image, and then the terminal may perform background blur processing on the first target image according to the depth information. An output image is obtained, and a schematic diagram of the flow can be seen in FIG.

本实施例提供一种图像的处理装置,应用于终端,所述终端至少包括广角摄像模组和长焦摄像模组,所述装置包括:The embodiment provides an image processing device, which is applied to a terminal, and the terminal includes at least a wide-angle camera module and a telephoto camera module, and the device includes:

第一获取模块,用于获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;a first acquiring module, configured to acquire a first image and a second image, where the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module ;

第一处理模块,用于对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;a first processing module, configured to perform a preset first process on the first image, to obtain a first target image, where the number of pixels of the first target image is smaller than the number of pixels of the first image;

第二获取模块,用于根据所述第一目标图像和所述第二图像,获取景深信息;a second acquiring module, configured to acquire depth information according to the first target image and the second image;

第二处理模块,用于根据所述景深信息,对所述第一目标图像进行预设第二处理。The second processing module is configured to perform preset second processing on the first target image according to the depth information.

在一种实施方式中,所述第二处理模块可以用于:对所述第一目标图像进行背景虚化处理。In an embodiment, the second processing module may be configured to perform background blurring processing on the first target image.

在一种实施方式中,所述第一处理模块还可以用于:对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量。In an embodiment, the first processing module may be further configured to perform a preset third process on the second image to obtain a second target image, where the number of pixels of the second target image is smaller than The number of pixels of the second image.

那么,所述第二获取模块,可以用于:根据所述第一目标图像和所述第二目标图像,获取景深信息。Then, the second acquiring module may be configured to: acquire depth information according to the first target image and the second target image.

在一种实施方式中,所述第一处理模块可以用于:对所述第二图像进行预设第三处理,得到所述第二目标图像,其中所述第二目标图像的像素点数量为所述第二图像的像素点数量的四分之一。In an embodiment, the first processing module may be configured to: perform a preset third process on the second image to obtain the second target image, where the number of pixels of the second target image is The fourth image has a quarter of the number of pixels.

在一种实施方式中,所述第一处理模块可以用于:通过Binning算法,对所述第二图像进行处理,得到所述第二目标图像。In an embodiment, the first processing module may be configured to: process the second image by using a Binning algorithm to obtain the second target image.

在一种实施方式中,第一处理模块可以用于:对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量为所述第一图像的像素点数量的二分之一。In an embodiment, the first processing module may be configured to: perform a preset first process on the first image to obtain a first target image, where the number of pixels of the first target image is the first One-half the number of pixels in the image.

在一种实施方式中,第一处理模块可以用于:对所述第一图像进行预设第一处理得到第一目标图像,其中所述预设第一处理为图像缩小处理,或者图像裁剪处理,或者图像缩小处理和图像裁剪处理的结合。In an embodiment, the first processing module may be configured to: perform preset first processing on the first image to obtain a first target image, where the preset first processing is image reduction processing, or image cropping processing , or a combination of image reduction processing and image cropping processing.

请参阅图10,图10为本申请实施例提供的图像的处理装置的结构示意图。该图像的处理装置可以应用于终端。该终端可以是诸如智能手机或平板电脑等搭载有双摄像模组的任何电子设备。其中该双摄像模组可以是广角摄像模组和长焦摄像模组的组合。图像的处理装置300可以包括:第一获取模块301,第一处理模块302,第二获取模块303,以及第二处理模块304。Please refer to FIG. 10 , which is a schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure. The processing device of the image can be applied to the terminal. The terminal may be any electronic device such as a smartphone or tablet that is equipped with a dual camera module. The dual camera module can be a combination of a wide-angle camera module and a telephoto camera module. The image processing apparatus 300 may include: a first obtaining module 301, a first processing module 302, a second obtaining module 303, and a second processing module 304.

第一获取模块301,用于获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像。a first acquiring module 301, configured to acquire a first image and a second image, where the first image is an image captured by the wide-angle camera module, and the second image is collected by the telephoto camera module image.

比如,第一获取模块301可以先获取第一图像和第二图像。其中该终端可以是搭载有广角摄像模组和长焦摄像模组的终端,该第一图像是由终端上的广角摄像模组采集到的,该第二图像是由终端上的长焦摄像模组采集到的。For example, the first obtaining module 301 may first acquire the first image and the second image. The terminal may be a terminal equipped with a wide-angle camera module and a telephoto camera module. The first image is captured by a wide-angle camera module on the terminal, and the second image is a telephoto camera module on the terminal. Collected by the group.

第一处理模块302,用于对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量。The first processing module 302 is configured to perform a preset first process on the first image to obtain a first target image, where the number of pixels of the first target image is smaller than the number of pixels of the first image.

比如,在第一获取模块301获取到由广角摄像模组采集到的第一图像后,第一处理模块302可以对该第一图像进行预设第一处理,从而得到第一目标图像。其中该第一目标图像的像素点数量可以小于该第一图像的像素点数量。。For example, after the first acquiring module 301 acquires the first image collected by the wide-angle camera module, the first processing module 302 may perform a preset first process on the first image, thereby obtaining a first target image. The number of pixels of the first target image may be smaller than the number of pixels of the first image. .

第二获取模块303,用于根据所述第一目标图像和所述第二图像,获取景深信息。The second obtaining module 303 is configured to obtain depth information according to the first target image and the second image.

比如,在得到第一目标图像后,第二获取模块303可以根据该第一目标图像和第二图像,获取景深信息。需要说明的是,该景深信息是相对于图像中的对焦物体而言的,是在确定出对焦物体后获取到的景深信息。For example, after obtaining the first target image, the second obtaining module 303 can obtain the depth information according to the first target image and the second image. It should be noted that the depth of field information is relative to the in-focus object in the image, and is the depth of field information acquired after the in-focus object is determined.

第二处理模块304,用于根据所述景深信息,对所述第一目标图像进行预设第二处理。The second processing module 304 is configured to perform a preset second process on the first target image according to the depth of field information.

比如,在第二获取模块303获取到景深信息后,第二处理模块304可以根据该景深信息,对第一目标图像进行预设第二处理。For example, after the second acquisition module 303 obtains the depth information, the second processing module 304 may perform a preset second processing on the first target image according to the depth information.

在一种实施方式中,第二处理模块304可以用于:对所述第一目标图像进行背景虚化处理。In an embodiment, the second processing module 304 is configured to perform background blurring processing on the first target image.

在一种实施方式中,第一处理模块302可以用于:对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量。In an embodiment, the first processing module 302 may be configured to perform a preset third process on the second image to obtain a second target image, where the number of pixels of the second target image is smaller than the first The number of pixels in the second image.

那么,第二获取模块303可以用于:根据所述第一目标图像和所述第二目标图像,获取景深信息。Then, the second obtaining module 303 can be configured to: acquire depth information according to the first target image and the second target image.

在一种实施方式中,第一处理模块302可以用于:对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量为所述第二图像的像素点数量的四分之一。In an embodiment, the first processing module 302 may be configured to: perform a preset third process on the second image to obtain a second target image, where the number of pixels of the second target image is the The image has a quarter of the number of pixels.

在一种实施方式中,第一处理模块302可以用于:通过Binning算法,对所述第二图像进行处理,得到第二目标图像。In an embodiment, the first processing module 302 can be configured to: process the second image by using a Binning algorithm to obtain a second target image.

在一种实施方式中,第一处理模块302可以用于:对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量为所述第一图像的像素点数量的二分之一。In an embodiment, the first processing module 302 may be configured to perform a preset first process on the first image to obtain a first target image, where the number of pixels of the first target image is the first One-fifth of the number of pixels in an image.

在一种实施方式中,第一处理模块302可以用于:对所述第一图像进行预设第一处理得到第一目标图像,其中所述预设第一处理为图像缩小处理,或者图像裁剪处理,或者图像缩小处理和图像裁剪处理的结合。In an embodiment, the first processing module 302 may be configured to: perform preset first processing on the first image to obtain a first target image, where the preset first processing is image reduction processing, or image cropping Processing, or a combination of image reduction processing and image cropping processing.

关于该实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。With regard to the apparatus in this embodiment, the specific manner in which the respective modules perform the operations has been described in detail in the embodiment relating to the method, and will not be explained in detail herein.

本申请实施例提供一种计算机可读的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上执行时,使得所述计算机执行如本实施例提供的图像的处理方法中的流程。The embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, and when the computer program is executed on a computer, causing the computer to execute a process in the image processing method provided by the embodiment. .

本申请实施例还提供一种电子设备,包括存储器,处理器,所述处理器通过调用所述存储器中存储的计算机程序,用于执行本实施例提供的图像的处理方法中的流程。The embodiment of the present application further provides an electronic device, including a memory, and a processor, by using a computer program stored in the memory, to execute a process in a method for processing an image provided by the embodiment.

例如,上述电子设备可以是诸如平板电脑或者智能手机等移动终端。请参阅图11,图11为本申请实施例提供的移动终端的结构示意图。For example, the above electronic device may be a mobile terminal such as a tablet or a smart phone. Please refer to FIG. 11. FIG. 11 is a schematic structural diagram of a mobile terminal according to an embodiment of the present disclosure.

该移动终端400可以包括摄像模组401、存储器402、处理器403等部件。本领域技术人员可以理解,图11中示出的移动终端结构并不构成对移动终端的限定,可以包括比图 示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The mobile terminal 400 can include components such as a camera module 401, a memory 402, a processor 403, and the like. It will be understood by those skilled in the art that the mobile terminal structure illustrated in Figure 11 does not constitute a limitation to the mobile terminal, and may include more or less components than those illustrated, or some components may be combined, or different component arrangements.

摄像模组401可以包括双摄像模组,该双摄像模组可以包括广角摄像模组和长焦摄像模组。The camera module 401 can include a dual camera module, and the dual camera module can include a wide-angle camera module and a telephoto camera module.

存储器402可用于存储应用程序和数据。存储器402存储的应用程序中包含有可执行代码。应用程序可以组成各种功能模块。处理器403通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。Memory 402 can be used to store applications and data. The application stored in the memory 402 contains executable code. Applications can form various functional modules. The processor 403 executes various functional applications and data processing by running an application stored in the memory 402.

处理器403是移动终端的控制中心,利用各种接口和线路连接整个移动移动终端的各个部分,通过运行或执行存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行移动终端的各种功能和处理数据,从而对移动终端进行整体监控。The processor 403 is a control center of the mobile terminal, connects various parts of the entire mobile mobile terminal using various interfaces and lines, performs operations by running or executing an application stored in the memory 402, and calling data stored in the memory 402. The various functions of the terminal and processing data to monitor the mobile terminal as a whole.

在本实施例中,移动终端中的处理器403会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行代码加载到存储器402中,并由处理器403来运行存储在存储器402中的应用程序,从而执行:In this embodiment, the processor 403 in the mobile terminal loads the executable code corresponding to the process of one or more applications into the memory 402 according to the following instructions, and is stored in the memory by the processor 403. The application in 402, thus executing:

获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;根据所述第一目标图像和所述第二图像,获取景深信息;根据所述景深信息,对所述第一目标图像进行预设第二处理。Obtaining a first image that is an image captured by the wide-angle camera module, the second image is an image captured by the telephoto camera module, and the first image Performing a preset first process to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image; and acquiring according to the first target image and the second image Depth of field information; performing preset second processing on the first target image according to the depth of field information.

本申请实施例还提供一种电子设备。上述电子设备中包括图像处理电路,图像处理电路可以利用硬件和/或软件组件实现,可包括定义图像信号处理(Image Signal Processing)管线的各种处理单元。图像处理电路至少可以包括:摄像头、图像信号处理器(Image Signal Processor,ISP处理器)、控制逻辑器、图像存储器以及显示器等。其中摄像头至少可以包括一个或多个透镜和图像传感器。An embodiment of the present application further provides an electronic device. The above electronic device includes an image processing circuit that can be implemented using hardware and/or software components, and can include various processing units that define an Image Signal Processing pipeline. The image processing circuit may at least include: a camera, an image signal processor (ISP), a control logic, an image memory, a display, and the like. The camera may include at least one or more lenses and an image sensor.

图像传感器可包括色彩滤镜阵列(如Bayer滤镜)。图像传感器可获取用图像传感器的每个成像像素捕捉的光强度和波长信息,并提供可由图像信号处理器处理的一组原始图像数据。The image sensor can include a color filter array (such as a Bayer filter). The image sensor can acquire light intensity and wavelength information captured with each imaging pixel of the image sensor and provide a set of raw image data that can be processed by the image signal processor.

图像信号处理器可以按多种格式逐个像素地处理原始图像数据。例如,每个图像像素可具有8、10、12或14比特的位深度,图像信号处理器可对原始图像数据进行一个或多个图像处理操作、收集关于图像数据的统计信息。其中,图像处理操作可按相同或不同的位深度精度进行。原始图像数据经过图像信号处理器处理后可存储至图像存储器中。图像信号处理器还可从图像存储器处接收图像数据。The image signal processor can process the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the image signal processor may perform one or more image processing operations on the raw image data, collecting statistical information about the image data. Among them, image processing operations can be performed with the same or different bit depth precision. The raw image data can be stored in the image memory after being processed by the image signal processor. The image signal processor can also receive image data from the image memory.

图像存储器可为存储器装置的一部分、存储设备、或电子设备内的独立的专用存储器,并可包括DMA(Direct Memory Access,直接直接存储器存取)特征。The image memory can be part of a memory device, a storage device, or a separate dedicated memory within an electronic device, and can include DMA (Direct Memory Access) features.

当接收到来自图像存储器的图像数据时,图像信号处理器可进行一个或多个图像处理操作,如时域滤波。处理后的图像数据可发送给图像存储器,以便在被显示之前进行另外的处理。图像信号处理器还可从图像存储器接收处理数据,并对所述处理数据进行原始域中以及RGB和YCbCr颜色空间中的图像数据处理。处理后的图像数据可输出给显示器,以供用户观看和/或由图形引擎或GPU(Graphics Processing Unit,图形处理器)进一步处理。此外,图像信号处理器的输出还可发送给图像存储器,且显示器可从图像存储器读取 图像数据。在一种实施方式中,图像存储器可被配置为实现一个或多个帧缓冲器。When image data from the image memory is received, the image signal processor can perform one or more image processing operations, such as time domain filtering. The processed image data can be sent to the image memory for additional processing before being displayed. The image signal processor can also receive processing data from the image memory and process the image data in the original domain and in the RGB and YCbCr color spaces. The processed image data can be output to a display for viewing by a user and/or further processed by a graphics engine or a GPU (Graphics Processing Unit). Additionally, the output of the image signal processor can also be sent to an image memory, and the display can read image data from the image memory. In one embodiment, the image memory can be configured to implement one or more frame buffers.

图像信号处理器确定的统计数据可发送给控制逻辑器。例如,统计数据可包括自动曝光、自动白平衡、自动聚焦、闪烁检测、黑电平补偿、透镜阴影校正等图像传感器的统计信息。The statistics determined by the image signal processor can be sent to the control logic. For example, the statistics may include statistical information of image sensors such as auto exposure, auto white balance, auto focus, flicker detection, black level compensation, lens shading correction, and the like.

控制逻辑器可包括执行一个或多个例程(如固件)的处理器和/或微控制器。一个或多个例程可根据接收的统计数据,确定摄像头的控制参数以及ISP控制参数。例如,摄像头的控制参数可包括照相机闪光控制参数、透镜的控制参数(例如聚焦或变焦用焦距)、或这些参数的组合。ISP控制参数可包括用于自动白平衡和颜色调整(例如,在RGB处理期间)的增益水平和色彩校正矩阵等。The control logic can include a processor and/or a microcontroller that executes one or more routines, such as firmware. One or more routines may determine the camera's control parameters and ISP control parameters based on the received statistics. For example, the camera's control parameters may include camera flash control parameters, lens control parameters (eg, focus or zoom focal length), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (eg, during RGB processing), and the like.

请参阅图12,图12为本实施例中图像处理电路的结构示意图。如图12所示,为便于说明,仅示出与本申请实施例相关的图像处理技术的各个方面。Please refer to FIG. 12. FIG. 12 is a schematic structural diagram of an image processing circuit in the embodiment. As shown in FIG. 12, for convenience of explanation, only various aspects of the image processing technique related to the embodiment of the present application are shown.

图像处理电路可以包括:第一摄像头510、第二摄像头520、第一图像信号处理器530、第二图像信号处理器540、控制逻辑器550、图像存储器560、显示器570。其中,第一摄像头510可以包括一个或多个第一透镜511和第一图像传感器512。第二摄像头520可以包括一个或多个第二透镜521和第二图像传感器522。The image processing circuit may include a first camera 510, a second camera 520, a first image signal processor 530, a second image signal processor 540, a control logic 550, an image memory 560, and a display 570. The first camera 510 may include one or more first lenses 511 and a first image sensor 512. The second camera 520 can include one or more second lenses 521 and a second image sensor 522.

在一些实施例中,第一摄像头可为长焦摄像头或广角摄像头中的任一者。第二摄像头可为长焦摄像头或广角摄像头中的任一者。例如,在本实施例中第一摄像头为广角摄像头,第二摄像头为长焦摄像头。In some embodiments, the first camera can be any of a telephoto camera or a wide-angle camera. The second camera can be any of a telephoto camera or a wide-angle camera. For example, in this embodiment, the first camera is a wide-angle camera and the second camera is a telephoto camera.

第一摄像头510采集的第一图像传输给第一图像信号处理器530进行处理。第一图像信号处理器530处理第一图像后,可将第一图像的统计数据(如图像的亮度、图像的反差值、图像的颜色等)发送给控制逻辑器550。控制逻辑器550可根据统计数据确定第一摄像头510的控制参数,从而第一摄像头510可根据控制参数进行自动对焦、自动曝光等操作。第一图像经过第一图像信号处理器530进行处理后可存储至图像存储器560中。第一图像信号处理器530也可以读取图像存储器560中存储的图像以进行处理。另外,第一图像经过图像信号处理器530进行处理后可直接发送至显示器570进行显示。显示器570也可以读取图像存储器560中的图像以进行显示。The first image acquired by the first camera 510 is transmitted to the first image signal processor 530 for processing. After the first image signal processor 530 processes the first image, the statistical data of the first image (such as the brightness of the image, the contrast of the image, the color of the image, etc.) may be sent to the control logic 550. The control logic 550 can determine the control parameters of the first camera 510 according to the statistical data, so that the first camera 510 can perform operations such as auto focus, auto exposure, and the like according to the control parameters. The first image is processed by the first image signal processor 530 and stored in the image memory 560. The first image signal processor 530 can also read the image stored in the image memory 560 for processing. In addition, the first image is processed by the image signal processor 530 and sent directly to the display 570 for display. Display 570 can also read images in image memory 560 for display.

第二摄像头520采集的第二图像传输给第二图像信号处理器540进行处理。第二图像信号处理器540处理第二图像后,可将第二图像的统计数据(如图像的亮度、图像的反差值、图像的颜色等)发送给控制逻辑器550。控制逻辑器550可根据统计数据确定第二摄像头520的控制参数,从而第二摄像头520可根据控制参数进行自动对焦、自动曝光等操作。第二图像经过第二图像信号处理器540进行处理后可存储至图像存储器560中。第二图像信号处理器540也可以读取图像存储器560中存储的图像以进行处理。另外,第二图像经过图像信号处理器540进行处理后可直接发送至显示器570进行显示。显示器570也可以读取图像存储器560中的图像以进行显示。The second image acquired by the second camera 520 is transmitted to the second image signal processor 540 for processing. After the second image signal processor 540 processes the second image, the statistical data of the second image (such as the brightness of the image, the contrast of the image, the color of the image, etc.) may be sent to the control logic 550. The control logic 550 can determine the control parameters of the second camera 520 according to the statistical data, so that the second camera 520 can perform operations such as auto focus, automatic exposure, and the like according to the control parameters. The second image is processed by the second image signal processor 540 and stored in the image memory 560. The second image signal processor 540 can also read the image stored in the image memory 560 for processing. In addition, the second image is processed by the image signal processor 540 and sent directly to the display 570 for display. Display 570 can also read images in image memory 560 for display.

在另一些实施方式中,第一图像信号处理器和第二图像信号处理器也可合成为统一的图像信号处理器,分别处理第一图像传感器和第二图像传感器的数据。In other embodiments, the first image signal processor and the second image signal processor may also be synthesized into a unified image signal processor that processes data of the first image sensor and the second image sensor, respectively.

此外,图中没有展示的,电子设备还可以包括CPU和供电模块。CPU和逻辑控制器、第一图像信号处理器、第二图像信号处理器、图像存储器和显示器均连接,CPU用于实现 全局控制。供电模块用于为各个模块供电。In addition, not shown in the figure, the electronic device may further include a CPU and a power supply module. The CPU and the logic controller, the first image signal processor, the second image signal processor, the image memory, and the display are all connected, and the CPU is used to implement global control. The power supply module is used to power each module.

一般的,具有双摄像模组的手机,在某些拍照模式下,双摄像模组均工作。此时,CPU控制供电模块为第一摄像头和第二摄像头供电。第一摄像头中的图像传感器上电,第二摄像头中的图像传感器上电,从而可以实现图像的采集转换。在某些拍照模式下,可以是双摄像模组中的一个摄像头工作。例如,仅长焦摄像头工作。这种情况下,CPU控制供电模块给相应摄像头的图像传感器供电即可。在本申请的实施例中,由于要进行景深计算和虚化处理,因此需要两个摄像模头同时工作的。In general, a mobile phone with a dual camera module works in both camera modes and dual camera modules. At this time, the CPU controls the power supply module to supply power to the first camera and the second camera. The image sensor in the first camera is powered on, and the image sensor in the second camera is powered up, so that image acquisition and conversion can be realized. In some camera modes, it can be a camera in a dual camera module. For example, only telephoto cameras work. In this case, the CPU controls the power supply module to supply power to the image sensor of the corresponding camera. In the embodiment of the present application, since the depth of field calculation and the blurring process are to be performed, it is required that the two camera dies work simultaneously.

此外,双摄像模组在终端的安装距离可根据终端的尺寸确定和拍摄效果确定。在一些实施例中,为了使第一摄像模组和第二摄像模组拍摄的物体重叠度高,可以将两个摄像模组安装得越近越好,例如在10mm以内。In addition, the installation distance of the dual camera module in the terminal can be determined according to the size determination of the terminal and the shooting effect. In some embodiments, in order to make the objects captured by the first camera module and the second camera module have a high degree of overlap, the two camera modules may be mounted as close as possible, for example, within 10 mm.

以下为运用图12中图像处理技术实现本实施例提供的图像的处理方法的流程,其中该电子设备至少包括广角摄像模组和长焦摄像模组:The following is a flow of a method for processing an image provided by the embodiment in the image processing technology of FIG. 12, wherein the electronic device includes at least a wide-angle camera module and a telephoto camera module:

获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;根据所述第一目标图像和所述第二图像,获取景深信息;根据所述景深信息,对所述第一目标图像进行预设第二处理。Obtaining a first image that is an image captured by the wide-angle camera module, the second image is an image captured by the telephoto camera module, and the first image Performing a preset first process to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image; and acquiring according to the first target image and the second image Depth of field information; performing preset second processing on the first target image according to the depth of field information.

在一种实施方式中,电子设备执行所述对所述第一目标图像进行预设第二处理时,可以执行:对所述第一目标图像进行背景虚化处理。In an embodiment, when the electronic device performs the preset second processing on the first target image, performing: performing background blur processing on the first target image.

在一种实施方式中,电子设备在获取到第二目标图像之后,还可以执行:对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量。In an embodiment, after acquiring the second target image, the electronic device may further perform: performing a preset third process on the second image to obtain a second target image, where the pixels of the second target image The number of dots is smaller than the number of pixels of the second image.

那么,电子设备执行所述根据所述第一目标图像和所述第二图像获取景深信息时,可以执行:根据所述第一目标图像和所述第二目标图像,获取景深信息。Then, when the electronic device performs the acquiring the depth information according to the first target image and the second image, it may be performed to acquire the depth information according to the first target image and the second target image.

在一种实施方式中,电子设备执行所述对所述第二图像进行预设第三处理得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量时,可以执行:对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量为所述第二图像的像素点数量的四分之一。In an embodiment, the electronic device performs the preset third processing on the second image to obtain a second target image, wherein the number of pixels of the second target image is smaller than the pixel of the second image. The quantity may be performed by performing a preset third process on the second image to obtain a second target image, wherein the number of pixels of the second target image is four quarters of the number of pixels of the second image. One.

在一种实施方式中,电子设备执行所述对所述第二图像进行预设第三处理得到第二目标图像时,可以执行:通过Binning算法,对所述第二图像进行处理,得到第二目标图像。In an embodiment, when the electronic device performs the preset third processing on the second image to obtain the second target image, the electronic image may be processed by using the Binning algorithm to obtain the second image. Target image.

在一种实施方式中,电子设备执行所述对所述第一图像进行预设第一处理得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量时,可以执行:对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量为所述第一图像的像素点数量的二分之一。In an embodiment, the electronic device performs the preset first processing on the first image to obtain a first target image, where the number of pixels of the first target image is smaller than the pixel of the first image. The quantity may be performed by performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is two-half of the number of pixels of the first image. One.

在一种实施方式中,电子设备执行所述对所述第一图像进行预设第一处理得到第一目标图像时,可以执行:对所述第一图像进行预设第一处理得到第一目标图像,其中所述预设第一处理为图像缩小处理,或者图像裁剪处理,或者图像缩小处理和图像裁剪处理的结合。In an embodiment, when the electronic device performs the preset first processing on the first image to obtain the first target image, performing: performing preset first processing on the first image to obtain the first target. An image, wherein the preset first process is an image reduction process, or an image cropping process, or a combination of image reduction processing and image cropping processing.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对图像的处理方法的详细描述,此处不再赘述。In the above-mentioned embodiments, the descriptions of the various embodiments are different. For details that are not detailed in an embodiment, reference may be made to the detailed description of the processing method for the image, and details are not described herein again.

本申请实施例提供的所述图像的处理装置与上文实施例中的图像的处理方法属于同一构思,在所述图像的处理装置上可以运行所述图像的处理方法实施例中提供的任一方法,其具体实现过程详见所述图像的处理方法实施例,此处不再赘述。The processing device of the image provided by the embodiment of the present application is the same as the processing method of the image in the above embodiment, and any one of the embodiments provided in the processing method of the image may be executed on the processing device of the image. The specific implementation process of the method is described in the embodiment of the image processing method, and details are not described herein again.

需要说明的是,对本申请实施例所述图像的处理方法而言,本领域普通技术人员可以理解实现本申请实施例所述图像的处理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在存储器中,并被至少一个处理器执行,在执行过程中可包括如所述图像的处理方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)等。It should be noted that, in the processing method of the image in the embodiment of the present application, a person skilled in the art may understand all or part of the process for implementing the image processing method according to the embodiment of the present application, and the related program may be controlled by a computer program. The computer program can be stored in a computer readable storage medium, such as in a memory, and executed by at least one processor, and can include an implementation of a processing method such as the image during execution. The flow of the example. The storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), a random access memory (RAM), or the like.

对本申请实施例的所述图像的处理装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。For the processing device of the image of the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist physically separately, or two or more modules may be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. The integrated module, if implemented in the form of a software functional module and sold or used as a standalone product, may also be stored in a computer readable storage medium, such as a read only memory, a magnetic disk or an optical disk, etc. .

以上对本申请实施例所提供的一种图像的处理方法、装置、存储介质以及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The method, the device, the storage medium, and the electronic device for processing an image provided by the embodiments of the present application are described in detail. The principles and implementation manners of the present application are described in the following, and the description of the above embodiments is described. It is only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. The contents of the description should not be construed as limiting the application.

Claims (20)

一种图像的处理方法,应用于终端,其中,所述终端至少包括广角摄像模组和长焦摄像模组,所述方法包括:An image processing method is applied to a terminal, wherein the terminal includes at least a wide-angle camera module and a telephoto camera module, and the method includes: 获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;Acquiring the first image and the second image, the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module; 对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;Performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image; 根据所述第一目标图像和所述第二图像,获取景深信息;Obtaining depth information according to the first target image and the second image; 根据所述景深信息,对所述第一目标图像进行预设第二处理。And performing preset second processing on the first target image according to the depth information. 根据权利要求1所述的图像的处理方法,其中,所述对所述第一目标图像进行预设第二处理,包括:The image processing method according to claim 1, wherein the performing the preset second processing on the first target image comprises: 对所述第一目标图像进行背景虚化处理。Performing background blurring processing on the first target image. 根据权利要求1所述的图像的处理方法,其中,在获取到所述第二图像之后,所述方法还包括:The method of processing an image according to claim 1, wherein after the acquiring the second image, the method further comprises: 对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量;Performing a third process on the second image to obtain a second target image, wherein the number of pixels of the second target image is smaller than the number of pixels of the second image; 所述根据所述第一目标图像和所述第二图像获取景深信息,包括:And obtaining the depth information according to the first target image and the second image, including: 根据所述第一目标图像和所述第二目标图像,获取景深信息。The depth of field information is acquired according to the first target image and the second target image. 根据权利要求3所述的图像的处理方法,其中,所述对所述第二图像进行预设第三处理得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量,包括:The image processing method according to claim 3, wherein the performing a third process on the second image to obtain a second target image, wherein the number of pixels of the second target image is smaller than the second image The number of pixels in the image, including: 对所述第二图像进行预设第三处理,得到所述第二目标图像,其中所述第二目标图像的像素点数量为所述第二图像的像素点数量的四分之一。Performing a third processing on the second image to obtain the second target image, wherein the number of pixels of the second target image is one quarter of the number of pixels of the second image. 根据权利要求4所述的图像的处理方法,其中,所述对所述第二图像进行预设第三处理得到第二目标图像,包括:The image processing method according to claim 4, wherein the performing the third processing on the second image to obtain the second target image comprises: 通过Binning算法,对所述第二图像进行处理,得到所述第二目标图像。The second image is processed by a Binning algorithm to obtain the second target image. 根据权利要求1所述的图像的处理方法,其中,所述对所述第一图像进行预设第一处理得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量,包括:The image processing method according to claim 1, wherein the performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the first The number of pixels in the image, including: 对所述第一图像进行预设第一处理,得到所述第一目标图像,其中所述第一目标图像的像素点数量为所述第一图像的像素点数量的二分之一。Performing a preset first process on the first image to obtain the first target image, wherein the number of pixels of the first target image is one-half of the number of pixels of the first image. 根据权利要求1所述的图像的处理方法,其中,所述对所述第一图像进行预设第一处理得到第一目标图像,包括:The image processing method according to claim 1, wherein the performing the preset first processing on the first image to obtain the first target image comprises: 对所述第一图像进行预设第一处理得到所述第一目标图像,其中所述预设第一处理为图像缩小处理,或者图像裁剪处理,或者图像缩小处理和图像裁剪处理的结合。Performing a preset first process on the first image to obtain the first target image, wherein the preset first process is an image reduction process, or an image cropping process, or a combination of image reduction processing and image cropping processing. 一种图像的处理装置,应用于终端,其中,所述终端至少包括广角摄像模组和长焦摄像模组,所述装置包括:An image processing device is applied to a terminal, wherein the terminal includes at least a wide-angle camera module and a telephoto camera module, and the device includes: 第一获取模块,用于获取第一图像和第二图像,所述第一图像是由所述广角摄像模组 采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;a first acquiring module, configured to acquire a first image and a second image, where the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module ; 第一处理模块,用于对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;a first processing module, configured to perform a preset first process on the first image, to obtain a first target image, where the number of pixels of the first target image is smaller than the number of pixels of the first image; 第二获取模块,用于根据所述第一目标图像和所述第二图像,获取景深信息;a second acquiring module, configured to acquire depth information according to the first target image and the second image; 第二处理模块,用于根据所述景深信息,对所述第一目标图像进行预设第二处理。The second processing module is configured to perform preset second processing on the first target image according to the depth information. 根据权利要求8所述的图像的处理装置,其中,所述第二处理模块用于:The image processing apparatus according to claim 8, wherein said second processing module is configured to: 对所述第一目标图像进行背景虚化处理。Performing background blurring processing on the first target image. 根据权利要求8所述的图像的处理装置,其中,所述第一处理模块用于:对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量;The image processing apparatus according to claim 8, wherein the first processing module is configured to: perform a preset third process on the second image to obtain a second target image, wherein the second target image The number of pixels is smaller than the number of pixels of the second image; 所述第二获取模块,用于:根据所述第一目标图像和所述第二目标图像,获取景深信息。The second acquiring module is configured to: acquire depth information according to the first target image and the second target image. 根据权利要求10所述的图像的处理装置,其中,所述第一处理模块用于:The image processing apparatus according to claim 10, wherein said first processing module is configured to: 对所述第二图像进行预设第三处理,得到所述第二目标图像,其中所述第二目标图像的像素点数量为所述第二图像的像素点数量的四分之一。Performing a third processing on the second image to obtain the second target image, wherein the number of pixels of the second target image is one quarter of the number of pixels of the second image. 根据权利要求11所述的图像的处理装置,其中,所述第一处理模块用于:The image processing apparatus according to claim 11, wherein said first processing module is configured to: 通过Binning算法,对所述第二图像进行处理,得到所述第二目标图像。The second image is processed by a Binning algorithm to obtain the second target image. 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上执行时,使得所述计算机执行如权利要求1至7中任一项所述的方法。A storage medium having stored thereon a computer program, wherein when the computer program is executed on a computer, the computer is caused to perform the method of any one of claims 1 to 7. 一种电子设备,包括存储器,处理器,其中,所述电子设备至少包括广角摄像模组和长焦摄像模组,所述处理器通过调用所述存储器中存储的计算机程序,用于执行:An electronic device includes a memory, a processor, wherein the electronic device includes at least a wide-angle camera module and a telephoto camera module, and the processor is configured to execute by calling a computer program stored in the memory: 获取第一图像和第二图像,所述第一图像是由所述广角摄像模组采集的图像,所述第二图像是由所述长焦摄像模组采集的图像;Acquiring the first image and the second image, the first image is an image captured by the wide-angle camera module, and the second image is an image captured by the telephoto camera module; 对所述第一图像进行预设第一处理,得到第一目标图像,其中所述第一目标图像的像素点数量小于所述第一图像的像素点数量;Performing a preset first process on the first image to obtain a first target image, wherein the number of pixels of the first target image is smaller than the number of pixels of the first image; 根据所述第一目标图像和所述第二图像,获取景深信息;Obtaining depth information according to the first target image and the second image; 根据所述景深信息,对所述第一目标图像进行预设第二处理。And performing preset second processing on the first target image according to the depth information. 根据权利要求14所述的电子设备,其中,所述处理器用于执行:The electronic device of claim 14, wherein the processor is operative to: 对所述第一目标图像进行背景虚化处理。Performing background blurring processing on the first target image. 根据权利要求14所述的电子设备,其中,所述处理器用于执行:The electronic device of claim 14, wherein the processor is operative to: 对所述第二图像进行预设第三处理,得到第二目标图像,其中所述第二目标图像的像素点数量小于所述第二图像的像素点数量;Performing a third process on the second image to obtain a second target image, wherein the number of pixels of the second target image is smaller than the number of pixels of the second image; 根据所述第一目标图像和所述第二目标图像,获取景深信息。The depth of field information is acquired according to the first target image and the second target image. 根据权利要求16所述的电子设备,其中,所述处理器用于执行:The electronic device of claim 16 wherein said processor is operative to: 对所述第二图像进行预设第三处理,得到所述第二目标图像,其中所述第二目标图像的像素点数量为所述第二图像的像素点数量的四分之一。Performing a third processing on the second image to obtain the second target image, wherein the number of pixels of the second target image is one quarter of the number of pixels of the second image. 根据权利要求17所述的电子设备,其中,所述处理器用于执行:The electronic device of claim 17 wherein said processor is operative to: 通过Binning算法,对所述第二图像进行处理,得到所述第二目标图像。The second image is processed by a Binning algorithm to obtain the second target image. 根据权利要求14所述的电子设备,其中,所述处理器用于执行:The electronic device of claim 14, wherein the processor is operative to: 对所述第一图像进行预设第一处理,得到所述第一目标图像,其中所述第一目标图像的像素点数量为所述第一图像的像素点数量的二分之一。Performing a preset first process on the first image to obtain the first target image, wherein the number of pixels of the first target image is one-half of the number of pixels of the first image. 根据权利要求14所述的电子设备,其中,所述处理器用于执行:The electronic device of claim 14, wherein the processor is operative to: 对所述第一图像进行预设第一处理得到所述第一目标图像,其中所述预设第一处理为图像缩小处理,或者图像裁剪处理,或者图像缩小处理和图像裁剪处理的结合。Performing a preset first process on the first image to obtain the first target image, wherein the preset first process is an image reduction process, or an image cropping process, or a combination of image reduction processing and image cropping processing.
PCT/CN2018/122861 2018-01-31 2018-12-21 Image processing method and device, storage medium, and electronic apparatus Ceased WO2019148996A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810097883.0 2018-01-31
CN201810097883.0A CN108307114B (en) 2018-01-31 2018-01-31 Image processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2019148996A1 true WO2019148996A1 (en) 2019-08-08

Family

ID=62850560

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/122861 Ceased WO2019148996A1 (en) 2018-01-31 2018-12-21 Image processing method and device, storage medium, and electronic apparatus

Country Status (2)

Country Link
CN (1) CN108307114B (en)
WO (1) WO2019148996A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108307114B (en) * 2018-01-31 2020-01-14 Oppo广东移动通信有限公司 Image processing method and device, storage medium and electronic equipment
CN113497880A (en) * 2020-03-20 2021-10-12 华为技术有限公司 Method for shooting image and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103986867A (en) * 2014-04-24 2014-08-13 宇龙计算机通信科技(深圳)有限公司 Image shooting terminal and image shooting method
CN104519259A (en) * 2013-09-26 2015-04-15 联想(北京)有限公司 A data acquisition method and an electronic device
US20160142627A1 (en) * 2014-11-13 2016-05-19 Altek Semiconductor Corp. Image capturing device and digital zooming method thereof
US20160173757A1 (en) * 2014-12-15 2016-06-16 Samsung Electro-Mechanics Co., Ltd. Camera module
CN106385541A (en) * 2016-09-30 2017-02-08 虹软(杭州)科技有限公司 Method for realizing zooming through wide-angle photographing component and long-focus photographing component
CN106412421A (en) * 2016-08-30 2017-02-15 成都丘钛微电子科技有限公司 System and method for rapidly generating large-size multi-focused image
CN108307114A (en) * 2018-01-31 2018-07-20 广东欧珀移动通信有限公司 Image processing method and device, storage medium and electronic equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7084385B2 (en) * 2003-08-19 2006-08-01 Autoliv Asp, Inc. Range discriminating optical sensor having a wide angle lens with a fixed focal length
US7683962B2 (en) * 2007-03-09 2010-03-23 Eastman Kodak Company Camera using multiple lenses and image sensors in a rangefinder configuration to provide a range map
CN104253939A (en) * 2013-06-27 2014-12-31 聚晶半导体股份有限公司 Method for adjusting focusing position and electronic device
KR102157675B1 (en) * 2014-07-25 2020-09-18 삼성전자주식회사 Image photographing apparatus and methods for photographing image thereof
US9800975B1 (en) * 2016-04-18 2017-10-24 mPerpetuo, Inc. Audio system for a digital camera
CN106454121B (en) * 2016-11-11 2020-02-07 努比亚技术有限公司 Double-camera shooting method and device
CN107835372A (en) * 2017-11-30 2018-03-23 广东欧珀移动通信有限公司 Imaging method, device, mobile terminal and storage medium based on dual camera

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104519259A (en) * 2013-09-26 2015-04-15 联想(北京)有限公司 A data acquisition method and an electronic device
CN103986867A (en) * 2014-04-24 2014-08-13 宇龙计算机通信科技(深圳)有限公司 Image shooting terminal and image shooting method
US20160142627A1 (en) * 2014-11-13 2016-05-19 Altek Semiconductor Corp. Image capturing device and digital zooming method thereof
US20160173757A1 (en) * 2014-12-15 2016-06-16 Samsung Electro-Mechanics Co., Ltd. Camera module
CN106412421A (en) * 2016-08-30 2017-02-15 成都丘钛微电子科技有限公司 System and method for rapidly generating large-size multi-focused image
CN106385541A (en) * 2016-09-30 2017-02-08 虹软(杭州)科技有限公司 Method for realizing zooming through wide-angle photographing component and long-focus photographing component
CN108307114A (en) * 2018-01-31 2018-07-20 广东欧珀移动通信有限公司 Image processing method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN108307114A (en) 2018-07-20
CN108307114B (en) 2020-01-14

Similar Documents

Publication Publication Date Title
KR102293443B1 (en) Image processing method and mobile terminal using dual camera
US10805508B2 (en) Image processing method, and device
KR102279436B1 (en) Image processing methods, devices and devices
US11431915B2 (en) Image acquisition method, electronic device, and non-transitory computer readable storage medium
CN110213502B (en) Image processing method, device, storage medium and electronic device
CN111028189A (en) Image processing method, device, storage medium and electronic device
CN107592473A (en) Exposure parameter adjustment method, device, electronic device and readable storage medium
CN108322669A (en) The acquisition methods and device of image, imaging device, computer readable storage medium and computer equipment
CN107948519A (en) Image processing method, device and equipment
CN108833804A (en) Imaging method, device and electronic equipment
CN108833802B (en) Exposure control method and device and electronic equipment
CN107704798B (en) Image blurring method, apparatus, computer-readable storage medium, and computer device
CN110198418B (en) Image processing method, device, storage medium and electronic device
US11503223B2 (en) Method for image-processing and electronic device
CN108712608A (en) Terminal equipment shooting method and device
CN107197152B (en) Focusing method, focusing device, computer readable storage medium and mobile terminal
WO2019105298A1 (en) Image blurring processing method, device, mobile device and storage medium
CN107277348B (en) Focusing method, focusing device, computer readable storage medium and mobile terminal
CN107454322A (en) Photographing method, device, computer storage medium and mobile terminal
CN110717871A (en) Image processing method, image processing device, storage medium and electronic equipment
CN108900785A (en) Exposure control method and device and electronic equipment
CN107682611B (en) Method, apparatus, computer readable storage medium and electronic device for focusing
CN108307114B (en) Image processing method and device, storage medium and electronic equipment
CN108282616B (en) Image processing method and device, storage medium and electronic equipment
CN108520036B (en) Image selection method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18904380

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18904380

Country of ref document: EP

Kind code of ref document: A1