Depth image processing method, depth image processing device and electronic device

By acquiring and processing depth images in electronic devices, calculating the target depth of field in groups and blurring, the problem of poor blurring of non-shot subjects when multiple people or groups are taking photos is solved, and the user experience is improved.

CN115866419BActive Publication Date: 2025-05-09GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211462523.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-11-02
Publication Date
2025-05-09
Estimated Expiration
2038-11-02

AI Technical Summary

Technical Problem

The prior art cannot effectively deal with the blurring of non-shot subjects when taking photos by multiple people or groups, resulting in poor user experience.

Method used

By acquiring the initial depth image in the electronic device, acquiring the target depth data of the region of interest, determining whether the number of regions of interest is greater than a predetermined value, calculating the target depth of field in groups, and blurring the initial depth image according to the target depth of field.

Benefits of technology

When taking photos from multiple people or groups, ensure that the area of ​​interest is clear, improve the user experience, and effectively deal with the blurring of non-subjects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115866419B_ABST
    Figure CN115866419B_ABST
Patent Text Reader

Abstract

A depth image processing method, a depth image processing device (10) and an electronic device (100). The depth image processing method is used in an electronic device (100). The electronic device (100) includes a depth image acquisition device (20). The depth image acquisition device (20) is used to acquire an initial depth image. The depth image processing method includes: (01) acquiring target depth data of an area of ​​interest based on the initial depth image; (02) determining whether the number of areas of interest is greater than a predetermined value; (03) when the number of areas of interest is greater than the predetermined value, grouping the areas of interest based on the target depth data to calculate a target depth of field; (04) calculating a target blur intensity based on the target depth of field; and (05) blurring the initial depth image based on the target blur intensity to obtain a blurred depth image.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application based on the prior application with application number 201880098758.X and invention name “Depth image processing method, depth image processing device and electronic device”. Technical Field

[0002] The present application relates to the field of image processing technology, and in particular to a depth image processing method, a depth image processing device and an electronic device. Background Art

[0003] Smartphone cameras are becoming more and more popular, and blurring is a common method used in camera photography. The current blurring method is to define a depth of field based on the subject, and then blur the parts outside the depth of field. However, when taking photos of multiple people or a group of people at the same time, except for the portrait of the subject, the rest of the parts will be blurred, resulting in a poor user experience. Summary of the invention

[0004] Embodiments of the present application provide a depth image processing method, a depth image processing device, and an electronic device.

[0005] The depth image processing method of the embodiment of the present application is used for an electronic device. The electronic device includes a depth image acquisition device. The depth image acquisition device is used to acquire an initial depth image. The depth image processing method includes: acquiring target depth data of the region of interest according to the initial depth image; determining whether the number of the regions of interest is greater than a predetermined value; when the number of the regions of interest is greater than the predetermined value, grouping the regions of interest according to the target depth data to calculate a target depth of field; calculating a target blur intensity according to the target depth of field; and blurring the initial depth image according to the target blur intensity to obtain a blurred depth image.

[0006] The depth image processing device of the embodiment of the present application is used for an electronic device. The electronic device includes a depth image acquisition device. The depth image acquisition device is used to acquire an initial depth image. The depth image processing device includes an acquisition module, a first judgment module, a first calculation module, a second calculation module and a processing module. The acquisition module is used to acquire target depth data of the region of interest based on the initial depth image. The first judgment module is used to determine whether the number of the regions of interest is greater than a predetermined value. The first calculation module is used to group the regions of interest according to the target depth data to calculate the target depth of field when the number of the regions of interest is greater than the predetermined value. The second calculation module is used to calculate the target blur intensity according to the target depth of field. The processing module is used to blur the initial depth image according to the target blur intensity to obtain a blurred depth image.

[0007] The electronic device of the embodiment of the present application includes a depth image acquisition device and a processor. The depth image acquisition device is used to acquire an initial depth image. The processor is used to: acquire target depth data of the region of interest according to the initial depth image; determine whether the number of the regions of interest is greater than a predetermined value; when the number of the regions of interest is greater than the predetermined value, group the regions of interest according to the target depth data to calculate the target depth of field; calculate the target blur intensity according to the target depth of field; and blur the initial depth image according to the target blur intensity to obtain a blurred depth image.

[0008] When the number of regions of interest is greater than a predetermined value, the depth image processing method, depth image processing device and electronic device of the embodiments of the present application group the regions of interest according to the target depth data of the regions of interest to calculate the target depth of field, thereby calculating the target blur degree according to the target depth of field to blur the initial depth image, so that a better user experience can be provided when taking photos of multiple people or groups.

[0009] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0011] Figure 1 is a flowchart of a depth image processing method according to certain embodiments of the present application;

[0012] Figure 2 is a three-dimensional structural schematic diagram of a state of an electronic device in some embodiments of the present application;

[0013] Figure 3 is a schematic diagram of a three-dimensional structure of an electronic device in another state according to some embodiments of the present application;

[0014] Figure 4 is a schematic diagram of a module of a depth image processing device according to some embodiments of the present application;

[0015] Figure 5 is a scene schematic diagram of a depth image processing method according to some embodiments of the present application;

[0016] Figure 6 is a flowchart of a depth image processing method according to certain embodiments of the present application;

[0017] Figure 7 is a scene schematic diagram of a depth image processing method according to some embodiments of the present application;

[0018] Figure 8 is a schematic diagram of a module of an acquisition module in some embodiments of the present application;

[0019] Fig. 9 is a flowchart of a depth image processing method according to certain embodiments of the present application;

[0020] Fig.10 is a schematic diagram of a module of an acquisition module in some embodiments of the present application;

[0021] Fig.11 is a flowchart of a depth image processing method according to certain embodiments of the present application;

[0022] Fig.12 is a module schematic diagram of a first computing module in certain embodiments of the present application;

[0023] Fig.13 and Fig.14 is a scene schematic diagram of a depth image processing method according to some embodiments of the present application;

[0024] Fig.15 is a flowchart of a depth image processing method according to certain embodiments of the present application;

[0025] Fig.16 is a module schematic diagram of a first computing module in certain embodiments of the present application;

[0026] Fig.17 is a flowchart of a depth image processing method according to certain embodiments of the present application;

[0027] Fig.18 is a schematic diagram of a module of a depth image processing device according to some embodiments of the present application;

[0028] Fig.19 is a flowchart of a depth image processing method according to certain embodiments of the present application;

[0029] Fig. 20 is a schematic diagram of a module of a depth image processing device according to some embodiments of the present application;

[0030] Fig.21 It is a scene schematic diagram of the depth image processing method of certain embodiments of the present application. DETAILED DESCRIPTION

[0031] Please also read Figures 1 to 3 The depth image processing method of the embodiment of the present application is used in the electronic device 100. The electronic device 100 includes a depth image acquisition device 20. The depth image acquisition device 20 is used to acquire an initial depth image. The depth image processing method includes:

[0032] 01: Obtain target depth data of the area of ​​interest based on the initial depth image;

[0033] 02: Determine whether the number of regions of interest is greater than a predetermined value;

[0034] 03: When the number of regions of interest is greater than a predetermined value, the regions of interest are grouped according to the target depth data to calculate the target depth of field;

[0035] 04: Calculate the target blur intensity based on the target depth of field; and

[0036] 05: Blur the initial depth image according to the target blur intensity to obtain a blurred depth image.

[0037] Please combine Figure 4 , the depth image processing device 10 of the embodiment of the present application is used for the electronic device 100. The electronic device 100 includes a depth image acquisition device 20. The depth image acquisition device 20 is used to acquire an initial depth image. The depth image processing device 10 includes an acquisition module 11, a first judgment module 12, a first calculation module 13, a second calculation module 14 and a processing module 15. The depth image processing method of the embodiment of the present application can be implemented by the depth image processing device 10 of the embodiment of the present application. For example, the acquisition module 11 can be used to execute the method in 01, the first judgment module 12 can be used to execute the method in 02, the first calculation module 13 can be used to execute the method in 03, the second calculation module 14 can be used to execute the method in 04, and the processing module 15 can be used to execute the method in 05. That is to say, the acquisition module 11 can be used to acquire the target depth data of the region of interest according to the initial depth image. The first judgment module 12 can be used to determine whether the number of regions of interest is greater than a predetermined value. The first calculation module 13 can be used to group the regions of interest according to the target depth data to calculate the target depth of field when the number of regions of interest is greater than a predetermined value. The second calculation module 14 may be used to calculate the target blur intensity according to the target depth of field. The processing module 15 may be used to blur the initial depth image according to the target blur intensity to obtain a blurred depth image.

[0038] Please refer again Figure 3, the electronic device 100 of the embodiment of the present application includes a depth image acquisition device 20 and a processor 30. The depth image acquisition device 20 is used to acquire an initial depth image. The depth image processing method of the embodiment of the present application can be implemented by the electronic device 100 of the embodiment of the present application. For example, the processor 30 can be used to execute the methods in 01, 02, 03, 04 and 05. That is to say, the processor 30 can be used to: acquire target depth data of the region of interest based on the initial depth image; determine whether the number of regions of interest is greater than a predetermined value; when the number of regions of interest is greater than a predetermined value, group the regions of interest according to the target depth data to calculate the target depth of field; calculate the target blur intensity according to the target depth of field; and blur the initial depth image according to the target blur intensity to obtain a blurred depth image.

[0039] Specifically, the electronic device 100 can be a mobile phone, a tablet computer, a game console, a smart watch, a head-mounted display device, a drone, etc. The implementation mode of the present application is described using the electronic device 100 as a mobile phone as an example. It can be understood that the specific form of the electronic device 100 is not limited to a mobile phone.

[0040] See also Figure 2 and Figure 3 , the electronic device 100 includes a housing 40. The housing 40 can be used as a mounting carrier for the functional elements of the electronic device 100. The housing 40 can provide protection for the functional elements such as dustproof, waterproof, and drop-proof. The functional elements can be a display screen 50, a receiver 60, etc. The functional element can also be a depth image acquisition device 20. The depth image acquisition device 20 includes any one or more of a dual camera (including a first camera 21 and a second camera 22), a time-of-flight depth camera 23, and a structured light depth camera 24. In an embodiment of the present application, the housing 40 includes a main body 41 and a movable bracket 42. The movable bracket 42 can move relative to the main body 41 under the drive of a driving device. For example, the movable bracket 42 can slide relative to the main body 41 to slide into the main body 41 (such as Figure 2 ) or slide out from the main body 41 (as shown) Figure 3 As shown). Some functional elements (such as the display screen 50) can be installed on the main body 41, and other functional elements (such as the receiver 60 and the depth image acquisition device 20) can be installed on the movable bracket 42. The movement of the movable bracket 42 can drive the other functional elements to retract into the main body 41 or extend from the main body 41. Of course, Figure 2 and Figure 3 What is shown is merely an example of a specific form of the housing 40 and should not be construed as a limitation on the housing 40 of the present application.

[0041] The depth image acquisition device 20 is mounted on the housing 40. Specifically, the depth image acquisition device 20 is mounted on a movable bracket 42. When the user needs to use the depth image acquisition device 20 to acquire a depth image, the user can trigger the movable bracket 42 to slide out of the main body 41 to drive the depth image acquisition device 20 to extend from the main body 41. When the depth image acquisition device 20 is not needed, the user can trigger the movable bracket 42 to slide into the main body 41 to drive the depth image acquisition device 20 to retract into the main body 41. In other embodiments, a light-through hole (not shown) may be provided on the housing 40, and the depth image acquisition device 20 is immovably disposed in the housing 40 and corresponds to the light-through hole to acquire a depth image; or, a light-through hole (not shown) may be provided on the display screen 50, and the depth image acquisition device 20 is disposed below the display screen 50 and corresponds to the light-through hole to acquire a depth image.

[0042] When the depth image processing method of the embodiment of the present application is applied, the processor 30 obtains the target depth data of the region of interest based on the initial depth image. The region of interest is the focus area in the image. The region of interest can be an area set or selected in advance by the user, such as flowers, trees or other scenery selected by the user, and the region of interest can also be a face area. The number of regions of interest can be one or more. For example, when taking a group or multiple people photo, each portrait area can be used as a region of interest. Figure 5 In the figure, there are three regions of interest, namely R1, R2, and R3. When taking pictures, the regions R1, R2, and R3 remain clear, while the regions other than R1, R2, and R3 present a certain blur effect. The target depth data of the regions R1, R2, and R3 acquired by the processor 30 may be D1, D2, and D3, respectively, where D1<D2<D3, i.e., the distance between the photographed objects corresponding to the regions R1, R2, and R3 and the image acquisition device 20 gradually increases.

[0043] The processor 30 also determines whether the number of regions of interest is greater than a predetermined value. Specifically, the predetermined value may be 1. In other words, when there are two or more regions of interest, it is determined whether the number of regions of interest is greater than the predetermined value.

[0044] When the number of regions of interest is greater than a predetermined value, the processor 30 groups the regions of interest according to the target depth data to calculate the target depth of field. Figure 5For example, since the number of regions of interest is 3, which is greater than the predetermined value 1, the processor 30 groups the R1, R2, and R3 regions according to the sizes of D1, D2, and D3. Specifically, the processor 30 can group the regions of interest with adjacent target depth data from small to large. For example, the processor 30 first groups R1 and R2 as a group, calculates a depth of field D12, and then calculates a depth of field D123 with R3 as a group, and finally determines the target depth of field based on the calculated depth of field D123, and then determines the target blur intensity, and blurs the initial depth image according to the target blur intensity to obtain a blurred depth image. Similarly, when the number of regions of interest is 4 or more, for example, the regions of interest are R1, R2, R3, and R4, the processor 30 first groups R1 and R2 as a group, calculates a depth of field D12, and then calculates a depth of field D123 with R3 as a group, and finally calculates a depth of field D1234 with R4 as a group. Of course, in other embodiments, the processor 30 may also group the regions of interest with adjacent target depth data from large to small. For example, when the number of regions of interest is 3, the processor 30 first groups R3 and R2 as a group, calculates a depth of field D32, and then groups them with R1 as a group to calculate a depth of field D321.

[0045] It can be understood that when the number of regions of interest is less than or equal to a predetermined value, for example, when taking a single person photo, the number of regions of interest is 1, and the processor 30 does not need to group the regions of interest according to the target depth data. The processor 30 can directly calculate the target depth of field based on the region of interest, and then determine the target blur intensity, and blur the initial depth image according to the target blur intensity to obtain a blurred depth image.

[0046] The depth image processing method, depth image processing device 10 and electronic device 100 of the embodiments of the present application, when the number of regions of interest is greater than a predetermined value, group multiple regions of interest according to the target depth data of the regions of interest to calculate the target depth of field, rather than considering only the target depth data of one region of interest to determine the target depth of field corresponding to the one region of interest. Therefore, it can be ensured that multiple regions of interest are clear, so that a better user experience can be provided when taking photos of multiple people or groups.

[0047] See also Figure 6 and Figure 7 In some embodiments, the depth image acquisition device 20 includes a first camera 21 and a second camera 22. The first camera 21 is used to acquire a first image. The second camera 22 is used to acquire a second image. The first image and the second image are used to synthesize an initial depth image. Acquiring target depth data of the region of interest (i.e., 01) according to the initial depth image includes:

[0048] 011: Identify a region of interest in the first image or the second image;

[0049] 012: Calculate initial depth data of an initial depth image; and

[0050] 013: Obtain target depth data corresponding to the region of interest in the initial depth data.

[0051] Please combine Figure 8 In some embodiments, the depth image acquisition device 20 includes a first camera 21 and a second camera 22. The first camera 21 is used to acquire a first image. The second camera 22 is used to acquire a second image. The first image and the second image are used to synthesize an initial depth image. The acquisition module 11 includes a first recognition unit 111, a first calculation unit 112, and a first acquisition unit 113. The first recognition unit 111 can be used to execute the method in 011, the first calculation unit 112 can be used to execute the method in 012, and the first acquisition unit 113 can be used to execute the method in 013. That is, the first recognition unit 111 can be used to identify a region of interest in the first image or the second image. The first calculation unit 112 can be used to calculate initial depth data of an initial depth image. The first acquisition unit 113 can be used to acquire target depth data corresponding to the region of interest in the initial depth data.

[0052] Please refer again Figure 7 In some embodiments, the depth image acquisition device 20 includes a first camera 21 and a second camera 22. The first camera 21 is used to acquire a first image. The second camera 22 is used to acquire a second image. The first image and the second image are used to synthesize an initial depth image. The processor 30 can be used to execute the methods in 011, 012, and 013. That is, the processor 30 can be used to identify a region of interest in the first image or the second image; calculate initial depth data of the initial depth image; and obtain target depth data corresponding to the region of interest in the initial depth data.

[0053] Specifically, the first camera 21 and the second camera 22 may be RGB cameras. The first camera 21 and the second camera 22 shoot the same scene from two different angles to obtain a first image and a second image respectively, thereby synthesizing an initial depth image with depth information.

[0054] In the embodiment of the present application, the first camera 21 and the second camera 22 may both be visible light cameras, in which case the first image and the second image are both visible light images; or the first camera 21 is an infrared camera and the second camera 22 is a visible light camera, in which case the first image is an infrared image and the second image is a visible light image; or the first camera 21 is a visible light camera and the second camera 22 is an infrared camera, in which case the first image is a visible light image and the second image is an infrared image. Of course, the first camera 21 and the second camera 22 may also be other types of cameras, and the first image and the second image are images of corresponding types, which are not limited here. The region of interest is an image region in the first image or the second image. The processor 30 may use an image recognition algorithm to identify whether there is a region of interest from the first image or the second image, and determine the position of the region of interest, that is, the horizontal and vertical coordinate range of the pixels occupied by the region of interest in the first image or the second image; the processor 30 also calculates the initial depth data of the entire initial depth image; since the first image or the second image is registered and aligned with the initial depth image and has a certain corresponding relationship, the processor 30 may search for target depth data corresponding to the region of interest from the initial depth data. It should be noted that the execution order of 011 and 012 can be arbitrary, for example, 011 is executed first and then 012, or 012 is executed first and then 011, or 011 and 012 are executed at the same time.

[0055] See also Figure 3 and Fig. 9 In some embodiments, the depth image acquisition device 20 includes a time of flight (TOF) depth camera 23. Acquiring target depth data of the region of interest (ie, 01) according to the initial depth image includes:

[0056] 014: Identify the region of interest in the initial depth image;

[0057] 015: Calculate initial depth data of an initial depth image; and

[0058] 016: Obtain target depth data corresponding to the region of interest in the initial depth data.

[0059] Please combine Fig.10In some embodiments, the depth image acquisition device 20 includes a time-of-flight depth camera 23. The acquisition module 11 includes a second recognition unit 114, a second calculation unit 115, and a second acquisition unit 116. The second recognition unit 114 can be used to execute the method in 014, the second calculation unit 115 can be used to execute the method in 015, and the second acquisition unit 116 can be used to execute the method in 016. That is, the second recognition unit 114 can be used to identify the region of interest in the initial depth image. The second calculation unit 115 can be used to calculate the initial depth data of the initial depth image. The second acquisition unit 116 can be used to acquire the target depth data corresponding to the region of interest in the initial depth data.

[0060] See also Figure 3 In some embodiments, the depth image acquisition device 20 includes a time-of-flight depth camera 23. The processor 30 may be used to execute the methods in 014, 015, and 016. That is, the processor 30 may be used to: identify a region of interest in an initial depth image; calculate initial depth data of the initial depth image; and acquire target depth data corresponding to the region of interest in the initial depth data.

[0061] Specifically, the time-of-flight depth camera 23 may include an infrared transmitter, an infrared receiver and an infrared processing chip. The infrared processing chip is connected to the infrared transmitter and the infrared receiver, respectively. When the time-of-flight depth camera 23 is used to obtain an initial depth image, the infrared transmitter emits infrared light of a specific wavelength (for example, 950nm) to a predetermined distance range in front of the electronic device 100. The infrared light will be reflected back after encountering the object to be measured and received by the infrared receiver. The infrared receiving chip can obtain the depth information of the object to be measured by calculating the phase difference or time difference between the emitted infrared light and the reflected infrared light, thereby obtaining an initial depth image. Among them, the infrared processing chip and the processor 30 can be the same component or two different components.

[0062] In the implementation manner of the present application, the region of interest is an image region in the initial depth image. The processor 30 can identify whether there is a region of interest from the initial depth image based on the depth information, and determine the position of the region of interest, that is, the horizontal and vertical coordinate range of the pixels occupied by the region of interest in the initial depth image; the processor 30 also calculates the initial depth data of the entire initial depth image; the processor 30 finally searches for the target depth data corresponding to the region of interest from the initial depth data. It should be pointed out that the order of execution of 014 and 015 can be arbitrary, for example, execute 014 first and then execute 015, or execute 015 first and then execute 014, or execute 014 and 015 at the same time.

[0063] See also Figure 3 and Fig. 9In some embodiments, the depth image acquisition device 20 includes a structured light depth camera 24. Acquiring target depth data of the region of interest (ie, 01) according to the initial depth image includes:

[0064] 014: Identify the region of interest in the initial depth image;

[0065] 015: Calculate initial depth data of an initial depth image; and

[0066] 016: Obtain target depth data corresponding to the region of interest in the initial depth data.

[0067] Please combine Fig.10 In some embodiments, the depth image acquisition device 20 includes a structured light depth camera 24. The acquisition module 11 includes a second recognition unit 114, a second calculation unit 115, and a second acquisition unit 116. The second recognition unit 114 can be used to execute the method in 014, the second calculation unit 115 can be used to execute the method in 015, and the second acquisition unit 116 can be used to execute the method in 016. The second recognition unit 114 can be used to identify a region of interest in an initial depth image. The second calculation unit 115 can be used to calculate initial depth data of the initial depth image. The second acquisition unit 116 can be used to acquire target depth data corresponding to the region of interest in the initial depth data.

[0068] See also Figure 3 In some embodiments, the depth image acquisition device 20 includes a structured light depth camera 24. The processor 30 may be used to execute the methods in 014, 015, and 016. That is, the processor 30 may be used to: identify the region of interest in the initial depth image; calculate the initial depth data of the initial depth image; and obtain the target depth data corresponding to the region of interest in the initial depth data.

[0069] Specifically, the structured light depth camera 24 may include a structured light projector, a structured light camera, and a structured light processing chip. The structured light processing chip is connected to the structured light projector and the structured light camera, respectively. The structured light camera may be an infrared camera. When the structured light depth camera 24 is used to obtain an initial depth image, the structured light projector projects a laser pattern to a predetermined distance range in front of the electronic device 100, and the structured light camera collects the modulated laser pattern of the object to be measured. The structured light processing chip is used to process the laser pattern to obtain an initial depth image. Among them, the structured light processing chip and the processor 30 may be the same component or two different components.

[0070] In the implementation manner of the present application, the region of interest is an image region in the initial depth image. The processor 30 can identify whether there is a region of interest from the initial depth image based on the depth information, and determine the position of the region of interest, that is, the horizontal and vertical coordinate range of the pixels occupied by the region of interest in the initial depth image; the processor 30 also calculates the initial depth data of the entire initial depth image; the processor 30 finally searches for the target depth data corresponding to the region of interest from the initial depth data. Similarly, the order of execution of 014 and 015 can be arbitrary, for example, execute 014 first and then execute 015, or execute 015 first and then execute 014, or execute 014 and 015 at the same time.

[0071] The depth image processing method of the embodiment of the present application can be applied to a dual-camera, a time-of-flight depth camera 23 or a structured light depth camera 24, and has a wide range of applications.

[0072] See also Fig.11 In some embodiments, grouping regions of interest according to target depth data to calculate a target depth of field (ie, 03) includes:

[0073] 031: Two regions of interest with adjacent target depth data are regarded as a region of interest group;

[0074] 032: Determine whether a depth difference between a first depth of field of one of the regions of interest and a second depth of field of another region of interest in the region of interest group is less than (or equal to) a depth threshold;

[0075] 033: when the depth difference is less than (or equal to) the depth threshold, merging the first depth of field and the second depth of field to obtain a combined depth of field; and

[0076] 034: Calculate target depth of field based on merged depth of field.

[0077] See also Fig.12In some embodiments, the first calculation module 13 includes a first grouping unit 131, a judgment unit 132, a merging unit 133 and a fourth calculation unit 134. The first grouping unit 131 can be used to execute the method in 031, the judgment unit 132 can be used to execute the method in 032, the merging unit 133 can be used to execute the method in 033, and the fourth calculation unit 134 can be used to execute the method in 034. That is to say, the first grouping unit 131 can be used to treat two regions of interest with adjacent target depth data as a region of interest group. The judgment unit 132 can be used to determine whether the depth difference between the first depth of field of one region of interest and the second depth of field of another region of interest in the region of interest group is less than (or equal to) a depth threshold. The merging unit 133 can be used to merge the first depth of field and the second depth of field to obtain a merged depth of field when the depth difference is less than (or equal to) the depth threshold. The fourth calculation unit 134 can be used to calculate the target depth of field based on the merged depth of field.

[0078] See also Figure 3 In some embodiments, the processor 30 may be used to execute the methods in 031, 032, 033, and 034. That is, the processor 30 may be used to: treat two regions of interest with adjacent target depth data as a region of interest group; determine whether the depth difference between the first depth of field of one region of interest and the second depth of field of another region of interest in the region of interest group is less than (or equal to) a depth threshold; when the depth difference is less than (or equal to) the depth threshold, merge the first depth of field and the second depth of field to obtain a merged depth of field; and calculate the target depth of field according to the merged depth of field.

[0079] Specifically, Fig.13 For example, when taking a photo of two people, the number of regions of interest (i.e., portrait regions) is 2. If the depth of field is directly determined as (5.5, 6.5) based on the first region of interest, and the blur intensity is further determined as the curve represented by S11 and S12, then the parts (0, 5.5) and (6.5) outside the depth of field will be blurred, that is, the second region of interest will also be blurred, and the user experience is not good.

[0080] See also Fig.14In the implementation manner of the present application, the processor 30 first regards two regions of interest with adjacent target depth data as a region of interest group, that is, regards the first region of interest and the second region of interest as a region of interest group, and then determines whether the depth difference between the first depth of field (5.5, 6.5) of the first region of interest and the second depth of field (9.5, 10.5) of the second region of interest is less than (or equal to) the depth threshold. When the depth difference is less than (or equal to) the depth threshold, the first depth of field (5.5, 6.5) and the second depth of field (9.5, 10.5) are merged to obtain a merged depth of field, and the target depth of field is calculated based on the merged depth of field.

[0081] See also Fig.15 In some embodiments, the first depth of field and the second depth of field both include a depth of field front edge, a depth of field rear edge, and a predetermined depth value within a range from the depth of field front edge to the depth of field rear edge. Determining whether the depth difference between the first depth of field of one region of interest in the region of interest group and the second depth of field of another region of interest is less than (or equal to) a depth threshold (i.e., 032) includes:

[0082] 0321: Determine whether a depth difference between a predetermined depth value of a first depth of field and a predetermined depth value of a second depth of field is less than (or equal to) a depth threshold.

[0083] See also Fig.16 In some embodiments, the first depth of field and the second depth of field both include a leading edge of the depth of field, a trailing edge of the depth of field, and a predetermined depth value within the range from the leading edge of the depth of field to the trailing edge of the depth of field. The judgment unit 132 includes a judgment subunit 1321. The judgment subunit 1321 can be used to execute the method in 0321. That is, the judgment subunit 1321 can be used to judge whether the depth difference between the predetermined depth value of the first depth of field and the predetermined depth value of the second depth of field is less than (or equal to) the depth threshold.

[0084] See also Figure 3 In some embodiments, the first depth of field and the second depth of field both include a depth of field leading edge, a depth of field trailing edge, and a predetermined depth value located within the range from the depth of field leading edge to the depth of field trailing edge. The processor 30 may be used to execute the method in 0321. That is, the processor 30 may be used to determine whether the depth difference between the predetermined depth value of the first depth of field and the predetermined depth value of the second depth of field is less than (or equal to) a depth threshold.

[0085] Specifically, the leading edge of the depth of field is the depth value closest to the depth acquisition device 20 within the depth of field, and the trailing edge of the depth of field is the depth value farthest from the depth acquisition device 20 within the depth of field. Fig.14For example, the first depth of field (5.5, 6.5) has a depth of field front edge of 5.5, a depth of field rear edge of 6.5, and a predetermined depth value within the range of (5.5, 6.5). The second depth of field (9.5, 10.5) has a depth of field front edge of 9.5, a depth of field rear edge of 10.5, and a predetermined depth value within the range of (9.5, 10.5).

[0086] When the predetermined depth value of the first depth of field is selected as the depth trailing edge of the first depth of field and the predetermined depth value of the second depth of field is selected as the depth leading edge of the second depth of field, the processor 30 determines whether the depth difference between the first depth of field (5.5, 6.5) and the second depth of field (9.5, 10.5) is less than (or equal to) the depth threshold by determining whether the depth difference between the depth trailing edge 6.5 of the first depth of field and the depth leading edge 9.5 of the second depth of field is less than (or equal to) the depth threshold. Of course, the predetermined depth value of the first depth of field and the predetermined depth value of the second depth of field can also be selected as other depth values ​​within the range from the depth leading edge to the depth trailing edge. For example, the predetermined depth value is selected as the midpoint between the depth leading edge and the depth trailing edge.

[0087] See also Fig.15 In some embodiments, the first depth of field and the second depth of field both include a leading edge of the depth of field, a trailing edge of the depth of field, and a predetermined depth value within the range from the leading edge of the depth of field to the trailing edge of the depth of field. When the depth difference is less than (or equal to) the depth threshold, merging the first depth of field and the second depth of field to obtain a merged depth of field (i.e., 033) includes:

[0088] 0331: When the depth difference is less than (or equal to) the depth threshold, the smaller value between the leading edge of the first depth of field and the leading edge of the second depth of field is used as the leading edge of the depth of field of the merged depth of field, and the larger value between the trailing edge of the first depth of field and the trailing edge of the second depth of field is used as the trailing edge of the depth of field of the merged depth of field.

[0089] See also Fig.16 In some embodiments, the first depth of field and the second depth of field both include a depth of field leading edge, a depth of field trailing edge, and a predetermined depth value within the range from the depth of field leading edge to the depth of field trailing edge. The merging unit 133 includes a merging subunit 1331. The merging subunit 1331 can be used to execute the method in 0331. That is, the merging subunit 1331 can be used to use the smaller value of the depth of field leading edge of the first depth of field and the depth of field leading edge of the second depth of field as the depth of field leading edge of the merged depth of field, and use the larger value of the depth of field trailing edge of the first depth of field and the depth of field trailing edge of the second depth of field as the depth of field trailing edge of the merged depth of field when the depth difference is less than (or equal to) the depth threshold.

[0090] See also Figure 3In some embodiments, the first depth of field and the second depth of field both include a depth of field leading edge, a depth of field trailing edge, and a predetermined depth value within the range from the depth of field leading edge to the depth of field trailing edge. The processor 30 may be used to execute the method in 0331. The processor 30 may be used to: when the depth difference is less than (or equal to) the depth threshold, use the smaller value of the depth of field leading edge of the first depth of field and the depth of field leading edge of the second depth of field as the depth of field leading edge of the combined depth of field, and use the larger value of the depth of field trailing edge of the first depth of field and the depth of field trailing edge of the second depth of field as the depth of field trailing edge of the combined depth of field.

[0091] Specifically, Fig.14 For example, if the predetermined depth value of the first depth of field is selected as the depth of field trailing edge 6.5 of the first depth of field, the predetermined depth value of the second depth of field is selected as the depth of field leading edge 9.5 of the second depth of field, and the depth threshold is set to 4, then the depth difference between the predetermined depth value of the first depth of field and the predetermined depth value of the second depth of field is less than the depth threshold, and the processor 30 uses the smaller value of the depth of field leading edge 5.5 of the first depth of field and the depth of field leading edge 9.5 of the second depth of field, that is, 5.5, as the depth of field leading edge of the merged depth of field, and uses the larger value of the depth of field trailing edge 6.5 of the first depth of field and the depth of field trailing edge 10.5 of the second depth of field, that is, 10.5, as the depth of field trailing edge of the merged depth of field. That is to say, the merged depth of field calculated according to the region of interest group is (5.5, 10.5), and then the processor 30 calculates the target depth of field according to the merged depth of field (5.5, 10.5).

[0092] See also Fig.17 In some embodiments, after merging the first depth of field and the second depth of field to obtain a combined depth of field (ie, 033), the depth image processing method further includes: 06: determining whether all regions of interest have been grouped;

[0093] Calculating the target depth of field (ie 034) based on the combined depth of field includes:

[0094] 0341: When all regions of interest have been grouped, the merged depth of field is used as the target depth of field;

[0095] Grouping the regions of interest according to the target depth data to calculate the target depth of field (ie 03) also includes:

[0096] 035: When there are regions of interest that have not been grouped, the region of interest group and the regions of interest having target depth data adjacent to the region of interest group are taken as a new region of interest group.

[0097] See also Fig.18In some embodiments, the depth image processing device 10 further includes a second judgment module 16. The fourth calculation unit 134 includes a calculation subunit 1341. The first calculation module 13 includes a second grouping unit 135. The second judgment module 16 can be used to execute the method in 06, the calculation subunit 1341 can be used to execute the method in 0341, and the second grouping unit 135 can be used to execute the method in 035. That is to say, after merging the first depth of field and the second depth of field to obtain a combined depth of field, the second judgment module 16 can be used to determine whether all regions of interest have been grouped. The calculation subunit 1341 can be used to use the combined depth of field as the target depth of field when all regions of interest have been grouped. The second grouping unit 135 can be used to use the region of interest group and the region of interest with target depth data adjacent to the region of interest group as a new region of interest group when there are regions of interest that have not been grouped.

[0098] See also Figure 3 In some embodiments, the processor 30 may be used to execute the methods in 06, 0341, and 035. That is, after merging the first depth of field and the second depth of field to obtain a combined depth of field, the processor 30 may be used to: determine whether all regions of interest have been grouped; when all regions of interest have been grouped, use the combined depth of field as the target depth of field; and when there are regions of interest that have not been grouped, use the region of interest group and the region of interest having target depth data adjacent to the region of interest group as a new region of interest group.

[0099] Specifically, after the processor 30 calculates the combined depth of field to be (5.5, 10.5), it further determines whether all the regions of interest have been grouped, for example Fig.14 In the example, the number of regions of interest is two, and the two regions of interest have been grouped to calculate the target depth of field. Then, the processor 30 directly uses the combined depth of field (5.5, 10.5) as the target depth of field, that is, the target depth of field is also (5.5, 10.5). Then, the processor 30 calculates the target blur intensity according to the target depth of field (5.5, 10.5), and blurs the initial depth image according to the target blur intensity to obtain a blurred depth image. Fig.14 In the example, the target blur intensity is the curve represented by S11 and S22. The processor 30 gradually blurs the image area within the range of (0, 5.5). Specifically, as the depth value increases, the blur becomes weaker. The processor 30 keeps the image area within the range of the target depth of field (5.5, 10.5) clear. The processor 30 also gradually blurs the image area within the range of (10.5, +∞). Specifically, as the depth value increases, the blur becomes stronger.

[0100] When there are regions of interest that are not grouped, for example, when the number of regions of interest is three, the above method is adopted, and the combined depth of field is calculated to be (5.5, 10.5) based on the grouping of the first region of interest and the second region of interest. After that, the processor 30 also takes the region of interest group consisting of the first region of interest and the second region of interest as a new region of interest, and takes the new region of interest and the third region of interest as a new region of interest group. Assuming that the third depth of field of the third region of interest is (11.5, 13), the depth difference between the predetermined depth value 10.5 of the combined depth of field and the predetermined depth value 11.5 of the third depth of field is still less than the depth threshold 4, and the processor 30 merges the depth of field (5.5, 10.5) and (11.5, 13) again to obtain a new combined depth of field (5.5, 13), and then executes the process of determining whether all regions of interest have been grouped again, until all regions of interest have been grouped to calculate the target depth of field.

[0101] See also Fig.19 In some embodiments, grouping the regions of interest according to the target depth data to calculate the target depth of field (ie, 03) further includes:

[0102] 036: When the depth difference is greater than (or equal to) the depth threshold, both the first depth of field and the second depth of field are used as the target depth of field;

[0103] Calculating the target blur intensity (i.e. 04) according to the target depth of field includes:

[0104] 041: calculating a first blur intensity according to the first depth of field and calculating a second blur intensity according to the second depth of field; and

[0105] 042: The smaller value between the first blur intensity and the second blur intensity is used as the target blur intensity.

[0106] See also Fig. 20 In some embodiments, the first calculation module 13 also includes a fifth calculation unit 136. The second calculation module 14 includes a sixth calculation unit 141 and a seventh calculation unit 142. The fifth calculation unit 136 can be used to execute the method in 036, the sixth calculation unit 141 can be used to execute the method in 041, and the seventh calculation unit 142 can be used to execute the method in 042. That is to say, the fifth calculation unit 136 can be used to use the first depth of field and the second depth of field as the target depth of field when the depth difference is greater than (or equal to) the depth threshold. The sixth calculation unit 141 can be used to calculate the first blur intensity according to the first depth of field and the second blur intensity according to the second depth of field. The seventh calculation unit 142 can be used to use the smaller value of the first blur intensity and the second blur intensity as the target blur intensity.

[0107] See also Figure 3In some embodiments, the processor 30 may be used to execute the methods in 036, 041, and 042. That is, the processor 30 may be used to: when the depth difference is greater than (or equal to) the depth threshold, use both the first depth of field and the second depth of field as the target depth of field; calculate the first blur intensity according to the first depth of field, and calculate the second blur intensity according to the second depth of field; and use the smaller value of the first blur intensity and the second blur intensity as the target blur intensity.

[0108] Specifically, see Fig.21 , if the predetermined depth value of the first depth of field is selected as the depth of field trailing edge 6.5 of the first depth of field, and the predetermined depth value of the second depth of field is selected as the depth of field leading edge 9.5 of the second depth of field, and the depth threshold is set to 2, then the depth difference between the predetermined depth value of the first depth of field and the predetermined depth value of the second depth of field is greater than the depth threshold, and the processor 30 uses both the first depth of field (5.5, 6.5) and the second depth of field (9.5, 10.5) as the target depth of field, and then calculates the first blur intensity according to the first depth of field (5.5, 6.5), and the first blur intensity is the curve represented by S11 and S12; the second blur intensity is calculated according to the second depth of field (9.5, 10.5), and the second blur intensity is the curve represented by S21 and S22. Finally, the processor 30 uses the smaller value of the first blur intensity and the second blur intensity as the target blur intensity, that is, Fig.21 The dashed line represents the curve.

[0109] See also Fig.19 In some embodiments, after the smaller value of the first blur intensity and the second blur intensity is used as the target blur intensity (ie, 042), the depth image processing method further includes: 06: determining whether all regions of interest have been grouped;

[0110] Blurring the initial depth image according to the target blur intensity to obtain a blurred depth image (ie, 05) includes:

[0111] 051: when all the regions of interest have been grouped, blurring the initial depth image according to the target blurring intensity to obtain a blurred depth image;

[0112] Grouping the regions of interest according to the target depth data to calculate the target depth of field (ie 03) also includes:

[0113] 035: When there are regions of interest that have not been grouped, the region of interest group and the regions of interest having target depth data adjacent to the region of interest group are taken as a new region of interest group.

[0114] See also Fig. 20In some embodiments, the depth image processing device 10 further includes a second judgment module 16. The processing module 15 includes a blurring unit 151. The first calculation module 13 includes a second grouping unit 135. The second judgment module 16 can be used to execute the method in 06, the blurring unit 151 can be used to execute the method in 051, and the second grouping unit 135 can be used to execute the method in 035. That is to say, when the smaller value of the first blurring intensity and the second blurring intensity is used as the target blurring intensity, the second judgment module 16 can be used to determine whether all regions of interest have been grouped. The blurring unit 151 can be used to blur the initial depth image according to the target blurring intensity to obtain a blurred depth image when all regions of interest have been grouped. The second grouping unit 135 can be used to treat the region of interest group and the region of interest with target depth data adjacent to the region of interest group as a new region of interest group when there are regions of interest that have not been grouped.

[0115] See also Figure 3 In some embodiments, the processor 30 may be used to execute the methods in 06, 051, and 035. That is, after taking the smaller value of the first blur intensity and the second blur intensity as the target blur intensity, the processor 30 may be used to: determine whether all regions of interest have been grouped; when all regions of interest have been grouped, blur the initial depth image according to the target blur intensity to obtain a blurred depth image; and when there are regions of interest that have not been grouped, take the region of interest group and the region of interest having adjacent target depth data to the region of interest group as a new region of interest group.

[0116] Specifically, after the processor 30 calculates the target blur strength, it also determines whether all the regions of interest have been grouped, for example Fig.21 In the example, the number of regions of interest is two, and both regions of interest have been grouped to calculate the target depth of field. Then the processor 30 directly blurs the initial depth image according to the target blur intensity to obtain a blurred depth image. The processor 30 gradually blurs the image area within the range of (0, 5.5). Specifically, as the depth value increases, the blurring becomes weaker and weaker. The processor 30 keeps the image area within the target depth of field (5.5, 6.5) clear. The processor 30 gradually blurs the image area within the range of (6.5, 8) and (8, 9.5). Specifically, in the range of (6.5, 8), the blurring becomes stronger and stronger as the depth value increases; in the range of (8, 9.5), the blurring becomes weaker and weaker as the depth value increases. The processor 30 keeps the image area within the target depth of field (9.5, 10.5) clear. The processor 30 also gradually blurs the image area within the range of (10.5, +∞). As the depth value increases, the blurring becomes stronger and stronger.

[0117] When there are regions of interest that are not grouped, for example, when the number of regions of interest is three, the above method is adopted to calculate the target blur intensity only based on the grouping of the first region of interest and the second region of interest. After that, the processor 30 also takes the region of interest group consisting of the first region of interest and the second region of interest as a new region of interest, and takes the new region of interest and the third region of interest as a new region of interest group. Assuming that the third depth of field of the third region of interest is (11.5, 13), the depth difference between the predetermined depth value 10.5 of the depth of field (5.5, 6.5) and (9.5, 10.5) of the new region of interest and the predetermined depth value 11.5 of the third depth of field is less than the depth threshold 2, and the processor 30 merges the depth of field (9.5, 10.5) with the third depth of field (11.5, 13). Finally, the processor 30 keeps the image area within the range of (5.5, 6.5) and (9.5, 13) clear. The processor 30 keeps judging whether all regions of interest have been grouped until all regions of interest have been grouped to calculate the target depth of field.

[0118] It can be understood that the above-mentioned method for image processing can effectively ensure the clarity of each region of interest, whether the depth difference is greater than (or equal to) the depth threshold or the depth difference is less than (or equal to) the depth threshold, so that the user has a better photo-taking experience. In addition, in the embodiment of the present application, when the depth threshold is set to be large enough, for example, greater than the difference between the maximum depth value and the minimum depth value in the entire initial depth image, the processor 30 does not blur the initial depth image, and the full focus of the entire initial depth image can be achieved.

Claims

1. A depth image processing method for an electronic device, characterized in that: The electronic device includes a depth image acquisition device, the depth image acquisition device is used to acquire an initial depth image, and the depth image processing method includes: Acquire target depth data of the region of interest according to the initial depth image; determine whether the number of the regions of interest is greater than a predetermined value; the region of interest is a focus area in the image; When the number of the regions of interest is greater than the predetermined value, grouping the regions of interest according to the target depth data to calculate a target depth of field; Calculating the target blur intensity according to the target depth of field; and Blurring the initial depth image according to the target blur intensity to obtain a blurred depth image; The grouping the regions of interest according to the target depth data to calculate the target depth of field comprises: The two regions of interest having adjacent target depth data are grouped as a region of interest group; Determine whether a depth difference between a first depth of field of one region of interest and a second depth of field of another region of interest in the group of regions of interest is less than a depth threshold; When the depth difference is less than the depth threshold, the first depth of field and the second depth of field are combined to obtain a combined depth of field; and the target depth of field is calculated according to the combined depth of field.

2. The depth image processing method according to claim 1, characterized in that: The depth image acquisition device includes a first camera and a second camera, the first camera is used to acquire a first image, the second camera is used to acquire a second image, the first image and the second image are used to synthesize the initial depth image, and acquiring target depth data of the area of ​​interest according to the initial depth image includes: identifying a region of interest in the first image or the second image; calculating initial depth data for the initial depth image; and The target depth data corresponding to the region of interest in the initial depth data is acquired.

3. The depth image processing method according to claim 1, characterized in that: The depth image acquisition device includes a time-of-flight depth camera, and acquiring target depth data of the region of interest according to the initial depth image includes: identifying a region of interest in the initial depth image; calculating initial depth data of the initial depth image; and The target depth data corresponding to the region of interest in the initial depth data is acquired.

4. The depth image processing method according to claim 1, characterized in that: The depth image acquisition device includes a structured light depth camera, and acquiring target depth data of the region of interest according to the initial depth image includes: identifying a region of interest in the initial depth image; calculating initial depth data of the initial depth image; and The target depth data corresponding to the region of interest in the initial depth data is acquired.

5. The depth image processing method according to claim 1, characterized in that: The predetermined value is 1.

6. The depth image processing method according to claim 1, characterized in that: The first depth of field and the second depth of field both include a depth of field front edge, a depth of field rear edge, and a predetermined depth value within a range from the depth of field front edge to the depth of field rear edge, and the determining whether a depth difference between a first depth of field of one region of interest and a second depth of field of another region of interest in the region of interest group is less than a depth threshold comprises: It is determined whether the depth difference between the predetermined depth value of the first depth of field and the predetermined depth value of the second depth of field is less than the depth threshold.

7. The depth image processing method according to claim 1, characterized in that: The first depth of field and the second depth of field both include a depth of field leading edge, a depth of field trailing edge, and a predetermined depth value located in a range from the depth of field leading edge to the depth of field trailing edge, and when the depth difference is less than the depth threshold, merging the first depth of field and the second depth of field to obtain a merged depth of field includes: When the depth difference is less than the depth threshold, the smaller value between the leading edge of the depth of field of the first depth of field and the leading edge of the depth of field of the second depth of field is used as the leading edge of the depth of field of the merged depth of field, and the larger value between the trailing edge of the depth of field of the first depth of field and the trailing edge of the depth of field of the second depth of field is used as the trailing edge of the depth of field of the merged depth of field.

8. The depth image processing method according to claim 1, characterized in that: After merging the first depth of field and the second depth of field to obtain a combined depth of field, the depth image processing method further includes: determining whether all of the regions of interest have been grouped; Calculating the target depth of field according to the combined depth of field comprises: When all the regions of interest have been grouped, using the combined depth of field as the target depth of field; The grouping the regions of interest according to the target depth data to calculate the target depth of field also includes: When there are regions of interest that are not grouped, the region of interest group and the regions of interest having the target depth data adjacent to the region of interest group are taken as a new region of interest group.

9. The depth image processing method according to claim 1, characterized in that: The grouping the regions of interest according to the target depth data to calculate the target depth of field also includes: When the depth difference is greater than the depth threshold, taking both the first depth of field and the second depth of field as the target depth of field; Calculating the target blur intensity according to the target depth of field comprises: respectively calculating a first blur intensity according to the first depth of field and a second blur intensity according to the second depth of field; and A smaller value between the first blur intensity and the second blur intensity is used as the target blur intensity.

10. The depth image processing method according to claim 9, characterized in that: After taking the smaller value of the first blur intensity and the second blur intensity as the target blur intensity, the depth image processing method further includes: Determining whether all the regions of interest have been grouped; The blurring the initial depth image according to the target blurring intensity to obtain a blurred depth image comprises: When all the regions of interest have been grouped, blurring the initial depth image according to the target blurring intensity to obtain the blurred depth image; The grouping the regions of interest according to the target depth data to calculate the target depth of field also includes: When there are regions of interest that are not grouped, the region of interest group and the regions of interest having the target depth data adjacent to the region of interest group are taken as a new region of interest group.

11. A depth image processing device, used in an electronic device, characterized in that: The electronic device includes a depth image acquisition device, the depth image acquisition device is used to acquire an initial depth image, and the depth image processing device includes: An acquisition module, configured to acquire target depth data of a region of interest according to the initial depth image; the region of interest is a focus area in the image; A first judging module, configured to judge whether the number of the regions of interest is greater than a predetermined value; A first calculation module is used for, when the number of the regions of interest is greater than the predetermined value, treating two regions of interest having adjacent target depth data as a region of interest group; determining whether a depth difference between a first depth of field of one region of interest and a second depth of field of another region of interest in the region of interest group is less than a depth threshold; when the depth difference is less than the depth threshold, merging the first depth of field and the second depth of field to obtain a merged depth of field; and calculating a target depth of field according to the merged depth of field; A second calculation module, configured to calculate a target blur intensity according to the target depth of field; and A processing module is used to blur the initial depth image according to the target blur intensity to obtain a blurred depth image.

12. An electronic device, characterized in that: The electronic device comprises a depth image acquisition device and a processor, wherein the depth image acquisition device is used to acquire an initial depth image, and the processor is used to: Acquire target depth data of the region of interest according to the initial depth image; determine whether the number of the regions of interest is greater than a predetermined value; the region of interest is a focus area in the image; When the number of the regions of interest is greater than the predetermined value, two regions of interest having adjacent target depth data are regarded as a region of interest group; Determine whether a depth difference between a first depth of field of one region of interest and a second depth of field of another region of interest in the group of regions of interest is less than a depth threshold; When the depth difference is less than the depth threshold, combining the first depth of field and the second depth of field to obtain a combined depth of field; and calculating a target depth of field according to the combined depth of field; Calculating the target blur intensity according to the target depth of field; and The initial depth image is blurred according to the target blur intensity to obtain a blurred depth image.

13. The electronic device according to claim 12, characterized in that: The depth image acquisition device includes a first camera and a second camera, the first camera is used to acquire a first image, the second camera is used to acquire a second image, the first image and the second image are used to synthesize the initial depth image, and the processor is further used to: Identifying a region of interest in the first image or the second image; calculating initial depth data of the initial depth image; and The target depth data corresponding to the region of interest in the initial depth data is acquired.

14. The electronic device according to claim 12, characterized in that: The depth image acquisition device includes a time-of-flight depth camera, and the processor is further configured to: identifying a region of interest in the initial depth image; calculating initial depth data of the initial depth image; and The target depth data corresponding to the region of interest in the initial depth data is acquired.

15. The electronic device according to claim 12, characterized in that: The depth image acquisition device includes a structured light depth camera, and the processor is further used for: identifying a region of interest in the initial depth image; calculating initial depth data of the initial depth image; and The target depth data corresponding to the region of interest in the initial depth data is acquired.

16. The electronic device according to claim 12, characterized in that: The predetermined value is 1.

17. The electronic device according to claim 12, characterized in that: The first depth of field and the second depth of field both include a leading edge of the depth of field, a trailing edge of the depth of field, and a predetermined depth value located within a range from the leading edge of the depth of field to the trailing edge of the depth of field, and the processor is further configured to: It is determined whether the depth difference between the predetermined depth value of the first depth of field and the predetermined depth value of the second depth of field is less than the depth threshold.

18. The electronic device according to claim 12, characterized in that: The first depth of field and the second depth of field both include a leading edge of the depth of field, a trailing edge of the depth of field, and a predetermined depth value within a range from the leading edge of the depth of field to the trailing edge of the depth of field, and the processor is further configured to: When the depth difference is less than the depth threshold, the smaller value between the leading edge of the depth of field of the first depth of field and the leading edge of the depth of field of the second depth of field is used as the leading edge of the depth of field of the merged depth of field, and the larger value between the trailing edge of the depth of field of the first depth of field and the trailing edge of the depth of field of the second depth of field is used as the trailing edge of the depth of field of the merged depth of field.

19. The electronic device according to claim 12, characterized in that: After combining the first depth of field and the second depth of field to obtain a combined depth of field, the processor is further configured to: Determining whether all the regions of interest have been grouped; When all the regions of interest have been grouped, using the combined depth of field as the target depth of field; and When there are regions of interest that are not grouped, the region of interest group and the regions of interest having the target depth data adjacent to the region of interest group are taken as a new region of interest group.

20. The electronic device according to claim 12, characterized in that: The processor is further configured to: When the depth difference is greater than the depth threshold, taking both the first depth of field and the second depth of field as the target depth of field; respectively calculating a first blur intensity according to the first depth of field and a second blur intensity according to the second depth of field; and A smaller value between the first blur intensity and the second blur intensity is used as the target blur intensity.

21. The electronic device according to claim 20, characterized in that: After taking the smaller value of the first blur intensity and the second blur intensity as the target blur intensity, the processor is further configured to: Determining whether all the regions of interest have been grouped; When all the regions of interest have been grouped, blurring the initial depth image according to the target blurring intensity to obtain the blurred depth image; and When there are regions of interest that are not grouped, the region of interest group and the regions of interest having the target depth data adjacent to the region of interest group are taken as a new region of interest group.

Citation Information

Patent Citations

  • Photographing method and mobile terminal

    CN107592466A