A method, device and equipment for controlling a fill light switch of a camera device
By adopting different logic judgment methods and environmental stability judgment in the camera, the frequent switching of fill lights in high-reflection scenarios is solved, which improves imaging quality and extends service life.
Patent Information
- Application Number
- CN202211433632.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-11-16
AI Technical Summary
The fill lights of existing cameras frequently switch in high-reflection scenarios due to light reflection, which affects the imaging quality and shortens the service life.
Different logic judgment methods are used to control the switch of the fill light. By obtaining the gain and brightness values of the camera device, different thresholds and cumulative thresholds are set to judge the environmental stability, and avoid frequent switching.
It effectively avoids frequent switching of fill lights due to environmental instability, improves imaging quality and extends the service life of fill lights.
Smart Images

Figure CN115835027B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of video surveillance, and particularly to a method, device and equipment for controlling the switch of a fill light of a camera device. Background Art
[0002] Currently, the security industry has higher and higher requirements for the color low-light effect of cameras at night, and cameras with fill lights have emerged. Such cameras can effectively supplement the ambient brightness in low-light scenarios and ensure the imaging quality of color images at night.
[0003] However, when such cameras with visible light fill lights face some highly reflective scenarios, the light intensity of the visible light fill lights is largely reflected back to the cameras by the reflective objects. After the photoresistors on the cameras sense the light intensity, the voltage signal rises, and it is determined that the current scenario is a daytime scenario. The camera responds by turning off the visible light fill light. After turning off the visible light fill light, the photoresistors on the cameras sense that the ambient brightness is very dark, and the voltage signal drops. It is determined that the current scenario is a nighttime scenario, and the camera responds by turning on the visible light fill light. Repeating like this causes the fill lights on the cameras to be in a state of cyclic switching all the time, affecting the imaging quality of the images of the cameras and the service life of the fill lights of the cameras.
[0004] Therefore, how to solve the control problem of the fill light switch, so that the fill light switch does not cycle in some scenarios, is a technical problem that needs to be solved. Summary of the Invention
[0005] This proposal provides a method, device and equipment for controlling the switch of a fill light of a camera device, which can solve the technical problem that the fill light of the camera repeatedly switches in some scenarios.
[0006] In a first aspect, the present invention provides a method for controlling the switch of a fill light of a camera device, including:
[0007] A method for controlling the switch of a fill light of a camera device, including:
[0008] Obtain the upper gain limit value and the lower gain limit value set for the camera device. If the difference between the lower gain limit value and the upper gain limit value is greater than a preset first threshold, use a first control method to control the switch of the fill light; otherwise, use a second control method to control the switch of the fill light;
[0009] Wherein, the first control method is to determine whether to turn on the fill light according to the current gain value, and determine whether to turn off the fill light according to the current ambient brightness value; the second control method is to determine whether to turn on the fill light according to the current brightness value, and determine whether to turn off the fill light according to the current ambient brightness value.
[0010] In an embodiment of the present invention, the opening logic judgment process of the fill light and the closing logic judgment process of the fill light adopt different logical judgment methods for determination. Therefore, the opening logic judgment process and the closing logic judgment process of the fill light are a non-equivalent process, which are different judgment processes. This can avoid the problem of frequent cyclic switching of the fill light caused by occasional environmental instability. Therefore, the technical solution of the embodiment of the present application can effectively avoid the problem of frequent cyclic switching of the fill light caused by misjudgment problems due to some external environmental changes and other condition oscillations during the actual use of the camera. Relatively, it improves the imaging quality of the image of the camera and prolongs the service life of the fill light of the camera.
[0011] Moreover, the technical solution of the present application can adopt different judgment conditions for different settings of the same device, with strong applicability and good judgment effect. If the user adjusts the settings of the gain upper limit value and the gain lower limit value, it will automatically adopt different schemes to judge the opening and closing of the fill light according to different settings, which has strong applicability.
[0012] Optionally, in some embodiments, the second control method specifically includes:
[0013] Periodically obtain the current brightness value of the imaging device;
[0014] If the fill light of the imaging device is already on, when it is determined that the current brightness value of the imaging device is greater than a preset second threshold, determine whether to turn off the fill light according to the current ambient brightness value; if the fill light of the device is already off, when it is determined that the current brightness value of the imaging device is less than a preset fourth threshold, turn on the fill light;
[0015] Wherein, the second threshold is different from the fourth threshold.
[0016] The technical solution of the embodiment of the present invention sets the thresholds of the switch judgment conditions to be different from each other, which can avoid repeatedly entering the process of whether the fill light is on or off due to environmental jitter problems at the same judgment threshold. Therefore, it further solves the problem that the switch of the fill light will not be in a cyclic switching state in some scenarios.
[0017] Optionally, in some embodiments, before periodically obtaining the current brightness value of the imaging device, it further includes:
[0018] Calculate the brightness difference between two adjacent image frames of the imaging device. When the brightness difference is less than a preset seventh threshold, increment by 1 the first parameter representing the adjustable state of the light;
[0019] Determine that the cumulative value of the first parameter is greater than the first cumulative threshold.
[0020] Before adjusting the fill light, it is necessary to determine whether the exposure is in a relatively stable state in the technical solution of this application. The technical solution of this application is carried out by continuously judging and accumulating. Therefore, before entering the calculation, it is necessary to judge whether the imaging device is in a stable exposure state, which solves the problem that when the imaging device is in an unstable exposure state, the asynchronous operation of fill light and exposure may easily cause logical confusion. In the technical solution of this application, after determining that the exposure is in a relatively stable state, the switching logic of the fill light is judged, which makes the switching logic judgment of the fill light more accurate and further solves the problem that the fill light is in a cyclic switching state in some scenarios.
[0021] In this solution, when it is determined that the conditions for turning on the fill light are met, the current environment is judged to be stable by continuously accumulating thresholds. After determining that the environment is stable, the operation of turning on the fill light is then executed, avoiding the frequent turning on of the fill light of the imaging device caused by the external unstable environment, that is, it can effectively prevent the fill light from being in a cyclic switching state, and thus solve the technical problem to be solved in this application.
[0022] Optionally, in some embodiments, it further includes:
[0023] After determining that the current brightness value of the imaging device is less than a preset fourth threshold and before turning on the fill light, it further includes:
[0024] Increment the third parameter representing the turn-on state of the fill light by 1, and set the parameters representing other states of the fill light to 0;
[0025] Determine that the cumulative value of the third parameter is greater than the third cumulative threshold.
[0026] In the technical solution of the embodiment of the present invention, when it is determined that the conditions for turning on the fill light are met, that is, when the current brightness currEV of the imaging device is less than the preset fourth threshold μ1, the current environment is judged to be stable by continuously accumulating thresholds. After determining that the environment is stable, the operation of turning on the fill light is then executed, avoiding the frequent turning on of the fill light of the imaging device caused by the external unstable environment, that is, it can effectively prevent the fill light from being in a cyclic switching state, and thus solve the technical problem to be solved in this application.
[0027] For example, when a mobile phone takes a picture of the current imaging device at night, it often triggers the flash of the mobile phone. At this time, the image sensor of the imaging device will obtain the external ambient brightness. If the current imaging device is easily determined to have sufficient external ambient brightness without cyclic determination, the operation of turning off the fill light will be initiated. However, the flash of the mobile phone is temporary and does not equal the current ambient brightness. When the flash goes out, the fill light will be turned on again due to insufficient external ambient brightness, resulting in the fill light being repeatedly turned on and off. The technical solution of this application determines whether the current environment is stable through continuous cumulative thresholds, avoiding the problem of frequent turning off of the fill light of the imaging device caused by an unstable external environment, and effectively preventing the fill light from being in a cyclic on-off state all the time.
[0028] Optionally, in some embodiments, the second threshold is greater than the fourth threshold.
[0029] Optionally, in some embodiments, the first control method specifically includes:
[0030] Periodically obtain the gain value of the imaging device;
[0031] If the fill light of the imaging device is already on, when it is determined that the gain value is greater than a preset fifth threshold, determine whether to turn off the fill light according to the current ambient brightness; if the fill light of the device is already off, when it is determined that the gain value is greater than a preset sixth threshold, turn on the fill light;
[0032] Wherein, the fifth threshold is different from the sixth threshold.
[0033] The technical solution of the embodiment of the present invention can more accurately determine the brightness state of the external environment by judging which gain interval the current gain is in, and the fifth threshold is different from the sixth threshold, making the conditions for determining whether to turn on the fill light not equivalent to the conditions for determining whether to turn off the fill light, and further avoiding the problem of frequent on-off of the fill light caused by unstable external environment.
[0034] For example, when a mobile phone takes a picture of the current imaging device at night, it often triggers the flash of the mobile phone. At this time, the image sensor of the imaging device will obtain the external ambient brightness. If the current imaging device is easily determined to have sufficient external ambient brightness without cyclic determination, the operation of turning off the fill light will be initiated. However, the flash of the mobile phone is temporary and does not equal the current ambient brightness. When the flash goes out, the fill light will be turned on again due to insufficient external ambient brightness, resulting in the fill light being repeatedly turned on and off. The technical solution of this application determines whether the current environment is stable through continuous cumulative thresholds, avoiding the problem of frequent turning off of the fill light of the imaging device caused by an unstable external environment, and effectively preventing the fill light from being in a cyclic on-off state all the time.
[0035] Optionally, in some embodiments, after determining that the gain value is greater than a preset sixth threshold and before turning on the fill light, the method further includes:
[0036] Incrementing by 1 a third parameter representing the turn-on state of the fill light and setting parameters representing other states of the fill light to 0;
[0037] Determining that the cumulative value of the third parameter is greater than a third cumulative threshold.
[0038] In this solution, when it is determined that the condition for turning on the fill light is met, it is determined whether the current environment is stable through continuous cumulative thresholds. After determining that the environment is stable, the operation of turning on the fill light is then executed, avoiding frequent turning on of the fill light of the imaging device due to an unstable external environment, that is, effectively preventing the fill light from being in a state of cyclic switching, thereby solving the technical problem to be solved in this application.
[0039] For example, when a mobile phone takes a picture of the current imaging device at night, the flash of the mobile phone is often triggered. At this time, the image sensor of the imaging device will obtain the external ambient brightness. If the cyclic determination is not performed, the current imaging device is likely to be determined that the external ambient brightness is sufficient, and the operation of turning off the fill light will be started. However, the flash of the mobile phone is temporary and does not equal the current ambient brightness. When the flash goes out, the fill light will be turned on again due to insufficient external ambient brightness, so the fill light will be turned on and off repeatedly. The technical solution of this application determines whether the current environment is stable through continuous cumulative thresholds, avoiding the problem of frequent turning off of the fill light of the imaging device due to an unstable external environment, and effectively preventing the fill light from being in a state of cyclic switching all the time.
[0040] Optionally, in some embodiments, the fifth threshold is greater than the sixth threshold.
[0041] Optionally, in some embodiments, the determining whether to turn off the fill light according to the ambient brightness specifically includes:
[0042] Determining that the imaging device enters a ready state and calculating the current ambient brightness value;
[0043] Determining that the current ambient brightness value is less than a preset third threshold and turning off the fill light.
[0044] In the technical solution of the embodiments of the present invention, the judgment logics for turning off the fill light and turning on the fill light are not the same. After determining that the imaging device enters the ready state, the current ambient brightness value is calculated, and the obtained result is accurate, reducing the probability of misjudgment. Furthermore, after the fill light is turned off, it is prevented from being turned on again due to environmental jitter, reducing the occurrence of the problem of possible cyclic switching of the fill light.
[0045] Optionally, in some embodiments, after determining that the current ambient brightness value is less than a preset third threshold and before turning off the fill light, the method further includes:
[0046] Increment the second parameter representing the closable state of the fill light by 1, and set the parameters representing other states of the fill light to 0;
[0047] Determine that the cumulative value of the second parameter is greater than the second cumulative threshold.
[0048] This solution can effectively prevent the fill light from being in a cyclic on-off state by controlling the cyclic on-off of the fill light caused by unstable environment, thereby solving the technical problem to be solved in this application.
[0049] For example, when a mobile phone takes a picture of the current imaging device at night, the flash of the mobile phone is often triggered. At this time, the image sensor of the imaging device will obtain the external ambient brightness. If the cyclic determination is not performed, the current imaging device is likely to be determined that the external ambient brightness is sufficient, and the operation of turning off the fill light will be started. However, the flash of the mobile phone is temporary and does not equal the current external ambient brightness. When the flash goes out, the fill light will be turned on again due to insufficient external ambient brightness, so the fill light will be turned on and off repeatedly. The technical solution of this application determines whether the current environment is stable through continuous cumulative threshold, avoiding the problem of frequent turning off of the fill light of the imaging device caused by unstable external environment, and effectively preventing the fill light from always being in a cyclic on-off state.
[0050] Optionally, in some embodiments, the calculating the current ambient brightness value specifically includes:
[0051] Obtain the current gain value, current exposure and current brightness value of the imaging device;
[0052] Use the result obtained by dividing the product of the gain value and the exposure by the brightness value as the current ambient brightness value.
[0053] Optionally, in some embodiments, the determining that the imaging device enters the ready state specifically includes:
[0054] Obtain the current brightness value, and obtain the preset brightness value and preset tolerance value of the imaging device;
[0055] When it is determined that the current brightness value is within the interval of the preset brightness value and the tolerance value of the imaging device, determine that the imaging device enters the ready state;
[0056] Wherein, the preset brightness value is determined according to the image parameters collected by the imaging device.
[0057] The ambient brightness is a defined value calculated based on the gain value, the current exposure, and the current brightness value, and is applicable to various brightness scenarios.
[0058] In a second aspect, an embodiment of the present invention further provides a fill light switch control device for a camera device, including:
[0059] An acquisition module, configured to acquire the upper gain limit value and the lower gain limit value set for the camera device;
[0060] A judgment module, configured to judge the difference between the lower gain limit value and the upper gain limit value. If the difference is greater than a preset first threshold, a first control method is used to control the switch of the fill light; otherwise, a second control method is used to control the switch of the fill light;
[0061] Wherein, the first control method is to determine whether the fill light is turned on according to the current gain value, and determine whether the fill light is turned off according to the current ambient brightness value; the second control method is to determine whether the fill light is turned on according to the current brightness value, and determine whether the fill light is turned off according to the current ambient brightness value.
[0062] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes: a processor and a memory;
[0063] The processor is configured to call a program stored in the memory, and when the program is executed, the processor executes the method according to any one of the above first aspects.
[0064] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, storing a computer program, and the computer program includes a method for executing any one of the above first aspects.
[0065] The beneficial effects of the technical solution implemented by the present invention are as follows: In the embodiment of the present invention, different logical determination methods are used for the opening logic judgment process and the closing logic judgment process of the fill light. Therefore, the opening logic determination process and the closing logic determination process of the fill light are non-equivalent processes and are different determination processes, which can avoid the problem of frequent cyclic switching of the fill light caused by occasional environmental instability. Therefore, the technical solution of the embodiment of the present invention can effectively avoid the problem of frequent cyclic switching of the fill light caused by misjudgment problems caused by some external environmental changes and other condition oscillations during the actual use of the camera, and relatively improve the imaging quality of the image of the camera and extend the service life of the fill light of the camera.
[0066] Moreover, the technical solution of the present application can adopt different determination conditions for different settings of the same device, with strong applicability and good determination effect. If the user adjusts the settings of the gain upper limit value and the gain lower limit value, different schemes will be automatically adopted according to different settings to determine the turning on and off of the fill light, which has strong applicability.
[0067] For the beneficial effects of the second aspect to the fourth aspect, refer to the beneficial effects of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0069] Figure 1 It is a schematic flowchart of a method for controlling the switch of a fill light of a camera device provided by an embodiment of the present invention;
[0070] Figure 2 It is a schematic flowchart of a method for a fill light of a camera device to execute a second control method provided by an embodiment of the present invention;
[0071] Figure 3 It is a schematic flowchart of another method for a fill light of a camera device to execute a second control method provided by an embodiment of the present invention;
[0072] Figure 4 It is a schematic flowchart of another method for a fill light of a camera device to execute a second control method provided by an embodiment of the present invention;
[0073] Figure 5 It is a schematic flowchart of a method for a fill light of a camera device to execute a first control method provided by an embodiment of the present invention;
[0074] Figure 6 It is a schematic flowchart of another method for a fill light of a camera device to execute a first control method provided by an embodiment of the present invention;
[0075] Figure 7 It is a schematic flowchart of a method for determining whether a fill light of a camera device is turned off provided by an embodiment of the present invention;
[0076] Figure 8 It is a schematic flowchart of another method for determining whether a fill light of a camera device is turned off provided by an embodiment of the present invention;
[0077] Figure 9 It is a schematic block diagram of a device for controlling the switch of a fill light of a camera device provided by an embodiment of the present invention. Detailed implementation manners
[0078] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0079] It should be understood that in the description of the embodiments of the present invention, terms such as "first" and "second" are only used for the purpose of distinction and description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0080] A method for controlling the switch of a fill light of a camera device includes:
[0081] Obtain the upper gain limit value and the lower gain limit value set by the camera device. If the difference between the lower gain limit value and the upper gain limit value is greater than a preset first threshold, use the first control method to control the switch of the fill light; otherwise, use the second control method to control the switch of the fill light.
[0082] Among them, the first control method is to determine whether the fill light is turned on according to the current gain value, and determine whether the fill light is turned off according to the current ambient brightness value; the second control method is to determine whether the fill light is turned on according to the current brightness value, and determine whether the fill light is turned off according to the current ambient brightness value.
[0083] The following is illustrated by specific embodiments, as shown in Figure 1 shown.
[0084] S101: Obtain the upper gain limit value and the lower gain limit value set by the camera device, and calculate the difference between the upper gain limit value and the lower gain limit value.
[0085] There is a default set value for the upper gain limit value and the lower gain limit value at the time of factory shipment, but the user can also set the upper gain limit value and the lower gain limit value by himself. Therefore, for different camera devices, even for the same model and the same batch of camera devices, the upper gain limit value and the lower gain limit value may vary according to different users, and may also vary according to the settings of the user at different time periods.
[0086] Therefore, it is necessary to obtain the upper gain limit value and the lower gain limit value set by the current camera device, and obtain the difference between the upper gain limit value and the lower gain limit value.
[0087] S102: Determine whether the difference is greater than a preset first threshold?
[0088] If so, execute step S103; if not, execute step S104.
[0089] The first threshold α can be freely set according to needs during actual use. The embodiments of the present invention provide a value, but not limited to this, and the seventh threshold α can be 18 dB.
[0090] The first control method is to determine whether the fill light needs to be turned on according to the gain value gain, and determine whether the fill light needs to be turned off according to the current ambient brightness value. The second control method is to determine whether the fill light needs to be turned on according to the current brightness value ev, and determine whether the fill light needs to be turned off according to the current ambient brightness value.
[0091] If the user does not change the factory default value, preferably, the gain is used to determine whether the fill light needs to be turned on. The process of determining whether the fill light is turned on through the gain has fewer steps and the determined result is more accurate. If the user adjusts the settings of the gain upper limit value and the gain lower limit value, when it is lower than the preset first threshold α, it is no longer accurate to determine whether the fill light needs to be turned on and off according to the gain gain. Preferably, it is determined whether the fill light needs to be turned on and off according to the ambient brightness ev.
[0092] S103: Execute the first control method.
[0093] The first control method is to determine whether the fill light is turned on according to the current gain value gain, and determine whether the fill light is turned off according to the current ambient brightness value.
[0094] S104: Execute the second control method.
[0095] The second control method is to determine whether the fill light is turned on according to the current brightness value ev, and determine whether the fill light is turned off according to the current ambient brightness value.
[0096] In the embodiments of the present invention, the opening logic judgment process of the fill light and the closing logic judgment process of the fill light adopt different logic judgment methods to judge. Therefore, the opening logic judgment process and the closing logic judgment process of the fill light are a non-equivalent process, which are different judgment processes, and can avoid the problem of frequent cyclic switching of the fill light caused by occasional environmental instability. Therefore, the technical solution of the embodiments of the present application can effectively avoid the problem of frequent cyclic switching of the fill light caused by misjudgment problems caused by some external environmental changes and other condition oscillations during the actual use of the camera, and relatively improve the imaging quality of the image of the camera and extend the service life of the fill light of the camera.
[0097] Moreover, the technical solution of the present application can adopt different judgment conditions for different settings of the same device, has strong applicability and good judgment effect. If the user adjusts the settings of the gain upper limit value and the gain lower limit value, it will automatically adopt different schemes to judge the opening and closing of the fill light according to different settings, and has strong applicability.
[0098] Optionally, as one of the embodiments, the second control method specifically includes:
[0099] Periodically obtain the current brightness value of the imaging device;
[0100] If the fill light of the imaging device is on, when it is determined that the current brightness value of the imaging device is greater than a preset second threshold, determine whether to turn off the fill light according to the current ambient brightness value; if the fill light of the device is off, when it is determined that the current brightness value of the imaging device is less than a preset fourth threshold, turn on the fill light;
[0101] Wherein, the second threshold is different from the fourth threshold.
[0102] Optionally, as one of the embodiments, the second threshold is greater than the fourth threshold.
[0103] The following is illustrated by specific embodiments, as shown in the appendix Figure 2 as follows.
[0104] S201: Periodically obtain the current brightness value of the imaging device.
[0105] The current brightness value can be obtained through the image sensor of the imaging device.
[0106] S202: Determine whether the fill light of the imaging device is on?
[0107] If yes, execute step S203; if no, execute step S,
[0108] If the fill light of the imaging device is on, it is necessary to execute the determination process of whether to turn off the fill light and execute step S203; if the fill light of the imaging device is off, it is necessary to execute the determination process of whether to turn on the fill light and execute step S204.
[0109] S203: Determine that the ambient brightness value is greater than a preset second threshold.
[0110] If the current ambient brightness is greater than the preset second threshold μ2, it indicates that the current external environment is in a relatively bright state, and the obtained image can have a better quality, and there is no need for the fill light to be on to supplement the brightness. Therefore, the next step can be continued.
[0111] The main function of the second threshold μ2 here is to determine which brightness interval the current brightness is in, and it can be freely set according to needs in actual use.
[0112] Optionally, if the image bit width is 8 bits as an example, the brightness upper limit is 255, then the second threshold μ2 value can be but not limited to 200.
[0113] S204: Evaluate whether the fill light needs to be turned off according to the ambient brightness.
[0114] Execute the process of determining whether the fill light needs to be turned off.
[0115] S205: Determine that the current brightness value of the imaging device is less than a preset fourth threshold.
[0116] Among them, the second threshold is different from the fourth threshold.
[0117] The function of the fourth threshold μ1 is to determine which brightness interval the current brightness is in, and it can be freely set according to needs in actual use.
[0118] Taking the image bit width of 8 bits as an example, the brightness upper limit is 255, then the value of the fourth threshold μ1 can be but not limited to 50.
[0119] S206: Turn on the fill light.
[0120] Turn on the fill light.
[0121] Optionally, as one of the embodiments, the second threshold μ2 is greater than the fourth threshold μ1. For example, in the embodiment of the present application, the value of the fourth threshold μ1 can be 50, but not limited to 50, and the second threshold μ2 can be 200, but not limited to 200.
[0122] In the technical solution of the embodiment of the present invention, setting the thresholds of the determination conditions of the switch to be different from each other can avoid repeatedly entering the process of whether the fill light is turned on or off due to the jitter problem of the environment at the same judgment threshold. Therefore, it further solves the problem that the switch of the fill light does not cycle in some scenarios.
[0123] Optionally, as one of the embodiments, before periodically obtaining the current brightness value of the imaging device, it further includes:
[0124] Calculate the brightness difference between two adjacent image frames of the imaging device. When the brightness difference is less than a preset seventh threshold, increment the first parameter representing the light adjustable state by 1;
[0125] Determine that the cumulative value of the first parameter is greater than the first cumulative threshold.
[0126] The following is illustrated by specific embodiments, as shown in Figure 3 shown.
[0127] S301: Set the first parameter representing the light adjustable state to 0.
[0128] Before calculating the brightness difference between two adjacent image frames of the imaging device, set the first parameter to 0.
[0129] When the imaging device is in an unstable exposure state, it is easy for the supplementary light and the exposure to proceed asynchronously. In such a case, there may be a problem of logical confusion. Before adjusting the supplementary light, it is necessary to determine whether the exposure is in a relatively stable state. The technical solution of this application is carried out by continuously judging and accumulating. Therefore, before entering the calculation, the first parameter representing the adjustable state of the light is set to 0.
[0130] Of course, other technical solutions can also be adopted. For example, if the first parameter is not set to 0, and if the number after the first parameter is accumulated can be divided by a preset value, then it can also be shown that the accumulated first parameter is acceptable. Therefore, setting the first parameter representing the adjustable state of the light to 0 is only an example here and does not mean that it must be set to 0 first. Those skilled in the art can set it according to actual needs. For the convenience of explanation here, therefore, the first parameter representing the adjustable state of the light is set to 0 before calculation, so as to facilitate the next operation.
[0131] S302: Calculate the brightness difference between two adjacent image frames of the imaging device.
[0132] By calculating the brightness difference between two adjacent image frames of the imaging device, when the brightness difference is less than a preset seventh threshold, the first parameter enableFlag representing the adjustable state of the light is incremented by 1.
[0133] The brightness values of two adjacent image frames can be obtained through the image sensor of the imaging device, or determined according to a certain image area determined by the current image frame, or the current image area can be divided, and the average value of the obtained brightness is used as the brightness value of the current image frame.
[0134] Obtaining the brightness value of the image frame is an existing technology and will not be listed here. By obtaining the brightness value of the current image frame and the brightness value of the previous image frame or the brightness value of the next image frame, the brightness difference between two adjacent image frames is calculated.
[0135] S303: Determine whether the brightness difference is less than a preset seventh threshold?
[0136] If so, execute step S304; if not, continue to execute step S302.
[0137] Optionally, the seventh threshold θ can be one-tenth of the preset brightness value evDefault. The preset brightness value evDefault is a value set according to the actual needs of the camera. For example, if the image bit width collected by the camera is 8bit, then its brightness upper limit is 255. At this time, the evDefault value can be but not limited to 100, and the first threshold can be 10 at this time.
[0138] S304: Increment the first parameter by 1.
[0139] Increment the first parameter enableFlag representing the adjustable state of the light by 1.
[0140] When the first parameter enableFlag is incremented by 1, it indicates that the brightness difference between adjacent frames is not significant, and it can be determined that the environment for adjacent two frames is relatively stable.
[0141] S305: Determine whether the cumulative value of the first parameter is greater than the first cumulative threshold?
[0142] If yes, execute step S201; if no, continue to execute step S302.
[0143] By judging the brightness difference between two adjacent image frames, if the brightness difference is less than the preset seventh threshold θ, it indicates that the environmental state of the current two frames is relatively stable and there is no problem of environmental jitter. By continuously judging the brightness difference between two adjacent image frames and incrementing the first parameter enableFlag by 1, it indicates that the brightness difference between two adjacent image frames has been determined to be less than the preset seventh threshold θ multiple times, indicating that the external environment is stable.
[0144] Through the way of continuous cumulative judgment, that is, continuously judging that the environment of adjacent frames is stable to a certain extent. It can be understood that when the cumulative value of the first parameter enableFlag is greater than the first cumulative threshold ε, it can be considered that the current imaging device is in a relatively stable exposure state; otherwise, it is considered that the current imaging device is in an unstable exposure state.
[0145] When the exposure is stable, execute step S201. If the exposure is in an unstable state, return and continue to execute step S302 until the exposure is in a stable state and then proceed to the next process.
[0146] Optionally, also taking the image bit width as 8bit as an example, the brightness upper limit is 255, then the first cumulative threshold ε can be but not limited to 10.
[0147] In the technical solution of the present application, before adjusting the fill light, it is necessary to determine whether the exposure is in a relatively stable state. The technical solution of the present application is carried out by continuous cumulative judgment. Therefore, before entering the calculation, it is determined whether the imaging device is in a stable exposure state, which solves the problem that when the imaging device is in an unstable exposure state, logical confusion may easily occur due to asynchronous fill light and exposure. In the technical solution of the present application, after determining that the exposure is in a relatively stable state, then enter the on / off logic judgment of the fill light, making the on / off logic judgment of the fill light more accurate, and further solving the problem that the on / off of the fill light is in a cyclic on / off state in some scenarios.
[0148] When it is determined that the condition for turning on the fill light is met, the current environment is judged to be stable through continuous cumulative thresholds. After determining that the environment is stable, the operation of turning on the fill light is then executed, avoiding frequent turning on of the fill light of the camera device due to an unstable external environment, that is, effectively preventing the fill light from being in a cyclic on / off state, thereby solving the technical problem to be solved in this application.
[0149] Optionally, as one of the embodiments, after determining that the current brightness value of the camera device is less than a preset fourth threshold and before turning on the fill light, it further includes:
[0150] Increment the third parameter indicating the turn-on state of the fill light by 1, and set the parameters indicating other states of the fill light to 0;
[0151] Determine that the cumulative value of the third parameter is greater than the third cumulative threshold.
[0152] The following is illustrated by specific examples, as shown in Figure 4 shown.
[0153] For the technical solutions of the embodiments of this application, the same steps as those in the above embodiments will not be elaborated here. Refer to the above embodiments. Only the differences from the above embodiments will be described here.
[0154] S401: Determine whether the current brightness value currEV of the camera device is less than the preset fourth threshold μ1?
[0155] If yes, execute step S402; if no, execute step S201.
[0156] If the current brightness value currEV of the current camera device is less than the preset fourth threshold μ1, it indicates that the current environment determined by the current frame is darker. Therefore, it is necessary to start the process of determining whether to turn on the fill light.
[0157] S402: Increment the third parameter OnCnt by 1, and set other parameters to 0;
[0158] The third parameter OnCnt is a parameter indicating the turn-on state of the fill light, and other parameters such as the parameter OffCnt indicating the turn-off state of the fill light or other parameters are set to 0.
[0159] If the environment of the current frame is darker, it cannot be ruled out that it is caused by environmental jitter, that is, it does not mean that the external environment has always been in a darker state. Therefore, by continuous accumulation, the third parameter OnCnt is incremented by 1. Each time it is incremented, it means that the brightness of the images of the consecutive frames obtained is lower than the preset fourth threshold μ1.
[0160] S403: Determine whether the cumulative value OnCnt of the third parameter is greater than the third cumulative threshold OnMax?
[0161] If so, execute step S206; if not, execute step S401.
[0162] The function of the third cumulative threshold OnMax is to determine whether the count of the current condition for turning on the light reaches a certain number of frames. When it is continuously determined that the cumulative value OnCnt of the third parameter is greater than the third cumulative threshold OnMax, it indicates that the current environmental state is stable and the next operation can be executed. If the third cumulative threshold OnMax cannot be reached, it indicates that the current environmental state is unstable. Therefore, return to execute step S401.
[0163] This embodiment provides a value, but not limited to this. The value of the third cumulative threshold OnMax can be, but not limited to, 25.
[0164] The technical solution of the embodiment of the present invention, when determining the condition for turning on the fill light, that is, when the current brightness currEV of the imaging device is less than the preset fourth threshold μ1, continuously determines whether the current environment is stable through the cumulative threshold. After determining that the environment is stable, then execute the operation of turning on the fill light, avoiding the frequent turning on of the fill light of the imaging device due to the external unstable environment, that is, effectively preventing the fill light from being in a state of cyclic switching, thereby solving the technical problem to be solved in this application.
[0165] For example, when the mobile phone takes a picture of the current imaging device at night, it often triggers the flash of the mobile phone. At this time, the image sensor of the imaging device will obtain the external environmental brightness. If the cyclic determination is not passed, the current imaging device is likely to be determined that the external environmental brightness is sufficient, and the operation of turning off the fill light will be started. However, the flash of the mobile phone is temporary and does not equal the current environmental brightness. When the flash goes out, the fill light will be turned on again due to insufficient external environmental brightness. Therefore, the fill light will be repeatedly turned on and off. The technical solution of this application continuously determines whether the current environment is stable through the cumulative threshold, avoiding the problem of frequent turning off of the fill light of the imaging device due to the external unstable environment, and effectively preventing the fill light from being in a state of cyclic switching all the time.
[0166] Optionally, as one of the embodiments, the first control method specifically includes:
[0167] Periodically obtain the gain value of the imaging device;
[0168] If the fill light of the imaging device is already on, when it is determined that the gain value is less than the preset fifth threshold, determine whether to turn off the fill light according to the current environmental brightness value; if the fill light of the device is already off, when it is determined that the gain value is greater than the preset sixth threshold, turn on the fill light;
[0169] Wherein, the fifth threshold is different from the sixth threshold.
[0170] Optionally, as one of the embodiments, the fifth threshold is less than the sixth threshold.
[0171] The following is illustrated by specific embodiments, as shown in the appendix Figure 5 as shown.
[0172] S501: Periodically obtain the gain value of the imaging device.
[0173] In the embodiments of the present invention, the gain value can be directly obtained from the imaging device, and the larger the gain value, the darker the external environment.
[0174] S502: Determine whether the fill light of the imaging device is turned on?
[0175] If yes, execute step S503; if no, execute step S505.
[0176] If the fill light of the imaging device is turned on, it is necessary to execute the determination process of whether the fill light needs to be turned off and execute step S503. If the fill light of the imaging device is turned off, it is necessary to execute the determination process of whether the fill light needs to be turned on and execute step S505.
[0177] S503: Determine that the gain value is less than the preset fifth threshold.
[0178] The function of the "fifth threshold γ2" here is to determine which gain interval the current gain is in. In actual use, it can be freely set according to needs. The embodiments of the present invention provide a value but not limited to this. The value of the fifth threshold γ2 can be but not limited to 10 dB.
[0179] S504: Evaluate whether the fill light needs to be turned off according to the ambient brightness.
[0180] Execute the process of determining whether the fill light needs to be turned off.
[0181] S505: Determine that the gain value is greater than the preset sixth threshold.
[0182] Among them, the fifth threshold is different from the sixth threshold.
[0183] The function of the "sixth threshold γ1" here is to determine which gain interval the current gain is in. In actual use, it can be freely set according to needs. The embodiments of the present invention provide a value but not limited to this. The value of the sixth threshold γ1 can be but not limited to 20 dB.
[0184] Optionally, as one of the embodiments, the fifth threshold is less than the sixth threshold.
[0185] The fifth threshold γ2 is a starting condition for determining whether the fill light is turned off when the fill light is in the on state. When the gain value of the imaging device is greater than the preset fifth threshold γ2, the process of determining whether the fill light is turned off is entered.
[0186] The sixth threshold γ1 is a starting condition for determining whether the fill light is turned on when the fill light is in the off state. When the gain value of the imaging device is less than the preset sixth threshold γ1, the process of determining whether the fill light is turned on is entered.
[0187] For example, in the embodiments of the present application, the value of the fifth threshold γ2 can be 10dB but is not limited thereto, and the value of the sixth threshold γ1 can be 20dB but is not limited thereto.
[0188] S506: Turn on the fill light.
[0189] Turn on the fill light.
[0190] The technical solution of the embodiment of the present invention can more accurately judge the brightness state of the external environment by judging which gain interval the current gain is in, and the fifth threshold is different from the sixth threshold, so that the condition for determining whether the fill light is turned on is not equivalent to the condition for determining whether the fill light is turned off, which can further avoid the problem of frequent switching of the fill light caused by unstable external environment.
[0191] For example, when a mobile phone takes a picture of the current imaging device at night, the flash of the mobile phone is often triggered. At this time, the image sensor of the imaging device will obtain the external environmental brightness. If the loop judgment is not passed, the current imaging device is likely to be judged that the external environmental brightness is sufficient, and the turn-off operation of the fill light will be started. However, the flash of the mobile phone is temporary and does not equal the current environmental brightness. When the flash goes out, the fill light will be turned on again due to insufficient external environmental brightness, so the fill light will be switched repeatedly. The technical solution of the present application judges whether the current environment is stable through continuous cumulative thresholds, avoids the problem of frequent turning off of the fill light of the imaging device caused by unstable external environment, and effectively prevents the fill light from being in a state of continuous loop switching.
[0192] Optionally, as one of the embodiments, after determining that the gain value is greater than the preset sixth threshold and before turning on the fill light, it further includes:
[0193] Increment the third parameter representing the turn-on state of the fill light by 1, and set the parameters representing other states of the fill light to 0;
[0194] Determine that the cumulative value of the third parameter is greater than the third cumulative threshold.
[0195] The following is illustrated by specific embodiments, as shown in the appendix Figure 6 as shown.
[0196] For the technical solutions of the embodiments of the present application, the same steps as those in the above embodiments will not be elaborated here. Please refer to the above embodiments. Only the differences from the above embodiments will be described here.
[0197] S601: Determine whether the gain value of the imaging device is greater than the preset sixth threshold γ1?
[0198] If yes, execute step S602; if no, execute step S501.
[0199] If the gain value currGain of the current imaging device is greater than the preset sixth threshold γ1, it indicates that the current environment is relatively dark. Therefore, it is necessary to start the process of determining whether to turn on the fill light.
[0200] The function of the "sixth threshold γ1" here is to determine which gain interval the current gain is in. In actual use, it can be freely set according to needs. The embodiments of the present invention provide a value, but not limited to this. The value of the sixth threshold γ1 can be, but not limited to, 20 dB.
[0201] S602: Increment the third parameter by 1 and set other parameters to 0.
[0202] The third parameter is the third parameter OnCnt used to represent the turn-on state of the fill light, and other parameters such as the parameter OffCnt representing the turn-off state of the fill light or other parameters are set to 0.
[0203] If the environment of the current frame is relatively dark, it cannot be excluded that it is caused by environmental jitter, that is, it does not mean that the external environment is always relatively dark. Therefore, by continuously incrementing, the third parameter OnCnt is incremented by 1. Each time it is incremented, it means that the gain values of the continuously obtained frames of images are all greater than the preset sixth threshold γ1. Therefore, when the third parameter is incremented by 1, it means that the currently continuously obtained gain values have been greater than the preset sixth threshold γ1. As previously described, the larger the gain value, the darker the environment. And when the obtained gain value has been greater than the preset sixth threshold γ1, it indicates that the current environment is continuously dark and the possibility of environmental jitter is small.
[0204] S603: Determine whether the cumulative value OnCnt of the third parameter is greater than the third cumulative threshold OnMax?
[0205] If yes, execute step S506; if no, continue to execute step S601.
[0206] The function of the third cumulative threshold OnMax is to determine whether the count of the current lighting-on condition is reached for a certain number of frames. When continuously determining that the cumulative value OnCnt of the third parameter is greater than the third cumulative threshold OnMax, it indicates that the current environmental state is stable and the next operation can be executed. If the third cumulative threshold OnMax cannot be reached, it indicates that the current environmental state is unstable. Therefore, return to execute step S601.
[0207] This embodiment provides a value that is not limited to this. The value of the third cumulative threshold OnMax can be but not limited to 25.
[0208] S506: Turn on the fill light.
[0209] Turn on the fill light.
[0210] In this solution, when determining the condition for turning on the fill light, it is judged whether the current environment is stable through continuous cumulative thresholds. After determining that the environment is stable, the operation of turning on the fill light is executed, avoiding the frequent turning on of the fill light of the camera device due to the external unstable environment, that is, it can effectively prevent the fill light from being in a state of cyclic switching, thereby solving the technical problem to be solved in this application.
[0211] For example, when a mobile phone takes a picture of the current camera device at night, it often triggers the flash of the mobile phone. At this time, the image sensor of the camera device will obtain the external environmental brightness. If it is not judged through cycling, the current camera device is likely to be judged that the external environmental brightness is sufficient and the operation of turning off the fill light will be started. However, the flash of the mobile phone is temporary and does not equal the current environmental brightness. When the flash goes out, the fill light will be turned on again due to insufficient external environmental brightness, so the fill light will be repeatedly switched on and off. The technical solution of this application judges whether the current environment is stable through continuous cumulative thresholds, avoiding the problem of frequent turning off of the fill light of the camera device due to the external unstable environment, and effectively preventing the fill light from always being in a state of cyclic switching.
[0212] Optionally, as one of the embodiments, determining whether to turn off the fill light according to the environmental brightness specifically includes:
[0213] Determine that the camera device enters the ready state and calculate the current environmental brightness value;
[0214] Determine that the current environmental brightness value is less than the preset third threshold and turn off the fill light.
[0215] The following is illustrated by specific embodiments, as shown in the appendix Figure 7 as follows.
[0216] S701: Determine that the camera device enters the ready state.
[0217] In actual use, the camera always focuses on how to adjust the exposure factors such as the shutter, gain, and aperture of the camera to make the camera reach the preset brightness in the current scene. Therefore, before calculating the current ambient brightness value, it is necessary to determine that the imaging device has entered the ready state before making adjustments, otherwise it is likely to result in inaccurate results of the calculated ambient brightness value.
[0218] S702: Calculate the current ambient brightness value.
[0219] Calculating the current ambient brightness value can be the result obtained through a specified calculation method based on the values read by the current imaging device from the external environment. For example, it can be calculated using the obtained current gain value, the obtained brightness value, etc., and it can also refer to the attribute values of the current image for calculation. The specific calculation method can be adjusted according to actual needs.
[0220] Optionally, an embodiment of the present invention provides a solution that can calculate the ambient brightness currLumin through the current gain currGain, the current exposure currShut, and the current brightness currEv of the camera.
[0221] S703: Determine whether the current ambient brightness value is less than a preset third threshold?
[0222] If yes, execute step S704; if no, continue to execute step S701.
[0223] The current ambient brightness value currLumin is a value calculated based on the relevant parameters of the imaging device, and the next process is determined according to this value.
[0224] The function of the third threshold λ is to serve as a judgment threshold for the ambient brightness currLumin, which can be freely set according to needs in actual use. Optionally, taking the image bit width as 8bit as an example, the brightness upper limit is 255. Assuming the preset brightness value evDefault is 100, then the third threshold λ can be but is not limited to 12.
[0225] S704: Turn off the fill light.
[0226] If the current ambient brightness value is less than the preset third threshold λ, it means that the current environment is relatively bright and the obtained image quality is good. Therefore, additional fill light from the fill light is not required, and the fill light is turned off.
[0227] In the technical solution of the embodiment of the present invention, the judgment logics for turning off and turning on the fill light are different. After determining that the imaging device enters the preparation state, the current ambient brightness value is calculated. The obtained calculation result is accurate, reducing the probability of misjudgment. Furthermore, after the fill light is turned off, it is prevented from being turned on again due to environmental jitter, reducing the occurrence of the problem of possible cyclic switching of the fill light.
[0228] Optionally, as one of the embodiments, after determining that the current ambient brightness value is less than a preset third threshold and before turning off the fill light, it further includes:
[0229] Increment the second parameter representing the turn-off state of the fill light by 1, and set the parameters representing other states of the fill light to 0;
[0230] Determine that the cumulative value of the second parameter is greater than the second cumulative threshold.
[0231] The following is illustrated by specific embodiments, as shown in the appendix Figure 8 as shown.
[0232] For the technical solution of the embodiment of the present application, the same steps as those in the above embodiment will not be elaborated here. Refer to the above embodiment. Only the differences from the above embodiment are described here.
[0233] S801: Increment the second parameter by 1, and set other parameters to 0;
[0234] To avoid the problem of cyclic switching of the fill light caused by environmental jitter, one of the solutions can be to avoid misjudgment and turning off the fill light due to environmental jitter, that is, the problem of cyclic switching caused by environmental jitter can be solved, and it will not be misturned off. Then, it is equivalent to achieving that it will not be misturned on indirectly, thereby solving the problem of cyclic switching of the fill light caused by environmental jitter.
[0235] The second parameter OffCnt represents the turn-off state of the fill light. Therefore, increment the second parameter OffCnt by 1, and set the parameters representing other states of the fill light to 0. For example, set the third parameter OnCnt representing the turn-on state of the fill light to 0.
[0236] S802: Determine whether the cumulative value of the second parameter OffCnt is greater than the second cumulative threshold OffMax?
[0237] If yes, execute step S704; if no, continue to execute step S701.
[0238] The function of the second cumulative threshold OffMax is to determine whether the count of the current condition for turning off the light reaches a certain number of frames. In actual use, it can be freely set according to needs. Optionally, the value of OffMax can be but not limited to 25.
[0239] S704: Turn off the fill light.
[0240] Turn off the fill light.
[0241] When the cumulative value of the second parameter is greater than the second cumulative threshold OffMax, it indicates that the current external environment is relatively stable. When a certain cumulative threshold is reached, the operation of turning off the fill light is performed, which avoids the frequent turning off of the fill light caused by the unstable external environment. By using the second cumulative threshold OffMax to avoid the frequent turning off of the fill light caused by the unstable external environment, it can effectively prevent the fill light from being in a state of cyclic switching.
[0242] This solution can effectively prevent the fill light from being in a state of cyclic switching by controlling the cyclic turning off of the fill light caused by the unstable environment, thereby solving the technical problem to be solved in this application.
[0243] For example, when a mobile phone takes a picture of the current camera device at night, it often triggers the flash of the mobile phone. At this time, the image sensor of the camera device will obtain the external ambient brightness. If the cyclic determination is not performed, the current camera device is likely to be determined that the external ambient brightness is sufficient, and the operation of turning off the fill light will be started. However, the flash of the mobile phone is temporary and does not equal the current external ambient brightness. When the flash goes out, the fill light will be turned on again due to insufficient external ambient brightness, so the fill light will be turned on and off repeatedly. The technical solution of this application determines whether the current environment is stable through continuous cumulative thresholds, avoiding the problem of frequent turning off of the fill light of the camera device caused by the unstable external environment, and effectively preventing the fill light from being in a state of cyclic switching.
[0244] Optionally, as one of the embodiments, calculating the current ambient brightness value specifically includes:
[0245] Obtain the current gain value, current exposure value, and current brightness value of the camera device;
[0246] Take the result obtained by dividing the product of the gain value and the exposure value by the brightness value as the current ambient brightness value.
[0247] The following is illustrated by specific embodiments.
[0248] The current gain currGain and current exposure currShut of the camera can be directly read out from the camera, while the current brightness currEv can be measured by the image sensor in the camera. The formula for calculating the ambient brightness based on the gain value, current exposure value, and current brightness value is as follows:
[0249] Ambient brightness value currLumin = (Gain currGain * Exposure currShut) / Current brightness currEv
[0250] The ambient brightness is a defined value calculated based on a gain value, the current exposure, and the current brightness value, and can be applicable to various brightness scenarios.
[0251] Optionally, as one of the embodiments, determining that the imaging device enters a preparation state specifically includes:
[0252] Obtaining the current brightness value, and obtaining a preset brightness value and a preset tolerance value of the imaging device;
[0253] When it is determined that the current brightness value is within the interval of the preset brightness value and the tolerance value of the imaging device, it is determined that the imaging device enters the preparation state;
[0254] Wherein, the preset brightness value is determined according to the image parameters collected by the imaging device.
[0255] The following is illustrated by specific embodiments.
[0256] The preset brightness value evDefault is determined according to the image parameters collected by the imaging device. For example, if the image bit width collected by the camera is 8 bits, then the brightness upper limit is 255. At this time, the preset brightness value evDefault can be but is not limited to 100.
[0257] In actual use, the current brightness value is related to the gain and shutter of the camera, and both the gain and the shutter may be a non - continuous variable quantity and cannot be guaranteed to be exactly equal. Therefore, the function of the preset tolerance value β is to add a tolerance interval, which can be freely set according to needs. Similarly, taking the image bit width of 8 bits as an example, the brightness upper limit is 255, then the preset tolerance value β can be but is not limited to 5.
[0258] When it is determined that the current brightness value currEv is within the interval of the preset brightness value (evDefault) and the preset tolerance value β of the imaging device, it is determined that the imaging device enters the preparation state. When the preparation state flag bit is set to startFag, it can be expressed by the formula as follows:
[0259] The preparation state flag bit startFag = (currEv >= (evDefault - β) && currEv <= (evDefault + β))
[0260] Condition 1: The ambient brightness value currEv >= (the preset brightness value evDefault - the tolerance β)
[0261] Condition 2: The ambient brightness value currEv <= (the preset brightness value evDefault + the tolerance β)
[0262] When both Condition 1 and Condition 2 are satisfied, the ready status flag startFag is 1; otherwise, it is 0.
[0263] In the actual usage process, the imaging device mainly adjusts the exposure factors such as the shutter, gain, and aperture of the imaging device to make the current brightness currEv of the imaging device reach near the preset brightness value (evDefault) in the current scene. If the brightness currEv in the current scene is near the preset brightness value (evDefault), it is considered that the current camera is in a proper and stable state and no further adjustment is needed. That is to say, when both Condition 1 and Condition 2 are satisfied, it is considered that the current camera is in a proper and stable state, and it is determined that the imaging device enters the ready state.
[0264] It is determined whether the imaging device enters the ready state through the status flag startFag, that is, when it is determined that the current brightness value is within the interval of the preset brightness value (evDefault) and the tolerance value β of the imaging device, it is determined that the imaging device enters the ready state.
[0265] Optionally, an embodiment of the present invention further provides a fill light switch control device 900 for an imaging device, as shown in the appendix Figure 9 shown, including:
[0266] An acquisition module 901, configured to acquire the upper gain limit value and the lower gain limit value set for the imaging device;
[0267] A judgment module 902, configured to judge the difference between the lower gain limit value and the upper gain limit value. If the difference is greater than a preset first threshold, the first control method is used to control the switch of the fill light; otherwise, the second control method is used to control the switch of the fill light;
[0268] Wherein, the first control method is to determine whether the fill light is turned on according to the current brightness and determine whether the fill light is turned off according to the current ambient brightness; the second control method is to determine whether the fill light is turned on according to the current gain and determine whether the fill light is turned off according to the current ambient brightness.
[0269] Optionally, an embodiment of the present invention further provides an electronic device, which includes: a processor and a memory;
[0270] The processor is configured to call a program stored in the memory. When the program is executed, the processor is caused to execute the method in any one of the above embodiments.
[0271] Optionally, an embodiment of the present invention further provides a computer storage medium, storing a computer program, and the computer program includes a method for executing any one of the above embodiments.
[0272] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0273] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0274] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0275] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0276] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A method for controlling the fill light switch of a camera device, characterized in that, Including: Obtain the upper gain limit value and the lower gain limit value set by the imaging device. If the difference between the lower gain limit value and the upper gain limit value is greater than a preset first threshold, use a first control method to control the switch of the fill light; otherwise, use a second control method to control the switch of the fill light. Among them, the first control method is to determine whether to turn on the fill light according to the current gain value, and determine whether to turn off the fill light according to the current ambient brightness value; the second control method is to determine whether to turn on the fill light according to the current brightness value, and determine whether to turn off the fill light according to the current ambient brightness value. The current ambient brightness value is the result obtained through a specified calculation method from the value read by the imaging device from the external environment, and the current brightness value is obtained through the image sensor of the imaging device.
2. The method according to claim 1, characterized in that, The second control method specifically includes: Periodically obtain the current brightness value of the imaging device. If the fill light of the imaging device is already on, when it is determined that the current brightness value of the imaging device is greater than a preset second threshold, determine whether to turn off the fill light according to the current ambient brightness value; if the fill light of the device is already off, when it is determined that the current brightness value of the imaging device is less than a preset fourth threshold, turn on the fill light. Among them, the second threshold is different from the fourth threshold.
3. The method according to claim 1, wherein The first control method specifically includes: Periodically obtain the gain value of the imaging device. If the fill light of the imaging device is already on, when it is determined that the gain value is less than a preset fifth threshold, determine whether to turn off the fill light according to the current ambient brightness value; if the fill light of the device is already off, when it is determined that the gain value is greater than a preset sixth threshold, turn on the fill light. Among them, the fifth threshold is different from the sixth threshold.
4. The method according to claim 1, characterized in that The determining whether to turn off the fill light according to the current ambient brightness value specifically includes: Determine that the imaging device enters the preparation state, and calculate the current ambient brightness value. Determine that the current ambient brightness value is less than a preset third threshold, and turn off the fill light.
5. The method according to claim 2, wherein Before periodically obtaining the current brightness value of the imaging device, it further includes: Calculate the brightness difference between two adjacent image frames of the imaging device. When the brightness difference is less than a preset seventh threshold, increment by 1 the first parameter representing the adjustable state of the light. Determine that the cumulative value of the first parameter is greater than the first cumulative threshold.
6. The method according to claim 2, wherein It also includes: Before turning on the fill light after determining that the current brightness value of the imaging device is less than a preset fourth threshold, it further includes: Increment by 1 the third parameter representing the turn-on state of the fill light, and set the parameters representing other states of the fill light to 0. Determine that the cumulative value of the third parameter is greater than the third cumulative threshold.
7. The method according to claim 2, characterized in that, The second threshold is greater than the fourth threshold.
8. The method according to claim 3, characterized in that, Before turning on the fill light after determining that the gain value is greater than a preset sixth threshold, it further includes: Increment by 1 the third parameter representing the turn-on state of the fill light, and set the parameters representing other states of the fill light to 0. Determine that the cumulative value of the third parameter is greater than the third cumulative threshold.
9. The method according to claim 3, characterized in that, The fifth threshold is less than the sixth threshold.
10. The method according to claim 4, wherein After determining that the current ambient brightness value is less than a preset third threshold and before turning off the fill light, it further includes: Incrementing by 1 the second parameter representing the closable state of the fill light and setting to 0 the parameters representing other states of the fill light; Determining that the cumulative value of the second parameter is greater than a second cumulative threshold.
11. The method according to claim 4, wherein The calculating of the current ambient brightness value specifically includes: Obtaining the current gain value, current exposure, and current brightness value of the imaging device; Taking the result obtained by dividing the product of the gain value and the exposure by the brightness value as the current ambient brightness value.
12. The method according to claim 4, characterized in that The determining that the imaging device enters the preparation state specifically includes: Obtaining the current brightness value, and obtaining the preset brightness value and preset tolerance value of the imaging device; When determining that the current brightness value is within the range of the preset brightness value of the imaging device and the tolerance value, determining that the imaging device enters the preparation state; Wherein, the preset brightness value is determined according to the image parameters collected by the imaging device.
13. A fill light switch control device for a camera device, characterized in that, It includes: An obtaining module, configured to obtain the upper gain limit value and lower gain limit value set for the imaging device; A judging module, configured to judge the difference between the lower gain limit value and the upper gain limit value. If the difference is greater than a preset first threshold, controlling the on / off of the fill light using a first control method; otherwise, controlling the on / off of the fill light using a second control method; Wherein, the first control method determines whether to turn on the fill light according to the current gain value and determines whether to turn off the fill light according to the current ambient brightness value; the second control method determines whether to turn on the fill light according to the current brightness value and determines whether to turn off the fill light according to the current ambient brightness value. The current ambient brightness value is the result obtained by subjecting the value read by the imaging device from the external environment to a specified calculation method, and the current brightness value is obtained through the image sensor of the imaging device.
14. An electronic device, characterized in that, The device includes: a processor and a memory; The memory is used to store a computer program; The processor is used to call the computer program stored in the memory. When the computer program is executed, the processor executes the method according to any one of the above claims 1-12.
15. A computer storage medium, characterized in that, There is a computer program stored, and when the computer program is executed by the processor, it implements the method according to any one of the above claims 1-12.
Citation Information
Patent Citations
Light supplement lamp control method and device
CN108551553A
Light supplement lamp control method and device, camera equipment and storage medium
CN110418067A