CN112153302B - Infrared light source control method and device, electronic equipment and readable storage medium - Google Patents

Infrared light source control method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112153302B
CN112153302B CN202011042348.9A CN202011042348A CN112153302B CN 112153302 B CN112153302 B CN 112153302B CN 202011042348 A CN202011042348 A CN 202011042348A CN 112153302 B CN112153302 B CN 112153302B
Authority
CN
China
Prior art keywords
current
light source
infrared light
exposure time
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011042348.9A
Other languages
Chinese (zh)
Other versions
CN112153302A (en
Inventor
应云剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Qiwen Technology Co ltd
Beijing Qisheng Technology Co Ltd
Hangzhou Qingqi Science and Technology Co Ltd
Original Assignee
北京骑胜科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京骑胜科技有限公司 filed Critical 北京骑胜科技有限公司
Priority to CN202011042348.9A priority Critical patent/CN112153302B/en
Publication of CN112153302A publication Critical patent/CN112153302A/en
Application granted granted Critical
Publication of CN112153302B publication Critical patent/CN112153302B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/76Circuitry for compensating brightness variation in the scene by influencing the image signals

Abstract

The embodiment of the invention discloses an infrared light source control method, an infrared light source control device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: the method comprises the steps of obtaining a video stream, obtaining current exposure time and current brightness gain, and controlling an infrared light source according to the current exposure time and the current brightness gain. The video stream comprises a plurality of frames, the current exposure time is the exposure time of the image of the target frame, and the current brightness gain is the brightness gain of the image of the target frame. Therefore, the ambient brightness is improved through the infrared light source, the infrared light source is dynamically adjusted through the exposure time and the brightness gain parameter of each frame of image in the video stream, and the power consumption of the infrared light source is reduced while the image brightness is ensured.

Description

Infrared light source control method and device, electronic equipment and readable storage medium
Technical Field
The invention relates to the technical field of computers, in particular to an infrared light source control method and device, electronic equipment and a readable storage medium.
Background
The magnitude of the ambient brightness is directly related to the quality of the captured image. When the ambient brightness is darker, the ambient brightness can be improved by installing an infrared light source near the image acquisition device, so that the image brightness is improved, and the image with higher quality can be acquired conveniently.
However, the existing infrared light source usually adopts the following two ways: firstly, the infrared light source is kept in a normally bright state during image acquisition until the image acquisition is finished. This approach can ensure image brightness, but in daytime or bright environments, it causes waste of power consumption. Secondly, determining the starting of the infrared light source according to the brightness gain value of each frame of image acquired by the image acquisition, and starting the infrared light source when the gain value is greater than a preset value; and when the gain value is smaller than another preset value, the infrared light source is turned off. The mode can control the on-off state of the infrared light source according to the brightness of the environment, but a fault exists in the adjusting range, the dark environment and the bright environment cannot be distinguished, the on-off state of the infrared light source is frequently switched, the power consumption is high, and the image quality is easily influenced.
Disclosure of Invention
In view of this, embodiments of the present invention provide an infrared light source control method, an infrared light source control apparatus, an electronic device, and a readable storage medium, which reduce waste of power consumption of an infrared light source while ensuring image brightness.
In a first aspect, an embodiment of the present invention provides an infrared light source control method, where the method includes:
acquiring a video stream, wherein the video stream comprises a plurality of frames;
acquiring current exposure time and current brightness gain, wherein the current exposure time is the exposure time of an image of a target frame, and the current brightness gain is the brightness gain of the image of the target frame; and
and controlling the infrared light source according to the current exposure time and the current brightness gain.
Further, the controlling the infrared light source according to the current exposure time and the current brightness gain includes:
controlling the infrared light source to be turned off in response to the current exposure time being less than the first threshold; and
and controlling the infrared light source to be switched to an on state in response to the current exposure time being greater than or equal to a first threshold value and the current brightness gain being greater than a second threshold value.
Further, the controlling the infrared light source to switch to the on state includes:
determining an initial value of current through the infrared light source;
acquiring exposure time adjustment and brightness gain adjustment; and
adjusting the current value of the infrared light source according to the adjusted exposure time and the adjusted brightness gain;
and the adjusted exposure time is the exposure time of the image of the next frame, and the adjusted brightness gain is the brightness gain of the image of the next frame.
Further, the initial value of the current is a product of a preset brightness gain value and a constant proportionality coefficient.
Further, the adjusting the current value of the infrared light source according to the adjusted exposure time and the adjusted brightness gain comprises:
in response to the adjusted exposure time being equal to or greater than a first threshold and the adjusted brightness gain being equal to or less than the second threshold, ending the adjustment;
triggering a current value increase adjusting strategy in response to the adjusting exposure time being greater than or equal to a first threshold value and the adjusting brightness gain being greater than a second threshold value until the adjusting brightness gain is less than or equal to the second threshold value; and
and triggering a current value reduction regulation strategy in response to the regulated exposure time being smaller than a first threshold value until the regulated exposure time is larger than or equal to the first threshold value or the infrared light source is turned off.
Further, the current value increase adjustment strategy specifically includes:
and gradually increasing the current value of the infrared light source according to a preset increment by taking the initial current value as a reference.
Further, the current value reduction adjustment strategy specifically includes:
and gradually reducing the current value of the infrared light source according to a preset increment by taking the initial current value as a reference.
In a second aspect, an embodiment of the present invention provides an infrared light source control apparatus, including:
an acquisition unit configured to acquire a video stream, the video stream including a plurality of frames;
the detection unit is used for acquiring current exposure time and a current gain value, wherein the current exposure time is the exposure time of an image of a target frame, and the current brightness gain is the brightness gain of the image of the target frame; and
and the control unit is used for controlling the infrared light source according to the current exposure time and the current brightness gain.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes:
the image acquisition module is used for acquiring an image;
the infrared light source is used for adjusting the image brightness; and
a controller configured to execute computer program instructions;
wherein the computer program instructions are executed by a controller to implement the method as described above.
In a fourth aspect, embodiments of the present invention provide a readable storage medium on which computer program instructions are stored, which when executed by a processor implement the method as described above.
According to the technical scheme of the embodiment of the invention, the infrared light source is arranged, so that the ambient brightness is improved, and the image brightness during image acquisition is further improved. Meanwhile, in the using process of the infrared light source, the infrared light source is dynamically adjusted through the exposure time and the brightness gain parameter of each frame of image in the video stream, and the power consumption of the infrared light source is reduced while the image brightness is ensured.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart of a method of controlling an infrared light source according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of adjusting an infrared light source according to an embodiment of the invention;
FIG. 3 is a flow chart of a method for controlling the switching of an infrared light source according to an embodiment of the present invention;
FIG. 4 is a flow chart of current value adjustment for an infrared light source in accordance with an embodiment of the present invention;
FIG. 5 is a schematic diagram of an infrared light source control apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an electronic device of an embodiment of the invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present invention.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including, but not limited to".
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
When the image is collected, the size of the ambient brightness is directly related to the definition of the collected image. When the ambient brightness is low, the conventional method is to install an infrared light source near the image acquisition device to improve the ambient brightness, so as to improve the image brightness and the quality of the acquired image. However, when the brightness of the existing infrared light source is adjusted, the dynamic adaptability is poor, the power consumption is large, and the quality of the collected image is affected in the adjusting process.
In this embodiment, an image acquisition of a video recorder in a network appointment service during use is taken as an example for explanation. Those skilled in the art will readily understand that the infrared light source control method of the embodiment of the present invention may also be used in other scenes where images are captured.
The video recorder is a similar automobile data recorder product and is used for standardizing the service behavior of a driver, improving the experience of a user in using the network car booking service and solving the safety problem and conflict dispute which may occur in the service process. The commonly used video recorder is a portable handheld terminal device, and a battery and a front camera and a rear camera are arranged in the video recorder. The front camera is used for shooting videos outside the vehicle so as to judge whether traffic violation behaviors, such as solid line lane changing and red light running, exist for a driver. The rear camera is used for shooting videos in the vehicle to monitor the normative of the service behaviors of the driver, such as whether the driver wears white gloves or wears a safety belt or not, whether driver and passenger conflicts or fatigue driving exist or not and the like.
When the ambient brightness is darker in the car, in order to guarantee that clear image can be gathered to back camera, install the infrared lamp near back camera usually to regard the infrared lamp as infrared light source, improve the luminance of image in the car. However, infrared lamps consume additional operating current when they are operated. Based on this, the embodiment of the invention provides an infrared light source control method, which reduces the waste of the power consumption of an infrared light source while ensuring the brightness of a collected image.
Fig. 1 is a flowchart of an infrared light source control method according to an embodiment of the present invention. As shown in fig. 1, the method for controlling an infrared light source according to an embodiment of the present invention includes the following steps:
in step S100, a video stream is acquired.
In this embodiment, the video stream includes a plurality of frames, each frame corresponding to an image.
In step S110, the current exposure time and the current luminance gain are acquired.
In this embodiment, the current exposure time is the exposure time of the image of the target frame, and the current brightness gain is the brightness gain of the image of the target frame.
In step S120, the infrared light source is controlled according to the current exposure time and the current brightness gain.
The brightness of the image collected by the camera is determined by the exposure time and the brightness gain of the camera. The larger the exposure time, the brighter the acquired image. The larger the brightness gain, the brighter the acquired image. However, in actual use, the values of the exposure time and the luminance gain cannot be set excessively large.
When the exposure time is too long, on the one hand, the frame rate of the video image decreases and the image is stuck. On the other hand, camera shake occurs during the exposure time, and the image is smeared and the screen is unclear. When the brightness gain is too large, the noise of the image is too much, and the image definition is affected.
In the embodiment, the exposure is preferentially used to generate the image by default, namely, the state of the infrared light source is preferentially controlled according to the exposure time. And simultaneously, when the exposure time meets the preset condition, controlling the infrared light source according to the current exposure time and the current brightness gain. Therefore, the problem that an image generated by adjusting the infrared light source through single adjustment of exposure time and brightness gain value is jammed or unclear is solved, the use performance of the infrared light source is improved, and image acquisition is facilitated.
In an optional implementation manner, the controlling the infrared light source according to the current exposure time and the current brightness gain of the embodiment specifically includes the following steps:
in step S121, in response to the current exposure time being less than the first threshold, the infrared light source is controlled to be turned off.
In this embodiment, the first threshold is a maximum value of the exposure time during actual image acquisition, is determined according to the frame rate during actual image acquisition, and satisfies the following relationship:
threshold 1000/frame rate
When the current exposure time is less than the first threshold value, it is indicated that a clear image can be acquired under the current ambient brightness, and the infrared light source is not required to provide brightness, that is, the infrared light source is in a closed state.
In step S122, in response to that the current exposure time is greater than or equal to the first threshold and the current brightness gain is greater than the second threshold, the infrared light source is controlled to switch to the on state.
In this embodiment, the second threshold is a preset value, and the size of the preset value is related to a current value actually measured by the image acquisition and passing through the infrared light source, and is a luminance gain corresponding to the current value when the luminance (lux) of 1 unit is increased.
When the current exposure time is greater than or equal to the first threshold and the current brightness gain is greater than the second threshold, it indicates that a clear image can be acquired only by providing brightness by the infrared light source under the current ambient brightness, that is, the infrared light source is in an on state.
Preferably, after the infrared light source is switched to the on state, as shown in fig. 2, the method for adjusting the infrared light source of the embodiment includes the following steps:
in step S200, an initial value of the current through the infrared light source is determined.
Preferably, the initial value of the current in this embodiment is specifically a product of a preset luminance gain value and a constant proportionality coefficient. The method specifically comprises the following steps:
i0=k×g0
wherein i0Is the initial value of current, k is constant proportionality coefficient, g0Is a preset brightness gain value.
In step S210, an adjusted exposure time and an adjusted brightness gain are acquired.
In the present embodiment, the exposure time is adjusted to be the exposure time of the image of the next frame, and the luminance gain is adjusted to be the luminance gain of the image of the next frame.
In step S220, the current value of the infrared light source is adjusted according to the adjusted exposure time and the adjusted brightness gain.
Preferably, in this embodiment, adjusting the current value of the infrared light source corresponding to the next frame of image by taking the frame of image as the minimum unit according to the exposure time adjustment and the brightness gain adjustment specifically includes:
in step S221, in response to the adjustment of the exposure time being equal to or greater than the first threshold and the adjustment of the luminance gain being equal to or less than the second threshold, the adjustment is ended.
In this embodiment, when the acquired adjusted exposure time is greater than or equal to the first threshold and the adjusted brightness gain is less than or equal to the second threshold, it indicates that a clear image can be acquired by the next frame of image under the corresponding adjusted exposure time and adjusted brightness gain, the image brightness meets the actual requirement, the use state of the infrared light source does not need to be changed, the adjustment operation is ended, and the current value corresponding to the image of the current target frame is used as the current value of the infrared light source during the next frame of image acquisition.
In step S222, in response to the adjusted exposure time being equal to or greater than the first threshold and the adjusted brightness gain being greater than the second threshold, the current value increase adjustment strategy is triggered until the adjusted brightness gain is equal to or less than the second threshold.
Preferably, the current value increase adjustment strategy implemented in this embodiment is specifically: and taking the initial current value as a reference, gradually increasing the current value of the infrared light source according to a preset increment, and correspondingly increasing the brightness of the infrared light source until the brightness gain is adjusted to be less than or equal to a second threshold value. Therefore, according to the real-time exposure time adjustment, brightness gain adjustment and actual use requirements, the current value passing through the infrared light source is dynamically increased, and the definition of the acquired image is ensured. Meanwhile, the extra power consumption caused by the overlarge increment of the current value is reduced, and the power consumption generated in the use process of the infrared light source is further reduced.
Specifically, in this embodiment, gradually increasing the current value of the infrared light source according to the initial current value and the preset increment specifically includes:
i=i1+a
where i is the adjusted current value, i1And a is a preset constant and is a positive number, and is the current value obtained after the last adjustment is finished.
It should be noted that, when only a single adjustment of the current value of the infrared light source is needed, the current value i obtained after the previous adjustment is finished is obtained1Is an initial value of current i0The adjusted current value i is the initial current value i0And adding the sum value obtained by adding the sum value with a preset constant a, wherein the current value corresponding to the next frame of the target frame during image acquisition is the increased current value.
When multiple adjustments are needed, the reference current i is adjusted for the first time when the current value of the infrared light source is adjusted1Is an initial value of current i0. Reference value i for current value adjustment from the second adjustment1And the current value obtained after the last adjustment is finished is the current value obtained when the next frame of image corresponding to the exposure time adjustment and the brightness gain adjustment of the last time is acquired.
In step S223, in response to the adjusted exposure time being less than the first threshold, the current value reduction adjustment strategy is triggered until the adjusted exposure time is greater than or equal to the first threshold or the infrared light source is turned off.
Preferably, the current value reduction adjustment strategy of this embodiment is specifically: and gradually reducing the current value of the infrared light source according to a preset increment by taking the initial current value as a reference until the exposure time is adjusted to be less than a first threshold value or the infrared light source is turned off (namely the current of the infrared light source is 0, the infrared light source is in a turned-off state). Therefore, according to the real-time requirements of adjusting exposure time, adjusting brightness gain and practical use, the current value passing through the infrared light source is dynamically reduced, the definition of collected images is guaranteed, meanwhile, extra current passing through the infrared light source is reduced, and power consumption generated in the use process of the infrared light source is further reduced.
Specifically, the step of increasing the current value of the infrared light source according to the initial current value and the preset increment in this embodiment specifically includes:
i=i1-b
where i is the adjusted current value, i1B is a preset constant and is a positive number, and is a current value obtained after the last adjustment is finished.
When the current value of the infrared light source is adjusted only once, the current value i obtained after the previous adjustment in the above formula is completed1Is an initial value of current i0The adjusted current value i is the initial current value i0And subtracting the preset constant b to obtain a difference value, wherein the current value corresponding to the next frame of the target frame during image acquisition is the increased current value.
When multiple adjustments are needed, the reference current when the current value of the infrared light source is adjusted for the first time is the initial current value i0. Reference value i for current value adjustment from the second adjustment1And the current value obtained after the last adjustment is finished is the current value obtained when the next frame of image corresponding to the exposure time adjustment and the brightness gain adjustment of the last time is acquired.
It is easily understood by those skilled in the art that the steps S221, S222 and S223 are all methods for adjusting the infrared light source according to different adjusted exposure time and adjusted brightness gain, and are logically parallel. That is, only one of the above-described steps S221, S222, and S223 can be performed when the adjustment action is performed once.
Preferably, the present embodiment uses the same value as the preset increment of increase or decrease, that is, a-b, when adjusting the infrared light source current value. Therefore, parameter setting is reduced, and the control of the current value of the infrared light source is more convenient and faster.
Fig. 3 is a flowchart of a method for controlling on/off of an infrared light source according to an embodiment of the present invention. As shown in fig. 3, the method for controlling the on/off of the infrared light source of the present embodiment includes the following steps:
in step S300, a video stream is acquired.
The video stream of the present embodiment is composed of a plurality of frames of images.
In step S310, the current exposure time and the current luminance gain are acquired.
The current exposure time and the current brightness gain of the embodiment are respectively the exposure time and the brightness gain corresponding to the target frame image.
In step S320, it is determined whether the current exposure time is less than a first threshold.
If yes, go to step S330; otherwise, step S340 is performed.
In step S330, the infrared light source is turned off.
When the current exposure time is less than the first threshold value, the clear image can be acquired under the current environment brightness, the infrared light source is not required to provide brightness, and the infrared light source is controlled to be in a closed state.
In step S340, it is determined whether the current brightness gain is greater than a second threshold.
If yes, go to step S350; otherwise, step S330 is performed.
In step S350, the infrared light source is turned on.
When the current exposure time is greater than or equal to the first threshold and the current brightness gain is greater than the second threshold, it is indicated that a clear image can be acquired only when the infrared light source provides brightness under the current environment brightness, and the infrared light source is controlled to be in an on state.
Therefore, the opening and closing of the infrared light source are controlled through the relationship between the current exposure time and the current brightness gain and the first threshold value and the second threshold value respectively, the service time of the infrared light source is reduced on the basis of ensuring the image definition, and the power consumption of the infrared light source is reduced.
In order to further reduce the power consumption generated during the use of the infrared light source, in this embodiment, the current value passing through the infrared light source is also adjusted according to the adjustment of the exposure time and the adjustment of the brightness gain.
Fig. 4 is a flow chart of current value adjustment of the infrared light source according to the embodiment of the present invention. As shown in fig. 4, the current value adjustment of the infrared light source of the present embodiment includes the steps of:
in step S400, the infrared light source is turned on.
In step S401, an initial value of current through the infrared light source is determined.
Preferably, the initial value of the current in this embodiment is specifically a product of a preset luminance gain value and a constant proportionality coefficient.
In step S402, an adjusted exposure time and an adjusted brightness gain are acquired.
In this embodiment, the exposure time is adjusted to be the exposure time of the image of the next frame, and the brightness gain is adjusted to be the brightness gain of the image of the next frame.
In step S403, it is determined whether the adjusted exposure time is equal to or greater than a first threshold.
If yes, go to step S404; otherwise, step S409 is performed.
In step S404, it is determined whether the adjusted luminance gain is equal to or less than a second threshold.
If yes, go to step S405; otherwise, step S406 is performed.
In step S405, the adjustment is ended.
In this embodiment, when the exposure adjustment time is greater than or equal to the first threshold and the brightness adjustment gain is less than or equal to the second threshold, it indicates that a clear image can be acquired by the next frame of image under the corresponding exposure adjustment time and brightness adjustment gain, the use state of the infrared light source does not need to be changed, the adjustment operation is ended, and the current value corresponding to the image of the current target frame is used as the current value of the infrared light source during the next frame of image acquisition.
In step S406, the current value is increased.
In this embodiment, the brightness gain is adjusted to be greater than the second threshold, which indicates that the current ambient brightness is low, and a current value needs to be increased to improve the brightness of the acquired image, so as to ensure the definition of the acquired image.
In this embodiment, the current value of the infrared light source is gradually increased by a preset increment based on the initial current value. Therefore, the current value of the infrared light source is increased in a gradually increasing mode, the brightness of the infrared light source is improved, the image acquisition brightness is further improved, the infrared light source is prevented from being damaged by current mutation, and meanwhile, the electric energy consumption is saved.
In step S407, it is determined whether the adjusted luminance gain is smaller than a second threshold.
If yes, go to step S408; otherwise, the step S406 is executed back.
In this embodiment, when the corresponding brightness gain is greater than or equal to the second threshold after the current value is increased, it indicates that there is still room for improving the quality of the image acquired under the brightness corresponding to the current value of the current infrared light source, and the current value needs to be further increased to improve the quality of the acquired image.
In step S408, the adjustment is ended.
In this embodiment, when the adjusted brightness gain is smaller than the first threshold, it indicates that the brightness corresponding to the current value of the current infrared light source can meet the requirement of the definition when the image is acquired, and the adjustment is finished, which is beneficial to reducing the extra irradiation intensity of the infrared light source and reducing the power consumption.
In step S409, the current value is decreased.
In this embodiment, adjusting the exposure time to be less than the first threshold indicates that the brightness of the current infrared light source is too high, and the current value needs to be reduced to reduce the power consumption of the infrared light source.
Preferably, the current value of the infrared light source is gradually reduced by a preset increment based on the initial value of the current. Therefore, the current value of the infrared light source and the brightness of the infrared light source are reduced in a gradually decreasing mode, the image acquisition brightness is further reduced, and the electric energy consumption is saved while the image acquisition brightness is ensured.
In step S410, it is determined whether the current value is 0.
If yes, go to step S411; otherwise, step S412 is performed.
In step S411, the infrared light source is turned off.
In this embodiment, when the current passing through the infrared light source is 0, the infrared light source is automatically turned off and no power consumption occurs.
In step S412, it is determined whether the adjusted exposure time is less than a first threshold.
If yes, go to step S413; otherwise, the process returns to step S409.
When the corresponding exposure adjusting time is larger than or equal to the second threshold value after the current value is reduced, the current brightness of the infrared light source is larger than the actual requirement, and the current value can be further reduced so as to reduce the power consumption of the infrared light source.
In step S413, the adjustment is ended.
When the corresponding adjustment exposure time is smaller than the first threshold value after the current value is reduced, it is indicated that a higher-quality acquired image can be obtained under the brightness of the current infrared light source, no redundant power consumption is generated, and the adjustment is finished.
The following describes the method for controlling the infrared light source in this embodiment in detail with reference to specific usage scenarios.
In this embodiment, the image capturing device used in capturing the image generates 30 frames of image per second, and the corresponding frame rate value is 30 fps. To ensure that the output frame rate is 30fps, the maximum exposure time per frame is less than 1 second/30. Initial value of current i of infrared light source090mA, constant k of proportionality coefficient 3, and preset brightness gain value g0Is 30. Meanwhile, the first threshold value m in the present embodiment is set to 33 ms. The second threshold n is set to 2, and the preset increment is set to a 10 mA.
In the daytime, when the ambient brightness is sufficiently bright, the exposure time when the image acquisition device acquires each frame of image is less than a first threshold value. For example, the acquired current exposure time is 15ms, which is less than the first threshold value of 33ms, and can meet the quality requirement of the acquired image. Therefore, the infrared light source is not required to provide brightness, i.e., the infrared light source is in an off state.
When the ambient brightness of the image capturing device is dark or dark (e.g., entering a tunnel, garage, or weather blacking), the current exposure time is 33ms, and the current brightness gain is 3.3. At this time, the current exposure time is greater than or equal to the first threshold value, and the brightness adjustment gain is greater than the second threshold value, which indicates that a clear image cannot be acquired under the current ambient brightness, and the infrared light source is adjusted to be in an on state. At this time, the value of the current passing through the infrared light source is equal to the initial current value of 90 mA. On the basis, the exposure adjusting time and the brightness adjusting gain corresponding to the next frame of image are obtained, and the current value of the infrared light source is adjusted according to the exposure adjusting time and the brightness adjusting gain.
When the acquired adjustment brightness gain is equal to the first threshold and the adjustment brightness gain is smaller than the second threshold (for example, the adjustment exposure time is 33ms, and the adjustment brightness gain is 1.5), since the adjustment brightness gain is smaller than the second threshold 2, it indicates that a clear image can be acquired by a next frame of image under the corresponding adjustment exposure time and adjustment brightness gain, the image brightness meets the actual requirement, the use state of the infrared light source does not need to be changed, the current value of the infrared light source does not need to be adjusted, and the adjustment operation is ended.
When the acquired adjustment brightness gain is equal to the first threshold and the adjustment brightness gain is greater than the second threshold (for example, the adjustment exposure time is 33ms, and the adjustment brightness gain is 2.5), since the brightness adjustment gain is greater than the second threshold 2, it indicates that a clear image cannot be acquired under the adjustment exposure time and the adjustment brightness gain corresponding to the next frame of image, and the brightness of the image needs to be improved by increasing the current value of the infrared light source. Meanwhile, the brightness of the infrared light source is improved in a mode of gradually increasing 10mA until the brightness gain is adjusted to be smaller than a second threshold value.
When the brightness of the environment where the image acquisition device is located is increased (for example, the environment leaves a tunnel, a garage or the sky becomes bright), the adjusted exposure time is smaller than a first threshold (for example, the adjusted exposure time is 25ms), which indicates that a clear image can be acquired by the next frame of image under the corresponding adjusted exposure time, and the brightness of the image meets the actual requirement. Therefore, the current value of the infrared light source is reduced in a stepwise manner by 10mA until the current value is reduced to 0, and the time during which the infrared light source is turned off or the exposure time is adjusted is changed to the first threshold value.
The technical scheme of the embodiment of the invention obtains the current exposure time and the current exposure gain corresponding to the target frame image in the video stream and the adjusted exposure time and the adjusted exposure gain corresponding to the next frame image, and dynamically adjusts the working state of the infrared light source in real time according to the current exposure time gain, the current brightness gain, the adjusted exposure time and the adjusted brightness gain. Therefore, the extra use time of the infrared light source is reduced while the image brightness and the image definition are ensured. And when the infrared light source is in an on state, the current value of the infrared light source is dynamically adjusted in real time according to the exposure time adjustment and the brightness gain adjustment, so that the ambient brightness of the infrared light source is improved, the image brightness and the image definition are ensured, and the power consumption of the infrared light source is reduced.
Fig. 5 is a schematic diagram of an infrared light source control apparatus according to an embodiment of the present invention. As shown in fig. 5, the infrared light source control apparatus of the present embodiment includes an acquisition unit 1, a detection unit 2, and a control unit 3.
An obtaining unit 1 is configured to obtain a video stream, where the video stream includes a plurality of frames.
And the detection unit 2 is used for acquiring the current exposure time and the current gain value.
And the control unit 3 is used for controlling the infrared light source according to the current exposure time and the current brightness gain. And the current exposure time is the exposure time of the image of the target frame, and the current brightness gain is the brightness gain of the image of the target frame.
In an alternative implementation, the control unit 3 of the present embodiment includes an opening subunit 31 and a closing subunit 32. Wherein the turn-off subunit 32 is configured to control the infrared light source to turn off in response to the current exposure time being less than the first threshold. The turn-on subunit 31 is configured to control the infrared light source to switch to the on state in response to the current exposure time being equal to or greater than the first threshold and the current brightness gain being greater than the second threshold.
Preferably, the opening subunit 31 of the present embodiment includes a determining module 311, an obtaining module 312, and an adjusting module 313.
The determination module 311 is configured to determine an initial value of the current through the infrared light source. In the present embodiment, the initial value of the current is the product of the preset luminance gain value and the constant proportionality coefficient.
The acquisition module 312 is configured to acquire an adjusted exposure time and an adjusted brightness gain. And adjusting the exposure time to be the exposure time of the image of the next frame, and adjusting the brightness gain to be the brightness gain of the image of the next frame.
The adjusting module 313 is configured to adjust the current value of the infrared light source according to the adjusted exposure time and the adjusted brightness gain.
In particular, the adjusting module 313 of the present embodiment includes an ending sub-module 3131, an incrementing sub-module 3132, and a decrementing sub-module 3133.
The end sub-module 3131 is configured to end the adjustment in response to the adjusted exposure time being equal to or greater than a first threshold and the adjusted brightness gain being less than a second threshold.
In this embodiment, when the exposure time is adjusted to be greater than or equal to the first threshold and the brightness gain is adjusted to be less than the second threshold, the current value corresponding to the current infrared light source is equal to the current initial value, and the image brightness meets the actual requirement without adjustment.
The incrementing sub-module 3132 is configured to increase the current value in response to adjusting the exposure time to be equal to or greater than a first threshold and adjusting the brightness gain to be equal to or greater than a second threshold.
In this embodiment, when the current value is increased, the current value of the infrared light source is gradually increased according to a preset increment with the initial current value as a reference, and the brightness of the infrared light source is increased correspondingly until the brightness gain is adjusted to be smaller than the second threshold.
Decrementing sub-module 3133 is configured to decrease the current value in response to the adjusted exposure time being less than the first threshold.
In this embodiment, when the current value is decreased, the current value of the infrared light source is gradually decreased according to a preset increment with the initial current value as a reference, and the brightness of the infrared light source is decreased until the exposure time is less than the first threshold, or the current of the infrared light source is 0, which is in an off state.
Fig. 6 is a schematic diagram of an electronic device of an embodiment of the invention. As shown in fig. 6, the electronic device of this embodiment includes an image capturing module 4, an infrared light source 5 and a controller 6, where the image capturing module 4 and the infrared light source 5 are respectively in communication connection with the controller 6, and the communication connection is in a wireless or wired connection manner. Alternatively, the image capturing module 4, the infrared light source 5 and the controller 6 may be separately provided as different components or disposed on the same component or terminal device (e.g., a mobile phone) in an integrated manner.
Preferably, the image capturing module 4 may be a CCD camera, a CMOS camera, or other hardware structure with image and video capturing functions, and is used for acquiring a video stream including a plurality of frames, each frame corresponding to an image. The infrared light source 5 may be an LED or a laser infrared lamp, and the image brightness is adjusted by changing the value of current passing through the infrared light source. The controller 6 may be a control chip or other element or device with a data processing function, and is configured to execute a computer program instruction, and adjust the on-off state and the passing current value of the infrared light source according to the current exposure time and the current exposure gain corresponding to the image of the target frame in the video stream and the adjusted exposure time and the adjusted brightness gain corresponding to the image of the next frame of the target frame, so that the usage state of the infrared light dynamically adapts to the ambient brightness, which is convenient for the image capturing device to capture a clear image, and reduces the power consumption of the infrared light source.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus (device) or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may employ a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations of methods, apparatus (devices) and computer program products according to embodiments of the application. It will be understood that each flow in the flow diagrams can be implemented by computer program instructions.
These computer program instructions may be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows.
These computer program instructions may also be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows.
Another embodiment of the invention is directed to a non-transitory storage medium storing a computer-readable program for causing a computer to perform some or all of the above-described method embodiments.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An infrared light source control method, characterized in that the method comprises:
acquiring a video stream, wherein the video stream comprises a plurality of frames;
acquiring current exposure time and current brightness gain, wherein the current exposure time is the exposure time of an image of a target frame, and the current brightness gain is the brightness gain of the image of the target frame; and
controlling the infrared light source according to the current exposure time and the current brightness gain;
wherein the controlling the infrared light source according to the current exposure time and the current brightness gain specifically comprises:
preferentially controlling the infrared light source according to the current exposure time; and
and when the current exposure time meets a preset condition, controlling the infrared light source according to the current exposure time and the current brightness gain.
2. The method of claim 1, wherein said controlling the infrared light source according to the current exposure time and the current brightness gain comprises:
controlling the infrared light source to be turned off in response to the current exposure time being less than the first threshold; and
and controlling the infrared light source to be switched to an on state in response to the current exposure time being greater than or equal to a first threshold value and the current brightness gain being greater than a second threshold value.
3. The method of claim 1, wherein the controlling the infrared light source to switch to an on state comprises:
determining an initial value of current through the infrared light source;
acquiring exposure time adjustment and brightness gain adjustment; and
adjusting the current value of the infrared light source according to the adjusted exposure time and the adjusted brightness gain;
and the adjusted exposure time is the exposure time of the image of the next frame, and the adjusted brightness gain is the brightness gain of the image of the next frame.
4. The method of claim 3, wherein the initial value of the current is a product of a preset luminance gain value and a constant scaling factor.
5. The method of claim 3, wherein said adjusting the current value of the infrared light source according to the adjusted exposure time and the adjusted brightness gain comprises:
in response to the adjusted exposure time being equal to or greater than a first threshold and the adjusted brightness gain being equal to or less than the second threshold, ending the adjustment;
triggering a current value increase adjusting strategy in response to the adjusting exposure time being greater than or equal to a first threshold value and the adjusting brightness gain being greater than a second threshold value until the adjusting brightness gain is less than or equal to the second threshold value; and
and triggering a current value reduction regulation strategy in response to the regulated exposure time being smaller than a first threshold value until the regulated exposure time is larger than or equal to the first threshold value or the infrared light source is turned off.
6. The method according to claim 5, wherein the current value increase adjustment strategy is specifically:
and gradually increasing the current value of the infrared light source according to a preset increment by taking the initial current value as a reference.
7. The method according to claim 5, wherein the current value reduction adjustment strategy is in particular:
and gradually reducing the current value of the infrared light source according to a preset increment by taking the initial current value as a reference.
8. An infrared light source control apparatus, characterized in that the apparatus comprises:
an acquisition unit configured to acquire a video stream, the video stream including a plurality of frames;
the detection unit is used for acquiring current exposure time and a current gain value, wherein the current exposure time is the exposure time of an image of a target frame, and the current brightness gain is the brightness gain of the image of the target frame; and
a control unit, configured to control the infrared light source according to the current exposure time and the current brightness gain, where the controlling the infrared light source according to the current exposure time and the current brightness gain specifically includes: preferentially controlling the infrared light source according to the current exposure time; and when the current exposure time meets a preset condition, controlling the infrared light source according to the current exposure time and the current brightness gain.
9. An electronic device, characterized in that the electronic device comprises:
the image acquisition module is used for acquiring an image;
the infrared light source is used for adjusting the image brightness; and
a controller configured to execute computer program instructions;
wherein the computer program instructions are executed by a controller to implement the method of claims 1-7.
10. A readable storage medium on which computer program instructions are stored, which computer program instructions, when executed by a processor, implement the method of any one of claims 1-7.
CN202011042348.9A 2020-09-28 2020-09-28 Infrared light source control method and device, electronic equipment and readable storage medium Active CN112153302B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011042348.9A CN112153302B (en) 2020-09-28 2020-09-28 Infrared light source control method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011042348.9A CN112153302B (en) 2020-09-28 2020-09-28 Infrared light source control method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112153302A CN112153302A (en) 2020-12-29
CN112153302B true CN112153302B (en) 2022-04-15

Family

ID=73894172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011042348.9A Active CN112153302B (en) 2020-09-28 2020-09-28 Infrared light source control method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112153302B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113271414B (en) * 2020-02-14 2022-11-18 上海海思技术有限公司 Image acquisition method and device
CN114019746A (en) * 2021-11-05 2022-02-08 资阳联耀医疗器械有限责任公司 LED calibration method and system
CN117129191B (en) * 2023-10-24 2024-02-06 徐州徐工汽车制造有限公司 Infrared lamp fault diagnosis method, controller, camera system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202537A (en) * 2014-09-05 2014-12-10 天彩电子(深圳)有限公司 Dimming method for infrared camera
CN105611127A (en) * 2015-12-28 2016-05-25 天津鼎视汇达科技有限公司 Intelligent light supply system for infrared dome camera
CN105874779A (en) * 2015-03-31 2016-08-17 深圳市大疆创新科技有限公司 An image forming apparatus, a light filling control method thereof, a system, and a movable object
CN106534712A (en) * 2016-10-24 2017-03-22 北京旷视科技有限公司 Control method, image processing unit, light-filling and camera device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100950465B1 (en) * 2007-12-21 2010-03-31 손승남 Camera control method for vehicle enrance control system
CN101873437B (en) * 2009-09-15 2012-01-25 杭州海康威视系统技术有限公司 Method and device for regulating exposure
CN102291538A (en) * 2011-08-17 2011-12-21 浙江博视电子科技股份有限公司 Automatic exposure method and control device of camera
CN102509452B (en) * 2011-10-19 2014-04-02 杭州海康威视数字技术股份有限公司 Flashlight control method of intelligent traffic monitoring system and device thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104202537A (en) * 2014-09-05 2014-12-10 天彩电子(深圳)有限公司 Dimming method for infrared camera
CN105874779A (en) * 2015-03-31 2016-08-17 深圳市大疆创新科技有限公司 An image forming apparatus, a light filling control method thereof, a system, and a movable object
CN105611127A (en) * 2015-12-28 2016-05-25 天津鼎视汇达科技有限公司 Intelligent light supply system for infrared dome camera
CN106534712A (en) * 2016-10-24 2017-03-22 北京旷视科技有限公司 Control method, image processing unit, light-filling and camera device

Also Published As

Publication number Publication date
CN112153302A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN112153302B (en) Infrared light source control method and device, electronic equipment and readable storage medium
CN110351490B (en) Exposure method, exposure device and image pickup equipment
CN111418200B (en) Adaptive infrared illumination for exposure correction
JP5981053B2 (en) Imaging device with scene-adaptive automatic exposure compensation
JP4835593B2 (en) Image processing apparatus, image processing method, program, and recording medium
CN100389362C (en) Exposure regulating method and device
JPWO2006098358A1 (en) Image processing apparatus and method, program, and recording medium
CN103533252A (en) Method and device for automatically switching day and night modes
US10999520B2 (en) Image capture device, method of image capture, signal processing device, method of signal processing, and program
US11153504B2 (en) Flash control for video capture
CN105163039A (en) Control method and control device
EP3190784A1 (en) Method and apparatus for switching region of interest
JP2009017474A (en) Image processing unit and image processing method
CN112036201B (en) Image processing method, device, equipment and medium
JP2009188900A (en) Solar illumination lamp device with monitor camera
JP2017063245A (en) Imaging device
JP7447041B2 (en) A method for evaluating ambient light during night mode image acquisition
EP2863717A2 (en) Power measurement system, method of synchronizing power measurement device information and method of displaying consumed power
JP4457150B2 (en) How to display images taken with a video camera
CN115767282A (en) Fill light brightness control method, terminal device and computer readable storage medium
US8421896B2 (en) Electronic camera with plurality of imaging mode including a self imaging mode
CN103581564A (en) Iris control system and method of photographic device
WO2023236215A1 (en) Image processing method and apparatus, and storage medium
JP2014220762A (en) Imaging apparatus
JP6439635B2 (en) Lighting control system, lighting control program, and lighting control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220420

Address after: Room 203, 2 / F, building 34, yard 8, Dongbei Wangxi Road, Haidian District, Beijing 100193

Patentee after: Beijing Qisheng Technology Co.,Ltd.

Patentee after: HANGZHOU QINGQI SCIENCE AND TECHNOLOGY Co.,Ltd.

Patentee after: Xiamen Qiwen Technology Co.,Ltd.

Address before: Room 203, 2 / F, building 34, yard 8, Dongbei Wangxi Road, Haidian District, Beijing 100193

Patentee before: Beijing Qisheng Technology Co.,Ltd.