Flash lamp exposure control method and device, chip and computer equipment
By using pre-flash and main flash exposure control methods, exposure parameters and brightness data are obtained, the degree of brightness influence is determined, and reasonable initial exposure parameters for the main flash are set. This solves the problem of poor image quality in high dynamic range scenes, achieves appropriate brightness in highlight areas and foreground areas, and improves image quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SPREADTRUM SEMICON (NANJING) CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-05-19
AI Technical Summary
In high dynamic range scenes, existing technologies struggle to simultaneously ensure that the brightness of bright areas is appropriate while the overall brightness of other areas is also appropriate, leading to a decline in image quality.
By using the exposure control method of pre-flash and main flash, the exposure parameters and image brightness data before and after pre-flash are obtained, the influence of pre-flash on the brightness of the foreground area of the image is determined, and then reasonable initial exposure parameters for the main flash are set, and the two exposure parameters are adjusted to optimize image quality.
In high dynamic range scenes, ensuring appropriate brightness in both the highlight and foreground areas improves the overall image quality.
Smart Images

Figure CN122069433A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of flash lamp technology, and in particular to a flash lamp exposure control method, apparatus, chip, and computer equipment. Background Technology
[0002] With the development of smartphones and other photography devices, the night scene flash photography function has received increasing attention. Because flash algorithm chains rarely use modules to improve dynamic range, in real-world scenes with bright objects (e.g., billboards), the brightness of the captured image can result in two scenarios: the bright areas are appropriately bright while other areas are generally dark; or the bright areas are overexposed while other areas are appropriately bright.
[0003] To address the aforementioned issues, it is often necessary to output two exposure parameters to adjust the exposure of the acquired image separately. The images under the influence of these two exposure parameters are then fused to obtain an image where the brightness of the highlight areas is appropriate, and the overall brightness of other areas is also suitable. These two exposure parameters are typically determined based on the initial master flash exposure parameters. Therefore, setting reasonable initial master flash exposure parameters is crucial to ensuring appropriate brightness in both highlight areas and other areas in high dynamic range scenes. Summary of the Invention
[0004] Therefore, it is necessary to provide a flash exposure control method, device, chip, and computer equipment to address the above-mentioned technical problems. By setting reasonable initial master flash exposure parameters, it is possible to ensure that the brightness of the bright areas in high dynamic scenes is appropriate and the overall brightness of other areas is also appropriate, thereby improving image quality.
[0005] In a first aspect, this application provides a flash exposure control method, the method comprising: controlling the flash to perform a pre-flash, and acquiring pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash; determining the degree of influence of the pre-flash on the brightness of the foreground area of the image based on the pre-flash exposure parameters and the image brightness data; determining the initial exposure parameters of the main flash based on the degree of influence of the pre-flash on the brightness of the foreground area of the image; and controlling the flash to perform the main flash based on the initial exposure parameters of the main flash.
[0006] In one embodiment, determining the initial exposure parameters of the main flash based on the degree of influence of the pre-flash on the brightness of the foreground region of the image includes: determining the degree of influence of the main flash on the brightness of the foreground region of the image based on the degree of influence of the pre-flash on the brightness of the foreground region of the image; and determining the initial exposure parameters of the main flash based on the degree of influence of the main flash on the brightness of the foreground region of the image.
[0007] In one embodiment, determining the brightness influence of the main flash on the foreground region of the image based on the influence of the pre-flash on the brightness of the foreground region includes: determining a distance coefficient based on the focus position parameters of the image acquisition module in the device to which the flash belongs; and determining the brightness influence of the main flash on the foreground region of the image based on the distance coefficient and the influence of the pre-flash on the brightness of the foreground region of the image. The distance coefficient is used to characterize the distance between the foreground target corresponding to the foreground region of the image in the current scene and the image acquisition module.
[0008] In one embodiment, the focus position parameters include a telephoto position parameter, a near-focus position parameter, and a current near-focus position parameter. Accordingly, determining the distance coefficient based on the focus position parameters of the image acquisition module in the device to which the flash belongs includes: determining the focus range of the image acquisition module based on the telephoto and near-focus position parameters; determining the focus deviation data of the image acquisition module based on the near-focus and near-focus position parameters; and determining the distance coefficient based on the focus range and focus deviation data.
[0009] In one embodiment, determining the brightness influence of the main flash on the foreground area of the image based on the influence of the pre-flash on the foreground area includes: determining a brightness coefficient based on the image brightness data corresponding to the pre-flash target setting and the main flash target setting; and determining the brightness influence of the main flash on the foreground area of the image based on the brightness coefficient and the influence of the pre-flash on the foreground area of the image. The brightness coefficient is used to characterize the relative magnitude between the image brightness data corresponding to the pre-flash target setting and the main flash target setting.
[0010] In one embodiment, determining the brightness coefficient based on the image brightness data corresponding to the pre-flash target level and the main flash target level of the flash lamp respectively includes: obtaining the pre-flash target level used by the flash lamp during the pre-flash process, and obtaining a first image brightness pre-calibrated for the pre-flash target level; determining the main flash target level of the flash lamp based on the ambient brightness of the current scene, and obtaining a second image brightness pre-calibrated for the main flash target level; and determining the brightness coefficient based on the first image brightness and the second image brightness.
[0011] In one embodiment, determining the degree of influence of pre-flash on the brightness of the foreground region of the image based on pre-flash exposure parameters and image brightness data includes: determining first brightness correlation data before pre-flash based on the corresponding pre-flash exposure parameters and corresponding image brightness data before pre-flash; determining second brightness correlation data after pre-flash based on the corresponding pre-flash exposure parameters and corresponding image brightness data after pre-flash; and determining the degree of influence of pre-flash on the brightness of the foreground region of the image based on the first brightness correlation data and the second brightness correlation data.
[0012] Secondly, this application provides a flash exposure control device, comprising: a first control module for controlling the flash to perform a pre-flash and acquiring pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash; a first determination module for determining the degree of influence of the pre-flash on the brightness of the foreground area of the image based on the pre-flash exposure parameters and the image brightness data; a second determination module for determining the initial exposure parameters of the main flash based on the degree of influence of the pre-flash on the brightness of the foreground area of the image; and a second control module for controlling the flash to perform the main flash based on the initial exposure parameters of the main flash.
[0013] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method provided in the first aspect.
[0014] Fourthly, this application provides a chip including a processor and a communication interface, the processor being configured to cause the chip to perform the steps of the method provided in the first aspect.
[0015] Fifthly, this application also provides a chip module, including a communication module, a power module, a storage module, and a chip, wherein: the power module is used to provide electrical energy to the chip module; the storage module is used to store data and instructions; the communication module is used for internal communication within the chip module, or for communication between the chip module and external devices; and the chip is used to perform the steps of the method provided in the first aspect above.
[0016] In a sixth aspect, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect.
[0017] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method provided in the first aspect.
[0018] The aforementioned flash exposure control method, device, chip, and computer equipment first control the flash to perform a pre-flash, and acquire the pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash. Based on these parameters, the degree of influence of the pre-flash on the brightness of the foreground area of the image is determined, thus understanding the impact of the pre-flash on the brightness of the foreground area. Next, based on the degree of influence of the pre-flash on the foreground area, the initial exposure parameters for the main flash are determined. Since the foreground area is the most important part of the acquired image, this embodiment considers the influence of the pre-flash on the brightness of the most important part, thus determining reasonable initial exposure parameters for the main flash. Finally, based on the initial exposure parameters, the flash is controlled to perform the main flash. For high dynamic range scenes, during the main flash control process using the initial exposure parameters, two exposure parameters can be determined based on these parameters. The exposure of the acquired image is adjusted separately, and the images under the influence of the two exposure parameters are then processed to obtain a final image with appropriate brightness in both the high-brightness areas and the overall brightness of the foreground area (i.e., the non-high-brightness areas), thereby improving the quality of the final image. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating a flash exposure control method in one embodiment;
[0021] Figure 2 This is a flowchart illustrating the steps for determining the degree of brightness influence in one embodiment;
[0022] Figure 3 This is a flowchart illustrating the steps for determining the degree of influence of pre-flash on foreground brightness in one embodiment.
[0023] Figure 4 This is a flowchart illustrating the steps for determining the degree of influence of the main flash on the foreground brightness in one embodiment.
[0024] Figure 5 This is a flowchart illustrating the steps for determining the degree of influence of the main flash on the foreground brightness in one embodiment.
[0025] Figure 6 This is a flowchart illustrating the steps for determining the degree of influence of the main flash on the foreground brightness in one embodiment.
[0026] Figure 7 This is a structural block diagram of a flash exposure control device in one embodiment;
[0027] Figure 8 This is an internal structural diagram of a computer device in one embodiment;
[0028] Figure 9 This is an internal structure diagram of a chip module in one embodiment. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0030] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0031] In one exemplary embodiment, a flash exposure control method is provided, see [link to relevant documentation]. Figure 1 Flash exposure control methods include:
[0032] S110 controls the flash to perform a pre-flash and acquires the pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash.
[0033] The flash control process includes pre-flash and main flash. The flash performs a pre-flash before the main flash to determine the exposure parameters needed for the main flash. When the image acquisition module actually takes the picture, it controls the flash to perform the main flash according to the previously determined exposure parameters.
[0034] Understandably, since the flash does not fire before the pre-flash, the pre-flash exposure parameters are actually the pre-flash exposure parameters, and the pre-flash exposure parameters are actually the post-flash exposure parameters. These are referred to as pre-flash exposure parameters to distinguish them from the subsequent main flash exposure parameters.
[0035] In real-world scenarios, the process of controlling the flash to pre-flash in the S110 can include the following steps:
[0036] S111 controls the flash to pre-flash according to the target flash setting.
[0037] The pre-flash target setting can be selected as the maximum setting. Of course, other current settings can also be selected, which are not limited here.
[0038] Understandably, the higher the flash setting, the greater the flash current and the brighter the flash output.
[0039] S112, in response to the fact that the brightness of the image acquired by the image acquisition module does not reach the target brightness, the pre-flash exposure parameters are adjusted until the brightness of the acquired image reaches the target brightness.
[0040] That is, after initiating pre-flash, the image acquisition module (e.g., a camera) acquires an initial image under the initial pre-flash exposure parameters and determines the brightness of the initial image. If the brightness of the initial image does not reach the target brightness, the initial pre-flash exposure parameters are adjusted at least once until the image acquired by the image acquisition module reaches the target brightness, at which point the pre-flash stabilizes. The pre-flash exposure parameters obtained from the last parameter adjustment are recorded as the pre-flash exposure parameters a1 after pre-flash, and the aforementioned initial pre-flash exposure parameters are recorded as the pre-flash exposure parameters a0 before pre-flash.
[0041] As can be seen, based on S111~S112, the pre-flash control of the flash is realized.
[0042] In practical scenarios, the process of obtaining the pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash in S110 may include the following steps:
[0043] S113, obtain the pre-flash exposure parameters before parameter adjustment begins and the pre-flash exposure parameters after parameter adjustment ends.
[0044] That is, obtain the above-mentioned pre-flash exposure parameter a0 and the above-mentioned pre-flash exposure parameter a1.
[0045] S114, Obtain the brightness statistics of the image acquired before parameter adjustment begins and the brightness statistics of the image acquired after parameter adjustment ends.
[0046] In practical scenarios, the acquired image can be evenly divided into multiple blocks. The average brightness value of each pixel in each block is taken as the brightness value of that block, and the brightness values of all blocks in the acquired image are used as the brightness statistics of the acquired image. In this way, the brightness statistics of the acquired image before parameter adjustment and the brightness statistics of the acquired image after parameter adjustment can be obtained.
[0047] S115 identifies the foreground and background regions of each acquired image.
[0048] Specifically, for the image acquired before parameter adjustment begins, the depth information of the acquired image is used to determine the blocks belonging to the foreground region and the blocks belonging to the background region of the image. For the image acquired after parameter adjustment is completed, the depth information of the acquired image is used to determine the blocks belonging to the foreground region and the blocks belonging to the background region of the image.
[0049] S116, based on the brightness statistics of the foreground region and the background region of the image collected before the parameter adjustment begins, determine the image brightness data corresponding to the image collected before the parameter adjustment begins.
[0050] Specifically, for the image acquired before parameter adjustment, the brightness values of each block belonging to the foreground region of the image are averaged to obtain the foreground brightness of the image; the brightness values of each block belonging to the background region of the image are averaged to obtain the background brightness of the image; and the foreground and background brightness are weighted and summed to obtain the image brightness data lum0 corresponding to the image. The foreground brightness is given a greater weight than the background brightness; for example, the foreground brightness has a weight of 0.7, and the background brightness has a weight of 0.3, so that the image brightness data lum0 mainly reflects the main foreground brightness.
[0051] S117. Based on the brightness statistics of the foreground region and the background region of the image collected after the parameter adjustment is completed, determine the image brightness data corresponding to the image collected after the parameter adjustment is completed.
[0052] Specifically, for the acquired image after parameter adjustment, the brightness values of each block belonging to the foreground region of the image are averaged to obtain the foreground brightness of the acquired image; the brightness values of each block belonging to the background region of the image are averaged to obtain the background brightness of the acquired image; the foreground and background brightness of the acquired image are then weighted and summed to obtain the corresponding image brightness data lum1. The foreground brightness is given a greater weight than the background brightness; for example, the foreground brightness has a weight of 0.7, and the background brightness has a weight of 0.3, thus ensuring that the image brightness data lum1 primarily reflects the main foreground brightness.
[0053] As can be seen, based on S113~S117, the pre-flash exposure parameter a0 and image brightness data lum0 corresponding to the pre-flash before pre-flash are obtained, as well as the pre-flash exposure parameter a1 and image brightness data lum1 corresponding to the pre-flash after pre-flash. Of course, in the above process, the proportion of bright blocks b0 in the image acquired before parameter adjustment begins and the proportion of bright blocks b1 in the image acquired after parameter adjustment are also statistically analyzed. The proportion of bright blocks refers to the ratio between the number of blocks in an image whose brightness is higher than the preset brightness and the total number of blocks in the image.
[0054] S120 determines the degree of influence of pre-flash on the brightness of the foreground area of the image based on the pre-flash exposure parameters and image brightness data.
[0055] In this context, the foreground region of an image frame is the main subject, or the most important part of that frame (for example, when photographing a person standing in a landscape, the person is in the foreground and the landscape is in the background; the area where the person is located in the image is the foreground region, which is the most important part of the image). Therefore, when focusing on the overall brightness of the image, it is sufficient to focus on the brightness of the foreground region. Thus, step S120 considers the impact of pre-flash on the brightness of the foreground region to improve the quality of the most important part of the final image.
[0056] As can be seen, in S120, based on the pre-flash exposure parameter a0 and image brightness data lum0 before the pre-flash, and the pre-flash exposure parameter a1 and image brightness data lum1 after the pre-flash, the brightness influence of the pre-flash on the foreground area of the image, pf_value, is calculated.
[0057] S130: Determine the initial exposure parameters of the main flash based on the degree of influence of the pre-flash on the brightness of the foreground area of the image.
[0058] That is, based on the influence of the pre-flash on the brightness of the foreground area of the image, pf_value, the initial exposure parameter mf_exp_value of the main flash is calculated.
[0059] S140 controls the flash to perform the main flash based on the initial exposure parameters of the main flash.
[0060] After controlling the main flash based on the initial exposure parameter mf_exp_value, the brightness of the foreground region in the final image is appropriate. That is, the image foreground region is used to characterize the whole image. Appropriate brightness in the foreground region indicates appropriate brightness in the overall image, thus ensuring the quality of the most important part of the final image.
[0061] Specifically, the main flash control process in S140 may include the following steps:
[0062] S141, determine the target exposure parameters of the main flash based on the dynamic scene type to which the current scene belongs and the initial exposure parameters of the main flash.
[0063] Among them, dynamic scene types include high dynamic scene types or low dynamic scene types.
[0064] Understandably, a high dynamic range scene type can be understood as a scene in which both extremely bright areas (e.g., billboards) and extremely dark areas (e.g., shadows) exist simultaneously, and the maximum difference in brightness between the extremely bright and extremely dark areas exceeds the dynamic range of ordinary imaging devices (e.g., cameras, smartphones, etc.).
[0065] Understandably, low dynamic range scene types can be understood as scenes where the maximum difference in brightness does not exceed the dynamic range of ordinary imaging devices (e.g., cameras, smartphones, etc.).
[0066] The method for determining the dynamic scene type of the current scene can include: determining whether the current scene is a high dynamic scene type based on information such as ambient brightness and the proportion of bright spots after pre-flash. The principle is: the higher the ambient brightness and / or the larger the proportion of bright spots after pre-flash, the greater the probability of being judged as a high dynamic scene type.
[0067] In practical scenarios, for low dynamic range (LVR) scenes, only one exposure parameter needs to be output. Therefore, the initial exposure parameter `mf_exp_value` of the main flash can be directly used as the target exposure parameter for the main flash for subsequent main flash control. Since there are no bright areas such as billboards in LVR scenes, a larger exposure parameter is sufficient to improve the overall brightness of the image.
[0068] In real-world scenarios, the process of determining the exposure parameters of the primary flash target may include the following steps:
[0069] S1, in response to the dynamic scene type being a high dynamic scene type, determines the first path exposure parameter in the main flash target exposure parameters as the main flash initial exposure parameter.
[0070] S2, based on the ambient brightness of the current scene and / or the image brightness data after pre-flash, determine the reduction ratio, and determine the second exposure parameter in the main flash target exposure parameters as the product of the main flash initial exposure parameters and the reduction ratio.
[0071] As can be seen, in high dynamic range scenarios, two exposure parameters need to be output: the first exposure parameter is the initial exposure parameter mf_exp_value of the main flash; the second exposure parameter mf_exp_value_short is the product of the scaling ratio se_ratio and the initial exposure parameter mf_exp_value of the main flash. It is evident that the first exposure parameter is larger, while the second exposure parameter is smaller.
[0072] In real-world scenarios, the higher the ambient brightness, the smaller the reduction ratio (se_ratio), indicating a negative correlation between ambient brightness and reduction ratio. The brightness data of the image after pre-flash can be represented by the proportion of bright areas in the pre-flash acquired image. A larger proportion of bright areas in the pre-flash acquired image results in a smaller reduction ratio (se_ratio), meaning a negative correlation between the proportion of bright areas and the reduction ratio. The purpose of this is to avoid overexposure of bright areas in the acquired image by setting a smaller second-path exposure parameter, given the high ambient brightness or pre-flash image brightness.
[0073] As can be seen, by using S1 and S2 above, two exposure parameters suitable for high dynamic range scenes can be quickly determined. Moreover, the second exposure parameter is more adapted to the ambient brightness of the current scene and / or the image brightness data after pre-flash, thus contributing to improving the quality of the final image.
[0074] S142 controls the flash to perform the main flash based on the exposure parameters of the target.
[0075] In low dynamic range scenarios, the initial exposure parameter mf_exp_value of the main flash can be used as the target exposure parameter of the main flash to control the flash to perform the main flash.
[0076] In high dynamic range (HVR) scenes, the first exposure parameter, when applied to the acquired image, significantly increases the brightness of the foreground region, thus maximizing the overall image brightness. The second exposure parameter, however, only slightly increases the overall brightness, indicating that it primarily suppresses excessive brightness in highlight areas, ensuring they receive appropriate brightness. The two frames processed by these two exposure parameters are then fused or subjected to other processing methods to obtain the final image. In this final image, the highlight areas have appropriate brightness, avoiding overexposure and preserving detail, while the foreground area also has suitable brightness, avoiding excessive darkness. Therefore, controlling the flash based on the target exposure parameters improves the quality of the final image.
[0077] It is evident that, regardless of whether the scene is in low or high dynamic range, determining the initial exposure parameter mf_exp_value of the main flash is crucial for obtaining appropriate exposure parameters for the main flash target. In this embodiment, the initial exposure parameter of the main flash is determined based on the degree of influence of the pre-flash on the brightness of the foreground region of the image. That is, considering the degree of influence of the pre-flash on the brightness of the most important part of the acquired image, a reasonable initial exposure parameter of the main flash can be determined.
[0078] In real-world scenarios, during main flash control, in addition to considering the exposure parameters of the main flash target, the flash level must also be controlled based on the main flash target's setting. The main flash target's setting can be determined based on the ambient brightness of the current scene. For example, the lower the ambient brightness, i.e., the darker the shooting environment, the higher the main flash target's setting, thus outputting a stronger light signal. However, it is essential to ensure that the main flash's color temperature is close to the ambient color temperature before the flash is applied.
[0079] The aforementioned flash exposure control method first controls the flash to perform a pre-flash, acquiring the pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash. Based on these parameters, the degree of influence of the pre-flash on the brightness of the foreground area is determined, thus understanding its impact. Next, the initial exposure parameters for the main flash are determined based on this influence. Since the foreground area is the most important part of the captured image, this embodiment considers the impact of the pre-flash on the brightness of this most important part, thus determining reasonable initial exposure parameters for the main flash. Finally, the flash is controlled to perform the main flash based on these initial exposure parameters. For high dynamic range scenes, during the main flash control process using the initial exposure parameters, two exposure parameters can be determined based on these parameters. These parameters are used to adjust the exposure of the captured image, and the images under the influence of these two exposure parameters are then processed to obtain a final image with appropriate brightness in both the high-brightness areas and the overall brightness of the foreground area (i.e., the non-high-brightness areas), thereby improving the quality of the final image.
[0080] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the step of determining the degree of influence of pre-flash on the brightness of the foreground area of the image in S120 is refined.
[0081] See Figure 2 The steps for determining the degree of influence of pre-flash on the brightness of the foreground area of the image include:
[0082] S210, determine the first brightness correlation data before pre-flash based on the pre-flash exposure parameters and the corresponding image brightness data.
[0083] The first brightness correlation data represents the relationship between the image brightness before pre-flash and the pre-flash exposure parameters. Specifically, the first brightness correlation data can be represented by the relative magnitude between the image brightness data before pre-flash and the pre-flash exposure parameters before pre-flash.
[0084] For example, the ratio between the image brightness data lum0 before pre-flash and the pre-flash exposure parameter a0 before pre-flash is used as the first brightness-related data. Of course, other calculation methods can also be used, which are not limited here.
[0085] S220: Determine the second brightness correlation data after pre-flash based on the pre-flash exposure parameters and the corresponding image brightness data.
[0086] The second brightness correlation data represents the relationship between the image brightness after pre-flash and the pre-flash exposure parameters. Specifically, the second brightness correlation data can be represented by the relative magnitude between the image brightness data after pre-flash and the pre-flash exposure parameters after pre-flash.
[0087] For example, the ratio between the image brightness data lum1 corresponding to the pre-flash and the pre-flash exposure parameter a1 corresponding to the pre-flash is used as the second brightness correlation data. Of course, other calculation methods can also be used, which are not limited here.
[0088] S230, based on the first brightness correlation data and the second brightness correlation data, determine the degree of influence of pre-flash on the brightness of the foreground area of the image.
[0089] For example, the difference between the second brightness correlation data and the first brightness correlation data is used to obtain the degree of influence of pre-flash on the brightness of the foreground area of the image. Of course, other calculation methods can also be used, which are not limited here.
[0090] Understandably, image brightness data primarily reflects foreground brightness. Therefore, the first brightness correlation data before pre-flash is actually the correlation between the foreground brightness before pre-flash and the pre-flash exposure parameters, while the second brightness correlation data is actually the correlation between the foreground brightness after pre-flash and the pre-flash exposure parameters.
[0091] In this embodiment, by comparing the first brightness correlation data before pre-flash and the second brightness correlation data after pre-flash, the degree of influence of pre-flash on the foreground brightness can be accurately determined.
[0092] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the step of determining the initial exposure parameters of the main flash in S130 is refined.
[0093] See Figure 3 The detailed steps for determining the initial exposure parameters of the main flash include:
[0094] S310, determine the degree of influence of the main flash on the brightness of the foreground area of the image based on the degree of influence of the pre-flash on the brightness of the foreground area of the image.
[0095] It is understandable that the main flash affects the brightness of the foreground area of the image, that is, the main flash affects the brightness of the foreground.
[0096] S320 determines the initial exposure parameters of the main flash based on the degree of influence of the main flash on the brightness of the foreground area of the image.
[0097] For example, a safe target value for the main flash brightness can be set according to the ambient brightness of the current scene, and then the ratio between the safe target value and the influence of the main flash on the brightness of the foreground area of the image, mf_value, can be used as the initial exposure parameter mf_exp_value of the main flash.
[0098] In this embodiment, the influence of the pre-flash on the foreground brightness is inferred from the influence of the pre-flash on the foreground brightness. Then, the initial exposure parameters of the main flash are determined based on the influence of the main flash on the foreground brightness, so that the determined initial exposure parameters of the main flash are consistent with the influence of the main flash on the foreground brightness, thereby improving the rationality of the initial exposure parameters of the main flash.
[0099] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the step of determining the degree of influence of the main flash on the brightness of the foreground area of the image in S310 is refined.
[0100] See Figure 4 The steps for determining the degree of influence of the refined main flash on the brightness of the foreground region of the image include:
[0101] S410 determines the distance coefficient based on the focus position parameters of the image acquisition module in the device to which the flash belongs.
[0102] The distance coefficient characterizes the distance between the foreground object in the current scene and the image acquisition module. For example, the distance between the person being photographed and the camera in the current scene.
[0103] The focus position parameters include the telephoto position parameters, the near-focus position parameters, and the current near-focus position parameters.
[0104] In an alternative implementation, the distance coefficient determination step in S410 may include:
[0105] S411 determines the focus range of the image acquisition module based on the telephoto and near-focus position parameters.
[0106] The telephoto position parameter can be understood as the position of the focusing element (such as the focusing lens group) inside the lens when the lens is focused to infinity (i.e., when shooting distant objects).
[0107] Among them, the near-focus position parameter can be understood as the closest distance at which the lens can focus clearly, and the position of the focusing element inside the lens.
[0108] For example, the focus range is obtained by subtracting the near-focus position parameter from the far-focus position parameter.
[0109] S412 determines the focus deviation data of the image acquisition module based on the near-focus position parameters and the close-focus position parameters.
[0110] The focus position parameter can be understood as the actual position of the focusing element in the current shooting state, that is, the position of the lens group corresponding to the distance of the object currently being focused on by the lens.
[0111] For example, the focus deviation data is obtained by subtracting the near-focus position parameter from the collimation position parameter.
[0112] S413 determines the distance coefficient based on the focus range and focus deviation data.
[0113] For example, the ratio between the focus deviation data and the focus range is used as the distance coefficient.
[0114] Thus, based on S411~S413, the distance coefficients were obtained.
[0115] In the above implementation, the focus range and focus deviation data are determined based on the focus position parameters, and then the distance coefficient is determined based on the focus range and focus deviation data, so as to know the distance between the near target (e.g., a person) in the current scene and the camera.
[0116] S420 determines the degree of influence of the main flash on the brightness of the foreground area of the image based on the distance coefficient and the degree of influence of the pre-flash on the brightness of the foreground area of the image.
[0117] In this embodiment, in determining the degree of influence of the main flash on the brightness of the foreground area of the image, not only the degree of influence of the pre-flash on the brightness of the foreground area of the image is considered, but also the distance between the near-field target in the current scene and the camera is considered, which can further improve the accuracy of the degree of influence of the main flash on the brightness of the foreground area of the image.
[0118] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the step of determining the degree of influence of the main flash on the brightness of the foreground area of the image in S310 is refined.
[0119] See Figure 5 The steps for determining the degree of influence of the main flash on the brightness of the foreground region of the image include:
[0120] S510 determines the brightness coefficient based on the image brightness data corresponding to the pre-flash target setting and the main flash target setting of the flash unit.
[0121] The brightness coefficient is used to characterize the relative magnitude between the image brightness data corresponding to the pre-flash target setting and the main flash target setting, respectively.
[0122] For example, the ratio between the image brightness data of the flash at the pre-flash target setting and the image brightness data of the flash at the main flash target setting is used as the brightness coefficient.
[0123] In one optional implementation, the luminance coefficient determination step in S510 includes:
[0124] S511, acquire the target flash level used by the flash during the pre-flash process, and acquire the first image brightness pre-calibrated for the target flash level.
[0125] In real-world scenarios, the image brightness at different pre-flash levels is pre-calibrated, and then the corresponding image brightness is found based on the target pre-flash level as the first image brightness.
[0126] S512 determines the main flash target level of the flash based on the ambient brightness of the current scene, and obtains the second image brightness pre-calibrated for the main flash target level.
[0127] In real-world scenarios, the image brightness at different master flash levels is pre-calibrated, and then the corresponding image brightness is found based on the master flash target level as the second image brightness.
[0128] S513, determine the brightness coefficient based on the brightness of the first image and the brightness of the second image.
[0129] For example, the ratio between the brightness of the first image and the brightness of the second image is used as the brightness coefficient.
[0130] In the above implementation method, the brightness coefficient determined according to the calibrated brightness corresponding to the pre-flash target level and the calibrated brightness corresponding to the main flash target level can reflect the difference between the calibrated brightness corresponding to the pre-flash target level and the calibrated brightness corresponding to the main flash target level.
[0131] S520 determines the degree of influence of the main flash on the brightness of the foreground area of the image based on the brightness coefficient and the degree of influence of the pre-flash on the brightness of the foreground area of the image.
[0132] In this embodiment, in determining the degree of influence of the main flash on the brightness of the foreground area of the image, not only is the degree of influence of the pre-flash on the brightness of the foreground area of the image taken into account, but also the brightness coefficient is taken into account. That is, the difference between the calibrated brightness corresponding to the pre-flash target level and the calibrated brightness corresponding to the main flash target level is taken into account, which can further improve the accuracy of the degree of influence of the main flash on the brightness of the foreground area of the image.
[0133] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the step of determining the degree of influence of the main flash on the brightness of the foreground area of the image in S310 is refined.
[0134] See Figure 6 The steps for determining the degree of influence of the refined main flash on the brightness of the foreground region of the image include:
[0135] S610 determines the distance coefficient based on the focus position parameters of the image acquisition module in the device to which the flash belongs; and determines the brightness coefficient based on the image brightness data corresponding to the pre-flash target setting and the main flash target setting of the flash respectively.
[0136] The process for determining the distance coefficient can be found in the relevant content of the above embodiments.
[0137] The process for determining the brightness coefficient can be found in the relevant content of the above embodiments.
[0138] S620 determines the degree of influence of the main flash on the brightness of the foreground area of the image based on the distance coefficient, brightness coefficient, and the degree of influence of the pre-flash on the brightness of the foreground area of the image.
[0139] For example, the brightness influence of the main flash on the foreground region of the image, mf_value, is the product of the distance coefficient, distance_ratio, brightness coefficient, R, and the brightness influence of the pre-flash on the foreground region of the image, pf_value, i.e., mf_value = pf_value * R * distance_ratio.
[0140] In this embodiment, in determining the degree of influence of the main flash on the brightness of the foreground area of the image, not only is the degree of influence of the pre-flash on the brightness of the foreground area of the image taken into account, but also the brightness coefficient and distance system are considered. That is, the difference between the calibrated brightness corresponding to the pre-flash target level and the calibrated brightness corresponding to the main flash target level, as well as the difference between the calibrated brightness corresponding to the pre-flash target level and the calibrated brightness corresponding to the main flash target level, can further improve the accuracy of the degree of influence of the main flash on the brightness of the foreground area of the image.
[0141] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0142] Based on the same inventive concept, this application also provides a flash exposure control device for implementing the flash exposure control method described above. This device can be applied to or integrated into a chip or chip module, for example. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more flash exposure control device embodiments provided below can be found in the limitations of the flash exposure control method described above, and will not be repeated here.
[0143] In one exemplary embodiment, a flash exposure control device is provided, such as... Figure 7 As shown, the flash exposure control device includes: a first control module 710, a first determination module 720, a second determination module 730, and a second control module 740, wherein:
[0144] The first control module 710 is used to control the flash to perform pre-flash and to obtain the pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash.
[0145] The first determining module 720 is used to determine the degree of influence of pre-flash on the brightness of the foreground area of the image based on the pre-flash exposure parameters and image brightness data;
[0146] The second determining module 730 is used to determine the initial exposure parameters of the main flash based on the degree of influence of the pre-flash on the brightness of the foreground area of the image.
[0147] The second control module 740 is used to control the flash to perform the main flash based on the initial exposure parameters of the main flash.
[0148] In one embodiment, the second determining module includes: a first determining submodule, configured to determine the brightness influence of the main flash on the foreground region of the image based on the brightness influence of the pre-flash on the foreground region of the image; and a second determining submodule, configured to determine the initial exposure parameters of the main flash based on the brightness influence of the main flash on the foreground region of the image. In one embodiment, the first determining submodule includes: a first determining unit, configured to determine a distance coefficient based on the focus position parameters of the image acquisition module in the flash unit; and a second determining unit, configured to determine the brightness influence of the main flash on the foreground region of the image based on the distance coefficient and the brightness influence of the pre-flash on the foreground region of the image; wherein the distance coefficient is used to characterize the distance between the foreground target corresponding to the foreground region of the image in the current scene and the image acquisition module.
[0149] In one embodiment, the focus position parameters include a far-focus position parameter, a near-focus position parameter, and a current near-focus position parameter; correspondingly, the first determining unit is specifically used to: determine the focus range of the image acquisition module based on the far-focus position parameter and the near-focus position parameter; determine the focus deviation data of the image acquisition module based on the near-focus position parameter and the near-focus position parameter; and determine the distance coefficient based on the focus range and the focus deviation data.
[0150] In one embodiment, the first determining submodule includes: a third determining unit, configured to determine a brightness coefficient based on the image brightness data corresponding to the pre-flash target setting and the main flash target setting, respectively; and a fourth determining unit, configured to determine the brightness influence of the main flash on the image foreground area based on the brightness coefficient and the degree of influence of the pre-flash on the brightness of the image foreground area; wherein the brightness coefficient is used to characterize the relative magnitude between the image brightness data corresponding to the pre-flash target setting and the main flash target setting, respectively.
[0151] In one embodiment, the third determining unit is specifically used to: obtain the pre-flash target level used by the flash during the pre-flash process, and obtain a first image brightness pre-calibrated for the pre-flash target level; determine the main flash target level of the flash based on the ambient brightness of the current scene, and obtain a second image brightness pre-calibrated for the main flash target level; and determine a brightness coefficient based on the first image brightness and the second image brightness.
[0152] In one embodiment, the first determining module is specifically used to: determine first brightness correlation data before pre-flash based on the pre-flash exposure parameters and corresponding image brightness data before pre-flash; determine second brightness correlation data after pre-flash based on the pre-flash exposure parameters and corresponding image brightness data after pre-flash; and determine the degree of influence of pre-flash on the brightness of the foreground area of the image based on the first brightness correlation data and the second brightness correlation data.
[0153] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, all of their modules / units can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.
[0154] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a flash exposure control method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0155] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0156] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the flash exposure control method provided in the above embodiment.
[0157] Based on the same inventive concept, this application also provides a chip, including a processor and a communication interface; the communication interface is used to receive or send data; the processor is configured to cause the chip to execute the steps of the flash exposure control method provided in the above embodiments.
[0158] It is understood that the chip involved in the embodiments of this application may be a field-programmable gate array (FPGA), may be an application-specific integrated circuit (ASIC), may be a system on chip (SoC), may be a central processor unit (CPU), may be a network processor (NP), may be a digital signal processor (DSP), may be a microcontroller unit (MCU), may be a programmable logic device (PLD), or other integrated chips, etc.
[0159] Based on the same inventive concept, this application also provides a chip module, such as... Figure 9 As shown, the chip module includes a communication module, a power module, a storage module, and a chip. Specifically: the power module provides power to the chip module; the storage module stores data and instructions; the communication module enables internal communication within the chip module or communication between the chip module and external devices; and the chip corresponds to the chip in the aforementioned chip embodiment. The implementation of this chip module can be found in the relevant content of the aforementioned chip embodiment, and will not be repeated here.
[0160] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the flash exposure control method provided in the above embodiments.
[0161] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the flash exposure control method provided in the above embodiments.
[0162] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0163] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0164] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A flash exposure control method, characterized in that, include: Control the flash to perform a pre-flash, and obtain the pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash; Based on the pre-flash exposure parameters and the image brightness data, determine the degree of influence of the pre-flash on the brightness of the foreground area of the image; The initial exposure parameters of the main flash are determined based on the degree of influence of the pre-flash on the brightness of the foreground area of the image. The flash unit is controlled to perform a main flash based on the initial exposure parameters of the main flash.
2. The method according to claim 1, characterized in that, The step of determining the initial exposure parameters of the main flash based on the degree of influence of the pre-flash on the brightness of the foreground area of the image includes: The degree of influence of the pre-flash on the brightness of the foreground region of the image is determined based on the degree of influence of the pre-flash on the brightness of the foreground region of the image; The initial exposure parameters of the main flash are determined based on the degree of influence of the main flash on the brightness of the foreground area of the image.
3. The method according to claim 2, characterized in that, The step of determining the degree of influence of the main flash on the brightness of the foreground region of the image based on the degree of influence of the pre-flash on the brightness of the foreground region of the image includes: The distance coefficient is determined based on the focus position parameters of the image acquisition module in the device to which the flash belongs; The degree of influence of the main flash on the brightness of the foreground region of the image is determined based on the distance coefficient and the degree of influence of the pre-flash on the brightness of the foreground region of the image. The distance coefficient is used to characterize the distance between the foreground target corresponding to the foreground region of the image in the current scene and the image acquisition module.
4. The method according to claim 3, characterized in that, The focus position parameters include telephoto position parameters, near-focus position parameters, and the current focus position parameters; correspondingly, determining the distance coefficient based on the focus position parameters of the image acquisition module in the flash unit includes: The focus range of the image acquisition module is determined based on the telephoto position parameters and the near-focus position parameters. Based on the near-focus position parameters and the near-focus position parameters, the focus deviation data of the image acquisition module is determined; The distance coefficient is determined based on the focus range and the focus deviation data.
5. The method according to claim 2, characterized in that, The step of determining the degree of influence of the main flash on the brightness of the foreground region of the image based on the degree of influence of the pre-flash on the brightness of the foreground region of the image includes: The brightness coefficient is determined based on the image brightness data corresponding to the pre-flash target setting and the main flash target setting of the flash lamp, respectively; The degree of influence of the main flash on the brightness of the foreground region of the image is determined based on the brightness coefficient and the degree of influence of the pre-flash on the brightness of the foreground region of the image. The brightness coefficient is used to characterize the relative magnitude between the image brightness data corresponding to the pre-flash target setting and the main flash target setting of the flash lamp.
6. The method according to claim 5, characterized in that, The step of determining the brightness coefficient based on the image brightness data corresponding to the pre-flash target setting and the main flash target setting of the flash lamp includes: The target flash level used by the flash during the pre-flash process is obtained, and the first image brightness pre-calibrated for the target flash level is obtained. Based on the ambient brightness of the current scene, determine the main flash target level of the flash and obtain the second image brightness pre-calibrated for the main flash target level; The brightness coefficient is determined based on the brightness of the first image and the brightness of the second image.
7. The method according to any one of claims 1 to 6, characterized in that, The step of determining the degree of influence of the pre-flash on the brightness of the foreground area of the image based on the pre-flash exposure parameters and the image brightness data includes: Based on the pre-flash exposure parameters and corresponding image brightness data before the pre-flash, determine the first brightness correlation data before the pre-flash; Based on the pre-flash exposure parameters and corresponding image brightness data after the pre-flash, determine the second brightness correlation data after the pre-flash; Based on the first brightness correlation data and the second brightness correlation data, the degree of influence of the pre-flash on the brightness of the foreground area of the image is determined.
8. A flash exposure control device, characterized in that, include: The first control module is used to control the flash to perform pre-flash and to obtain the pre-flash exposure parameters and corresponding image brightness data before and after the pre-flash. The first determining module is used to determine the degree of influence of the pre-flash on the brightness of the foreground area of the image based on the pre-flash exposure parameters and the image brightness data; The second determining module is used to determine the initial exposure parameters of the main flash based on the degree of influence of the pre-flash on the brightness of the foreground area of the image; The second control module is used to control the flash to perform the main flash based on the initial exposure parameters of the main flash.
9. A chip, characterized in that, The device includes a processor and a communication interface, the processor being configured to cause the chip to perform the steps of the method described in any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.