Image blurring method, device, equipment and storage medium
By dividing the image into in-focus and out-of-focus plane areas for differentiated processing, the image signal processing solves the problem of high system power consumption in the existing technology and achieves the effect of reducing energy consumption while ensuring image quality.
Patent Information
- Application Number
- CN202210946086.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-08
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-08-08
AI Technical Summary
When the existing technology processes the entire image, the system power consumption is high and the energy consumption of the image blurring process cannot be effectively reduced.
The image to be processed is divided into a first focal plane area image and a first non-focal plane area image, and different image signal processing strategies are used to perform differential processing on the two, and refinement and non-refinement processing are performed respectively, and then blurring processing is performed using an image blurring algorithm.
On the basis of ensuring the effect of the image in the focal plane area, the system power consumption is reduced and the image quality is improved.
Smart Images

Figure CN115409725B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to image processing technology, and in particular to an image blurring method, apparatus, device and storage medium. Background Art
[0002] Currently, image blurring is achieved by first processing the entire image using image signal processing (ISP) strategies, such as noise reduction, super-resolution, and high-dynamic range (HDR) processing. This processing is then applied to the processed image to achieve the desired blur effect. While this entire image can be processed, it does consume more system power. Summary of the Invention
[0003] The present application aims to provide an image blurring method, apparatus, device and storage medium.
[0004] The technical solution of this application is achieved as follows:
[0005] In a first aspect, a method for blurring an image is provided, the method comprising:
[0006] Acquiring an image to be processed, and dividing the image to be processed into a first focal plane area image and a first non-focal plane area image according to an image division strategy;
[0007] Processing the first focal plane area image according to a first image signal processing strategy to obtain a second focal plane area image;
[0008] processing the first non-focal plane area image according to a second image signal processing strategy to obtain a second non-focal plane area image; wherein the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image;
[0009] The second focal plane area image and the second non-focal plane area image are blurred using an image blurring algorithm to obtain blurred images.
[0010] In a second aspect, an image blurring device is provided, the device comprising:
[0011] a dividing unit, configured to acquire an image to be processed, and divide the image to be processed into a first focal plane area image and a first non-focal plane area image according to an image dividing strategy;
[0012] a first processing unit, configured to process the first focal plane area image according to a first image signal processing strategy to obtain a second focal plane area image; and to process the first non-focal plane area image according to a second image signal processing strategy to obtain a second non-focal plane area image; wherein the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image;
[0013] The second processing unit is configured to perform blurring processing on the second focal plane area image and the second non-focal plane area image by using an image blurring algorithm to obtain blurred images.
[0014] According to a third aspect, an electronic device is provided, comprising: a processor and a memory configured to store a computer program that can be run on the processor, wherein the processor is configured to execute the steps of the method according to the first aspect when running the computer program.
[0015] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program implements the steps of the method according to the first aspect when executed by a processor.
[0016] By adopting the above technical solution, the image to be processed is divided into a first focal plane area image and a first non-focal plane area image, image refinement processing is performed on the first focal plane area image, and image non-refinement processing is performed on the first non-focal plane area image, so that the system power consumption is reduced while ensuring the image effect of the first focal plane area image. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a schematic diagram of a first process of an image blurring method provided in an embodiment of the present application;
[0018] Figure 2 A schematic diagram of an image segmentation result provided in an embodiment of the present application;
[0019] Figure 3 This is a second flow chart of an image blurring method provided in an embodiment of the present application;
[0020] Figure 4 A schematic diagram of an image blurring principle provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of a camera system module provided in an embodiment of the present application;
[0022] Figure 6 This is a schematic diagram of a third flow chart of an image blurring method provided in an embodiment of the present application;
[0023] Figure 7A schematic diagram of the structure of an image blur processing device provided in an embodiment of the present application;
[0024] Figure 8 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0026] The embodiment of the present application provides an image blurring method. Figure 1 This is a first flow chart of an image blurring method provided in an embodiment of the present application, which is applied to an electronic device, which may be a camera.
[0027] like Figure 1 As shown, the image blurring method may specifically include:
[0028] Step 101: Acquire an image to be processed, and divide the image to be processed into a first focal plane area image and a first non-focal plane area image according to an image division strategy.
[0029] In actual applications, after the camera is turned on, the image to be processed is collected by the image sensor of the camera for preview (ie, taking a photo) or shooting (ie, recording a video).
[0030] Here, the first focal plane area image is the area image composed of the focused object, and can also be understood as the area image that does not need to be blurred. The first non-focal plane area image is the image other than the area image composed of the focused object, and can also be understood as the area image that needs to be blurred. For example, Figure 2 A schematic diagram of an image segmentation result provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the portrait is the first focal plane area image, and the secondary focal plane area image and the background area image other than the portrait belong to the first non-focal plane area image.
[0031] Step 102: Process the first focal plane area image according to a first image signal processing strategy to obtain a second focal plane area image.
[0032] That is, the first focal plane area image refers to the image not processed according to the first image signal processing strategy, that is, the image before processing. The second focal plane area image refers to the image after the first focal plane area image is processed according to the first image signal processing strategy, that is, the processed image.
[0033] Step 103: Process the first non-focal plane area image according to a second image signal processing strategy to obtain a second non-focal plane area image; wherein the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image.
[0034] That is, the first non-focal plane area image refers to the image that has not been processed according to the second image signal processing strategy, that is, the image before processing. The second non-focal plane area image refers to the image after the second focal plane area image is processed according to the second image signal processing strategy, that is, the processed image.
[0035] It should be noted that when the image signal processing (ISP) strategy mentioned in steps 102 and 103 is used to process the image to be processed, its image processing result can reflect the image quality. The present application does not directly use the image signal processing strategy to process the entire image, but first divides the image to be processed into a first focal plane area image that does not require blurring and a first non-focal plane area image that requires blurring. Then, the image signal of the first focal plane area image that does not require blurring is finely processed to reflect the image quality. Since the first non-focal plane area image needs to be blurred later, it is not necessary to reflect the image quality. Non-fine processing of the image signal is performed on it, that is, differential processing is performed on the first focal plane area image and the first non-focal plane area image, which will reduce certain system performance.
[0036] In some embodiments, the first image signal processing strategy includes at least one of the following: first image noise reduction processing, first image resolution processing and first high dynamic range (HDR) image processing; the second image signal processing strategy includes at least one of the following: second image noise reduction processing, second image resolution processing and second high dynamic range image processing.
[0037] Here, the processing effect of the first image signal processing strategy is better than the processing effect of the second image signal processing strategy, so that the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image.
[0038] In addition, the first image signal processing strategy also includes image brightness processing and image contrast processing, and the second image signal processing strategy also includes image brightness processing and image contrast processing. Here, image brightness processing and image contrast processing are required for both the first focal plane area image and the first non-focal plane area image to avoid the situation where one part of the image has normal brightness while another part may appear too bright or too dark.
[0039] Exemplarily, the image parameters used to measure the image quality of the second focal plane area image include at least one of the following: a first resolution and a first clarity; the image parameters used to measure the image quality of the second non-focal plane area image include at least one of the following: a second resolution and a second clarity; wherein the first resolution is higher than the second resolution, and the first clarity is higher than the second clarity.
[0040] In actual applications, steps 101 to 103 are performed by the front end of the camera (also called the CP side, i.e., the image sensor and the ISP image processor).
[0041] Step 104: using an image blurring algorithm to blur the second focal plane area image and the second non-focal plane area image to obtain blurred images.
[0042] In practical applications, step 104 is performed by the camera's backend (also known as the AP side, i.e., the application processor (CPU)). Specifically, after step 103 is completed, the second focal plane area image and the second non-focal plane area image need to be transmitted to the camera's backend, which then performs the image blurring process.
[0043] In some embodiments, step 104 specifically includes: using the image blurring algorithm to blur the second non-focal plane area image to obtain a third non-focal plane area image; and combining the third non-focal plane area image and the second focal plane area image to obtain the blurred image.
[0044] Here, the second focal plane area image and the second non-focal plane area image are spliced together, and the second non-focal plane area image in the spliced image is blurred using an image blurring algorithm to obtain a blurred image consisting of the third non-focal plane area image and the second focal plane area image.
[0045] Alternatively, the second non-focal plane area image is blurred using an image blurring algorithm to obtain a third non-focal plane area image, and the third non-focal plane area image is spliced with the second focal plane area image to obtain a blurred image.
[0046] Combine Figure 2 Further explanation of the image blur processing results: Figure 2 The secondary focal plane area image and the background area image, excluding the portrait, all belong to the first non-focal plane area image. In actual applications, although the area outside the first focal plane area image is blurred, the degree of blur is different. The closer to the first focal plane area image, the clearer it is, and the farther away from the first focal plane area image, the blurrier it is. That is, the blur degree of the background area image is higher than that of the secondary focal plane area image.
[0047] It should also be noted that whether to perform differentiated ISP image processing on the first focal plane area image and the first non-focal plane area image can be determined based on control information transmitted from the camera backend (AP side). For example, the control information can be information that determines whether to blur the image scene.
[0048] Here, the execution subject of steps 101 to 104 may be a processor of an electronic device, which may be a camera, a mobile phone, a tablet, etc.
[0049] By adopting the above technical solution, the image to be processed is divided into a first focal plane area image and a first non-focal plane area image, image refinement processing is performed on the first focal plane area image, and image non-refinement processing is performed on the first non-focal plane area image, so that the system power consumption is reduced while ensuring the image effect of the first focal plane area image.
[0050] In order to better reflect the purpose of this application, further examples are given based on the above embodiments of this application. Figure 3 This is a second flow chart of an image blurring method provided in an embodiment of the present application, such as Figure 3 As shown, the image blurring method specifically includes:
[0051] Step 301: Acquire an image to be processed and determine the depth value of each pixel in the image to be processed; wherein the depth value is the vertical distance between the pixel and the imaging plane of the collector.
[0052] Step 302: Determine the depth value of the focal plane.
[0053] For example, Figure 4 This is a schematic diagram of an image blurring principle provided in an embodiment of the present application, such as Figure 4 As shown, when using a camera to focus and take a photo of a portrait, the plane where the focus area (or area of interest) is located is called the focal plane, the plane where the camera is located is called the imaging plane, and the vertical distance between the focal plane and the imaging plane is the focus distance, also called the depth value of the focal plane.
[0054] The vertical distance between each pixel that makes up the portrait and the imaging plane of the camera (i.e., the collector) is the depth value of each pixel that makes up the portrait. The vertical distance between each pixel that makes up the background tree and the imaging plane of the camera is the depth value of each pixel that makes up the tree.
[0055] Regarding the method for calculating the depth value of each pixel in the image to be processed, for example, it can be obtained using a depth camera with a depth information acquisition function, which includes a time of flight (TOF) sensor. The ranging principle is to continuously send light pulses to the object, and then use the TOF sensor to receive the light pulses returned from the object. By detecting the flight (round-trip) time of the light pulses and the speed of light, the vertical distance between each pixel on the object and the camera imaging plane is obtained. It can also be obtained by measuring with a binocular camera. Specifically, the binocular camera captures two left and right images of the same scene, and uses a stereo matching algorithm to obtain a disparity map, and then obtains the depth map, that is, the depth information of the image.
[0056] Regarding the method for calculating the depth value of the focal plane, exemplarily, in some embodiments, determining the depth value of the focal plane includes: obtaining the focus parameters of the collector; determining the region of interest in the image to be processed based on the focus parameters; taking the plane where the region of interest is located as the focal plane; and determining the depth value of the focal plane based on the depth values of each pixel point in the image to be processed.
[0057] Here, the upper left corner coordinate information and the lower right corner coordinate information for determining the region of interest are obtained from the focus parameters, the region of interest of the image to be processed is determined according to the upper left corner coordinate information and the lower right corner coordinate information, the plane where the region of interest is located is used as the focal plane, and based on the depth value of each pixel point in the image to be processed, the depth value of any pixel point in the region of interest is obtained and used as the depth value of the focal plane.
[0058] Step 303: Divide the image to be processed into the first focal plane area image and the first non-focal plane area image based on the difference between the depth value of each pixel in the image to be processed and the depth value of the focal plane.
[0059] Here, the difference between the depth value of each pixel in the image to be processed and the depth value of the focal plane is the vertical distance between each pixel in the image to be processed and the focal plane.
[0060] That is, the image to be processed is divided into a first focal plane area image and a first non-focal plane area image according to the vertical distance between each pixel point in the image to be processed and the focal plane.
[0061] In some embodiments, step 303 specifically includes: when the difference value satisfies a first preset range, taking the area composed of the corresponding multiple pixel points in the image to be processed as the first focal plane area image; when the difference value satisfies a second preset range, taking the area composed of the corresponding multiple pixel points in the image to be processed as the first non-focal plane area image; wherein the maximum value of the first preset range is less than the minimum value of the second preset range.
[0062] It should be noted that the first preset range and the second preset range can be further refined to divide the first focal plane area image to different degrees and the first non-focal plane area image to different degrees, for example Figure 2 The secondary focal plane area image and the background area image shown in FIG. 1 both belong to the first non-focal plane area image.
[0063] It should also be noted that when performing image segmentation, the segmentation criteria can be set in advance, such as setting the first and second preset ranges above to divide the image to be processed into two levels, or further refine the range. The segmentation criteria can also be set based on the scene. For example, for photo shooting or low-resolution scenes, no grading or fewer levels can be used to achieve better image quality. In photo shooting scenarios, users need to preview a photo after taking it. To ensure the overall effect, image signal processing is performed on the entire photo without performing differentiated processing by level. However, when users take multiple photos continuously, differentiated processing by level is required due to time constraints. For low-resolution scenes, the resolution of the entire captured image is low, so differentiated processing by level is unnecessary.
[0064] Step 304: Process the first focal plane area image according to a first image signal processing strategy to obtain a second focal plane area image.
[0065] Step 305: Process the first non-focal plane area image according to a second image signal processing strategy to obtain a second non-focal plane area image; wherein the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image.
[0066] In actual applications, steps 301 to 305 are performed by the front end of the camera (also referred to as the CP side, i.e., the image sensor and the ISP image processor).
[0067] Step 306: Using an image blurring algorithm, blurring the second focal plane area image and the second non-focal plane area image to obtain blurred images.
[0068] In practical applications, step 306 is performed by the camera's backend (also known as the AP side, i.e., the application processor (CPU)). Specifically, after step 305 is completed, the second focal plane area image and the second non-focal plane area image need to be transmitted to the camera's backend, which then performs the image blurring processing.
[0069] In some embodiments, step 306 specifically includes: using the image blurring algorithm to blur the second non-focal plane area image to obtain a third non-focal plane area image; and combining the third non-focal plane area image and the second focal plane area image to obtain a blurred image.
[0070] It should also be noted that in addition to dividing the image to be processed based on the vertical distance between each pixel point and the focal plane in the image to be processed, the image to be processed can also be divided based on the recognition results of eye tracking, changes in the focus area, etc., without specific limitation.
[0071] By adopting the above technical solution, the image to be processed is divided into a first focal plane area image and a first non-focal plane area image according to the vertical distance between each pixel point in the image to be processed and the focal plane, and image refinement processing is performed on the first focal plane area image, while image non-refinement processing is performed on the first non-focal plane area image. This reduces system power consumption while ensuring the image quality of the first focal plane area image.
[0072] Based on the above embodiments, Figure 5 This is a schematic diagram of a camera system module provided in an embodiment of the present application, such as Figure 5 As shown, the camera system module includes a front end and a back end.
[0073] Among them, the front end of the camera is used to collect the image to be processed and determine the depth value of each pixel in the image to be processed; and based on the difference between the depth value of each pixel in the image to be processed and the depth value of the focal plane, the image to be processed is divided into a first focal plane area image and a first non-focal plane area image, and then the first focal plane area image and the first non-focal plane area image are differentially processed according to different image signal processing strategies to obtain a second focal plane area image and a second non-focal plane area image; the second focal plane area image and the second non-focal plane area image are transmitted to the back end of the camera through the MIPI / PCIe protocol for blur processing to obtain the blurred image of the image to be processed.
[0074] Based on the above embodiments of the present application, further examples are given to illustrate: Figure 6 This is a third flow chart of an image blurring method provided in an embodiment of the present application, such as Figure 6 As shown, the image blurring method specifically includes:
[0075] Step 601: Acquire an image to be processed and determine the depth value of each pixel in the image to be processed; wherein the depth value is the vertical distance between the pixel and the imaging plane of the collector.
[0076] Step 602: Determine the depth value of the focal plane.
[0077] For example, Figure 4 This is a schematic diagram of an image blurring principle provided in an embodiment of the present application, such as Figure 4 As shown, when using a camera to focus and take a photo of a portrait, the plane where the focus area (or area of interest) is located is called the focal plane, the plane where the camera is located is called the imaging plane, and the vertical distance between the focal plane and the imaging plane is the focus distance, also called the depth value of the focal plane.
[0078] The vertical distance between each pixel that makes up the portrait and the imaging plane of the camera (i.e., the collector) is the depth value of each pixel that makes up the portrait. The vertical distance between each pixel that makes up the background tree and the imaging plane of the camera is the depth value of each pixel that makes up the tree.
[0079] Regarding the method for calculating the depth value of each pixel in the image to be processed, for example, it can be obtained using a depth camera with a depth information acquisition function, which includes a time of flight (TOF) sensor. The ranging principle is to continuously send light pulses to the object, and then use the TOF sensor to receive the light pulses returned from the object. By detecting the flight (round-trip) time of the light pulses and the speed of light, the vertical distance between each pixel on the object and the camera imaging plane is obtained. It can also be obtained by measuring with a binocular camera. Specifically, the binocular camera captures two left and right images of the same scene, and uses a stereo matching algorithm to obtain a disparity map, and then obtains the depth map, that is, the depth information of the image.
[0080] Regarding the method for calculating the depth value of the focal plane, exemplarily, in some embodiments, determining the depth value of the focal plane includes: obtaining the focus parameters of the collector; determining the region of interest in the image to be processed based on the focus parameters; taking the plane where the region of interest is located as the focal plane; and determining the depth value of the focal plane based on the depth values of each pixel point in the image to be processed.
[0081] Here, the upper left corner coordinate information and the lower right corner coordinate information for determining the region of interest are obtained from the focus parameters, the region of interest of the image to be processed is determined according to the upper left corner coordinate information and the lower right corner coordinate information, the plane where the region of interest is located is used as the focal plane, and based on the depth value of each pixel point in the image to be processed, the depth value of any pixel point in the region of interest is obtained and used as the depth value of the focal plane.
[0082] Step 603: Divide the image to be processed into the first focal plane area image and the first non-focal plane area image based on the difference between the depth value of each pixel in the image to be processed and the depth value of the focal plane.
[0083] Here, the difference between the depth value of each pixel in the image to be processed and the depth value of the focal plane is the vertical distance between each pixel in the image to be processed and the focal plane.
[0084] That is, the image to be processed is divided into a first focal plane area image and a first non-focal plane area image according to the vertical distance between each pixel point in the image to be processed and the focal plane.
[0085] In some embodiments, step 603 specifically includes: when the difference value satisfies a first preset range, taking the area composed of the corresponding multiple pixel points in the image to be processed as the first focal plane area image; when the difference value satisfies a second preset range, taking the area composed of the corresponding multiple pixel points in the image to be processed as the first non-focal plane area image; wherein the maximum value of the first preset range is less than the minimum value of the second preset range.
[0086] It should be noted that the first preset range and the second preset range can be further refined to divide the first focal plane area image to different degrees and the first non-focal plane area image to different degrees, for example Figure 2 The secondary focal plane area image and the background area image shown in FIG. 1 both belong to the first non-focal plane area image.
[0087] Step 604: Acquire scene information of the image to be processed; wherein the scene information at least includes a portrait scene.
[0088] Here, the scene information of the image to be processed can be understood as the focus of this image signal processing. For example, the scene information at least includes a portrait scene.
[0089] It should be noted that, based on the division of the image to be processed according to the vertical distance between each pixel point and the focal plane in the image to be processed, combined with the focus of this image signal processing, that is, the scene information of the image, such as the portrait scene, the portrait in the entire image is processed with emphasis.
[0090] Step 605: Based on the portrait scene, if a non-portrait area image is segmented from the first focal plane area image, the non-portrait area image is used as the first non-focal plane area image; based on the portrait scene, if a portrait area image is segmented from the first non-focal plane area image, the portrait area image is used as the first focal plane area image.
[0091] Here, for the focus of this image signal processing, namely, a portrait scene, when a portion of the portrait is located in the first non-focal plane area image, a portrait recognition method can be used to segment the portrait area image in the first non-focal plane area image and use it as the first focal plane area image for image signal processing, i.e., executing step 606. When performing image blur processing, blur processing is performed on the portrait area image in the first non-focal plane area image and other area images in the first non-focal plane area image according to the same image blur strategy.
[0092] Correspondingly, when part of the non-portrait image is located on the first focal plane area image, the portrait area image in the first focal plane area image can be segmented out using a portrait recognition method to obtain a non-portrait area image in the first focal plane area image, which is then used as the first non-focal plane area image for image signal processing, i.e., step 607 is executed.
[0093] Step 606: Process the first focal plane area image according to a first image signal processing strategy to obtain a second focal plane area image.
[0094] Step 607: Process the first non-focal plane area image according to a second image signal processing strategy to obtain a second non-focal plane area image; wherein the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image.
[0095] In actual applications, steps 601 to 607 are performed by the front end of the camera (also referred to as the CP side, i.e., the image sensor and the ISP image processor).
[0096] Step 608: Using an image blurring algorithm, blurring the second focal plane area image and the second non-focal plane area image to obtain blurred images.
[0097] In practical applications, step 608 is performed by the camera's backend (also known as the AP side, i.e., the application processor (CPU)). Specifically, after step 607 is completed, the second focal plane area image and the second non-focal plane area image need to be transmitted to the camera's backend, which then performs the image blurring processing.
[0098] In some embodiments, blurring the second focal plane area image and the second non-focal plane area image using an image blurring algorithm includes: blurring the second non-focal plane area image using the image blurring algorithm to obtain a third non-focal plane area image; and the third non-focal plane area image and the second focal plane area image constitute a blurred image.
[0099] By adopting the above technical solution, the image to be processed is divided into a first focal plane area image and a first non-focal plane area image based on the vertical distance between each pixel point and the focal plane and scene information in the image to be processed. Image refinement processing is performed on the first focal plane area image, and image non-refinement processing is performed on the first non-focal plane area image. This reduces system power consumption while ensuring the image quality of the first focal plane area image.
[0100] In order to implement the method of the embodiment of the present application, based on the same inventive concept, the embodiment of the present application further provides an image blur processing device, Figure 7 A schematic diagram of the structure of an image blur processing device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the image blur processing device 70 includes:
[0101] A division unit 701 is configured to acquire an image to be processed and divide the image to be processed into a first focal plane area image and a first non-focal plane area image according to an image division strategy;
[0102] a first processing unit 702 configured to process the first focal plane area image according to a first image signal processing strategy to obtain a second focal plane area image; and to process the first non-focal plane area image according to a second image signal processing strategy to obtain a second non-focal plane area image; wherein the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image;
[0103] The second processing unit 703 is configured to perform blurring processing on the second focal plane area image and the second non-focal plane area image by using an image blurring algorithm to obtain blurred images.
[0104] By adopting the above technical solution, the image to be processed is divided into a first focal plane area image and a first non-focal plane area image, image refinement processing is performed on the first focal plane area image, and image non-refinement processing is performed on the first non-focal plane area image, so that the system power consumption is reduced while ensuring the image effect of the first focal plane area image.
[0105] In some embodiments, the first image signal processing strategy includes at least one of the following: a first image noise reduction process, a first image resolution process, and a first high dynamic range image process;
[0106] The second image signal processing strategy includes at least one of the following: a second image noise reduction process, a second image resolution process, and a second high dynamic range image process.
[0107] In some embodiments, the dividing unit 701 is specifically configured to determine a depth value of each pixel in the image to be processed; wherein the depth value is a vertical distance between the pixel and the imaging plane of the collector;
[0108] Determine the depth value of the focal plane;
[0109] Based on a difference between a depth value of each pixel in the image to be processed and a depth value of the focal plane, the image to be processed is divided into the first focal plane area image and the first non-focal plane area image.
[0110] In some embodiments, the dividing unit 701 is further configured to obtain a focus parameter of the collector;
[0111] Determine a region of interest in the image to be processed based on the focus parameter; and use the plane where the region of interest is located as a focal plane;
[0112] The depth value of the focal plane is determined based on the depth value of each pixel in the image to be processed.
[0113] In some embodiments, the dividing unit 701 is further configured to use, when the difference value satisfies a first preset range, an area consisting of corresponding pixels in the image to be processed as the first focal plane area image;
[0114] When the difference value satisfies a second preset range, an area formed by a corresponding plurality of pixel points in the image to be processed is used as the first non-focal plane area image;
[0115] The maximum value of the first preset range is smaller than the minimum value of the second preset range.
[0116] In some embodiments, the segmentation unit 701 is further configured to obtain scene information of the image to be processed; wherein the scene information includes at least a portrait scene; and based on the portrait scene, if a non-portrait area image is segmented from the first focal plane area image, the non-portrait area image is used as the first non-focal plane area image;
[0117] According to the portrait scene, if a portrait area image is segmented from the first non-focus plane area image, the portrait area image is used as the first focus plane area image.
[0118] In some embodiments, the second processing unit 703 is specifically configured to perform blurring processing on the second non-focal plane area image using the image blurring algorithm to obtain a third non-focal plane area image;
[0119] The third non-focal plane area image and the second focal plane area image are used to obtain the image after blurring.
[0120] The present application also provides another electronic device. Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 8 As shown, the electronic device 80 includes: a processor 801 and a memory 802 configured to store a computer program that can be run on the processor;
[0121] The processor 801 is configured to execute the method steps in the aforementioned embodiment when running the computer program.
[0122] Of course, in actual application, Figure 8 As shown, the various components in the electronic device 80 are coupled together via a bus system 803. It is understood that the bus system 803 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 803 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 8 Various buses are labeled as bus system 803.
[0123] In practical applications, the processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It is understood that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiments of the present application do not specifically limit this.
[0124] The above-mentioned memory can be a volatile memory (volatile memory), such as a random-access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above types of memory, and provides instructions and data to the processor.
[0125] In an exemplary embodiment, the present application also provides a computer-readable storage medium for storing a computer program.
[0126] Optionally, the computer-readable storage medium can be applied to any one of the methods in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the processor in each method in the embodiments of the present application. For the sake of brevity, they are not repeated here.
[0127] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0128] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0129] In addition, the functional units in the embodiments of the present invention can all be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the above-mentioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROMs), random access memories (RAMs), magnetic disks or optical disks.
[0130] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0131] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0132] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0133] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for blurring an image, characterized in that: The method comprises: Acquire an image to be processed, and divide the image to be processed into a first focal plane area image and a first non-focal plane area image according to an image division strategy; wherein the first focal plane area image is an area image consisting of a focused object, and the first non-focal plane area image is an image other than the area image consisting of the focused object; Processing the first focal plane area image according to a first image signal processing strategy to obtain a second focal plane area image; processing the first non-focal plane area image according to a second image signal processing strategy to obtain a second non-focal plane area image; wherein the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image; Performing blurring processing on the second focal plane area image and the second non-focal plane area image using an image blurring algorithm to obtain blurred images; The method of dividing the image to be processed into a first focal plane area image and a first non-focal plane area image according to an image division strategy includes: determining a depth value of each pixel in the image to be processed; wherein the depth value is a vertical distance between the pixel and an imaging plane of a collector; determining a depth value of a focal plane; and dividing the image to be processed into the first focal plane area image and the first non-focal plane area image based on a difference between the depth value of each pixel in the image to be processed and the depth value of the focal plane.
2. The method according to claim 1, characterized in that The first image signal processing strategy includes at least one of the following: a first image noise reduction process, a first image resolution process, and a first high dynamic range image process; The second image signal processing strategy includes at least one of the following: a second image noise reduction process, a second image resolution process, and a second high dynamic range image process.
3. The method according to claim 1, characterized in that Determining the depth value of the focal plane includes: Obtaining focus parameters of the collector; Determine a region of interest in the image to be processed based on the focus parameter; and use the plane where the region of interest is located as a focal plane; The depth value of the focal plane is determined based on the depth value of each pixel in the image to be processed.
4. The method according to claim 1, wherein The step of dividing the image to be processed into the first focal plane area image and the first non-focal plane area image based on a difference between a depth value of each pixel in the image to be processed and a depth value of the focal plane includes: When the difference value satisfies a first preset range, an area formed by a corresponding plurality of pixel points in the image to be processed is used as the first focal plane area image; When the difference value satisfies a second preset range, an area formed by a corresponding plurality of pixel points in the image to be processed is used as the first non-focal plane area image; The maximum value of the first preset range is smaller than the minimum value of the second preset range.
5. The method according to claim 1, wherein The method further includes: acquiring scene information of the image to be processed; wherein the scene information at least includes a portrait scene; After dividing the image to be processed into a first focal plane area image and a first non-focal plane area image, the method further includes: According to the portrait scene, if a non-portrait area image is segmented from the first focal plane area image, the non-portrait area image is used as the first non-focal plane area image; According to the portrait scene, if a portrait area image is segmented from the first non-focus plane area image, the portrait area image is used as the first focus plane area image.
6. The method according to claim 1, characterized in that The method of using an image blurring algorithm to blur the second focal plane area image and the second non-focal plane area image to obtain blurred images includes: Performing blurring processing on the second non-focal plane area image using the image blurring algorithm to obtain a third non-focal plane area image; The third non-focal plane area image and the second focal plane area image are used to obtain the image after blurring.
7. An image blurring device, characterized in that: The device comprises: a dividing unit, configured to acquire an image to be processed and divide the image to be processed into a first focal plane area image and a first non-focal plane area image according to an image dividing strategy; wherein the first focal plane area image is an area image consisting of an in-focus object, and the first non-focal plane area image is an image other than the area image consisting of the in-focus object; a first processing unit, configured to process the first focal plane area image according to a first image signal processing strategy to obtain a second focal plane area image; and to process the first non-focal plane area image according to a second image signal processing strategy to obtain a second non-focal plane area image; wherein the image quality of the second focal plane area image is higher than the image quality of the second non-focal plane area image; a second processing unit, configured to perform blurring processing on the second focal plane area image and the second non-focal plane area image using an image blurring algorithm to obtain blurred images; The division unit is specifically used to determine the depth value of each pixel point in the image to be processed; wherein the depth value is the vertical distance between the pixel point and the imaging plane of the collector; determine the depth value of the focal plane; based on the difference between the depth value of each pixel point in the image to be processed and the depth value of the focal plane, divide the image to be processed into the first focal plane area image and the first non-focal plane area image.
8. An electronic device, characterized in that: The electronic device comprises: a processor and a memory configured to store a computer program capable of running on the processor, Wherein, the processor is configured to execute the steps of the method according to any one of claims 1 to 6 when running the computer program.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method for fingerprint image mark direction calculation and image segmentation based on BP neural network
CN101414349A
Background blurring processing method, device and equipment
CN108024057A
Double-camera blurring processing method and device, electronic equipment and readable storage medium
CN112991245A
Image processing method and device, storage medium and mobile terminal
CN114390189A