Image shooting method and device, electronic equipment and storage medium

By adjusting the exposure parameters according to the brightness parameters of the subject and the background in HDR technology, the problem of difficulty in balancing the exposure of the subject and the background in extreme brightness difference scenes is solved, resulting in images with clear details and a wider dynamic range.

CN121567971APending Publication Date: 2026-02-24VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511672885.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing HDR technology struggles to balance the exposure of the subject and background in scenes with extreme brightness differences, resulting in poor image quality, with the subject overexposed or the background too dark.

Method used

Based on the brightness parameters of the subject and background areas in the preview image, specific exposure parameters are determined, and subject and background images are captured separately. A third image is then generated through image fusion to achieve the best exposure effect for both the subject and background.

Benefits of technology

It improves the image quality generated by HDR technology, ensuring clear details in both the subject and background, and producing images with a wider dynamic range and richer details.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567971A_ABST
    Figure CN121567971A_ABST
Patent Text Reader

Abstract

The invention discloses an image shooting method and device, electronic equipment and a storage medium, and belongs to the field of image processing. The method comprises the following steps: determining at least one first exposure parameter according to a first brightness parameter and a first brightness threshold corresponding to a main image area of a shot preview image, and determining at least one second exposure parameter according to a second brightness parameter and a second brightness threshold corresponding to a background image area of the shot preview image; a first image is shot based on each first exposure parameter, a second image is shot based on each second exposure parameter, and the first image and the second image are shot for the same scene; and generating a third image according to the main body image area in the at least one first image and the background image area in the at least one second image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing, and specifically relates to an image capturing method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of technology, High Dynamic Range (HDR) technology has been widely used in image and video shooting. HDR technology effectively expands the dynamic range of an image by capturing multiple images at different exposure levels and fusing them, allowing for excellent preservation of details in both bright and dark areas. Existing HDR technologies typically use a set of exposed images, including a bright frame and a dark frame, and generate the final HDR image by fusing these two frames.

[0003] However, in some scenes with extreme brightness differences, light is usually concentrated on the subject, resulting in the subject being too bright and the background being too dark. Existing technology, which only uses a bright frame and a dark frame to fuse, may not be able to cope with the drastic difference in brightness between the subject and the background, resulting in the final image having problems such as the subject being overexposed or the background being too dark. As a result, the image quality generated by existing HDR technology is poor. Summary of the Invention

[0004] The purpose of this application is to provide an image capturing method, apparatus, electronic device, and storage medium that can improve the quality of images generated by HDR technology.

[0005] In a first aspect, embodiments of this application provide an image capturing method, the method comprising: determining at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to a subject image region of a captured preview image, and determining at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to a background image region of the captured preview image; capturing a first image based on each first exposure parameter, and capturing a second image based on each second exposure parameter, wherein the first image and the second image are captured for the same scene; and generating a third image based on a subject image region in at least one first image and a background image region in at least one second image.

[0006] Secondly, embodiments of this application provide an image capturing device, comprising: a determining module, a capturing module, and a generating module. The determining module is configured to determine at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image region of a captured preview image, and to determine at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image region of the captured preview image. The capturing module is configured to capture a first image based on each first exposure parameter and a second image based on each second exposure parameter, wherein the first and second images are captured for the same scene. The generating module is configured to generate a third image from the main image region of at least one first image and the background image region of at least one second image.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0011] In this embodiment, at least one first exposure parameter can be determined based on the first brightness parameter and the first brightness threshold corresponding to the main image area of ​​the captured preview image, and at least one second exposure parameter can be determined based on the second brightness parameter and the second brightness threshold corresponding to the background image area of ​​the captured preview image. Then, a first image is captured based on each first exposure parameter, and a second image is captured based on each second exposure parameter. The first image and the second image are captured for the same scene. Finally, a third image is generated from the main image area in at least one first image and the background image area in at least one second image. In this solution, at least one first exposure parameter can be determined based on the first brightness parameter and the first brightness threshold corresponding to the main image area of ​​the preview image. This allows for targeted exposure optimization of the main image area of ​​the preview image, ensuring that the subject is clear in detail in the first image captured using the first exposure parameter. Furthermore, at least one second exposure parameter can be determined based on the second brightness parameter and the second brightness threshold corresponding to the background image area of ​​the preview image. This allows for targeted exposure optimization of the background image area of ​​the preview image, ensuring that the background is clear in detail in the second image captured using the second exposure parameter. As a result, the third image generated based on the main image area in at least one first image and the background image area in at least one second image can achieve optimal exposure for both the subject and the background, thus improving the quality of the image generated by HDR technology. Attached Figure Description

[0012] Figure 1 This is one of the flowcharts of the image capturing method provided in the embodiments of this application;

[0013] Figure 2(a) is a schematic diagram of the main image area provided in an embodiment of this application;

[0014] Figure 2(b) is a schematic diagram of the background image area provided in the embodiment of this application;

[0015] Figure 3 This is the second flowchart of the image capturing method provided in the embodiments of this application;

[0016] Figure 4 This is the third flowchart of the image capturing method provided in the embodiments of this application;

[0017] Figure 5 This is the fourth flowchart of the image capturing method provided in the embodiments of this application;

[0018] Figure 6 This is a schematic diagram of the preview image provided in the embodiment of this application;

[0019] Figure 7This is a schematic diagram of a bright frame in the main image region provided in an embodiment of this application;

[0020] Figure 8 This is one of the schematic diagrams of the dark frame of the background image area provided in the embodiments of this application;

[0021] Figure 9 This is a schematic diagram of the bright frame of the background image area provided in the embodiments of this application;

[0022] Figure 10 This is a second schematic diagram of a dark frame in the background image area provided in an embodiment of this application;

[0023] Figure 11 This is the fifth flowchart of the image capturing method provided in the embodiments of this application;

[0024] Figure 12 This is the sixth flowchart of the image capturing method provided in the embodiments of this application;

[0025] Figure 13 This is the seventh flowchart of the image capturing method provided in the embodiments of this application;

[0026] Figure 14 This is one of the schematic diagrams illustrating the execution process of the image capturing method provided in the embodiments of this application;

[0027] Figure 15 This is a second schematic diagram illustrating the execution process of the image capturing method provided in this application embodiment;

[0028] Figure 16 This is a schematic diagram of the image capturing device provided in the embodiments of this application;

[0029] Figure 17 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0030] Figure 18 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0031] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0032] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0033] The terms "at least one," "at least one," etc., in this application refer to any one, any two, or a combination of two or more of the included objects. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more, and its meaning is similar to that of "at least one."

[0034] The image capturing method, apparatus, electronic device, and storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0035] The embodiments of this application can be applied to scenarios where images are captured in situations where there is a large difference in brightness between the subject and the background or where lighting conditions are complex.

[0036] The image capturing method provided in this application will be illustrated below using some specific scenarios as examples.

[0037] Scene 1: Stage performance scene

[0038] During concert performances, stage lights focus on the performers, resulting in high brightness for the performers and relatively dark backgrounds. This significant difference in brightness makes it easy for users to overexpose their photos, making it difficult to capture the performance.

[0039] Scene 2: Outdoor backlighting shooting scene

[0040] When shooting people outdoors in strong sunlight, the person's face is in shadow while the background sky or distant objects are very bright, and users find that facial details are lost.

[0041] It should be noted that scenarios 1 to 3 above are merely exemplary examples of some scenarios that may be applied to the embodiments of this application. In actual implementation, the embodiments of this application can also be applied to any possible scenario for capturing more demanding images. The embodiments of this application are not limited here.

[0042] This application provides an image capturing method, apparatus, electronic device, and storage medium. Since at least one first exposure parameter can be determined based on a first brightness parameter and a first brightness threshold corresponding to the main image area of ​​the captured preview image, targeted exposure optimization can be performed on the main image area of ​​the captured preview image. This ensures that the subject is clear in detail in the first image captured using the first exposure parameter. Furthermore, since at least one second exposure parameter can be determined based on a second brightness parameter and a second brightness threshold corresponding to the background image area of ​​the captured preview image, targeted exposure optimization can be performed on the background image area of ​​the captured preview image. This ensures that the background is clear in detail in the second image captured using the second exposure parameter. Therefore, the third image generated based on the main image area in at least one first image and the background image area in at least one second image can achieve optimal exposure for both the subject and the background, thus improving the quality of images generated by HDR technology.

[0043] The image capturing method provided in this application can be executed by an image capturing device, which can be an electronic device, or a functional module or functional entity within an electronic device. The following description uses an electronic device as an example to illustrate the technical solution provided in this application.

[0044] Figure 1 A flowchart of an image capturing method provided in an embodiment of this application is shown, such as... Figure 1 As shown, the image capturing method provided in this application embodiment may include the following steps 201 to 203.

[0045] Step 201: The electronic device determines at least one first exposure parameter based on the first brightness parameter and the first brightness threshold corresponding to the main image area of ​​the captured preview image, and determines at least one second exposure parameter based on the second brightness parameter and the second brightness threshold corresponding to the background image area of ​​the captured preview image.

[0046] In some embodiments of this application, the aforementioned shooting preview image refers to a preview image captured by the electronic device through an image sensor and displayed in real time during the shooting process, which is used to help the user view the shooting scene in order to adjust the shooting angle, composition, etc.

[0047] In some embodiments of this application, the aforementioned main image area may also be simply referred to as the subject, which refers to the area where the main object of user attention is located in the shooting scene, such as a singer on stage or a person in the picture.

[0048] In some embodiments of this application, a mobile phone is used as an example. For example, as shown in FIG2(a), it is assumed that the mobile phone displays a shooting preview image 10, which includes a main image area 11.

[0049] In some embodiments of this application, the aforementioned first brightness parameter refers to the brightness parameter of the subject image region, used to measure the brightness level of the subject. The brightness parameter can be calculated from the brightness information captured by the image sensor, for example, by analyzing the grayscale value (luma) of the subject region.

[0050] In some embodiments of this application, the first exposure parameter mentioned above refers to the exposure parameter calculated based on the first brightness parameter and the first brightness threshold corresponding to the subject image area, which is used to adjust the exposure when shooting the subject.

[0051] In some embodiments of this application, the aforementioned first exposure parameter refers to an exposure combination for the subject image region.

[0052] In some embodiments of this application, the aforementioned background image area may also be simply referred to as the background, which refers to other parts of the shooting scene besides the main subject, such as the stage background, the sky, distant buildings, etc.

[0053] For example, in conjunction with FIG2(a), as shown in FIG2(b), the captured preview image 10 also includes a background image region 12.

[0054] In some embodiments of this application, the second brightness parameter is a brightness parameter of the background image region, used to measure the brightness level of the background, and can be determined by analyzing the grayscale values ​​of the background region.

[0055] In some embodiments of this application, the aforementioned second exposure parameter refers to the exposure parameter calculated based on the second brightness parameter and the second brightness threshold corresponding to the background image area, which is used to adjust the exposure when shooting the background.

[0056] In some embodiments of this application, the aforementioned at least one second exposure parameter refers to an exposure combination for a background image region.

[0057] In some embodiments of this application, the electronic device can calculate the ratio K = subject brightness (face luma) to background brightness (frame luma), where K = face luma / background luma, i.e., subject brightness = face luma, background brightness = frame luma, and K = face luma / frame luma. The electronic device can set a threshold a (a>1) to determine whether the scene is an extremely direct-lighting scene. An extremely direct-lighting scene refers to a scene where the subject is directly illuminated by a very strong light source, while the background brightness is relatively low compared to the subject brightness. In such scenes, the subject brightness may be much higher than the background, resulting in overexposure of the subject and underexposure of the background. For example, in a stage performance, a spotlight shines directly on the singer, while the background (such as the stage background or the audience) is relatively low in brightness. The specific calculation methods for subject brightness and background brightness are described below and will not be repeated here.

[0058] In some embodiments of this application, if K≥a, it means that the brightness of the subject is significantly higher than the brightness of the background, i.e., an extremely bright scene. The electronic device can execute the image shooting method of this application to perform separate exposure and follow the separate exposure path. If K<a, it means that the brightness of the subject and background is normal. The electronic device can generate an image without separate exposure and follow the conventional HDR path.

[0059] In some embodiments of this application, when K≥2, the brightness difference between the face and the background is large, so the threshold a can be set to 2, or the user can modify the threshold a according to the situation.

[0060] In some embodiments of this application, the electronic device can calculate the exposure of the subject and the background separately. Specifically:

[0061] ①Main part: Generally a portrait scene. By statistically analyzing the brightness of the face, a brightness target is set, and a set of low exposure combinations sens′ (EV0′, EV-′) is calculated.

[0062] ② Background part: Ignore the brightness of the face and treat the picture as an ordinary scene without the face. Calculate a set of high exposure combination sens″ (EV0″, EV-″) that takes into account the background.

[0063] In some embodiments of this application, combined with Figure 1 ,like Figure 3 As shown, step 201 above can be specifically implemented through step 201a below.

[0064] Step 201a: The electronic device determines the ratio of the third brightness parameter to the brightness threshold corresponding to the third image region as at least one third exposure parameter.

[0065] In some embodiments of this application, the third brightness parameter includes the first brightness parameter and the second brightness parameter.

[0066] In some embodiments of this application, the aforementioned brightness threshold is a preset brightness value used to determine whether the brightness of the image area reaches the desired level. If the brightness of the image area is lower than the brightness threshold, it may be necessary to increase the exposure; if the brightness is higher than the threshold, it may be necessary to decrease the exposure.

[0067] In some embodiments of this application, the aforementioned third exposure parameter is an exposure parameter calculated based on the ratio of the third brightness parameter to the brightness threshold.

[0068] In some embodiments of this application, when the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes at least one first exposure parameter.

[0069] In some embodiments of this application, when the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes at least one second exposure parameter.

[0070] In some embodiments of this application, when the third brightness parameter includes the first brightness parameter, the electronic device can determine the third exposure parameter based on the ratio of the first brightness parameter to the brightness threshold corresponding to the main image area.

[0071] In some embodiments of this application, when the third brightness parameter includes the first brightness parameter, if the ratio is greater than 1, it indicates that the brightness of the main image area is higher than the desired brightness, and the exposure needs to be reduced. If the ratio is less than 1, it indicates that the brightness of the main image area is lower than the desired brightness, and the exposure needs to be increased. If the ratio is close to 1, it indicates that the brightness of the main image area is close to the desired brightness, and the current exposure parameter can be kept unchanged.

[0072] In some embodiments of this application, the electronic device has a preset exposure parameter. When the electronic device starts shooting, it can first use the preset exposure parameter to take a picture. Then, the electronic device can multiply the ratio of the first brightness parameter to the brightness threshold corresponding to the main image area by the initial exposure and then by a preset coefficient used to control the speed at which the brightness of the main image area converges to the brightness threshold, to obtain an exposure value that makes the brightness of the main image area of ​​the captured image close to the brightness threshold, i.e., a third exposure parameter. When it is necessary to increase the exposure, the third exposure parameter can decrease the exposure so that the brightness of the main image area of ​​the captured image is close to the brightness threshold; when it is necessary to increase the exposure, the third exposure parameter can increase the exposure so that the brightness of the main image area of ​​the captured image is close to the brightness threshold.

[0073] In some embodiments of this application, after obtaining the third exposure parameter, the electronic device can use it in the image capture of the next frame. Thus, when capturing each frame, the electronic device can calculate the exposure parameters for the next frame, ensuring that the brightness of the main image area in the next frame approaches a brightness threshold, until the ratio of the first brightness parameter to the brightness threshold corresponding to the main image area approaches 1, i.e., the absolute value of the difference between this ratio and 1 is less than a threshold.

[0074] In some embodiments of this application, when the third brightness parameter includes the second brightness parameter, the electronic device can determine the third exposure parameter based on the ratio of the second brightness parameter to the brightness threshold corresponding to the background image area.

[0075] In some embodiments of this application, when the third brightness parameter includes the first brightness parameter, if the ratio is greater than 1, it indicates that the brightness of the background image area is higher than the expected brightness, and the exposure needs to be reduced. If the ratio is less than 1, it indicates that the brightness of the background image area is lower than the expected brightness, and the exposure needs to be increased. If the ratio is close to 1, it indicates that the brightness of the background image area is close to the expected brightness, and the current exposure parameter can be kept unchanged.

[0076] In some embodiments of this application, the electronic device has a preset exposure parameter. When the electronic device starts shooting, it can first use the preset exposure parameter to take a picture. Then, the electronic device can multiply the ratio of the first brightness parameter to the brightness threshold corresponding to the background image area by the initial exposure and then by a preset coefficient used to control the speed at which the brightness of the background image area converges to the brightness threshold, to obtain an exposure value that makes the brightness of the background image area of ​​the captured image close to the brightness threshold, i.e., a third exposure parameter. When it is necessary to increase the exposure, the third exposure parameter can decrease the exposure so that the brightness of the background image area of ​​the captured image is close to the brightness threshold; when it is necessary to increase the exposure, the third exposure parameter can increase the exposure so that the brightness of the background image area of ​​the captured image is close to the brightness threshold.

[0077] In some embodiments of this application, after obtaining the third exposure parameter, the electronic device can use it in the image capture of the next frame. Thus, when capturing each frame, the electronic device can calculate the exposure parameters for the next frame, ensuring that the brightness of the background image area in the next frame approaches a brightness threshold, until the ratio of the first brightness parameter to the brightness threshold corresponding to the background image area approaches 1, i.e., the absolute value of the difference between this ratio and 1 is less than a threshold.

[0078] In this way, the electronic device can determine the third exposure parameter based on the ratio of the third brightness parameter to the brightness threshold. For the subject image area, at least one third exposure parameter includes at least one first exposure parameter to ensure that the detail and brightness of the subject are optimized; for the background image area, at least one third exposure parameter includes at least one second exposure parameter to optimize the exposure effect of the background. Through this independent exposure optimization method, the electronic device can perform targeted exposure for the subject and background separately, effectively solving the problem of difficulty in simultaneously achieving the desired exposure for the subject and background in traditional HDR technology, thereby improving the overall quality of the image generated by HDR technology.

[0079] In some embodiments of this application, combined with Figure 1 ,like Figure 4 As shown, step 201 can be implemented through steps 201b to 201d below.

[0080] Step 201b: The electronic device determines the fourth exposure parameter based on the ratio of the third exposure parameter to the brightness threshold corresponding to the third image area.

[0081] In some embodiments of this application, the third brightness parameter includes the first brightness parameter and the second brightness parameter;

[0082] In some embodiments of this application, when the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes at least one first exposure parameter.

[0083] In some embodiments of this application, when the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes at least one second exposure parameter.

[0084] In some embodiments of this application, the fourth exposure parameter refers to an exposure combination. When the third brightness parameter includes the first brightness parameter, the fourth exposure parameter is the exposure combination for the main image region. When the third brightness parameter includes the second brightness parameter, the fourth exposure parameter is the exposure combination for the background image region.

[0085] In some embodiments of this application, when the third brightness parameter includes the first brightness parameter, the electronic device can determine at least one first exposure parameter corresponding to the main image region, i.e., the exposure combination sens′ of the main image region, based on the third exposure parameter.

[0086] In some embodiments of this application, when the third brightness parameter includes the first brightness parameter, the fourth exposure parameter, sens′, which is the exposure combination for the subject image region, may include a normal exposure parameter EV0′ and an underexposure parameter EV-′. EV0′ is an exposure parameter calculated based on the subject's brightness parameter, such as face luma. Its purpose is to ensure that the subject's brightness reaches a suitable level, neither overexposed nor underexposed, clearly presenting the subject's details and colors. EV-′ is an underexposure parameter calculated based on the subject's brightness parameter, used to capture the highlights of the subject, ensuring that details in these areas are not lost.

[0087] In some embodiments of this application, normal exposure parameters refer to the exposure parameters for bright frames. They are typically used to capture medium-brightness areas in a scene, ensuring that details and colors in these areas are accurately recorded. Underexposure parameters refer to the underexposure parameters for dark frames, used to capture highlight areas in a scene, ensuring that details in these areas are not lost due to overexposure. Underexposure parameters refer to parameter settings that intentionally reduce exposure during shooting to capture details in highlight areas.

[0088] In some embodiments of this application, a bright frame or a dark frame can be used as a brightness reference frame to determine the exposure parameters of other exposure frames. For example, a bright frame can be used as a brightness reference frame, and the exposure parameters of the dark frame can be determined using the exposure parameters of the bright frame, i.e., the normal exposure parameters. Here, the brightness reference frame refers to a specific exposure frame used for reference in HDR shooting. The brightness reference frame can be a bright frame or other exposure frames, such as a dark frame or an overexposed frame. The selection of the brightness reference frame depends on the specific requirements of the shooting scene and the exposure strategy.

[0089] In some embodiments of this application, when the third brightness parameter includes the second brightness parameter, the electronic device can determine at least one second exposure parameter corresponding to the background image region, i.e., the exposure combination sens′′ of the background image region, based on the third exposure parameter.

[0090] In some embodiments of this application, when the third brightness parameter includes the second brightness parameter, at least one fourth exposure parameter, the exposure combination sens′′ for the background image region, may include a normal exposure parameter EV0′′ and an underexposure parameter EV-′′. The normal exposure parameter EV0′′ is an exposure parameter calculated based on the background brightness parameter, such as frame luma, to ensure that the background brightness reaches a suitable level, clearly presenting the background details and layers. The underexposure parameter EV-′′ is an underexposure parameter calculated based on the background brightness parameter, used to capture the highlight areas of the background, ensuring that details in these areas are not lost.

[0091] In some embodiments of this application, the electronic device can determine an exposure combination sens′ that includes the exposure parameters of the main image region based on a third exposure parameter.

[0092] In some embodiments of this application, the exposure combination sens′ may include exposure parameters of the subject image region, specifically including normal exposure parameters EV0′, that is, exposure parameters obtained from the brightness of the subject.

[0093] In some embodiments of this application, for subject exposure calculation, the electronic device can read the face luma and set a preset target luma1 based on debugging experience. The exposure of the next frame is calculated by comparing the face luma value and the target luma1 value, and this process is repeated until the image processing (AE) converges. The converged exposure combination is set as sens′(EV0′, EV-′). For background exposure calculation, the electronic device can read the calculated frame luma and set a preset target luma2 based on debugging experience. The exposure of the next frame is calculated by comparing the face luma value and the target luma2 value, and this process is repeated until the AE converges. The converged exposure combination is set as sens″(EV0″, EV-″).

[0094] Step 201c: The electronic device captures a fourth image based on the fourth exposure parameters.

[0095] Step 201d: The electronic device determines the fifth exposure parameter based on the product of the first value corresponding to the proportion of overexposed areas in the fourth image and the fourth exposure parameter.

[0096] In some embodiments of this application, the above-mentioned at least one third exposure parameter includes a fourth exposure parameter and a fifth exposure parameter.

[0097] In some embodiments of this application, the overexposed areas are regions whose brightness exceeds a preset threshold. The proportion of overexposed areas in the fourth image refers to the percentage of regions in the fourth image whose brightness exceeds the preset threshold, used to evaluate whether the current exposure parameters are appropriate.

[0098] In some embodiments of this application, the fifth exposure parameter is an underexposure parameter, which can be the underexposure parameter EV-′ of the subject or the underexposure parameter EV--′ of the background.

[0099] In some embodiments of this application, the electronic device can capture a fourth image based on fourth exposure parameters, and then calculate the percentage of overexposed areas in the fourth image. For example, the percentage of overexposed areas can be 5%, 10%, 20%, etc.

[0100] In some embodiments of this application, the electronic device can capture a fourth image based on the normal exposure parameter EV0′ of the subject, and determine a fifth exposure parameter based on the proportion of overexposed areas in the fourth image and the normal exposure parameter EV0′ of the subject, and determine the fourth exposure parameter and the fifth exposure parameter as at least one third exposure parameter.

[0101] In some embodiments of this application, the electronic device can capture a fourth image based on the normal exposure parameter EV0′′ of the background, and determine a fifth exposure parameter based on the proportion of overexposed areas in the fourth image and the normal exposure parameter EV0′′ of the background, and determine the fourth exposure parameter and the fifth exposure parameter as at least one third exposure parameter.

[0102] In some embodiments of this application, the electronic device may use two sets of exposures, namely the exposure combination sens′ (EV0′, EV-′) of the main image area and the exposure combination sens″ (EV0″, EV-″) of the background image area, or it may use one set of exposures (EV0′, EV-′, EV--′), or it may be understood as two sets of exposures, namely the exposure combination sens′ (EV0′) of the main image area and the exposure combination sens″ (EV0″, EV-″) of the background image area.

[0103] In some embodiments of this application, when using a set of exposures (EV0′, EV-′, EV--′), i.e., the exposure combination sensor′ (EV0′) for the main image area and the exposure combination sensor″ (EV0″, EV-″) for the background image area, the brightness of EV0′ in sensor′ (EV0′) can be adjusted according to the specific scene. During HDR multi-frame fusion, the brightness reference frame for the main part is selected as the bright frame corresponding to EV0′, and the brightness reference frame for the background part is selected as the dark frame corresponding to EV0″, thus obtaining an image with appropriate brightness for both the main and background. Specifically, EV0′, EV0″, and EV-″ are first obtained based on the overall image exposure. Then, the main part of the frames corresponding to these exposure parameters is fused into multiple frames, and the background part is fused into multiple frames to obtain the final image.

[0104] In this way, the electronic device can choose to directly use the third exposure parameter as the fourth exposure parameter based on preset conditions, or calculate the fifth exposure parameter by capturing a third image and analyzing the proportion of overexposed areas, and then use both the third and fifth exposure parameters as the fourth exposure parameter. Using the third and calculated fifth exposure parameters as the fourth exposure parameter allows for the use of different reference frames for the subject and background during subsequent fusion, further improving the quality of the fused image. Conversely, directly using the third exposure parameter as the fourth exposure parameter reduces the number of exposures, saves frame capture time, and improves performance. Thus, the electronic device can employ different exposure combinations, allowing for different methods of subsequent image generation, producing various beneficial effects and enhancing the flexibility of image generation.

[0105] In some embodiments of this application, the electronic device may determine a first value corresponding to the proportion of overexposed areas in the third image.

[0106] In some embodiments of this application, the electronic device may preset a correspondence to map the percentage to a specific first value.

[0107] For example, the percentages from 0% to 10% can be mapped to 0 to -4, that is, 0% corresponds to 0, 10% corresponds to -4, 5% corresponds to -2, and so on. Each percentage in 0%-10% has a specific corresponding value, that is, the first value. The percentages greater than 10% are mapped to -4. In this way, any percentage can be mapped to the first value.

[0108] In some embodiments of this application, the electronic device may determine the fifth exposure parameter as the product of the first value and the third exposure parameter.

[0109] In some embodiments of this application, after calculating the proportion of overexposed areas in the third image, the electronic device can map the proportion to a numerical value. For example, if the proportion is 5%, the electronic device can map the proportion to the numerical value -2. Then, the electronic device can use the corresponding first numerical value as the exponent of 2 and multiply it by the third exposure parameter to obtain the fifth exposure parameter.

[0110] For example, when the first value is -2, we can get 2 to the power of -2, which is 1 / 4, or 0.25. Then, we can multiply 0.25 by the third exposure parameter to get the fifth exposure parameter.

[0111] In this way, electronic devices can dynamically adjust the exposure based on the specific proportion of the overexposed area, quantify the need for exposure adjustment due to the degree of overexposure, and achieve non-linear adjustment through exponential calculation, making the adjustment of exposure parameters more flexible and precise, thereby effectively avoiding overexposure problems and improving the overall image quality.

[0112] Step 202: The electronic device captures a first image based on each first exposure parameter and a second image based on each second exposure parameter.

[0113] In some embodiments of this application, the first image and the second image described above were captured for the same scene.

[0114] In some embodiments of this application, the first image is used to capture details of the main image region, and the second image is used to capture details of the background image region.

[0115] Step 203: The electronic device generates a third image based on the subject image region in at least one first image and the background image region in at least one second image.

[0116] In some embodiments of this application, generating a third image refers to synthesizing multiple images taken with different exposure parameters using image fusion technology to generate an image with a wider dynamic range and richer details. The fusion process typically includes steps such as alignment, weight calculation, and pixel synthesis.

[0117] In some embodiments of this application, the aforementioned third image refers to the final image generated through image fusion, which combines the best exposure effects of the subject and background, and can present more natural and realistic scene details.

[0118] In some embodiments of this application, the electronic device can fuse the main image region in at least one first image and the background image region in at least one second image to generate a final third image.

[0119] This application provides an image capture method. Since at least one first exposure parameter can be determined based on a first brightness parameter and a first brightness threshold corresponding to the main image area of ​​the captured preview image, targeted exposure optimization can be performed on the main image area of ​​the captured preview image. This ensures that the subject is clear in detail in the first image captured using the first exposure parameter. Furthermore, since at least one second exposure parameter can be determined based on a second brightness parameter and a second brightness threshold corresponding to the background image area of ​​the captured preview image, targeted exposure optimization can be performed on the background image area of ​​the captured preview image. This ensures that the background is clear in detail in the second image captured using the second exposure parameter. Therefore, the third image obtained by fusing the main image area from at least one first image and the background image area from at least one second image can achieve optimal exposure for both the subject and the background, thus improving the quality of images generated by HDR technology.

[0120] In some embodiments of this application, the number of at least one first image is at least two, and the number of at least one second image is at least two. (Combined with...) Figure 1,like Figure 5 As shown, step 203 can be implemented through steps 203a to 203c as described below.

[0121] Step 203a: The electronic device fuses at least two first images to obtain a fifth image, and fuses at least two second images to obtain a sixth image.

[0122] In some embodiments of this application, the fifth image is an image obtained by fusing at least two first images, containing the optimal exposure effect for the main image region. The sixth image is an image obtained by fusing at least two second images, containing the optimal exposure effect for the background image region.

[0123] In some embodiments of this application, when an electronic device performs image fusion, multiple captured images need to be aligned due to potential camera shake or scene movement during the shooting process to ensure that each pixel of the image correctly corresponds during subsequent fusion. Alignment methods include feature point matching, optical flow, deep learning methods, etc.

[0124] In some embodiments of this application, after image alignment, the electronic device can fuse the aligned images. Common methods include weighted averaging, Laplacian pyramid fusion, or other more complex algorithms. These methods adjust the weights based on the brightness, color, and contrast of each pixel to determine the contribution of each image to the final output.

[0125] Step 203b: The electronic device extracts the main image region from the fifth image and the background image region from the sixth image.

[0126] In some embodiments of this application, after the electronic device merges at least two first images into a fifth image and at least two second images into a sixth image, the electronic device can extract the main image region, i.e., the foreground region or foreground object, from the fifth image and extract the background image region, i.e., the background region or background, from the sixth image. The image matting method includes:

[0127] ① Edge detection: Determines the edges of objects by identifying gradient differences in pixel values ​​in an image.

[0128] ②Region-based growth: Starting from the seed point, similar neighboring pixels are gradually merged to form the foreground region.

[0129] ③ Deep learning methods: Using convolutional neural networks (CNNs), such as mask region-based convolutional neural networks (Mask R-CNN), to perform semantic segmentation and instance segmentation of images. This method offers higher automation and accuracy.

[0130] Step 203c: The electronic device performs image fusion on the extracted main image area and the extracted background image area to obtain a third image.

[0131] In some embodiments of this application, after extracting the main image region and the background image region, the electronic device can fuse the extracted main image region and the extracted background image region into an image with suitable exposure for both regions. Specifically, this may include the following steps:

[0132] ① Image registration: Ensuring alignment between different images is an important step, especially when compositing dynamic scenes or processing multi-view images.

[0133] ② Image blending: Seamless compositing is achieved by adjusting the color and lighting between the foreground and background objects. Techniques such as blending modes and transparency adjustments can be used.

[0134] ③ Lighting and Shadow Matching: Adjust the lighting and shadow effects of the foreground object to match the new background to enhance visual consistency.

[0135] ④ High-quality rendering: Utilize image rendering techniques to make the composite results look natural and realistic. For complex 3D scenes, realistic rendering techniques can be used.

[0136] ⑤ Detail enhancement: Enhance the details of the composite image, such as adjusting color balance, contrast, and sharpening.

[0137] It should be noted that, under normal circumstances, HDR images, due to their high dynamic range, cannot be displayed correctly directly on ordinary displays. Therefore, tone mapping algorithms are needed to compress the dynamic range of the image so that it can be displayed on standard display devices.

[0138] In some embodiments of this application, after the main image region and the background image region are image fused to obtain a third image, the electronic device can call the platform's tone processing module to perform tone processing on the obtained third image, retaining good contrast details and ensuring that the final third image looks natural.

[0139] In some embodiments of this application, the electronic device can perform exposure fusion on the subject and background portions respectively based on the input exposure combination (sens′, sens″), with the reference frame being their respective EV0. The exposure fusion process is as follows:

[0140] (1) First, take multiple photos of the same scene, each with a different exposure value (EV). Typically, this includes at least one normal exposure (EV0) and one underexposed (EV-) to capture highlight details. Here we directly use the combination of sens′ and sens″ calculated in step 103.

[0141] (2) Image alignment: Due to camera shake or scene movement during the shooting process, multiple images need to be aligned to ensure that each pixel of the image can be correctly matched during subsequent fusion.

[0142] (3) The aligned images are then fused. Common methods include weighted averaging, Laplacian pyramid fusion, or other more complex algorithms. These methods adjust the weights based on the brightness, color, and contrast of each pixel to determine the contribution of each image to the final output.

[0143] In some embodiments of this application, when the exposure combination sens′ for the main image area is used (EV0′, EV-′), after exposure fusion, the electronic device can blend the subject and background, and then pass the exposure-fused image to a dedicated tone processing module for subsequent color and brightness adjustments. The specific process is as follows:

[0144] (1) Extract the main body of sens' and the background of sens″. There are many methods for extraction; the following are a few examples for you to choose from:

[0145] ① Edge detection: Determines the edges of objects by identifying gradient differences in pixel values ​​in an image.

[0146] ②Region-based growth: Starting from the seed point, similar neighboring pixels are gradually merged to form the foreground region.

[0147] ③ Deep learning methods: Using convolutional neural networks (CNNs) such as Mask R-CNN to perform semantic segmentation and instance segmentation of images. This method offers a higher degree of automation and accuracy.

[0148] (2) Merge the extracted foreground and background into an image with appropriate exposure. Image fusion includes the following steps:

[0149] ① Image registration: Ensuring alignment between different images is an important step, especially when compositing dynamic scenes or processing multi-view images.

[0150] ② Image blending: Seamless compositing is achieved by adjusting the color and lighting between the foreground and background objects. Techniques such as blending modes and transparency adjustments can be used.

[0151] ③ Lighting and Shadow Matching: Adjust the lighting and shadow effects of the foreground object to match the new background to enhance visual consistency.

[0152] ④ High-quality rendering: Utilize image rendering techniques to make the composite results look natural and realistic. For complex 3D scenes, realistic rendering techniques can be used.

[0153] ⑤ Detail enhancement: Enhance the details of the composite image, such as adjusting color balance, contrast, and sharpening.

[0154] (3) Tone Processing: Typically, generated HDR images cannot be displayed correctly on ordinary displays due to their high dynamic range. Therefore, tone mapping algorithms need to be applied to compress the dynamic range of the image so that it can be displayed on standard display devices. This step needs to preserve good contrast details to ensure that the final image looks natural. The platform's tone processing module can be used here.

[0155] In some embodiments of this application, when the exposure combination sens′ for the main image region uses EV0′, the electronic device can extract the main subject and background from the three images obtained by the three exposures in the exposure combination sens′ for the main image region (EV0′, EV-″) and the three exposure combinations sens″ for the background image region (EV0″, EV-″). During multi-frame exposure fusion, the brightness reference frame for the main subject is selected as EV0′, and the brightness reference frame for the background is selected as EV0″. In HDR multi-frame fusion, the brightness reference frame for the main subject is selected as EV0′, and the brightness reference frame for the background is selected as EV0″, thus obtaining an image with appropriate brightness for both the main subject and the background.

[0156] For example, such as Figure 6 The image shown is a preview image 10 taken by the mobile phone. The mobile phone can first expose the overall scene based on the preview image 10 to obtain EV0′, EV0″, and EV-″, and then combine them with... Figure 6 ,like Figure 7 The image shown is a bright frame 13 of the main image area captured by EV0′. The mobile phone can crop the main part 14 of the bright frame 13, and combine it with... Figure 6 ,like Figure 8 The image shown is a dark frame 15 of the background image area captured by EV-″. The main body 16 of the dark frame 15 is cropped, and then the phone performs multi-frame fusion of the main body 14 of the bright frame 13 and the main body 16 of the dark frame 15. Figure 6 ,like Figure 9 The image shown is a bright frame 17 of the background image area captured by EV0″. The background portion 18 of the bright frame 17 is cropped by the mobile phone and combined with... Figure 6 ,like Figure 10 The image shown is a dark frame 15 of the background image area captured by EV-″. The phone cropped the background portion 19 of the dark frame 15, and then merged the background portion 18 of the bright frame 17 with the background portion 19 of the dark frame 15. Finally, the electronic device performed exposure fusion on the two images obtained by fusing multiple frames, and then connected them to the platform's tone processing module to obtain the final image. The process of exposure fusion and tone processing is described above and will not be repeated here.

[0157] In this way, electronic devices can optimize the exposure of the subject and background separately and merge them into a high-quality third image, thereby effectively solving the problem of inconsistent exposure between the subject and background and improving the quality of the generated image.

[0158] In some embodiments of this application, combined with Figure 1 ,like Figure 11 As shown, prior to step 201 above, the image capturing method provided in this application embodiment further includes steps 401 to 403 as described below.

[0159] Step 401: The electronic device divides the captured preview image into at least two first preview image regions corresponding to the shooting mode of the electronic device.

[0160] In some embodiments of this application, the shooting mode of the aforementioned electronic device is also referred to as metering mode, which refers to the method used by the electronic device to measure the brightness of the scene during shooting. Common metering modes include:

[0161] (1) Frame Average Metering: Measure the average brightness of the entire image.

[0162] (2) Center-Weighted Metering: measures the brightness of the central area of ​​the image, but also considers the surrounding areas.

[0163] (3) Spot Metering: Measuring the brightness of only a specific point in the image.

[0164] In some embodiments of this application, the aforementioned at least two first preview image regions refer to SATAS modules, which are multiple regions into which the captured preview image is divided according to the shooting mode. These are regional units used in image processing for statistical analysis of image brightness, color, and other information. In many modern electronic devices, such as smartphones and digital cameras, image sensors divide the captured image into multiple small regions, each called a SATAS module. These modules are used to collect and analyze image data from local areas for image processing operations such as exposure control and white balance adjustment.

[0165] In some embodiments of this application, the electronic device can determine the currently used shooting mode. The shooting mode can be preset by the electronic device or preset by the user. According to the determined shooting mode, the electronic device divides the shooting preview image into multiple first preview image regions, for example, dividing the shooting preview image into 16 * 16 SATAS modules, i.e., 16 rows and 16 columns.

[0166] Step 402: The electronic device obtains the weight table corresponding to the shooting mode.

[0167] In some embodiments of this application, the weight table above includes at least two first weight parameters, each of which corresponds to a first preview image region.

[0168] In some embodiments of this application, the aforementioned weight table is a data structure used to define the weight distribution of different regions in the captured preview image. It assigns a weight value to each region of the first preview image based on the shooting mode. The weight value determines the importance of that region in the overall brightness calculation. Each shooting mode has a pre-defined corresponding weight table.

[0169] In some embodiments of this application, the electronic device can obtain a corresponding weight table based on a determined shooting mode.

[0170] Step 403: The electronic device performs a weighted average of the brightness parameters of each first preview image region according to the first weight parameter corresponding to each first preview image region to obtain the second brightness parameter.

[0171] In some embodiments of this application, the second brightness parameter is an overall brightness value obtained by weighted averaging, which integrates the brightness information of all first preview image areas and reflects the brightness distribution of the entire screen.

[0172] In some embodiments of this application, the electronic device can convert the red, green, and blue (RGB) values ​​of each pixel into grayscale values, i.e., brightness values, and then calculate the average brightness value of all pixels within each first preview image area.

[0173] In some embodiments of this application, after calculating the average brightness value of all pixels within each first preview image region, the electronic device can obtain the first weight parameter corresponding to each first preview image region from the weight table. Then, the electronic device can use the brightness parameter of each first preview image region and the corresponding first weight parameter to perform a weighted average to obtain the second brightness parameter.

[0174] In some embodiments of this application, the electronic device can call the platform's built-in luma calculation function to calculate frameluma and face luma.

[0175] In some embodiments of this application, the electronic device can acquire the current metering mode, such as frame averaging, center-weighted metering, and spot metering. The electronic device can then obtain a weight table of 16 * 16 stats modules for the frame based on the metering mode, and calculate the weighted average luma for that frame, i.e., frame luma.

[0176] In this way, electronic devices can divide the shooting preview image into multiple first preview image areas according to the characteristics of different shooting modes, and adjust the weight of each area to ensure that the brightness calculation is more in line with the actual scene requirements, thereby improving the overall quality of image shooting under complex lighting conditions.

[0177] In some embodiments of this application, combined with Figure 1 ,like Figure 12 As shown, prior to step 201 above, the image capturing method provided in this application embodiment further includes steps 501 to 503 as described below.

[0178] Step 501: The electronic device divides the captured preview image into at least one second preview image area.

[0179] In some embodiments of this application, the aforementioned second preview image region is a sub-region after the captured preview image has been divided. These regions are used for subsequent weight allocation and brightness parameter calculation. Unlike the first preview image region, the division area of ​​the second preview image region can be smaller, and it is used later to analyze the relationship between the subject image region and the background image region.

[0180] In some embodiments of this application, the electronic device can divide the captured preview image into at least one second preview image region, for example, it can be divided into 64 * 48 second preview image regions, that is, 64 rows and 48 columns.

[0181] Step 502: The electronic device determines the second weight parameter corresponding to each second preview image region based on the distance between the main image region of the captured preview image and each second preview image region.

[0182] In some embodiments of this application, the aforementioned distance and the second weighting parameter are negatively correlated.

[0183] In some embodiments of this application, the distance between the main image region and each second preview image region refers to the distance between the center of the main image region and the center of each second preview image region.

[0184] In some embodiments of this application, the aforementioned second weighting parameter is a weight value calculated based on the distance between the main image region and each second preview image region, reflecting the importance of each second preview image region in the overall brightness calculation. The second weighting parameter is negatively correlated with distance; that is, the farther the distance, the lower the weight, and the closer the distance, the higher the weight.

[0185] In some embodiments of this application, the electronic device can first determine the location of the main image region, which can be achieved through various methods, such as:

[0186] (1) Face detection: If the subject is a person, use a face detection algorithm to identify the center position of the subject area.

[0187] (2) Edge detection: The outline of the subject is identified by the edge detection algorithm and its center position is determined.

[0188] (3) Deep learning method: use convolutional neural networks for semantic segmentation, identify the main body region and determine its center position.

[0189] In some embodiments of this application, the electronic device may use a suitable distance metric method to calculate the distance between the center position of the main image region and the center position of each second preview image region, such as Euclidean distance.

[0190] In some embodiments of this application, the electronic device can determine a second weight parameter for each second preview image region based on the calculated distance. The weight parameter is negatively correlated with the distance; that is, the greater the distance, the lower the weight. The specific relationship between the weight parameter and the distance can be linear decay, Gaussian decay, etc.

[0191] Step 503: The electronic device performs weighted averaging on the brightness parameters of at least one second preview image region according to the second weight parameter corresponding to at least one second preview image region, to obtain the first brightness parameter.

[0192] In some embodiments of this application, the first brightness parameter is the overall brightness value obtained by the electronic device through weighted averaging, which integrates the brightness information of all second preview image areas and reflects the brightness of the main image area.

[0193] In some embodiments of this application, the electronic device can calculate the average brightness value of each second preview image area, and then perform a weighted average process using the brightness parameter and the corresponding second weight parameter of each second preview image area. That is, each brightness parameter is multiplied by the corresponding weight parameter, and then these values ​​are added together and divided by the sum of all the second weights to obtain the first brightness parameter.

[0194] In some embodiments of this application, the electronic device can divide the entire screen into multiple modules, such as a statistical module with 64 * 48 stats. Each module is assigned a different weight based on its distance from the center point of the face, with closer modules receiving a higher weight. A weighted average luma is then calculated for each face. The electronic device can further assign different weights based on the size of the face and its position within the screen, with larger faces and those closer to the center receiving higher weights. Finally, the electronic device performs a weighted average across all faces to calculate the final face luma.

[0195] In this way, when calculating brightness, electronic devices can consider the relative positions of the subject and the background, and ensure the priority of the subject in the brightness calculation through distance-related weight parameters, while also taking into account the brightness information of the background. Finally, a first brightness parameter that can more accurately reflect the actual brightness of the subject image area is obtained, providing accurate data support for subsequent exposure parameter calculations.

[0196] In some embodiments of this application, the main image region of the aforementioned captured preview image includes at least two sub-image regions, and each second preview image region corresponds to at least two second weight parameters. Combined with... Figure 12 ,like Figure 13 As shown, step 503 can be specifically implemented through steps 503a to 503c below.

[0197] Step 503a: The electronic device performs a weighted average of the brightness parameters of each second preview image region according to each second weight parameter corresponding to each second preview image region, to obtain the third brightness parameter corresponding to each sub-image region.

[0198] In some embodiments of this application, the aforementioned main image region can be the image region of multiple subjects, and can be further divided into multiple sub-image regions, each sub-image region corresponding to a subject.

[0199] In some embodiments of this application, the electronic device can calculate the weight and brightness of the second preview image region for each sub-image region and perform a weighted average, so that each sub-image region can obtain a corresponding third brightness parameter, that is, the brightness of each subject.

[0200] Step 503b: The electronic device determines the third weight parameter corresponding to each sub-image region based on the position and size information of each sub-image region.

[0201] In some embodiments of this application, the above location information refers to the specific location of each sub-image region in the captured preview image, which is usually represented by coordinates, such as the center point coordinates (x, y).

[0202] In some embodiments of this application, the above-mentioned size information refers to the size, i.e., the area, of each sub-image region.

[0203] In some embodiments of this application, the electronic device can obtain the specific location and size of each sub-image region through predefined region division, and then determine a third weight parameter for each sub-image region based on the location and size of the sub-image region. Specifically, this may include:

[0204] (1) Position weight: The weight is assigned according to the position of the sub-image region in the picture. The region closer to the center of the picture has a higher weight, and the region farther away from the center has a lower weight.

[0205] (2) Size weight: The weight is assigned according to the size of the sub-image region. Larger regions have higher weights and smaller regions have lower weights.

[0206] Finally, the electronic device can combine position weight and size weight to calculate the comprehensive weight of each sub-image region, that is, multiply the position weight and size weight of each sub-image region to obtain the third weight parameter corresponding to each sub-image region, that is, the brightness weight of each subject in the captured preview image.

[0207] Step 503c: The electronic device performs a weighted average of at least two third brightness parameters based on the third weight parameters corresponding to at least two sub-image regions to obtain the first brightness parameter.

[0208] In some embodiments of this application, the electronic device can multiply the third brightness parameter of each sub-image region with the corresponding third weight parameter, then add these values ​​together and divide by the sum of all the third weight parameters to obtain the first brightness parameter.

[0209] In some embodiments of this application, when using a set of exposures (EV0′, EV-′, EV--′), i.e., the exposure combination sens′ (EV0′) for the main image region and the exposure combination sens″ (EV0″, EV-″) for the background image region, the electronic device can calculate the final luma as the background brightness. Specifically, final luma = face luma * face weight + frame luma * (1 - face weight), where face weight is the weight of each subject, i.e., the third weight parameter corresponding to each sub-image region. In this way, using the calculated final luma as the background brightness can further reduce the overall brightness to a more appropriate level, thus preventing overexposure when the exposure combination sens′ for the main image region uses a single exposure EV0′, and improving the quality of the final generated image.

[0210] In this way, the electronic device can independently evaluate and weight the brightness of multiple sub-image regions within the main image region, dynamically adjusting the weights based on their position and size. This ensures more accurate and flexible brightness calculation of the main image region, ultimately yielding a first brightness parameter that integrates the brightness information of all sub-image regions. This more accurately reflects the overall brightness distribution of the main image region, providing more reliable data support for subsequent exposure parameter calculations.

[0211] This application provides a method for separately exposing the subject and background. The foreground is the singer, and the background is the audience and background. The exposure of the subject and background is calculated separately, and the subject and background are then merged after multiple frames are fused.

[0212] In some embodiments of this application, similar to how concert beams are focused on the singer, the subject brightness is much higher than the background in a flash photography scene. Therefore, the image shooting method provided in this application is also applicable to flash photography scenes.

[0213] The purpose of this application is to provide a method for dynamic exposure or dynamic selection of a reference frame, so as to achieve suitable brightness for both the subject and background and improve the dynamic range of a stage scene. Specific improvements include:

[0214] 1. The subject and background can be exposed separately and then blended.

[0215] 2. Different brightness reference frames can be selected for the main background;

[0216] 3. Users can select the brightness reference frame according to their preferences.

[0217] In some embodiments of this application, the electronic device can be exposed and fused in two ways:

[0218] like Figure 14 The diagram shown illustrates the execution process of a first implementation of the image capturing method provided in this application.

[0219] Step 20: The electronic device calculates the brightness ratio K between the subject and the background, and sets the threshold to a (a>1).

[0220] Step 21: The electronic device determines whether K is greater than or equal to a.

[0221] When K is greater than or equal to a, the electronic device performs step 22 below; when K is less than a, the electronic device performs step 27, which is the regular HDR process.

[0222] Step 22: Calculate the exposure parameters EV0′ and EV-′ of the main body of the electronic device.

[0223] Step 23: The electronic device calculates the exposure parameters EV0″ and EV-″ for the background area.

[0224] Step 24: The electronic device performs exposure fusion on EV-′ using EV0′ as the brightness reference frame.

[0225] Step 25: The electronic device performs exposure fusion on EV-″ using EV0″ as the brightness reference frame.

[0226] Step 26: The electronic device extracts the subject and background of the merged image and performs fusion and tonal processing.

[0227] Step 27: The electronic device calculates the exposure parameters EV0 and EV- for the overall image.

[0228] Step 28: The electronic device fuses the image and performs tonal processing using EV0′ as the brightness reference frame.

[0229] The image capture method provided in this application embodiment can achieve separate exposure and fusion of the subject and background, ensuring appropriate brightness of the subject and background, preventing the subject from being overexposed and the background from being too dark, and improving the dynamic range of extreme lighting scenes such as stages.

[0230] like Figure 15 The diagram shown illustrates the execution process of a second implementation of the image capturing method provided in this application.

[0231] Step 30: The electronic device calculates the brightness ratio K between the subject and the background, and sets the threshold to a (a>1).

[0232] Step 31: The electronic device determines whether K is greater than or equal to a.

[0233] When K is greater than or equal to a, the electronic device performs step 32 below; when K is less than a, the electronic device performs step 37, which is the regular HDR process.

[0234] Step 32: The electronic device calculates the exposure parameters EV0′ and EV-′ for the background and the exposure parameter EV0″ for the main subject.

[0235] Step 33: The electronic device determines whether the image to be fused is the main part.

[0236] If the image to be merged is the main part, the electronic device performs step 34 below; otherwise, it performs step 35 below.

[0237] Step 34: The electronic device performs exposure fusion on EV-′ using EV0″ as the brightness reference frame.

[0238] Step 35: The electronic device performs exposure fusion on EV-′ using EV0′ as the brightness reference frame.

[0239] Step 36: The electronic device extracts the subject and background of the merged image and performs fusion and tonal processing.

[0240] Step 37: The electronic device calculates the exposure parameters EV0 and EV- for the overall image.

[0241] Step 38: The electronic device fuses the image and performs tonal processing using EV0′ as the brightness reference frame.

[0242] In some embodiments of this application, the electronic device can retain the input three-frame exposure (EV0′, EV-′, EV--′), and through post-processing, the exposure of the three frames can be increased or decreased, while separating the subject and background, allowing the user to select the brightness reference frame and brightness required for each section, thus satisfying the user's preferences and needs.

[0243] In some embodiments of this application, the electronic device does not need to calculate the dark frames of the main subject. This not only improves the quality of the HDR image but also reduces one exposure, saves frame capture time, and improves performance. Selecting brightness reference frames for both the main subject and the background utilizes the original HDR frame capture path while ensuring appropriate brightness for both the main subject and background, thus improving dynamic range.

[0244] Each of the above-described method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application does not impose any restrictions on this.

[0245] The image capturing method provided in this application can be executed by an image capturing device. This application uses an image capturing device executing the image capturing method as an example to illustrate the image capturing device provided in this application.

[0246] Figure 16 A schematic diagram of a possible structure of the image capturing device involved in some embodiments of this application is shown. For example... Figure 16 As shown, the image capturing device 70 may include: a determining module 71, a capturing module 72, and a generating module 73.

[0247] The determining module 71 is used to determine at least one first exposure parameter based on the first brightness parameter and the first brightness threshold corresponding to the main image area of ​​the captured preview image, and to determine at least one second exposure parameter based on the second brightness parameter and the second brightness threshold corresponding to the background image area of ​​the captured preview image.

[0248] The shooting module 72 is used to shoot a first image based on each first exposure parameter determined by the determining module 71, and to shoot a second image based on each second exposure parameter determined by the determining module 71, wherein the first image and the second image are taken for the same scene.

[0249] The generation module 73 is used to generate a third image from the subject image region in at least one first image captured by the shooting module 72 and the background image region in at least one second image.

[0250] In one possible implementation, the determining module 71 is specifically configured to: determine the ratio of the third brightness parameter to the brightness threshold corresponding to the third image region as at least one third exposure parameter; wherein the third brightness parameter includes a first brightness parameter and a second brightness parameter; when the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes at least one first exposure parameter; when the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes at least one second exposure parameter.

[0251] In one possible implementation, the determining module 71 is specifically configured to: determine a fourth exposure parameter based on the ratio of the third exposure parameter to the brightness threshold corresponding to the third image region; capture a fourth image based on the fourth exposure parameter; and determine a fifth exposure parameter based on the product of a first value corresponding to the proportion of overexposed areas in the fourth image and the fourth exposure parameter, wherein at least one third exposure parameter includes both the fourth and fifth exposure parameters; wherein the third brightness parameter includes a first brightness parameter and a second brightness parameter; when the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes at least one first exposure parameter; when the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes at least one second exposure parameter.

[0252] In one possible implementation, the number of at least one first image is at least two, and the number of at least one second image is at least two. The aforementioned generation module 73 is specifically used for: fusing at least one first image to obtain a fifth image, and fusing at least one second image to obtain a sixth image; extracting a main image region from the fifth image, and extracting a background image region from the sixth image; and fusing the extracted main image region and the extracted background image region to obtain a third image.

[0253] In one possible implementation, the image capturing device provided in this application embodiment further includes a processing module and an acquisition module. The processing module is configured to divide the captured preview image into at least two first preview image regions corresponding to the shooting mode of the electronic device, before the determining module 71 determines at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image region of the captured preview image, and determines at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image region of the captured preview image. The acquisition module is configured to acquire a weight table corresponding to the shooting mode, the weight table including at least two first weight parameters, each first weight parameter corresponding to a first preview image region. The processing module is further configured to perform a weighted average processing on the brightness parameter of each first preview image region based on the first weight parameter corresponding to each first preview image region to obtain a second brightness parameter.

[0254] In one possible implementation, the image capturing device provided in this application embodiment further includes a processing module. This processing module is configured to divide the captured preview image into at least one second preview image region before the determining module 71 determines at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image region of the captured preview image, and determines at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image region of the captured preview image. The determining module 71 is further configured to determine a second weight parameter corresponding to each second preview image region based on the distance between the main image region of the captured preview image and each second preview image region obtained by the processing module, wherein the distance and the second weight parameter are negatively correlated. The processing module is further configured to perform a weighted average processing on the brightness parameters of the at least one second preview image region based on the second weight parameter corresponding to the at least one second preview image region determined by the determining module 71, to obtain a first brightness parameter.

[0255] In one possible implementation, the main image region of the aforementioned captured preview image includes at least two sub-image regions, and each second preview image region corresponds to at least two second weight parameters. The aforementioned processing module is specifically used to: perform weighted average processing on the brightness parameters of each second preview image region according to each second weight parameter determined by the determining module 71, to obtain a third brightness parameter corresponding to each sub-image region; determine the third weight parameter corresponding to each sub-image region according to the position and size information of each sub-image region; and perform weighted average processing on the at least two third brightness parameters according to the third weight parameters corresponding to at least two sub-image regions, to obtain a first brightness parameter.

[0256] This application provides an image capturing device. Since at least one first exposure parameter can be determined based on a first brightness parameter and a first brightness threshold corresponding to the main image area of ​​the captured preview image, targeted exposure optimization can be performed on the main image area of ​​the captured preview image. This ensures that the subject is clear in detail in the first image captured using the first exposure parameter. Furthermore, since at least one second exposure parameter can be determined based on a second brightness parameter and a second brightness threshold corresponding to the background image area of ​​the captured preview image, targeted exposure optimization can be performed on the background image area of ​​the captured preview image. This ensures that the background is clear in detail in the second image captured using the second exposure parameter. Therefore, the third image generated based on the main image area in at least one first image and the background image area in at least one second image can achieve optimal exposure for both the subject and the background, thus improving the quality of images generated by HDR technology.

[0257] The image capturing device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0258] The image capturing device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0259] The image capturing device provided in this application embodiment can realize the various processes implemented in the above method embodiments, and will not be described again here to avoid repetition.

[0260] Optionally, such as Figure 17As shown, this application embodiment also provides an electronic device 1000, including a processor 1001 and a memory 1002. The memory 1002 stores a program or instructions that can run on the processor 1001. When the program or instructions are executed by the processor 1001, they implement the various steps of the above-described image capturing method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0261] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0262] Figure 18 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0263] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.

[0264] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 18 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0265] The processor 110 is configured to determine at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image area of ​​the captured preview image, and to determine at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image area of ​​the captured preview image.

[0266] Sensor 105 is used to capture a first image based on each first exposure parameter and a second image based on each second exposure parameter, wherein the first and second images are captured for the same scene.

[0267] Processor 110 is used to generate a third image from a subject image region in at least one first image and a background image region in at least one second image.

[0268] Optionally, the processor 110 is specifically configured to: determine the ratio of the third brightness parameter and the brightness threshold corresponding to the third image region as at least one third exposure parameter; wherein the third brightness parameter includes a first brightness parameter and a second brightness parameter; when the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes at least one first exposure parameter; when the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes at least one second exposure parameter.

[0269] Optionally, the processor 110 is specifically configured to: determine a fourth exposure parameter based on the ratio of a third exposure parameter to a brightness threshold corresponding to a third image region; capture a fourth image based on the fourth exposure parameter; and determine a fifth exposure parameter based on the product of a first value corresponding to the proportion of overexposed areas in the fourth image and the fourth exposure parameter, wherein at least one third exposure parameter includes both a fourth and a fifth exposure parameter; wherein the third brightness parameter includes a first brightness parameter and a second brightness parameter; when the third brightness parameter includes a first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes at least one first exposure parameter; when the third brightness parameter includes a second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes at least one second exposure parameter.

[0270] Optionally, the number of at least one first image is at least two, and the number of at least one second image is at least two. The processor 110 is specifically configured to: fuse at least one first image to obtain a fifth image, and fuse at least one second image to obtain a sixth image; extract a main image region from the fifth image, and extract a background image region from the sixth image; and fuse the extracted main image region and the extracted background image region to obtain a third image.

[0271] Optionally, the processor 110 is configured to divide the captured preview image into at least two first preview image regions corresponding to the shooting mode of the electronic device before determining at least one first exposure parameter based on the first brightness parameter and the first brightness threshold corresponding to the main image region of the captured preview image, and determining at least one second exposure parameter based on the second brightness parameter and the second brightness threshold corresponding to the background image region of the captured preview image. The processor 110 is also configured to obtain a weight table corresponding to the shooting mode, the weight table including at least two first weight parameters, each first weight parameter corresponding to a first preview image region. The processor 110 is further configured to perform a weighted average processing on the brightness parameter of each first preview image region based on the first weight parameter corresponding to each first preview image region to obtain a second brightness parameter.

[0272] Optionally, the processor 110 is configured to divide the captured preview image into at least one second preview image region before determining at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image region of the captured preview image, and before determining at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image region of the captured preview image. The processor 110 is further configured to determine a second weight parameter corresponding to each second preview image region based on the distance between the main image region of the captured preview image and each second preview image region, wherein the distance and the second weight parameter are negatively correlated. The processor 110 is further configured to perform a weighted average processing on the brightness parameters of at least one second preview image region based on the second weight parameter corresponding to at least one second preview image region to obtain a first brightness parameter.

[0273] Optionally, the main image region of the aforementioned captured preview image includes at least two sub-image regions, and each second preview image region corresponds to at least two second weight parameters. The processor 110 is specifically configured to: perform weighted average processing on the brightness parameters of each second preview image region according to each second weight parameter corresponding to each second preview image region, to obtain a third brightness parameter corresponding to each sub-image region; determine the third weight parameter corresponding to each sub-image region according to the position and size information of each sub-image region; and perform weighted average processing on at least two third brightness parameters according to the third weight parameters corresponding to at least two sub-image regions, to obtain a first brightness parameter.

[0274] This application provides an electronic device that can determine at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image area of ​​a captured preview image. This allows for targeted exposure optimization of the main image area of ​​the captured preview image, ensuring that the subject is clear in detail in the first image captured using the first exposure parameter. Furthermore, it can determine at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image area of ​​the captured preview image. This allows for targeted exposure optimization of the background image area of ​​the captured preview image, ensuring that the background is clear in detail in the second image captured using the second exposure parameter. As a result, the third image generated based on the main image area in at least one first image and the background image area in at least one second image can achieve optimal exposure for both the subject and the background, thus improving the quality of images generated by HDR technology.

[0275] The electronic device provided in this application embodiment can implement all the processes implemented in the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here. The beneficial effects of the various implementation methods in this embodiment can be found in the beneficial effects of the corresponding implementation methods in the above method embodiments. To avoid repetition, it will not be described again here.

[0276] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0277] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0278] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.

[0279] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described image capturing method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0280] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0281] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described image capturing method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0282] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0283] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the image capturing method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0284] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0285] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0286] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. An image capturing method, characterized in that, include: At least one first exposure parameter is determined based on the first brightness parameter and the first brightness threshold corresponding to the main image area of ​​the captured preview image, and at least one second exposure parameter is determined based on the second brightness parameter and the second brightness threshold corresponding to the background image area of ​​the captured preview image. A first image is captured based on each first exposure parameter, and a second image is captured based on each second exposure parameter, wherein the first image and the second image are captured for the same scene; A third image is generated based on the subject image region in at least one of the first images and the background image region in at least one of the second images.

2. The method according to claim 1, characterized in that, The step of determining at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image area of ​​the captured preview image, and determining at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image area of ​​the captured preview image, includes: The ratio of the third brightness parameter to the brightness threshold corresponding to the third image region is determined as at least one third exposure parameter; The third brightness parameter includes the first brightness parameter and the second brightness parameter; When the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes the at least one first exposure parameter; When the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes the at least one second exposure parameter.

3. The method according to claim 1, characterized in that, The step of determining at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image area of ​​the captured preview image, and determining at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image area of ​​the captured preview image, includes: The fourth exposure parameter is determined based on the ratio of the third exposure parameter to the brightness threshold corresponding to the third image region; A fourth image is captured based on the fourth exposure parameters; A fifth exposure parameter is determined based on the product of a first value corresponding to the proportion of overexposed areas in the fourth image and the fourth exposure parameter, wherein at least one third exposure parameter includes the fourth exposure parameter and the fifth exposure parameter. The third brightness parameter includes the first brightness parameter and the second brightness parameter; When the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes the at least one first exposure parameter; When the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes the at least one second exposure parameter.

4. The method according to claim 1, characterized in that, The number of at least one first image is at least two, and the number of at least one second image is at least two; The step of generating a third image based on a subject image region in at least one of the first images and a background image region in at least one of the second images includes: At least two of the first images are fused together to obtain a fifth image, and at least two of the second images are fused together to obtain a sixth image; The main image region is cropped from the fifth image, and the background image region is cropped from the sixth image; The extracted main image region and the extracted background image region are stitched together to obtain the third image.

5. The method according to claim 1, characterized in that, Before determining at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image region of the captured preview image, and determining at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image region of the captured preview image, the method further includes: The captured preview image is divided into at least two first preview image regions corresponding to the shooting mode of the electronic device; Obtain the weight table corresponding to the shooting mode. The weight table includes at least two first weight parameters, and each first weight parameter corresponds to a first preview image area. The brightness parameters of each first preview image region are weighted and averaged according to the first weight parameter corresponding to each first preview image region to obtain the second brightness parameter.

6. The method according to claim 1, characterized in that, Before determining at least one first exposure parameter based on a first brightness parameter and a first brightness threshold corresponding to the main image region of the captured preview image, and determining at least one second exposure parameter based on a second brightness parameter and a second brightness threshold corresponding to the background image region of the captured preview image, the method further includes: The captured preview image is divided into at least one second preview image region; A second weight parameter is determined for each second preview image region based on the distance between the main image region of the captured preview image and each second preview image region, wherein the distance and the second weight parameter are negatively correlated. The brightness parameters of the at least one second preview image region are weighted and averaged according to the second weight parameters corresponding to the at least one second preview image region to obtain the first brightness parameter.

7. The method according to claim 6, characterized in that, The main image region of the captured preview image includes at least two sub-image regions, and each second preview image region corresponds to at least two second weight parameters; The step of performing a weighted average of the brightness parameters of the at least one second preview image region based on the second weight parameter corresponding to the at least one second preview image region to obtain the first brightness parameter includes: The brightness parameters of each second preview image region are weighted and averaged according to each second weight parameter corresponding to each second preview image region to obtain the third brightness parameter corresponding to each sub-image region. The third weight parameter for each sub-image region is determined based on its position and size information. The first brightness parameter is obtained by weighting and averaging the at least two third brightness parameters based on the third weight parameters corresponding to the at least two sub-image regions.

8. An image capturing device, characterized in that, include: The module consists of a determination module, a shooting module, and a generation module; The determining module is used to determine at least one first exposure parameter based on the first brightness parameter and the first brightness threshold corresponding to the main image area of ​​the captured preview image, and to determine at least one second exposure parameter based on the second brightness parameter and the second brightness threshold corresponding to the background image area of ​​the captured preview image. The shooting module is used to capture a first image based on each first exposure parameter determined by the determining module, and to capture a second image based on each second exposure parameter determined by the determining module, wherein the first image and the second image are captured for the same scene; The generation module is used to generate a third image based on the subject image region in at least one of the first images captured by the shooting module and the background image region in at least one of the second images.

9. The apparatus according to claim 7, characterized in that, The determining module is specifically used for: The ratio of the third brightness parameter to the brightness threshold corresponding to the third image region is determined as at least one third exposure parameter; The third brightness parameter includes the first brightness parameter and the second brightness parameter; When the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes the at least one first exposure parameter; When the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes the at least one second exposure parameter.

10. The apparatus according to claim 9, characterized in that, The determining module is specifically used for: The fourth exposure parameter is determined based on the ratio of the third exposure parameter to the brightness threshold corresponding to the third image region; A fourth image is captured based on the fourth exposure parameters; A fifth exposure parameter is determined based on the product of a first value corresponding to the proportion of overexposed areas in the fourth image and the fourth exposure parameter, wherein at least one third exposure parameter includes the fourth exposure parameter and the fifth exposure parameter. The third brightness parameter includes the first brightness parameter and the second brightness parameter; When the third brightness parameter includes the first brightness parameter, the third image region includes the main image region of the captured preview image, and the at least one third exposure parameter includes the at least one first exposure parameter; When the third brightness parameter includes the second brightness parameter, the third image region includes the background image region of the captured preview image, and the at least one third exposure parameter includes the at least one second exposure parameter.

11. The apparatus according to claim 8, characterized in that, The number of at least one first image is at least two, and the number of at least one second image is at least two; The generation module is specifically used for: At least two of the first images are fused together to obtain a fifth image, and at least two of the second images are fused together to obtain a sixth image; Extract the main image region from the fifth image and extract the background image region from the sixth image; The extracted main image region and the extracted background image region are stitched together to obtain the third image.

12. The apparatus according to claim 8, characterized in that, The device further includes: a processing module and an acquisition module; The processing module is used to divide the shooting preview image into at least two first preview image regions corresponding to the shooting mode of the electronic device before the determining module determines at least one first exposure parameter based on the first brightness parameter and the first brightness threshold corresponding to the main image region of the shooting preview image, and determines at least one second exposure parameter based on the second brightness parameter and the second brightness threshold corresponding to the background image region of the shooting preview image. The acquisition module is used to acquire a weight table corresponding to the shooting mode. The weight table includes at least two first weight parameters, and each first weight parameter corresponds to a first preview image area. The processing module is further configured to perform weighted averaging of the brightness parameters of each first preview image region according to the first weight parameter corresponding to each first preview image region, so as to obtain the second brightness parameter.

13. The apparatus according to claim 8, characterized in that, The device further includes: a processing module; The processing module is used to divide the captured preview image into at least one second preview image region before the determining module determines at least one first exposure parameter based on the first brightness parameter and the first brightness threshold corresponding to the main image region of the captured preview image, and determines at least one second exposure parameter based on the second brightness parameter and the second brightness threshold corresponding to the background image region of the captured preview image. The determining module is further configured to determine a second weight parameter corresponding to each second preview image region based on the distance between the main image region of the captured preview image and each second preview image region obtained by the processing module, wherein the distance and the second weight parameter are negatively correlated. The processing module is further configured to perform weighted average processing on the brightness parameters of the at least one second preview image region according to the second weight parameters corresponding to the at least one second preview image region determined by the determining module, so as to obtain the first brightness parameter.

14. The apparatus according to claim 13, characterized in that, The main image region of the captured preview image includes at least two sub-image regions, and each second preview image region corresponds to at least two second weight parameters; The processing module is specifically used for: The brightness parameters of each second preview image region are weighted and averaged according to each second weight parameter corresponding to each second preview image region determined by the determining module to obtain the third brightness parameter corresponding to each sub-image region. The third weight parameter for each sub-image region is determined based on its position and size information. The first brightness parameter is obtained by weighting and averaging the at least two third brightness parameters based on the third weight parameters corresponding to the at least two sub-image regions.

15. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the image capturing method as described in any one of claims 1 to 7.

16. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the image capturing method as described in any one of claims 1 to 7.