Light supplementing lamp control method and device of camera equipment and storage medium

CN121691927BActive Publication Date: 2026-09-18HANGZHOU HUACHENG SOFTWARE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511614787.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-05
Publication Date
2026-09-18
Estimated Expiration
2045-11-05

AI Technical Summary

Technical Problem

然而,这种方法存在明显的缺陷,如误判断、频繁开关、适应性差、图像质量不稳定等问题

Benefits of technology

[0016] The above scheme calculates the gain-to-brightness ratio threshold corresponding to the fill light based on the state switching gain threshold and the target brightness reference; obtains the gain value used by the camera to capture the current image frame to obtain the current gain value, and obtains the brightness value of the current image frame to obtain the current image brightness; calculates the ratio between the current gain value and the current image brightness to obtain the current gain-to-brightness ratio; compares the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switches the state of the fill light based on the comparison result. The ratio of gain to brightness value can be used as the main judgment basis. The current gain-to-brightness ratio can better reflect the real ambient lighting conditions. Compared with the method of judging by only a single parameter, it effectively avoids the misjudgment problem caused by the fluctuation of a single parameter and improves the reliability of fill light control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121691927B_ABST
    Figure CN121691927B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, and storage medium for controlling the fill light of a camera device. The method includes: calculating a gain-to-brightness ratio threshold corresponding to the fill light based on a state switching gain threshold and a target brightness reference; obtaining the gain value used by the camera device to acquire the current image frame to obtain the current gain value, and obtaining the brightness value of the current image frame to obtain the current image brightness; calculating the ratio between the current gain value and the current image brightness to obtain the current gain-to-brightness ratio; comparing the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switching the state of the fill light based on the comparison result. The ratio of gain to brightness value can be used as the primary criterion for judgment. The current gain-to-brightness ratio can better reflect the actual ambient lighting conditions. Compared to using only a single parameter for judgment, this effectively avoids misjudgment caused by fluctuations in a single parameter, thus improving the reliability of the fill light control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image acquisition technology, and in particular to a method, device and storage medium for controlling the fill light of a camera device. Background Technology

[0002] When capturing video or images using camera equipment, ambient lighting can affect the image acquisition results. In particular, the image quality captured at night or in low-light environments is poor. Generally, it is necessary to illuminate the environment to improve the image acquisition quality. Lighting control technology is crucial for obtaining high-quality images.

[0003] Traditional lighting control methods are typically based on simple threshold judgments, such as turning on lighting equipment when the ambient brightness is below a certain fixed value and turning it off when it is above a certain fixed value. However, this method has obvious drawbacks, such as misjudgment, frequent switching, poor adaptability, and unstable image quality. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides at least one method, device, and storage medium for controlling the fill light of a camera device.

[0005] The first aspect of this application provides a method for controlling the fill light of a camera device. The method includes: obtaining a preset state switching gain threshold and a preset target brightness reference corresponding to the fill light; calculating a gain-to-brightness ratio threshold corresponding to the fill light based on the state switching gain threshold and the target brightness reference; obtaining the gain value used by the camera device to acquire the current image frame to obtain the current gain value, and obtaining the brightness value of the current image frame to obtain the current image brightness; calculating the ratio between the current gain value and the current image brightness to obtain the current gain-to-brightness ratio; comparing the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switching the state of the fill light based on the comparison result.

[0006] In one embodiment, the state of the supplementary light includes on and off, and the state switching gain threshold includes an on gain threshold and an off gain threshold. Based on the state switching gain threshold and a target brightness reference, the gain-to-brightness ratio threshold corresponding to the supplementary light is calculated, including: calculating the on gain-to-brightness ratio threshold corresponding to the supplementary light based on the on gain threshold and the target brightness reference; calculating the off gain-to-brightness ratio threshold corresponding to the supplementary light based on the off gain threshold and the target brightness reference; comparing the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switching the state of the supplementary light based on the comparison result, including: if the current gain-to-brightness ratio is greater than the on gain-to-brightness ratio threshold, then the supplementary light is turned on; after the supplementary light is turned on, if the current gain-to-brightness ratio is less than the off gain-to-brightness ratio threshold, then the supplementary light is turned off.

[0007] In one embodiment, after the fill light is turned on, if the current gain-to-brightness ratio is less than the off-gain-to-brightness ratio threshold, the fill light is turned off, including: after the fill light is turned on, entering a off-threshold statistical period; calculating the ambient brightness corresponding to each image frame based on the gain value and exposure time of the image frames acquired during the off-threshold statistical period; performing a weighted calculation on the ambient brightness corresponding to each image frame to obtain an ambient brightness threshold; in response to the end of the off-threshold statistical period, calculating the current ambient brightness based on the current gain value and current exposure time of the current image frame; if the current gain-to-brightness ratio is less than the off-gain-to-brightness ratio threshold and the current ambient brightness is less than the ambient brightness threshold, the fill light is turned off.

[0008] In one embodiment, if the current gain-to-brightness ratio is less than the threshold for turning off the gain-to-brightness ratio and the current ambient brightness is less than the ambient brightness threshold, then the fill light is turned off. This includes: obtaining the brightness statistics of the current image frame, the current image brightness, and obtaining the preset stable value corresponding to the automatic exposure module; calculating the statistical brightness threshold based on the brightness statistics, the current image brightness, the target brightness reference, and the preset stable value; if the current gain-to-brightness ratio is less than the threshold for turning off the gain-to-brightness ratio and the current ambient brightness is less than the ambient brightness threshold, and the brightness statistics are greater than the statistical brightness threshold, then updating the number of continuously accumulated frames and / or the duration; obtaining the waiting frame threshold and / or the waiting duration threshold; if the updated number of continuously accumulated frames is greater than the waiting frame threshold and / or the updated duration is greater than the waiting duration threshold, then the fill light is turned off.

[0009] In one embodiment, the method further includes: obtaining a preset sensitivity parameter; and adjusting the off gain-to-brightness ratio threshold and the on gain-to-brightness ratio threshold based on the sensitivity parameter.

[0010] In one embodiment, if the current gain-to-brightness ratio is greater than the threshold for enabling the gain-to-brightness ratio, then the fill light is turned on, including: if the current gain-to-brightness ratio is greater than the threshold for enabling the gain-to-brightness ratio, then updating the number of continuously accumulated frames and / or the duration of the accumulated frames; obtaining a waiting frame threshold and / or a waiting duration threshold; if the updated number of continuously accumulated frames is greater than the waiting frame threshold and / or the updated duration of the accumulated frames is greater than the waiting duration threshold, then the fill light is turned on.

[0011] In one embodiment, obtaining the waiting frame count threshold and / or waiting duration threshold includes: obtaining the current frame rate of the camera device; and calculating the waiting frame count threshold and / or waiting duration threshold based on the current frame rate.

[0012] In one embodiment, after the fill light is turned on, the method further includes: calculating an ambient difference based on the turn-on gain-to-brightness ratio threshold and the current gain-to-brightness ratio after the fill light is turned on; determining a PWM adjustment step size based on the ambient difference; and performing PWM adjustment on the fill light based on the PWM adjustment step size.

[0013] A second aspect of this application provides a fill light control device for a camera device. The device includes: a threshold calculation module, used to acquire a preset state switching gain threshold and a preset target brightness reference corresponding to the fill light, and to calculate a gain-to-brightness ratio threshold corresponding to the fill light based on the state switching gain threshold and the target brightness reference; a parameter acquisition module, used to acquire the gain value used by the camera device to acquire the current image frame to obtain the current gain value, and to acquire the brightness value of the current image frame to obtain the current image brightness; a ratio calculation module, used to calculate the ratio between the current gain value and the current image brightness to obtain the current gain-to-brightness ratio; and a switching judgment module, used to compare the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and to switch the state of the fill light based on the comparison result.

[0014] A third aspect of this application provides a camera device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-described fill light control method of the camera device.

[0015] The fourth aspect of this application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the above-described method for controlling the fill light of a camera device.

[0016] The above scheme calculates the gain-to-brightness ratio threshold corresponding to the fill light based on the state switching gain threshold and the target brightness reference; obtains the gain value used by the camera to capture the current image frame to obtain the current gain value, and obtains the brightness value of the current image frame to obtain the current image brightness; calculates the ratio between the current gain value and the current image brightness to obtain the current gain-to-brightness ratio; compares the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switches the state of the fill light based on the comparison result. The ratio of gain to brightness value can be used as the main judgment basis. The current gain-to-brightness ratio can better reflect the real ambient lighting conditions. Compared with the method of judging by only a single parameter, it effectively avoids the misjudgment problem caused by the fluctuation of a single parameter and improves the reliability of fill light control.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.

[0019] Figure 1 This is a flowchart illustrating a fill light control method for a camera device, as shown in an exemplary embodiment of this application;

[0020] Figure 2This is a flowchart illustrating the calculation of an ambient brightness threshold, as shown in an exemplary embodiment of this application;

[0021] Figure 3 This is a flowchart illustrating a specific application scenario for supplementary lighting control, as shown in an exemplary embodiment of this application;

[0022] Figure 4 This is a block diagram illustrating a fill light control device for a camera device, as shown in an exemplary embodiment of this application;

[0023] Figure 5 This is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of this application;

[0024] Figure 6 This is a schematic diagram illustrating the structure of a computer-readable storage medium, as shown in an exemplary embodiment of this application. Detailed Implementation

[0025] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0026] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0027] In this document, the term "and / or" is merely a description of the association information of related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0028] The following describes the fill light control method for the camera device provided in the embodiments of this application.

[0029] The supplementary lighting control method for a camera device provided in this application embodiment can be executed by the camera device itself, other electronic devices that are communicatively connected to the camera device, or by the camera device and other electronic devices interacting and cooperating to execute the steps. This application does not limit the scope of the method.

[0030] Please see Figure 1 , Figure 1 This is a flowchart illustrating a fill light control method for a camera device, as shown in an exemplary embodiment of this application. Figure 1As shown, the method for controlling the fill light of a camera device includes at least steps S110 to S140, which are described in detail below:

[0031] Step S110: Obtain the preset state switching gain threshold and the preset target brightness reference corresponding to the fill light. Based on the state switching gain threshold and the target brightness reference, calculate the gain-to-brightness ratio threshold corresponding to the fill light.

[0032] There are pre-set state switching gain thresholds for the fill light, and different image sensor models can be set with different state switching gain thresholds.

[0033] The state switching gain threshold represents the critical gain point. For example, when the gain of the image sensor reaches or exceeds this value, it is considered that the ambient light may be insufficient, and it is necessary to determine whether to turn on the supplementary light; or, when the gain of the image sensor is lower than this value, it is considered that the ambient light meets the image acquisition requirements, and it is necessary to determine whether to turn off the supplementary light.

[0034] The target brightness reference is also a preset value, which is the brightness level that the image frame is expected to reach.

[0035] Calculate the gain-to-brightness ratio threshold corresponding to the supplementary light based on the state switching gain threshold and the target brightness reference.

[0036] Specifically, the ratio of the state switching gain threshold to the target brightness reference is calculated to obtain the gain-to-brightness ratio threshold corresponding to the supplementary light.

[0037] It should be noted that the number of state switching gain thresholds can be one or more, thus one or more gain-to-brightness ratio thresholds can be calculated.

[0038] For example, the fill light may switch between off and on states, or between on and off states; or, the fill light may switch between different brightness levels, such as 0%, 25%, 50%, 75%, and 100%. A state switching gain threshold is set for each of these state switching states, resulting in multiple state switching gain thresholds. A gain-to-brightness ratio threshold is then calculated for each state switching gain threshold.

[0039] Step S120: Obtain the gain value used by the camera device to capture the current image frame to obtain the current gain value, and obtain the brightness value of the current image frame to obtain the current image brightness.

[0040] The camera equipment can be any device capable of image acquisition, such as a network camera, digital SLR camera, drone camera, or smartphone camera. This application does not limit the specific type of camera equipment.

[0041] Gain refers to the process of electronically amplifying the raw signal captured by an image sensor.

[0042] When a camera device acquires an image, it obtains the current gain value of the image sensor from the image signal processor (ISP), which represents the actual gain value being used in the current image frame, thus obtaining the current gain value.

[0043] Additionally, the brightness value of the current image frame is obtained to determine the current image brightness.

[0044] The current image brightness can be the average brightness of the entire current image frame calculated by the Auto Exposure (AE) module within the image sensor or chip. Alternatively, the current image brightness can be the average value of the Y (in YUV format, Y represents brightness information) values ​​within the current image frame.

[0045] Step S130: Calculate the ratio between the current gain value and the current image brightness to obtain the current gain-to-brightness ratio.

[0046] The current gain value and the current image brightness are compared to obtain the current gain-to-brightness ratio.

[0047] For example, using the current image brightness as the denominator and the current gain value as the numerator: the lower the current image brightness (i.e., the darker the current image frame) and the higher the current gain value used, the greater the current gain-to-brightness ratio; conversely, the higher the current image brightness (i.e., the brighter the current image frame) and the lower the current gain value used, the smaller the current gain-to-brightness ratio.

[0048] Of course, the current image brightness can also be used as the numerator and the current gain value as the denominator. As long as the logic for subsequent state switching judgments is compatible, this application does not impose any restrictions on this.

[0049] Step S140: Compare the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switch the state of the fill light based on the comparison result.

[0050] The current gain-to-brightness ratio reflects the effect of the gain. By comparing the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, it can be determined whether it is necessary to switch the state of supplementary lighting, etc.

[0051] For example, after comparing the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, if the comparison result shows that the current gain value has been adjusted to a high value, but the brightness value of the corresponding acquired image frame is still low, then it is determined that the natural light is insufficient and the supplementary light needs to be turned on to supplement the lighting to ensure the image acquisition quality; conversely, if the comparison result shows that the brightness value of the corresponding acquired image frame is high under the current gain value, then it is determined that the natural light is sufficient and the supplementary light does not need to be turned on.

[0052] Of course, if the fill light has multiple state switching gain thresholds, multiple state switching can be achieved. For example, the illumination brightness of the fill light can be adjusted from 25% to 50%, or from 50% to 100%. This application does not limit this.

[0053] The supplementary lighting control method for a camera device provided in this application calculates the gain-to-brightness ratio threshold corresponding to the supplementary lighting based on a state switching gain threshold and a target brightness reference; obtains the gain value used by the camera device to acquire the current image frame to obtain the current gain value, and obtains the brightness value of the current image frame to obtain the current image brightness; calculates the ratio between the current gain value and the current image brightness to obtain the current gain-to-brightness ratio; compares the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switches the state of the supplementary lighting based on the comparison result. The ratio of gain to brightness value can be used as the main judgment criterion, and the current gain-to-brightness ratio can better reflect the real ambient lighting conditions. Compared with the method of judging by using only a single parameter, it effectively avoids the misjudgment problem caused by the fluctuation of a single parameter and improves the reliability of supplementary lighting control.

[0054] The following describes some embodiments of this application in detail.

[0055] In some implementations, the state of the supplementary light includes on and off, and the state switching gain threshold includes an on gain threshold and an off gain threshold; in step S110, based on the state switching gain threshold and the target brightness reference, the gain-to-brightness ratio threshold corresponding to the supplementary light is calculated, including:

[0056] The calculation steps for the on-growth gain ratio threshold are as follows: Based on the on-growth gain threshold and the target brightness reference, calculate the on-growth gain ratio threshold corresponding to the supplementary light.

[0057] The calculation steps for the off gain-to-brightness ratio threshold are as follows: Based on the off gain threshold and the target brightness reference, calculate the off gain-to-brightness ratio threshold corresponding to the fill light.

[0058] For example, the current maximum gain of the image sensor, currMaxSenGain, is obtained from the ISP. currMaxSenGain refers to the maximum gain under the current automatic exposure strategy and scene limitations. The corresponding on-light gain threshold, gainDbForWlOpen, is obtained, and the target brightness reference, evTarget, is obtained. The on-light gain-to-brightness ratio threshold can be calculated using the following formula:

[0059] gainEvRatioThr2WLOn=MAX(MIN(currMaxSenGain,gainDbForWlOpen),M)×N / evTarget(Formula 1)

[0060] Wherein, gainEvRatioThr2WLOn is the threshold for enabling the gain-to-brightness ratio, MAX is the maximum of the two values, MIN is the minimum of the two values, M is the preset lower limit of gain, and N is the preset multiple.

[0061] Similarly, to obtain the corresponding off gain threshold gainDbForWlClose for the supplementary light, the off gain luminance ratio threshold can be calculated using the following formula 2:

[0062] gainEvRatioThr2WLOff=MAX(MIN(currMaxSenGain,gainDbForWlClose),M)×N / evTarget(Formula 2)

[0063] Wherein, gainEvRatioThr2WLOff is the threshold for turning off the gain-to-luminance ratio; for the explanation of the other symbols, please refer to Formula 1.

[0064] By setting different thresholds for when the fill light is on and off, oscillations are avoided, and the stability of the fill light control is improved.

[0065] In some implementations, a preset sensitivity parameter is obtained; and the gain-to-brightness ratio threshold for turning off and the gain-to-brightness ratio threshold for turning on are adjusted based on the sensitivity parameter.

[0066] The sensitivity parameter can be set by the user.

[0067] Adjust the gain-to-brightness ratio thresholds for turning off and on based on the sensitivity parameters.

[0068] For example, by querying the adjustment coefficient corresponding to the off gain-to-brightness ratio threshold based on the sensitivity parameter, the off threshold adjustment coefficient is obtained, and the off gain-to-brightness ratio threshold is adjusted according to the off threshold adjustment coefficient; similarly, by querying the adjustment coefficient corresponding to the on gain-to-brightness ratio threshold based on the sensitivity parameter, the on threshold adjustment coefficient is obtained, and the on gain-to-brightness ratio threshold is adjusted according to the on threshold adjustment coefficient.

[0069] Of course, when there are other types of gain-to-brightness ratio thresholds, or other types of thresholds, these thresholds can be adjusted uniformly according to the sensitivity parameters.

[0070] For example, based on the sensitivity parameters, the corresponding threshold adjustment coefficient is obtained as gainEvRatioThr2WLOnRatio, the current gain-to-brightness ratio is curGainEvRatio, and the threshold for enabling the gain-to-brightness ratio is gainEvRatioThr2WLOn. Then, when curGainEvRatio is greater than gainEvRatioThr2WLOn×gainEvRatioThr2WLOnRatio and this condition is met for a certain number of frames, the fill light is turned on.

[0071] The threshold coefficient can be dynamically adjusted by using sensitivity parameters to achieve personalized control and adapt to different user needs.

[0072] Additionally, calculate the current gain-to-luminance ratio.

[0073] For example, for the current image frame, the current gain value currGain and the current image brightness curEv are obtained from the ISP module. The current gain-to-brightness ratio can be calculated using the following formula 3:

[0074] curGainEvRatio=MAX(currGain, M)×N / curEv (Formula 3)

[0075] Wherein, curGainEvRatio is the current gain-to-brightness ratio; for the explanation of other symbols, please refer to Formula 1.

[0076] Then, based on the aforementioned gain-to-brightness ratio thresholds for enabling and disabling, the current gain-to-brightness ratio is compared with these thresholds, and the state of the fill light is switched based on the comparison result. Specifically, if the current gain-to-brightness ratio is greater than the threshold for enabling the gain-to-brightness ratio, the fill light is enabled; if the current gain-to-brightness ratio is less than the threshold for disabling the gain-to-brightness ratio after the fill light is enabled, the fill light is disabled.

[0077] For example, in step S140, comparing the magnitude relationship between the current gain-brightness ratio and the gain-brightness ratio threshold, and switching the state of the fill light based on the comparison result specifically includes the following steps S141 to S144.

[0078] Step S141: when the fill light is in an off state, determine whether the current gain-brightness ratio is greater than the turn-on gain-brightness ratio threshold, and if the current gain-brightness ratio is greater than the turn-on gain-brightness ratio threshold, perform step S142;

[0079] Step S142: turn on the fill light;

[0080] Step S143: after turning on the fill light, determine whether the current gain-brightness ratio is less than the turn-off gain-brightness ratio threshold, and if the current gain-brightness ratio is less than the turn-off gain-brightness ratio threshold, perform step S144;

[0081] Step S144: turn off the fill light.

[0082] In some embodiments, the fill light may be turned on after the current gain-brightness ratio is greater than the turn-on gain-brightness ratio threshold continuously for multiple frames or a continuous preset duration.

[0083] For example, if the current gain-brightness ratio is greater than the turn-on gain-brightness ratio threshold, update the cumulative number of continuous frames and / or the continuous duration; obtain a waiting frame number threshold and / or a waiting duration threshold, and if the updated cumulative number of continuous frames is greater than the waiting frame number threshold and / or the updated continuous duration is greater than the waiting duration threshold, turn on the fill light.

[0084] Wherein, the waiting frame number threshold and / or the waiting duration threshold may be preset based on experience, or may be calculated flexibly.

[0085] For example, obtaining the current frame rate of the camera device; calculating the waiting frame number threshold and / or the waiting duration threshold based on the current frame rate.

[0086] For example, preset CLIP(x,y,z) defines that the value of x is within the interval [y,z], that is, if x<y, then x=y; if x>z, then x=z; if y<x<z, then x=x.

[0087] Then, calculating the waiting frame number threshold according to the current frame rate may specifically refer to the following formula 4:

[0088] wlWaitFrame = CLIP((2×currFps), W_low,W_high) (Formula 4)

[0089] Where wlWaitFrame is the waiting frame threshold, currFps is the current frame rate, and W_low and W_high are the preset lower and upper limits for the waiting frame count, respectively.

[0090] And / or, calculate the waiting time threshold based on the current frame rate, as detailed in Formula 5 below:

[0091] DelayTime= CLIP((1000 / currFps), D_low, D_high) (Formula 5)

[0092] Where DelayTime is the waiting time threshold, currFps is the current frame rate, and D_low and D_high are the preset lower and upper limits of the waiting time, respectively.

[0093] W_low, W_high, D_low, and D_high can be adjusted according to the actual product.

[0094] State switching confirmation is achieved by using a waiting frame count threshold and / or a waiting duration threshold to avoid frequent switching of the fill light due to instantaneous fluctuations in environmental parameters. Furthermore, the waiting frame count threshold and / or waiting duration threshold are adaptively adjusted according to the frame rate to ensure appropriate control at different frame rates and improve compatibility across different devices.

[0095] In some implementations, after the fill light is turned on, in addition to determining whether to turn off the fill light based on the off gain-to-brightness ratio threshold, the ambient brightness threshold can also be used to determine whether to turn off the light.

[0096] For example, after turning on the fill light, the system enters the off threshold statistical period; based on the gain value and exposure time of the image frames collected within the off threshold statistical period, the ambient brightness of each image frame is calculated; the ambient brightness of each image frame is weighted and calculated to obtain the ambient brightness threshold.

[0097] If the fill light is detected to switch from off to on, the off threshold statistics period begins. The decision to end the off threshold statistics period can be based on the cumulative number of statistical frames and / or the cumulative duration of the statistics.

[0098] Within the statistical period of the closed threshold, the ambient brightness of each image frame is calculated based on the gain value and exposure time of the acquired image frame, and the weight of each image frame is determined. Then, the ambient brightness of each image frame is weighted and calculated to obtain the ambient brightness threshold.

[0099] The weight of the currently acquired image frame can be determined based on the number of image frames that have been accumulated within the statistical period of the closing threshold; or, the weight of the currently acquired image frame can be determined based on the timestamps of the image frames that have been accumulated within the statistical period of the closing threshold. This application does not limit the choice of which method to use.

[0100] For examples, please refer to Figure 2 , Figure 2 This is a flowchart illustrating the calculation of an ambient brightness threshold in an exemplary embodiment of this application, and the specific steps include the following steps S201 to S205.

[0101] Step S201: The supplementary light is detected to switch from off to on, and the off threshold statistics period begins.

[0102] Step S202: Continuously acquire image frames.

[0103] Step S203: Calculate the ambient brightness and weight corresponding to the kth image frame acquired cumulatively.

[0104] Step S204: Determine whether k is equal to the waiting frame threshold. If yes, proceed to step S205; otherwise, continue to step S202.

[0105] It should be noted that, in addition to determining whether the shutdown threshold statistical period has ended based on the waiting frame count threshold, the shutdown threshold statistical period can also be determined based on the waiting duration threshold. If the cumulative statistical duration corresponding to the shutdown threshold statistical period reaches the waiting duration threshold, the shutdown threshold statistical period ends. This application does not limit this.

[0106] Step S205: Perform weighted calculations on the ambient brightness corresponding to each image frame to obtain the ambient brightness threshold, and then close the threshold statistics cycle.

[0107] Specifically, the ambient brightness of the k-th image frame is calculated based on the gain value and exposure time corresponding to the k-th image frame.

[0108] For example, for an image frame with a resolution of 1024, the ambient brightness of the image frame is calculated using the following formula 6:

[0109] currEnvLum=db2Multiple(currGain)×(currSht)×1024 / curEv (Formula 6)

[0110] Where currEnvLum is the ambient brightness of the image frame, currGain is the gain value of the image frame, currSht is the exposure time of the image frame, curEv is the brightness value of the image frame, and the preset db2Multiple is the db to multiplier conversion function.

[0111] The specific steps for weighted calculation of the ambient brightness for each image frame to obtain the ambient brightness threshold may include:

[0112] The brightness thresholds are accumulated and summed using the following formula 7:

[0113] wlCloseLumThr=∑(k×currEnvLum / wlWaitFrame) (Formula 7)

[0114] Where wlCloseLumThr is the cumulative sum of brightness thresholds, k is the number of currently accumulated image frames, wlWaitFrame is the waiting frame threshold, and ∑ represents the summation of the calculation results for all image frames from k=1 to k=wlWaitFrame.

[0115] k / wlWaitFrame is the weighting factor, which increases linearly from 1 / wlWaitFrame to 1 as the number of frames k increases.

[0116] The waiting frame threshold can be preset based on experience or calculated according to Formula 4 above.

[0117] Then, the weighted sum is calculated using the following formula 8:

[0118] lumaWeight=∑(k / wlWaitFrame) (Formula 8)

[0119] Where, lumaWeight is the weighted sum, representing the sum of all weight factors used in Formula 7.

[0120] Finally, the ambient brightness threshold is calculated using the following formula 9:

[0121] curWlCloseThr=wlCloseLumThr / lumaWeight×γ (Formula 9)

[0122] Where, curWlCloseThr is the ambient brightness threshold, wlCloseLumThr is calculated by formula 7, lumaWeight is calculated by formula 8, and γ is an adjustment coefficient, the value of which can be flexibly set according to the actual situation.

[0123] The above embodiments improve the accuracy of the shutdown threshold calculation by setting a shutdown threshold statistical period and performing a weighted average of the ambient brightness of the image frames within the shutdown threshold statistical period.

[0124] Based on the above embodiments, after the fill light is turned on, the ambient brightness threshold is calculated. In response to the end of the threshold closing statistical period, the current ambient brightness is calculated based on the current gain value and current exposure time corresponding to the current image frame. If the current gain-to-brightness ratio is less than the turn-off gain-to-brightness ratio threshold and the current ambient brightness is less than the ambient brightness threshold, then the fill light is turned off.

[0125] In some implementations, even more parameters can be considered for determining when to turn off the lights.

[0126] For example, obtain the brightness statistics of the current image frame, the current image brightness, and the preset stable value corresponding to the automatic exposure module. Based on the brightness statistics, the current image brightness, the target brightness reference, and the preset stable value, calculate the statistical brightness threshold. If the current gain-to-brightness ratio is less than the off gain-to-brightness ratio threshold, the current ambient brightness is less than the ambient brightness threshold, and the brightness statistics are greater than the statistical brightness threshold, then update the number of continuously accumulated frames and / or the duration. Obtain the waiting frame threshold and / or the waiting duration threshold. If the updated number of continuously accumulated frames is greater than the waiting frame threshold and / or the updated duration is greater than the waiting duration threshold, then turn off the fill light.

[0127] Specifically, the statistical brightness threshold can be calculated using the following formulas 10 to 12:

[0128] evRatio=h3aEv / curEv (Formula 10)

[0129] b2cEvThr=evTarget×MIN(evRatio,1.0)(Formula 11)

[0130] evWlCloseThr=MAX((b2cEvThr-fixAE),0)(Formula 12)

[0131] Wherein, evWlCloseThr is the statistical brightness threshold; h3aEv is the brightness statistical value, which is obtained by dividing the current image frame into blocks, statistically obtaining the brightness information of each image block, and then averaging the results to obtain a brightness value. On some platforms, h3aEv may be equal to curEv; curEv is the current image brightness; evTarget is the target brightness reference; fixAE is the preset stable value of the automatic exposure module AE, which can be adjusted according to the actual product.

[0132] The conditions that must be met to turn off the fill light include:

[0133] Condition 1: The current gain-to-brightness ratio is less than the threshold for turning off the gain-to-brightness ratio.

[0134] curGainEvRatio<(gainEvRatioThr2WLOff×gainEvRatioThr2WLOffRatio)

[0135] Where, curGainEvRatio is the current gain-to-brightness ratio, gainEvRatioThr2WLOff is the threshold for turning off the gain-to-brightness ratio, and gainEvRatioThr2WLOffRatio is the adjustment coefficient for the threshold corresponding to the sensitivity parameter.

[0136] Condition 2: The current ambient brightness is less than the ambient brightness threshold.

[0137] currEnvLum <curWlCloseThr×curWlCloseThrRatio

[0138] Where currEnvLum is the current ambient brightness, curWlCloseThr is the ambient brightness threshold, and curWlCloseThrRatio is the ambient brightness threshold adjustment coefficient corresponding to the sensitivity parameter.

[0139] Condition 3: The brightness statistics value is greater than the statistical brightness threshold.

[0140] h3aEv>evWlCloseThr

[0141] Where h3aEv is the brightness statistics value, specifically obtained by dividing the current image frame into blocks, statistically analyzing the brightness information of each image block, and then averaging the results to obtain a brightness value. evWlCloseThr is the statistical brightness threshold.

[0142] Condition 4: The threshold statistics period ends.

[0143] Condition 5: If conditions 1 to 4 are met, then update the number of continuously accumulated frames and / or the duration of the accumulated frames. The updated number of continuously accumulated frames is greater than the waiting frame threshold, and / or the updated duration of the accumulated frames is greater than the waiting duration threshold.

[0144] If conditions 1 to 5 are met, then turn off the fill light.

[0145] For a detailed explanation using a specific application scenario as an example, please refer to [link / reference]. Figure 3 , Figure 3 This is a flowchart illustrating a specific application scenario for supplementary lighting control, as shown in an exemplary embodiment of this application. Figure 3 As shown, it includes:

[0146] Step S301: Obtain the current image frame being acquired and calculate the current gain-to-brightness ratio corresponding to the current image frame.

[0147] Step S302: Is the fill light turned on? If yes, proceed to step S303; otherwise, proceed to step S304.

[0148] Step S303: Calculate the ambient brightness threshold.

[0149] For detailed calculation steps, please refer to steps S201 to S205.

[0150] Step S304: Is the current gain-to-brightness ratio greater than the enabled gain-to-brightness ratio threshold? If yes, proceed to steps S305 to S307; otherwise, proceed to step S308.

[0151] Step S305: Update the number of active continuous cumulative frames and clear the number of deactivated continuous cumulative frames to zero.

[0152] Step S306: Is the number of continuously accumulated frames greater than or equal to the waiting frame threshold? If yes, proceed to step S307; otherwise, continue to step S301.

[0153] Step S307: Turn on the fill light.

[0154] Step S308: Is the current ambient brightness less than the ambient brightness threshold, is the brightness statistics value greater than the statistical brightness threshold, and has the threshold statistics period ended? If yes, proceed to steps S309 to S311; otherwise, proceed to step S312.

[0155] Step S309: Update the number of continuous cumulative frames that are turned off, and clear the number of continuous cumulative frames that are turned on to zero.

[0156] Step S310: Is the number of continuously accumulated frames that have been closed greater than or equal to the waiting frame threshold? If yes, proceed to step S311; otherwise, continue to step S301.

[0157] Step S311: Turn off the fill light.

[0158] Step S312: Reset both the number of active and passive cumulative frames to zero.

[0159] In some implementations, after the fill light is turned on, the method further includes: calculating an ambient difference based on an on-state gain-to-brightness ratio threshold and the current gain-to-brightness ratio after the fill light is turned on; determining a PWM adjustment step size based on the ambient difference; and performing PWM adjustment on the fill light based on the PWM adjustment step size.

[0160] Pulse Width Modulation (PWM) controls electrical signals by changing the period and duty cycle of a pulse train.

[0161] PWM adjustment step size refers to the minimum change or increment unit when adjusting the duty cycle of the PWM signal.

[0162] Specifically, the ambient difference is calculated based on the enabled gain-to-brightness ratio threshold gainEvRatioThr2WLOn and the current gain-to-brightness ratio curGainEvRatio. See Formula 13 below for details:

[0163] evDiff=curGainEvRatio-(gainEvRatioThr2WLOn+cv)(Formula 13)

[0164] Where evDiff is the environmental difference and cv is the preset deviation value, cv can be adjusted according to the actual product.

[0165] The PWM adjustment step size is determined based on the environmental difference.

[0166] For example, based on the relationship between the environmental difference evDiff and different thresholds, different PWM adjustment step sizes can be mapped. The specific values ​​of the PWM adjustment step sizes corresponding to different thresholds can be adjusted according to the actual situation. Furthermore, if curGainEvRatio is greater than gainEvRatioThr2WLOn+cv, positive adjustment is performed; otherwise, negative adjustment is performed.

[0167] In the above embodiments, the PWM adjustment step size is dynamically calculated based on the brightness difference to prevent screen flicker, and different adjustment strategies are adopted according to the duty cycle range.

[0168] Figure 4 This is a block diagram illustrating a fill light control device for a camera apparatus, as shown in an exemplary embodiment of this application. Figure 4 As shown, the exemplary camera device's fill light control device 400 includes:

[0169] The threshold calculation module 410 is used to obtain the preset state switching gain threshold and the preset target brightness reference corresponding to the fill light, and calculate the gain-to-brightness ratio threshold corresponding to the fill light based on the state switching gain threshold and the target brightness reference.

[0170] The parameter acquisition module 420 is used to acquire the gain value used by the camera device to capture the current image frame to obtain the current gain value, and to acquire the brightness value of the current image frame to obtain the current image brightness.

[0171] The ratio calculation module 430 is used to calculate the ratio between the current gain value and the current image brightness to obtain the current gain-brightness ratio;

[0172] The switching judgment module 440 is used to compare the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switch the state of the fill light based on the comparison result.

[0173] It should be noted that the fill light control device for the camera equipment provided in the above embodiments and the fill light control method for the camera equipment provided in the above embodiments belong to the same concept. The specific operation methods of each module and unit have been described in detail in the method embodiments and will not be repeated here. In practical applications, the fill light control device for the camera equipment provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation.

[0174] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating the structure of an electronic device in an exemplary embodiment of this application. The electronic device 500 includes a memory 501 and a processor 502. The processor 502 executes program instructions stored in the memory 501 to implement the steps in any of the above-described embodiments of the fill light control method for a camera device. In a specific implementation scenario, the electronic device 500 may include, but is not limited to, a microcomputer or a server. Furthermore, the electronic device 500 may also include mobile devices such as laptops and tablets, without limitation.

[0175] Specifically, processor 502 controls itself and memory 501 to implement the steps in the above-described embodiments of the fill light control method for any of the camera devices. Processor 502 can also be referred to as a Central Processing Unit (CPU). Processor 502 may be an integrated circuit chip with signal processing capabilities. Processor 502 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 502 can be implemented using integrated circuit chips.

[0176] Please see Figure 6 , Figure 6This is a schematic diagram illustrating the structure of a computer-readable storage medium in an exemplary embodiment of this application. The computer-readable storage medium 600 stores program instructions 610 that can be executed by a processor. The program instructions 610 are used to implement the steps in the above-described embodiments of the fill light control method for any of the camera devices.

[0177] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0178] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0179] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0180] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for controlling the fill light of a camera device, characterized in that, The method includes: Obtain a preset state switching gain threshold and a preset target brightness reference corresponding to the fill light. Based on the state switching gain threshold and the target brightness reference, calculate the gain-to-brightness ratio threshold corresponding to the fill light. The gain-to-brightness ratio threshold includes a turn-off gain-to-brightness ratio threshold. The current gain value is obtained by acquiring the gain value used by the camera device to capture the current image frame, and the current image brightness is obtained by acquiring the brightness value of the current image frame. Calculate the ratio between the current gain value and the current image brightness to obtain the current gain-to-brightness ratio; Compare the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switch the state of the fill light based on the comparison result; After the fill light is turned on, the off threshold statistical period is entered. Based on the gain value and exposure time of the image frames collected within the off threshold statistical period, the ambient brightness of each image frame is calculated. The ambient brightness of each image frame is weighted and calculated to obtain the ambient brightness threshold. In response to the end of the closing threshold statistical period, the current ambient brightness is calculated based on the current gain value and current exposure time corresponding to the current image frame. The brightness statistics value h3aEv and the current image brightness curEv of the current image frame are obtained, and the preset stable value fixAE corresponding to the automatic exposure module is obtained. The statistical brightness threshold evWlCloseThr = MAX((b2cEvThr-fixAE) ,0) is calculated, where b2cEvThr = evTarget × MIN(evRatio ,1.0), evRatio = h3aEv / curEv, evTarget is the target brightness reference, curEv is the average brightness of the entire image of the current image frame calculated by the automatic exposure module, and h3aEv is the brightness value obtained by averaging the brightness information of each image block after dividing the current image frame into blocks. If the current gain-to-brightness ratio is less than the off gain-to-brightness ratio threshold, the current ambient brightness is less than the ambient brightness threshold, and the brightness statistics value is greater than the statistical brightness threshold, then the fill light is turned off.

2. The method according to claim 1, characterized in that, The state of the supplementary light includes on and off, and the state switching gain threshold includes an on gain threshold and an off gain threshold; the calculation of the gain-to-brightness ratio threshold corresponding to the supplementary light based on the state switching gain threshold and the target brightness reference includes: Based on the on-gap gain threshold and the target brightness reference, calculate the on-gap gain-to-brightness ratio threshold corresponding to the fill light; Based on the off gain threshold and the target brightness reference, calculate the off gain-to-brightness ratio threshold corresponding to the fill light; The step of comparing the current gain-to-brightness ratio with the gain-to-brightness ratio threshold, and switching the state of the fill light based on the comparison result, includes: If the current gain-to-brightness ratio is greater than the activation gain-to-brightness ratio threshold, then the fill light is activated.

3. The method according to claim 2, characterized in that, The step of turning off the fill light if the current gain-to-brightness ratio is less than the off gain-to-brightness ratio threshold, the current ambient brightness is less than the ambient brightness threshold, and the brightness statistics value is greater than the statistical brightness threshold includes: If the current gain-to-brightness ratio is less than the off gain-to-brightness ratio threshold, the current ambient brightness is less than the ambient brightness threshold, and the brightness statistics value is greater than the statistical brightness threshold, then update the continuous accumulated frame count and / or duration. Obtain the waiting frame count threshold and / or waiting duration threshold. If the updated cumulative frame count is greater than the waiting frame count threshold and / or the updated duration is greater than the waiting duration threshold, then turn off the fill light.

4. The method according to claim 2, characterized in that, The method further includes: Obtain the preset sensitivity parameters; The off gain-to-brightness ratio threshold and the on gain-to-brightness ratio threshold are adjusted based on the sensitivity parameters.

5. The method according to claim 2, characterized in that, The step of turning on the fill light if the current gain-to-brightness ratio is greater than the turn-on gain-to-brightness ratio threshold includes: If the current gain-to-brightness ratio is greater than the enabled gain-to-brightness ratio threshold, then update the continuous accumulated frame count and / or duration; Obtain the waiting frame count threshold and / or waiting duration threshold. If the updated cumulative frame count is greater than the waiting frame count threshold and / or the updated duration is greater than the waiting duration threshold, then turn on the fill light.

6. The method according to claim 5, characterized in that, The acquisition of the waiting frame count threshold and / or waiting duration threshold includes: Obtain the current frame rate of the camera device; Based on the current frame rate, calculate the waiting frame threshold and / or waiting duration threshold.

7. The method according to claim 2, characterized in that, After the fill light is turned on, the method further includes: The ambient difference is calculated based on the aforementioned gain-to-brightness ratio threshold and the current gain-to-brightness ratio after the fill light is turned on. The PWM adjustment step size is determined based on the environmental difference. The fill light is PWM adjusted based on the PWM adjustment step size.

8. A camera device, characterized in that, The camera device includes a memory and a processor, the processor being configured to execute program instructions stored in the memory to implement the steps of the method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that can be executed by a processor to implement the steps of the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Light supplement lamp control method and device, camera equipment and storage medium

    CN110418067A