CN108289164A - A kind of mode switching method and device of the video camera with infrared light compensating lamp - Google Patents
A kind of mode switching method and device of the video camera with infrared light compensating lamp Download PDFInfo
- Publication number
- CN108289164A CN108289164A CN201710014669.XA CN201710014669A CN108289164A CN 108289164 A CN108289164 A CN 108289164A CN 201710014669 A CN201710014669 A CN 201710014669A CN 108289164 A CN108289164 A CN 108289164A
- Authority
- CN
- China
- Prior art keywords
- illumination
- intensity
- night
- state
- current
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/66—Remote control of cameras or camera parts, e.g. by remote control devices
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/64—Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/74—Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
An embodiment of the present invention provides a kind of mode switching method and device of the video camera with infrared light compensating lamp, method includes:The current intensity of illumination of video camera was obtained periodically and the first scene state that a upper period determines, the first scene state includes state or night state on daytime;If the first scene state determines the scene state in this period for state on daytime according to current intensity of illumination and preset daylight intensity threshold;According to the scene state in this period, it is determined to switch to night mode or keeps day mode;If the first scene state is night state, image when according to the current intensity of illumination of acquisition calculates and obtains current red component/green component ratio;According to current intensity of illumination, the threshold value of current red component/green component ratio, night intensity of illumination threshold value and preset red component/green component ratio, the scene state in this period is determined;According to the scene state in this period, it is determined to switch to day mode or keeps night mode.
Description
Technical field
The present invention relates to field of cameras, more particularly to a kind of pattern switching side of the video camera with infrared light compensating lamp
Method and device.
Background technology
Need the video camera to work under the different illumination intensities such as daytime, night, common configuration infrared light compensating lamp and infrared
Optical filter automatically switches the pattern of camera operation by judging scene state.The one mode switching side of existing video camera
Method is:Using intensity of illumination and preset threshold value comparison, when intensity of illumination is more than threshold value, determine that scene state is shape on daytime
Pattern switching is day mode, closes infrared light compensating lamp by state, and infrared fileter is switched to the infrared optical mode of cut-off, is prevented
Infrared light, which enters, causes image color cast;When intensity of illumination is less than or equal to threshold value, determine that scene state is night state, by mould
Formula is switched to night mode, opens infrared light compensating lamp, and infrared fileter is switched to infrared light responsive pattern, promotes night vision effect.
As it can be seen that the mode switching method of the prior art is judged, to determine scene state, to judge using only intensity of illumination
Accuracy it is not high, cause camera mode switch accuracy it is not high.
Invention content
A kind of mode switching method for being designed to provide the video camera with infrared light compensating lamp of the embodiment of the present invention and
Device, to improve the accuracy of camera mode switching.Specific technical solution is as follows:
An embodiment of the present invention provides a kind of mode switching methods of the video camera with infrared light compensating lamp, including:
The first scene state that the current intensity of illumination of acquisition video camera and a upper period determine periodically, described first
Scene state includes state or night state on daytime;
If first scene state is state on daytime, according to the current intensity of illumination and preset daylight
Intensity threshold determines the scene state in this period;
According to the scene state in described period, it is determined to switch to night mode or keeps day mode;
If first scene state is night state, according to image when obtaining the current intensity of illumination, meter
It calculates and obtains current red component/green component ratio;
According to the current intensity of illumination, the current red component/green component ratio, night intensity of illumination threshold
The threshold value of value and preset red component/green component ratio, determines the scene state in this period;
According to the scene state in described period, it is determined to switch to day mode or keeps night mode.
Optionally, described the step of obtaining the current intensity of illumination of video camera periodically, including:
A length of period, imaging sensor amplifying circuit when obtaining shooting current frame image when corresponding with one frame image of shooting
Current gain and current exposure time;
Calculate the average value of red pixel component, the average value of green pixel component and the blue pixel point of current frame image
The average value of amount;
According to the average value of the red pixel component, the average value of the green pixel component and the blue pixel point
The average value of amount calculates the average brightness for obtaining current frame image;
According to the average brightness of the current frame image, the current gain and the current exposure time, obtain current
Intensity of illumination;
The calculating obtains the step of current red component/green component ratio, is:It calculates and obtains the red pixel point
The ratio of the average value of amount and the average value of the green pixel component.
Optionally, if first scene state is state on daytime, according to the current intensity of illumination and in advance
If daylight intensity threshold, the step of determining the scene state in this period, including:
In the case where first scene state is state on daytime, judge whether to meet the first decision condition, and full
In the case of foot first decision condition, by switching points plus the first preset quantity;Do not meeting first decision condition
In the case of, it will the switching points preset quantity that subtracts the second;First decision condition is:Current intensity of illumination is less than preset
Daylight intensity threshold;
Judge whether switching points are more than preset switching points threshold value, if so, determining that the scene state in this period is
Night state, and switching points are reset;If not, it is determined that the scene state in this period is state on daytime.
Optionally, the night intensity of illumination threshold value includes:It is limited in night intensity of illumination upper limit threshold, night intensity of illumination
Threshold value, preset night intensity of illumination expanded threshold value;Wherein, the night intensity of illumination upper limit threshold is more than the night illumination
Threshold value is limited in intensity;
It is described strong according to the current intensity of illumination, the current red component/green component ratio, night illumination
Spend the threshold value of threshold value and preset red component/green component ratio, the step of determining the scene state in this period, including:
Judge whether to meet the second decision condition, and in the case where meeting second decision condition, switching is counted
Add the first preset quantity;It, will the switching points preset quantity that subtracts the second in the case where not meeting second decision condition;It is described
Second decision condition is:Current intensity of illumination is greater than or equal to night intensity of illumination upper limit threshold, and is greater than or equal to night
Intensity of illumination expanded threshold value, and current red component/green component ratio is less than preset red component/green component ratio
Threshold value;Or, current intensity of illumination is greater than or equal to night intensity of illumination expanded threshold value, and it is strong less than or equal to night illumination
Threshold value is limited in degree, and current red component/green component ratio is less than the threshold of preset red component/green component ratio
Value;
Judge whether switching points are more than preset switching points threshold value, if so, determining that the scene state in this period is
Daytime state, and will switching points reset;If not, it is determined that the scene state in this period is night state.
Optionally, the method further includes:
When the first scene state is state on daytime, this period switches to after night mode, obtains third preset quantity
The current intensity of illumination in period, and calculate the average value for the current intensity of illumination for obtaining the third preset quantity period;
Pass through the average value of the current intensity of illumination in the third preset quantity period, preset night intensity of illumination
Threshold coefficient is limited in upper limit threshold coefficient and preset night intensity of illumination, redefines night intensity of illumination upper limit threshold and night
Threshold value is limited in late intensity of illumination, so that in second decision condition in period later, it is strong using the night illumination redefined
Threshold value is limited in degree upper limit threshold and night intensity of illumination.
Optionally, the average value of the current intensity of illumination by the third preset quantity period, preset
Threshold coefficient is limited in night intensity of illumination upper limit threshold coefficient and preset night intensity of illumination, redefines night intensity of illumination
Threshold value is limited in upper limit threshold and night intensity of illumination, including:
Night intensity of illumination upper limit threshold is redefined according to formula th_high=i_avg* α and th_mid=i_avg* β
And limit threshold value in night intensity of illumination;Wherein, the th_high is the night intensity of illumination upper limit threshold, and the i_avg is
The average value of the current intensity of illumination in the third preset quantity period, the α are the preset night intensity of illumination
Upper limit threshold coefficient, the th_mid are that threshold value is limited in the night intensity of illumination, and the β is that the preset night illumination is strong
Threshold coefficient is limited in degree.
An embodiment of the present invention provides a kind of mode-changeover devices of the video camera with infrared light compensating lamp, including:
Acquisition module, the first scene for obtaining the current intensity of illumination of video camera and the determination of a upper period periodically
State, first scene state include state or night state on daytime;
First scene state determining module, if being state on daytime for first scene state, according to described current
Intensity of illumination and preset daylight intensity threshold, determine the scene state in this period;
First mode handover module is determined to switch to night mode or guarantor for the scene state according to described period
Hold day mode;
Night state computation module, it is described current according to obtaining if being night state for first scene state
Intensity of illumination when image, calculate and obtain current red component/green component ratio;
Second scene state determining module, for according to the current intensity of illumination, the current red component/green
The threshold value of colouring component ratio, night intensity of illumination threshold value and preset red component/green component ratio, determines the field in this period
Scape state;
Second mode handover module is determined to switch to day mode or guarantor for the scene state according to described period
Hold night mode.
Optionally, the acquisition module, including:
Gain and time for exposure acquisition submodule, in a length of period, obtain shooting when being used for corresponding with one frame image of shooting
The current gain and current exposure time of imaging sensor amplifying circuit when current frame image;
Pixel component computational submodule, average value, the green pixel of the red pixel component for calculating current frame image
The average value of the average value and blue pixel component of component;
Average brightness computational submodule, for average value, the green pixel component according to the red pixel component
Average value and the blue pixel component average value, calculate obtain current frame image average brightness;
Intensity of illumination computational submodule, for the average brightness, the current gain and institute according to the current frame image
Current exposure time is stated, current intensity of illumination is obtained;
The night state computation module, is specifically used for:Calculate obtain the average value of the red pixel component with it is described
The ratio of the average value of green pixel component.
Optionally, the first scene state determining module, including:
First decision sub-module, in the case where first scene state is state on daytime, judging whether to meet
First decision condition, and in the case where meeting first decision condition, by switching points plus the first preset quantity;Less than
It, will the switching points preset quantity that subtracts the second in the case of foot first decision condition;First decision condition is:Current
Intensity of illumination is less than preset daylight intensity threshold;
First scene state determination sub-module, for judging whether switching points are more than preset switching points threshold value, if
It is, it is determined that the scene state in this period is night state, and switching points are reset;If not, it is determined that the scene in this period
State is state on daytime.
Optionally, the night intensity of illumination threshold value includes:It is limited in night intensity of illumination upper limit threshold, night intensity of illumination
Threshold value, preset night intensity of illumination expanded threshold value;Wherein, the night intensity of illumination upper limit threshold is more than the night illumination
Threshold value is limited in intensity;
The second scene state determining module, including:
Second decision sub-module meets the second decision condition for judging whether, and is meeting second decision condition
In the case of, by switching points plus the first preset quantity;In the case where not meeting second decision condition, switching is counted
The preset quantity that subtracts the second;Second decision condition is:Current intensity of illumination is greater than or equal to night intensity of illumination upper limit threshold
Value, and it is greater than or equal to night intensity of illumination expanded threshold value, and current red component/green component ratio is less than preset red
The threshold value of colouring component/green component ratio;Or, current intensity of illumination is greater than or equal to night intensity of illumination expanded threshold value, and
Less than or equal to limiting threshold value in night intensity of illumination, and current red component/green component ratio is less than preset red point
The threshold value of amount/green component ratio;
Second scene state determination sub-module, for judging whether switching points are more than preset switching points threshold value, if
It is, it is determined that the scene state in this period is state on daytime, and switching points are reset;If not, it is determined that the scene in this period
State is night state.
Optionally, the first mode handover module, including:
First mode keeps submodule, for being state on daytime according to the scene state in described period, determines and keeps white
Day mode;
First mode switching submodule is determined to switch to for being night state according to the scene state in described period
Night mode;
Described device further includes:
Intensity of illumination mean value calculation module, for being state on daytime when the first scene state, the first mode switching
After this period is switched to night mode by submodule, the current intensity of illumination in third preset quantity period is obtained, and is counted
Calculate the average value for the current intensity of illumination for obtaining the third preset quantity period;
Night intensity of illumination threshold calculation module, for strong by the current illumination in the third preset quantity period
Threshold coefficient is limited in the average value of degree, preset night intensity of illumination upper limit threshold coefficient and preset night intensity of illumination, weight
New determine in night intensity of illumination upper limit threshold and night intensity of illumination limits threshold value, so that second in the period later judges item
In part, using limiting threshold value in the night intensity of illumination upper limit threshold and night intensity of illumination redefined.
Optionally, the night intensity of illumination threshold calculation module, is specifically used for:
Night intensity of illumination upper limit threshold is redefined according to formula th_high=i_avg* α and th_mid=i_avg* β
And limit threshold value in night intensity of illumination;Wherein, the th_high is the night intensity of illumination upper limit threshold, and the i_avg is
The average value of the current intensity of illumination in the third preset quantity period, the α are the preset night intensity of illumination
Upper limit threshold coefficient, the th_mid are that threshold value is limited in the night intensity of illumination, and the β is that the preset night illumination is strong
Threshold coefficient is limited in degree.
The mode switching method and device of video camera provided in an embodiment of the present invention with infrared light compensating lamp, first period
The first scene state that ground obtains the current intensity of illumination of video camera and a upper period determines.If the first scene state is daytime
State determines the scene state in this period then according to current intensity of illumination and preset daylight intensity threshold, and according to
The scene state in this period is determined to switch to night mode or keeps day mode;If the first scene state is night state,
Image when according to the current intensity of illumination of acquisition, calculates and obtains current red component/green component ratio, according to current
Intensity of illumination, current red component/green component ratio, night intensity of illumination threshold value and preset red component/green point
The threshold value for measuring ratio, determines the scene state in this period, and according to the scene state in this period, be determined to switch to day mode or
Keep night mode.
The embodiment of the present invention is utilized in the case where infrared light compensating lamp is opened, and red component caused by infrared external reflection light/
The larger principle of green component ratio, daytime state and when night state using the decision condition of different scene states,
When night state, not merely with current intensity of illumination and night intensity of illumination threshold value comparison, red component/green point is also introduced
Measure ratio and preset red component/green component ratio threshold value comparison, compared with the prior art be used only intensity of illumination and
For intensity of illumination threshold value comparison to determine scene state, the decision condition of the embodiment of the present invention is more fine, can obtain accuracy
The judging result of higher scene state, so as to obtain the higher pattern switching result of accuracy.Certainly, implement the present invention
Any product or method must be not necessarily required to reach all the above advantage simultaneously.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of flow chart of the mode switching method of the video camera with infrared light compensating lamp of the embodiment of the present invention;
Fig. 2 is another flow of the mode switching method of the video camera with infrared light compensating lamp of the embodiment of the present invention
Figure;
Fig. 3 changes over time signal for red component/green component ratio in the mode handover procedure of the embodiment of the present invention
Figure;
Fig. 4 changes over time schematic diagram for intensity of illumination in the mode handover procedure of the embodiment of the present invention corresponding with Fig. 3;
Fig. 5 is a kind of structure chart of the mode-changeover device of the video camera with infrared light compensating lamp of the embodiment of the present invention;
Fig. 6 is another structure of the mode-changeover device of the video camera with infrared light compensating lamp of the embodiment of the present invention
Figure.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a kind of mode switching methods and device of the video camera with infrared light compensating lamp, can
Improve the accuracy of camera mode switching.It a kind of is taken the photograph first below with infrared light compensating lamp to provided in an embodiment of the present invention
The mode switching method of camera is introduced.
The video camera to work under the different illumination intensities such as daytime, night, common configuration infrared light compensating lamp and infrared filtering
Piece, by intensity of illumination and preset threshold value comparison, the automatic judgement for carrying out scene state, and according to the judgement knot of scene state
Fruit carries out the pattern switching of video camera.But the mode switching method of the prior art is judged using only intensity of illumination to determine field
The accuracy of scape state, judgement is not high, causes the accuracy of the pattern switching of video camera not high.
The embodiment of the present invention uses different decision conditions for state on daytime and night state, is being for a upper period
When night state, by current intensity of illumination and multiple night intensity of illumination threshold value comparisons, while by current red component/green
The threshold value comparison of colouring component ratio and preset red component/green component ratio, scene state is determined by comparing result.This
For inventive embodiments using decision condition unlike the prior art, the decision condition is more fine, can obtain accuracy higher
Scene state judging result, so as to obtain the higher pattern switching result of accuracy.
It is one kind of the mode switching method of the video camera with infrared light compensating lamp of the embodiment of the present invention referring to Fig. 1, Fig. 1
Flow chart.Include the following steps:
Step 101, the first scene state of the current intensity of illumination of video camera and the determination of a upper period was obtained periodically.
Intensity of illumination is by the energy of the visible light received on camera unit area.In the embodiment of the present invention, with illumination
The size of intensity weighs the degree of strength of camera environment light.
The period of the embodiment of the present invention is the time span according to settings such as industrial requirement or camera properties, and the period is with the second
Or the meters such as millisecond.Such as, a length of period when the embodiment of the present invention can be corresponding with one frame image of shooting, wherein one frame figure of shooting
As corresponding duration is related to the characteristic of the imaging sensor of video camera, it is corresponding that different imaging sensors shoots a frame image
Duration is different, such as 40 milliseconds.
First scene state is the scene state determined in a upper period, and the first scene state includes state or night shape on daytime
State.
It should be noted that if the first scene is state on daytime, then it represents that upper period video camera is day mode,
I.e.:Infrared light compensating lamp is in off state, and infrared fileter is to end infrared optical mode;If the first scene is night state,
Indicate that upper period video camera is night mode, i.e.,:Infrared light compensating lamp is open state, and infrared fileter is infrared light responsive mould
Formula.
Step 102, if the first scene state is state on daytime, according to current intensity of illumination and preset daylight
Intensity threshold determines the scene state in this period.
In the embodiment of the present invention, when the first scene state is state on daytime, the decision condition of the scene state of use can
Similarly to the prior art, i.e., to be compared using current intensity of illumination and preset daylight intensity threshold, according to than
Relatively result determines the scene state in this period for state on daytime or night state.
Preset daylight intensity threshold is obtained according to industrial requirement, camera properties or a large amount of empirical datas etc.
Numerical value.
Step 103, it according to the scene state in this period, is determined to switch to night mode or keeps day mode.
In the embodiment of the present invention, the scene state in this period determined according to step 102 is night state, determines video camera
Pattern switching to night mode;Alternatively, the scene state in this period determined according to step 102 is state on daytime, determination is taken the photograph
The pattern of camera keeps day mode.
Step 104, if the first scene state is night state, image when according to the current intensity of illumination of acquisition, meter
It calculates and obtains current red component/green component ratio.
In the embodiment of the present invention, when the first scene state is night state, when according to the current intensity of illumination of acquisition
Image calculates and obtains current red component/green component ratio, current red component/green component ratio is used for
In scene state judgement when first scene state is night state.
Image when wherein, according to the current intensity of illumination of acquisition, calculates and obtains current red component/green component ratio
Value belongs to the prior art, and this will not be repeated here.
Step 105, according to current intensity of illumination, current red component/green component ratio, night intensity of illumination threshold
The threshold value of value and preset red component/green component ratio, determines the scene state in this period.
In the embodiment of the present invention, when the first scene state be night state when, the decision condition of the scene state of use with
The prior art is different, i.e.,:It is not compared merely with current intensity of illumination and preset night intensity of illumination threshold value, also utilizes
The threshold value of current red component/green component ratio and preset red component/green component ratio is compared, according to two
A comparison result synthesis determines the scene state in this period for state on daytime or night state.
The embodiment of the present invention is for the decision condition that the first scene state is night state, than the decision condition of the prior art
It is finer, the judging result accuracy higher of the scene state of acquisition.
Step 106, it according to the scene state in this period, is determined to switch to day mode or keeps night mode.
In the embodiment of the present invention, the scene state in this period determined according to step 105 is state on daytime, determines video camera
Pattern switching to day mode;Alternatively, the scene state in this period determined according to step 105 is night state, determination is taken the photograph
The pattern of camera keeps night mode.
As it can be seen that the mode switching method of the video camera provided in an embodiment of the present invention with infrared light compensating lamp, first period
The first scene state that ground obtains the current intensity of illumination of video camera and a upper period determines.Then according to different first
Scape state uses different decision conditions to obtain the judgement of scene state as a result, and carrying out video camera according to judgement result
Pattern switching, i.e.,:If the first scene state is state on daytime, according to current intensity of illumination and preset daylight intensity
Threshold value determines the scene state in this period, and according to the scene state in this period, is determined to switch to night mode or is kept for daytime
Pattern;If the first scene state is night state, image when according to the current intensity of illumination of acquisition is calculated and is obtained currently
Red/green component ratio, according to current intensity of illumination, current red component/green component ratio, night intensity of illumination
The threshold value of threshold value and preset red component/green component ratio determines the scene state in this period, and according to the field in this period
Scape state is determined to switch to day mode or keeps night mode.The embodiment of the present invention, which is utilized, opens in infrared light compensating lamp
In the case of, infrared external reflection light causes red component/larger principle of green component ratio, daytime state and when night state adopt
With the decision condition of different scene states, in night state, not merely with current intensity of illumination and night intensity of illumination
Threshold value comparison also introduces the threshold value comparison of red component/green component ratio and preset red component/green component ratio,
Compared with the prior art using only intensity of illumination and intensity of illumination threshold value comparison to determine that scene state, the embodiment of the present invention are sentenced
Fixed condition is more fine, can obtain the judging result of the higher scene state of accuracy, so as to obtain accuracy higher
Pattern switching result.
It is the video camera with infrared light compensating lamp of the embodiment of the present invention referring to Fig. 2, Fig. 2 as another embodiment
Another flow chart of mode switching method.Include the following steps:
Step 211, a length of period when corresponding with one frame image of shooting, the current intensity of illumination of acquisition video camera, and on
The first scene state that one period determined.Wherein, the first scene state includes state or night state on daytime.
In the embodiment of the present invention, obtain the current intensity of illumination of video camera periodically and belong to the prior art, may include with
Lower step:
The first step, a length of period, imaging sensor when obtaining shooting current frame image when corresponding with one frame image of shooting
The current gain and current exposure time of amplifying circuit.
In the embodiment of the present invention, the period is that video camera shoots the corresponding duration of a frame image, the figure of the duration and video camera
As the characteristic correlation of sensor, which can also be configured according to industrial requirement or according to user demand.The duration with
The meters such as second or millisecond.Such as with 1 second beats take the photograph 25 frame images calculate, shooting one frame image when it is 40 milliseconds a length of.
In the embodiment of the present invention, the current gain of imaging sensor amplifying circuit when shooting a current frame image is obtained
Current gain and current exposure time are used for the calculating of the 4th step by Gain and current exposure time Exposure.
It should be noted that the unit of the current gain in the embodiment of the present invention needs to be converted to multiple from dB.
Second step calculates the average value of the red pixel component of current frame image, the average value and indigo plant of green pixel component
The average value of colour prime component.
By existing optical knowledge it is found that light is after the color filter array of the imaging sensor of video camera, image
Each pixel is the one-component in three red pixel component, green pixel component, blue pixel component components.Red pixel
Component, green pixel component, blue pixel component are indicated with R component, G components, B component respectively.In the embodiment of the present invention, calculate
The average value of all pixels component is denoted as the average value Ravg of red pixel component, the average value of green pixel component respectively
Gavg, the average value Bavg of blue pixel component.
Third walks, according to the average value of red pixel component, the average value of green pixel component and blue pixel component
Average value calculates the average brightness for obtaining current frame image.
The average brightness of one frame image is the average value of red pixel component, the average value of green pixel component, blue picture
The weighting of the average value of prime component, average brightness are formulated as:
Brightness=CoefR_Y*Ravg+CoefG_Y*Gavg+CoefB_Y*Bavg
Wherein, Brightness is the average brightness of current frame image, and CoefR_Y is the weighting system of red pixel component
Number, CoefG_Y are the weighting coefficient of green pixel component, and CoefB_Y is the weighting coefficient of blue pixel component.Wherein,
CoefR_Y, CoefG_Y, CoefB_Y are given value.
4th step obtains current illumination according to the average brightness, current gain and current exposure time of current frame image
Intensity.
The calculation formula of current intensity of illumination Illumination is:
Illumination=Brightness/Gain/Exposure
Step 212, in the case where the first scene state is state on daytime, judge whether to meet the first decision condition,
In, the first decision condition is:Current intensity of illumination is less than preset daylight intensity threshold.If meeting the first judgement item
Part thens follow the steps 213, by switching points plus the first preset quantity;If not meeting the first decision condition, then follow the steps
218, will the switching points preset quantity that subtracts the second, and continue to execute step 219, determine that the scene state in this period is shape on daytime
State.In the embodiment of the present invention, for scene state be daytime state use the first decision condition, first decision condition with it is existing
Technology is similar, and the first decision condition is formulated as:
Illumination<th_low
Wherein, Illumination is current intensity of illumination, and th_low is preset daylight intensity threshold, th_
Low is fixed value.
It should be noted that the first preset quantity and the second preset quantity are, according to industrial requirement, user demand and according to
The numerical value of the settings such as a large amount of empirical datas, the first preset quantity and the second preset quantity can change according to demand.As
Preferred embodiment, the first preset quantity value in the embodiment of the present invention are 1, and the second preset quantity value is 2.
Step 214, judge whether switching points are more than preset switching points threshold value th_switch, if so, executing step
Rapid 215, it determines that the scene state in this period is night state, and continue to execute step 216, switching points is reset;If it is not, then
Step 219 is executed, determines that the scene state in this period is state on daytime.
After the embodiment of the present invention obtains judgement result using the first decision condition, this is not determined according to judgement result immediately
The scene state in period simultaneously carries out pattern switching, but accumulates multiple periods, when switching points are more than switching points threshold value,
It just determines the scene state in this period and carries out pattern switching.Accumulation of the embodiment of the present invention multiple periods carry out judging to avoid
The pattern of video camera caused by frequent mode switching shakes problem.
Step 217, the scene state in this period determined according to step 215 is night state, determines the pattern of video camera
Switch to night mode.
Step 220, the scene state in this period determined according to step 219 is state on daytime, determines the pattern of video camera
Keep day mode.
Present invention method further includes after the pattern switching to night mode that step 217 determines video camera, opening
Infrared light compensating lamp is opened, infrared fileter is switched to infrared light responsive pattern;With, step 220 determine video camera pattern keep
After day mode, infrared light compensating lamp is remained turned-off, it is to end infrared optical mode to keep infrared fileter.
In the embodiment of the present invention, when the first scene state is state on daytime, this period switches to after night mode, obtains
The current intensity of illumination in third preset quantity period, and the current illumination for calculating the acquisition third preset quantity period is strong
The average value of degree.Pass through the average value of the current intensity of illumination in third preset quantity period, preset night intensity of illumination
Threshold coefficient is limited in upper limit threshold coefficient and preset night intensity of illumination, redefines night intensity of illumination upper limit threshold and night
Threshold value is limited in late intensity of illumination, so that in second decision condition in period later, it is strong using the night illumination redefined
Threshold value is limited in degree upper limit threshold and night intensity of illumination.Specifically include following steps:
Step 221, next frame is waited for.
Step 222, current intensity of illumination Illumination is obtained.
Step 223, the current intensity of illumination for judging whether to have obtained the third preset quantity period, specifically, sentencing
The disconnected intensity of illumination Illumination for whether having obtained N frames.If so, thening follow the steps 224, the current light of N frames is calculated
According to the average value i_avg of intensity;If it is not, then returning to step 221.Wherein, third preset quantity is N, and N is more than 0
Natural number, such as 10.
Step 225, night intensity of illumination is redefined according to formula th_high=i_avg* α and th_mid=i_avg* β
Threshold value is limited in upper limit threshold and night intensity of illumination, so that in second decision condition in period later, using redefining
Night intensity of illumination upper limit threshold and night intensity of illumination in limit threshold value.
Wherein, th_high is night intensity of illumination upper limit threshold, and i_avg is the current of third preset quantity period
The average value of intensity of illumination, α are preset night intensity of illumination upper limit threshold coefficient, and th_mid is to limit threshold in night intensity of illumination
Value, β are to limit threshold coefficient in preset night intensity of illumination.Different numerical value can be arranged in α and β according to demand, such as α=1.25, β
=0.75.
The night intensity of illumination threshold value that present invention method is different from the prior art is a fixed value, but according to white
Day mode has just been switched to average value, the night intensity of illumination upper limit threshold of the intensity of illumination in preset time period after night mode
Threshold coefficient is limited in coefficient, night intensity of illumination, updates night intensity of illumination upper limit threshold, night light in the second decision condition
According to limiting threshold value in intensity.Therefore, present invention method can obtain and the higher night light of existing scene state matching degree
According to intensity threshold, the higher scene state judging result of accuracy is obtained, to obtain the higher pattern switching result of accuracy.
It should be noted that during the step 221 of the embodiment of the present invention to step 225, stop the judgement of scene state
And pattern switching, but since the process used time is extremely short, in milliseconds, therefore have no effect on the scene shape of present invention method
The accuracy of state and pattern switching.
Step 226, if the first scene state is night state, image when according to the current intensity of illumination of acquisition, meter
Calculate the ratio of the average value and the average value of green pixel component that obtain red pixel component.
In the embodiment of the present invention, according to the average value for each pixel component that second step in step 211 obtains, calculating is worked as
Preceding red component/green component ratio is R-G Ratio=Ravg/Gavg.
By existing optical knowledge it is found that the R-G Ratio of normal environment light are usually than the R-G of individual infrared external reflection light
Ratio is small.When opening infrared light compensating lamp, the collected light of imaging sensor=normal environment light of video camera+infrared anti-
Penetrate light.Therefore, camera acquisition to the R-G Ratio of image should be at the R-G Ratio of normal environment light, and it is individually red
Between the R-G Ratio of external reflectance light.And the prior art, it is carried out using only current intensity of illumination when opening infrared light compensating lamp
Judge, None- identified go out be due to normal environment light, or since the light of infrared light compensating lamp produces current intensity of illumination,
Therefore the prior art is not high to the accuracy of the judgement of scene state.And according to existing optical knowledge it is found that opening infrared light filling
In the case of lamp, if R-G Ratio are smaller, the scene state residing for video camera is bigger for shape probability of state on daytime, if R-G
Ratio is bigger, and the scene state residing for video camera is bigger for night shape probability of state, therefore the case where opening infrared light compensating lamp
Under, combination R-G Ratio of the embodiment of the present invention carry out judging to be reasonable and effective to scene state.
Step 227, judge whether to meet the second decision condition, wherein the second decision condition is:Current intensity of illumination is big
In or be equal to night intensity of illumination upper limit threshold, and be greater than or equal to night intensity of illumination expanded threshold value, and current red point
Amount/green component ratio is less than the threshold value of preset red component/green component ratio;Or, current intensity of illumination be more than or
Equal to night intensity of illumination expanded threshold value, and it is less than or equal in night intensity of illumination and limits threshold value, and current red component/green
Colouring component ratio is less than the threshold value of preset red component/green component ratio, if meeting the second decision condition, executes step
Rapid 228, by switching points plus the first preset quantity;If not meeting the second decision condition, 233 are thened follow the steps, by switching point
Preset quantity that number subtracts the second, and step 234 is continued to execute, determine that the scene state in this period is night state.
It is that night state uses the second decision condition, second decision condition for scene state in the embodiment of the present invention
Unlike the prior art, the second decision condition is formulated as:
Illumination >=th_high and Illumination >=th_ext and R-G Ratio<R or
Illumination >=th_ext and Illumination≤th_mid and R-G Ratio<R
Wherein, Illumination is current intensity of illumination, and th_high is night intensity of illumination upper limit threshold, th_
Mid is that threshold value is limited in night intensity of illumination, and th_ext is preset night intensity of illumination expanded threshold value, and R-G Ratio are current
Red component/green component ratio, R be preset red component/green component ratio threshold value, wherein th_high, th_
Mid is the newer value of dynamic, and th_ext, R are fixed value, and th_high>th_mid.
It should be noted that preset night intensity of illumination expanded threshold value th_ext is less than night illumination under normal conditions
Threshold value th_mid is limited in intensity, but is not excluded for some and there is th_mid in special circumstances<th_ext<Th_high or th_ext>
th_high。
Be night state for the first scene state, the prior art using current intensity of illumination and intensity of illumination threshold value into
Row compares, and the intensity of illumination threshold value of the prior art is a fixed value, i.e.,:If current intensity of illumination is more than intensity of illumination threshold
Day mode is switched to when value.And the embodiment of the present invention is carried out using current intensity of illumination and three night intensity of illumination threshold values
Compare, while the threshold value of current red component/green component ratio and preset red component/green component ratio being carried out
Compare.It is to adapt to frequently replace that the first scene state of the embodiment of the present invention pair is improved for the decision condition of night state
Scene state, in particular for some more extreme or special scenes, illustrated below with carrying out more accurate scene judgement
Explanation.
Example 1 presets th_low=200, th_ext=800.
Video camera changes to indoor no light scene from intense light irradiation scene, and intensity of illumination is relatively low at this time, gets current
Illumination is 100, because meeting the first decision condition, switches to night mode at this time, opening infrared light compensating lamp will be infrared
Optical filter is set as infrared light responsive pattern.Because indoor environment is narrow, infrared external reflection light is too strong, and illumination is strong after opening infrared light compensating lamp
Moment raising is spent, it is 2000 to get the illumination average values i_avg in preset time period at this time.
It is calculated according to i_avg:
Th_high=2000*1.25=2500
Th_mid=2000*0.75=1500
Later, user's carrying video camera enters outdoor, and current outdoor is at dusk or the cloudy day goes back though intensity of illumination is slightly lower
Infrared light compensating lamp need not be opened, day mode is should be.But at this time because of outdoor environment spaciousness, infrared external reflection light is very weak, therefore
The intensity of illumination that the sensor of video camera receives reduces instead, gets intensity of illumination and is reduced to 1000.If sentenced with the prior art
It is fixed, for example the intensity of illumination threshold value of the prior art is 2000, then current intensity of illumination is less than intensity of illumination threshold value, according to existing
Technology should keep night mode at this time.This is not inconsistent with the demand of actual use and judgement.But it can get, at this time because of outdoor optical
It is mainly made of natural light, R-G Ratio have been lowered to R or less.Therefore according to embodiments of the present invention, meet the second judgement at this time
Condition should be switched to day mode.Therefore the embodiment of the present invention is consistent with the demand of actual use and judgement, compared to existing
There are technology, the accuracy higher of the pattern switching of the embodiment of the present invention.
Step 229, judge whether switching points are more than preset switching points threshold value, if so, thening follow the steps 230, really
The scene state in this fixed period is state on daytime, and continues to execute step 231, and switching points are reset;If it is not, thening follow the steps
234, determine that the scene state in this period is night state.
After the embodiment of the present invention obtains judgement result using the second decision condition, this is not determined according to judgement result immediately
The scene state in period simultaneously carries out pattern switching, but accumulates multiple periods, when switching points are more than switching points threshold value,
It just determines the scene state in this period and carries out pattern switching.Accumulation of the embodiment of the present invention multiple periods carry out judging to avoid
The pattern of video camera caused by frequent mode switching shakes problem.
Step 232, the scene state in this period determined according to step 230 is state on daytime, determines the pattern of video camera
Switch to day mode.
Step 235, the scene state in this period determined according to step 234 is night state, determines the pattern of video camera
Keep night mode.
Present invention method further includes, and after the pattern switching to day mode that step 232 determines video camera, closes
Infrared light compensating lamp is closed, infrared fileter is switched to the infrared optical mode of cut-off;With, step 235 determine video camera pattern protect
After holding night mode, infrared light compensating lamp is kept it turning on, holding infrared fileter is infrared light responsive pattern.
Below in conjunction with attached drawing, the pattern switching mistake of the video camera with infrared light compensating lamp of embodiment is illustrated the present invention
Journey, at any time referring to red component/green component ratio in the mode handover procedure that Fig. 3 and Fig. 4, Fig. 3 are the embodiment of the present invention
Change schematic diagram;Fig. 4 changes over time signal for intensity of illumination in the mode handover procedure of the embodiment of the present invention corresponding with Fig. 3
Figure.
In Fig. 3 and Fig. 4, short interval dotted line indicates different moments t0, t1, t2, t3, t4, Fig. 3 and Fig. 4 dotted line at short intervals
Different moments are marked off, are for the ease of checking red component/green component ratio R/G Ratio and intensity of illumination
Variations of the Illumination in different moments.In Fig. 3, rectangle dotted line indicates the threshold of red component/green component ratio
Value R.In Fig. 4, long interval dotted line indicates that daylight intensity threshold th_low, single point-like line indicate night intensity of illumination upper limit threshold
Value th_high, double dotted lines indicate that limit threshold value th_mid in night intensity of illumination, triangle dotted line indicate night intensity of illumination
Expanded threshold value th_ext.
In conjunction with Fig. 3 and Fig. 4, the mode handover procedure of the video camera with infrared light compensating lamp of the embodiment of the present invention is specifically such as
Under:
T0 moment, video camera are in day mode, and the infrared light compensating lamp of video camera is closed, at infrared fileter
In the infrared optical mode of cut-off.
With time stepping method, Illumination is reduced, and at the t1 moment, when carrying out the scene state in this period and judging, is adopted
With the first decision condition, detects and meet the first decision condition:Illumination<Th_low, after switching over points plus 1,
It was found that switching points are more than switching points threshold value at this time, therefore it is switched to night mode, infrared light compensating lamp is opened, by infrared fileter
Switch to infrared light responsive pattern.Illumination moments improve later.According to the i_avg of a period of time, update th_high and
th_mid。
The t2 moment, using the second decision condition, detects Illumination when carrying out the scene state in this period and judging
>=th_high and Illumination >=th_ext and R-G Ratio<R after switching over points plus 1, has found switching point at this time
Number is more than switching points threshold value, therefore switches to day mode, closes infrared light compensating lamp, and switching infrared fileter is to ending infrared light
Pattern.
The t3 moment, using the first decision condition, detects Illumination when carrying out the scene state in this period and judging
<Th_low after switching over points plus 1, it is found that switching points are more than switching points threshold value at this time, therefore switch to night mode,
Infrared light compensating lamp is opened, infrared fileter is switched into infrared light responsive pattern.According to the i_avg of a period of time, th_ is updated again
High and th_mid.
The t4 moment, using the second decision condition, detects when carrying out the scene state in this period and judging
Illumination >=th_ext and Illumination≤th_mid and R-G Ratio<R switches over points
After adding 1, it is found that switching points are more than switching points threshold value at this time, therefore switch to day mode.Infrared light compensating lamp is closed, switching is red
Outer optical filter is to ending infrared optical mode.
As it can be seen that the mode switching method of the video camera provided in an embodiment of the present invention with infrared light compensating lamp, first period
The first scene state that ground obtains the current intensity of illumination of video camera and a upper period determines.Then according to different first
Scape state uses different decision conditions to obtain the judgement of scene state as a result, and completing video camera according to judgement result
Pattern switching, i.e.,:If the first scene state is state on daytime, according to current intensity of illumination and preset daylight intensity
Threshold value determines the scene state in this period, and according to the scene state in this period, is determined to switch to night mode or is kept for daytime
Pattern;If the first scene state is night state, image when according to the current intensity of illumination of acquisition is calculated and is obtained currently
Red component/green component ratio, according to current intensity of illumination, current red component/green component ratio, night illumination
The threshold value of intensity threshold and preset red component/green component ratio, determines the scene state in this period, and according to this period
Scene state, be determined to switch to day mode or keep night mode.The embodiment of the present invention is utilized to be opened in infrared light compensating lamp
In the case of opening, red component caused by the environment infrared external reflection light/larger principle of green component ratio, in state and night on daytime
Using the decision condition of different scene states when late state, in night state, not merely with current intensity of illumination and night
Late intensity of illumination threshold value comparison also introduces red component/green component ratio and preset red component/green component ratio
Threshold value comparison, compared with the prior art using only intensity of illumination and intensity of illumination threshold value comparison to determine scene state, the present invention
The decision condition of embodiment is more fine, can obtain the judging result of the higher scene state of accuracy, so as to obtain
The higher pattern switching result of accuracy.Meanwhile the embodiment of the present invention is after day mode is switched to night mode, by cutting
The average value of the intensity of illumination in rear preset time period is changed, dynamic updates night intensity of illumination upper limit threshold and night intensity of illumination
Middle limit threshold value will limit the scene state after threshold value is used in newer night intensity of illumination upper limit threshold and night intensity of illumination
Judgement, can not only improve fitness of the video camera to the scene of different illumination intensity, can also further increase video camera
The accuracy of pattern switching.
It is one kind of the mode-changeover device of the video camera with infrared light compensating lamp of the embodiment of the present invention referring to Fig. 5, Fig. 5
Structure chart.Including:
Acquisition module 501, first for obtaining the current intensity of illumination of video camera and the determination of a upper period periodically
Scape state, the first scene state include state or night state on daytime.
First scene state determining module 502, if being state on daytime for the first scene state, according to current illumination
Intensity and preset daylight intensity threshold, determine the scene state in this period.
First mode handover module 503 is determined to switch to night mode or holding for the scene state according to this period
Day mode.
Night state computation module 504, if being night state for the first scene state, according to the current illumination of acquisition
Image when intensity calculates and obtains current red component/green component ratio.
Second scene state determining module 505, for according to current intensity of illumination, current red component/green point
The threshold value of amount ratio, night intensity of illumination threshold value and preset red component/green component ratio, determines the scene shape in this period
State.
Second mode handover module 506 is determined to switch to day mode or holding for the scene state according to this period
Night mode.
As it can be seen that the mode-changeover device of the video camera provided in an embodiment of the present invention with infrared light compensating lamp, first period
The first scene state that ground obtains the current intensity of illumination of video camera and a upper period determines.Then according to different first
Scape state uses different decision conditions to obtain the judgement of scene state as a result, and carrying out video camera according to judgement result
Pattern switching, i.e.,:If the first scene state is state on daytime, according to current intensity of illumination and preset daylight intensity
Threshold value determines the scene state in this period, and according to the scene state in this period, is determined to switch to night mode or is kept for daytime
Pattern;If the first scene state is night state, image when according to the current intensity of illumination of acquisition is calculated and is obtained currently
Red component/green component ratio, according to current intensity of illumination, current red component/green component ratio, night illumination
The threshold value of intensity threshold and preset red component/green component ratio, determines the scene state in this period, and according to this period
Scene state, be determined to switch to day mode or keep night mode.The embodiment of the present invention is utilized to be opened in infrared light compensating lamp
In the case of opening, red component caused by the infrared external reflection light/larger principle of green component ratio, in state and night shape on daytime
Using the decision condition of different scene states when state, in night state, not merely with current intensity of illumination and night light
Compare according to intensity threshold, also introduces the threshold value of red component/green component ratio and preset red component/green component ratio
Compare, compared with the prior art using only intensity of illumination and intensity of illumination threshold value comparison to determine that scene state, the present invention are implemented
The decision condition of example is more fine, can obtain the judging result of the higher scene state of accuracy, accurate so as to obtain
Spend higher pattern switching result.
It should be noted that the device of the embodiment of the present invention is the pattern using the above-mentioned video camera with infrared light compensating lamp
The device of switching method, then all embodiments of the mode switching method of the above-mentioned video camera with infrared light compensating lamp be suitable for
The device, and can reach same or analogous advantageous effect.
It is the video camera with infrared light compensating lamp of the embodiment of the present invention referring to Fig. 6, Fig. 6 as another embodiment
Another structure chart of mode-changeover device.Including:
Acquisition module 601, including:
Gain and time for exposure acquisition submodule 6011, in a length of period, obtain when being used for corresponding with one frame image of shooting
The current gain and current exposure time of imaging sensor amplifying circuit when shooting current frame image.
Pixel component computational submodule 6012, the average value of the red pixel component for calculating current frame image, green
The average value of the average value and blue pixel component of pixel component.
Average brightness computational submodule 6013, for according to the average value of red pixel component, green pixel component it is flat
The average value of mean value and blue pixel component calculates the average brightness for obtaining current frame image.
Intensity of illumination computational submodule 6014, for according to the average brightness of current frame image, current gain and current exposure
Between light time, current intensity of illumination is obtained.
First scene state determining module 602, including:
First decision sub-module 6021, in the case where the first scene state is state on daytime, judging whether to meet
First decision condition, and in the case where meeting the first decision condition, by switching points plus the first preset quantity;Do not meeting
It, will the switching points preset quantity that subtracts the second in the case of one decision condition;First decision condition is:Current intensity of illumination is less than
Preset daylight intensity threshold.
First scene state determination sub-module 6022, for judging whether switching points are more than preset switching points threshold
Value if so, determining that the scene state in this period is night state, and switching points is reset;If not, it is determined that this period
Scene state is state on daytime.
First mode handover module 603, including:
First mode keeps submodule 6031, for being state on daytime according to the scene state in this period, determines and keeps white
Day mode.
First mode switching submodule 6032 is determined to switch to for being night state according to the scene state in this period
Night mode.
Intensity of illumination mean value calculation module 604, for being state on daytime, first mode switching when the first scene state
After this period is switched to night mode by module, the current intensity of illumination in third preset quantity period is obtained, and is calculated
Obtain the average value of the current intensity of illumination in third preset quantity period.
Night intensity of illumination threshold calculation module 605, for strong by the current illumination in third preset quantity period
Threshold coefficient is limited in the average value of degree, preset night intensity of illumination upper limit threshold coefficient and preset night intensity of illumination, weight
New determine in night intensity of illumination upper limit threshold and night intensity of illumination limits threshold value, so that second in the period later judges item
In part, using limiting threshold value in the night intensity of illumination upper limit threshold and night intensity of illumination redefined.
Wherein, night intensity of illumination threshold calculation module 605, is specifically used for:According to formula th_high=i_avg* α and
Th_mid=i_avg* β are redefined in night intensity of illumination upper limit threshold and night intensity of illumination and are limited threshold value;Wherein, th_
High is night intensity of illumination upper limit threshold, and i_avg is the average value of the current intensity of illumination in third preset quantity period,
α is preset night intensity of illumination upper limit threshold coefficient, and th_mid is that threshold value is limited in night intensity of illumination, and β is preset night
Threshold coefficient is limited in intensity of illumination.
Night state computation module 606 is strong according to current illumination if being night state for the first scene state
Degree calculates the ratio of the average value and the average value of green pixel component that obtain red pixel component.
Second scene state determining module 607, including:
Second decision sub-module 6071 meets the second decision condition for judging whether, and is meeting the second decision condition
In the case of, by switching points plus the first preset quantity;In the case where not meeting the second decision condition, switching points are subtracted the
Two preset quantities;Second decision condition is:Current intensity of illumination is greater than or equal to night intensity of illumination upper limit threshold, and is more than
Or it is equal to night intensity of illumination expanded threshold value, and current red component/green component ratio is less than preset red component/green
The threshold value of colouring component ratio;Or, current intensity of illumination is greater than or equal to night intensity of illumination expanded threshold value, and it is less than or equal to
Threshold value is limited in night intensity of illumination, and current red component/green component ratio is less than preset red component/green component
The threshold value of ratio.
Night intensity of illumination threshold value includes:Threshold value, preset is limited in night intensity of illumination upper limit threshold, night intensity of illumination
Night intensity of illumination expanded threshold value;Wherein, night intensity of illumination upper limit threshold, which is more than in night intensity of illumination, limits threshold value.
Second scene state determination sub-module 6072, for judging whether switching points are more than preset switching points threshold
Value if so, determining that the scene state in this period is state on daytime, and switching points is reset;If not, it is determined that this period
Scene state is night state.
It is similar with first mode handover module in the embodiment of the present invention, second mode handover module 608, including:
Second mode switching submodule 6081 is determined to switch to for being state on daytime according to the scene state in this period
Day mode.
Second mode keeps submodule 6082, for being night state according to the scene state in this period, determines and is kept for night
Late pattern.
As it can be seen that the mode-changeover device of the video camera provided in an embodiment of the present invention with infrared light compensating lamp, first period
The first scene state that ground obtains the current intensity of illumination of video camera and a upper period determines.Then according to different first
Scape state uses different decision conditions to obtain the judgement of scene state as a result, and completing video camera according to judgement result
Pattern switching, i.e.,:If the first scene state is state on daytime, according to current intensity of illumination and preset daylight intensity
Threshold value determines the scene state in this period, and according to the scene state in this period, is determined to switch to night mode or is kept for daytime
Pattern;If the first scene state is night state, image when according to the current intensity of illumination of acquisition is calculated and is obtained currently
Red component/green component ratio, according to current intensity of illumination, current red component/green component ratio, night illumination
The threshold value of intensity threshold and preset red component/green component ratio, determines the scene state in this period, and according to this period
Scene state, be determined to switch to day mode or keep night mode.The embodiment of the present invention is utilized to be opened in infrared light compensating lamp
In the case of opening, red component caused by the infrared external reflection light/larger principle of green component ratio, in state and night shape on daytime
Using the decision condition of different scene states when state, in night state, not merely with current intensity of illumination and night light
Compare according to intensity threshold, also introduces the threshold value of red component/green component ratio and preset red component/green component ratio
Compare, compared with the prior art using only intensity of illumination and intensity of illumination threshold value comparison to determine that scene state, the present invention are implemented
The decision condition of example is more fine, can obtain the judging result of the higher scene state of accuracy, accurate so as to obtain
Spend higher pattern switching result.Meanwhile the embodiment of the present invention is after day mode is switched to night mode, after switching
The average value of intensity of illumination in preset time period, dynamic updates to be limited in night intensity of illumination upper limit threshold and night intensity of illumination
Threshold value sentences the scene state limited in newer night intensity of illumination upper limit threshold and night intensity of illumination after threshold value is used for
It is fixed, fitness of the video camera to the scene of different illumination intensity can not only be improved, the mould of video camera can be also further increased
The accuracy of formula switching.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including element.
Each embodiment in this specification is all made of relevant mode and describes, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to embodiment of the method
Part explanation.
The above is merely preferred embodiments of the present invention, it is not intended to limit the scope of the present invention.It is all in this hair
Any modification, equivalent replacement, improvement and so within bright spirit and principle, are included within the scope of protection of the present invention.
Claims (12)
1. a kind of mode switching method of the video camera with infrared light compensating lamp, which is characterized in that the mode switching method packet
It includes:
The first scene state of the current intensity of illumination of video camera and the determination of a upper period, first scene were obtained periodically
State includes state or night state on daytime;
If first scene state is state on daytime, according to the current intensity of illumination and preset daylight intensity
Threshold value determines the scene state in this period;
According to the scene state in described period, it is determined to switch to night mode or keeps day mode;
If first scene state is night state, according to image when obtaining the current intensity of illumination, calculating obtains
Obtain red component/green component ratio currently;
According to the current intensity of illumination, the current red component/green component ratio, night intensity of illumination threshold value and
The threshold value of preset red component/green component ratio, determines the scene state in this period;
According to the scene state in described period, it is determined to switch to day mode or keeps night mode.
2. according to the method described in claim 1, it is characterized in that, described obtain the current intensity of illumination of video camera periodically
Step, including:
In a length of period when corresponding with one frame image of shooting, imaging sensor amplifying circuit works as when obtaining shooting current frame image
Preceding gain and current exposure time;
Calculate the average value of red pixel component of current frame image, the average value of green pixel component and blue pixel component
Average value;
According to the average value of the red pixel component, the average value of the green pixel component and the blue pixel component
Average value calculates the average brightness for obtaining current frame image;
According to the average brightness of the current frame image, the current gain and the current exposure time, current light is obtained
According to intensity;
The calculating obtains the step of current red component/green component ratio, is:It calculates and obtains the red pixel component
The ratio of average value and the average value of the green pixel component.
If 3. according to the method described in claim 1, it is characterized in that, first scene state be daytime state,
According to the current intensity of illumination and preset daylight intensity threshold, the step of determining the scene state in this period, packet
It includes:
In the case where first scene state is state on daytime, judge whether to meet the first decision condition, and meeting
In the case of stating the first decision condition, by switching points plus the first preset quantity;In the feelings for not meeting first decision condition
It, will the switching points preset quantity that subtracts the second under condition;First decision condition is:Current intensity of illumination is less than preset daytime
Intensity of illumination threshold value;
Judge whether switching points are more than preset switching points threshold value, if so, determining that the scene state in this period is night
State, and switching points are reset;If not, it is determined that the scene state in this period is state on daytime.
4. according to the method described in claim 3, it is characterized in that, the night intensity of illumination threshold value includes:Night illumination is strong
Spend limit threshold value, preset night intensity of illumination expanded threshold value in upper limit threshold, night intensity of illumination;Wherein, the night illumination
Upper intensity limit threshold value, which is more than in the night intensity of illumination, limits threshold value;
It is described according to the current intensity of illumination, the current red component/green component ratio, night intensity of illumination threshold
The step of being worth the threshold value with preset red component/green component ratio, determining the scene state in this period, including:
Judge whether to meet the second decision condition, it, will switching points plus the and in the case where meeting second decision condition
One preset quantity;It, will the switching points preset quantity that subtracts the second in the case where not meeting second decision condition;Described second
Decision condition is:Current intensity of illumination is greater than or equal to night intensity of illumination upper limit threshold, and is greater than or equal to night illumination
Intensity spread threshold value, and current red component/green component ratio is less than the threshold of preset red component/green component ratio
Value;Or, current intensity of illumination is greater than or equal to night intensity of illumination expanded threshold value, and less than or equal in night intensity of illumination
Threshold value is limited, and current red component/green component ratio is less than the threshold value of preset red component/green component ratio;
Judge whether switching points are more than preset switching points threshold value, if so, determining that the scene state in this period is daytime
State, and switching points are reset;If not, it is determined that the scene state in this period is night state.
5. according to the method described in claim 3, it is characterized in that, the method further includes:
When the first scene state is state on daytime, this period switches to after night mode, obtains the third preset quantity period
Current intensity of illumination, and calculate obtain the third preset quantity period current intensity of illumination average value;
Pass through the average value of the current intensity of illumination in the third preset quantity period, the preset night intensity of illumination upper limit
Threshold coefficient is limited in threshold coefficient and preset night intensity of illumination, redefines night intensity of illumination upper limit threshold and night light
According to limiting threshold value in intensity, so that in second decision condition in period later, using in the night intensity of illumination redefined
Threshold value is limited in limit threshold value and night intensity of illumination.
6. according to the method described in claim 5, it is characterized in that, described current by the third preset quantity period
The average value of intensity of illumination, limit threshold value in preset night intensity of illumination upper limit threshold coefficient and preset night intensity of illumination
Coefficient redefines in night intensity of illumination upper limit threshold and night intensity of illumination and limits threshold value, including:
Night intensity of illumination upper limit threshold and night are redefined according to formula th_high=i_avg* α and th_mid=i_avg* β
Threshold value is limited in late intensity of illumination;Wherein, the th_high is the night intensity of illumination upper limit threshold, and the i_avg is described
The average value of the current intensity of illumination in third preset quantity period, the α are the preset night intensity of illumination upper limit
Threshold coefficient, the th_mid are that threshold value is limited in the night intensity of illumination, and the β is in the preset night intensity of illumination
Limit threshold coefficient.
7. a kind of mode-changeover device of the video camera with infrared light compensating lamp, which is characterized in that the mode-changeover device packet
It includes:
Acquisition module, the first scene state for obtaining the current intensity of illumination of video camera and the determination of a upper period periodically,
First scene state includes state or night state on daytime;
First scene state determining module, if being state on daytime for first scene state, according to the current light
According to intensity and preset daylight intensity threshold, the scene state in this period is determined;
First mode handover module is determined to switch to night mode or keeps white for the scene state according to described period
Day mode;
Night state computation module, if being night state for first scene state, according to the acquisition current light
Image when according to intensity calculates and obtains current red component/green component ratio;
Second scene state determining module, for according to the current intensity of illumination, the current red component/green point
The threshold value of amount ratio, night intensity of illumination threshold value and preset red component/green component ratio, determines the scene shape in this period
State;
Second mode handover module is determined to switch to day mode or is kept for night for the scene state according to described period
Late pattern.
8. device according to claim 7, which is characterized in that the acquisition module, including:
Gain and time for exposure acquisition submodule, in a length of period, it is current to obtain shooting when being used for corresponding with one frame image of shooting
The current gain and current exposure time of imaging sensor amplifying circuit when frame image;
Pixel component computational submodule, average value, the green pixel component of the red pixel component for calculating current frame image
Average value and blue pixel component average value;
Average brightness computational submodule, for according to the average value of the red pixel component, the green pixel component it is flat
The average value of mean value and the blue pixel component calculates the average brightness for obtaining current frame image;
Intensity of illumination computational submodule, for according to the average brightness of the current frame image, the current gain and described working as
The prior exposure time obtains current intensity of illumination;
The night state computation module, is specifically used for:Calculate the average value for obtaining the red pixel component and the green
The ratio of the average value of pixel component.
9. device according to claim 7, which is characterized in that the first scene state determining module, including:
First decision sub-module, in the case where first scene state is state on daytime, judging whether satisfaction first
Decision condition, and in the case where meeting first decision condition, by switching points plus the first preset quantity;Do not meeting institute
It, will the switching points preset quantity that subtracts the second in the case of stating the first decision condition;First decision condition is:Current illumination
Intensity is less than preset daylight intensity threshold;
First scene state determination sub-module, for judging whether switching points are more than preset switching points threshold value, if so,
It determines that the scene state in this period is night state, and switching points is reset;If not, it is determined that the scene state in this period is
Daytime state.
10. device according to claim 9, which is characterized in that the night intensity of illumination threshold value includes:Night illumination is strong
Spend limit threshold value, preset night intensity of illumination expanded threshold value in upper limit threshold, night intensity of illumination;Wherein, the night illumination
Upper intensity limit threshold value, which is more than in the night intensity of illumination, limits threshold value;
The second scene state determining module, including:
Second decision sub-module meets the second decision condition for judging whether, and in the feelings for meeting second decision condition
Under condition, by switching points plus the first preset quantity;In the case where not meeting second decision condition, switching points are subtracted the
Two preset quantities;Second decision condition is:Current intensity of illumination is greater than or equal to night intensity of illumination upper limit threshold, and
More than or equal to night intensity of illumination expanded threshold value, and current red component/green component ratio is less than preset red point
The threshold value of amount/green component ratio;Or, current intensity of illumination is greater than or equal to night intensity of illumination expanded threshold value, and it is less than
Or equal to limiting threshold value in night intensity of illumination, and current red component/green component ratio is less than preset red component/green
The threshold value of colouring component ratio;
Second scene state determination sub-module, for judging whether switching points are more than preset switching points threshold value, if so,
It determines that the scene state in this period is state on daytime, and switching points is reset;If not, it is determined that the scene state in this period is
Night state.
11. device according to claim 9, which is characterized in that the first mode handover module, including:
First mode keeps submodule, for being state on daytime according to the scene state in described period, determines and keeps mould on daytime
Formula;
First mode switching submodule is determined to switch to night for being night state according to the scene state in described period
Pattern;
Described device further includes:
Intensity of illumination mean value calculation module, for being state on daytime when the first scene state, the first mode switches submodule
After this period is switched to night mode by block, the current intensity of illumination in third preset quantity period is obtained, and calculate and obtain
Take the average value of the current intensity of illumination in third preset quantity period;
Night intensity of illumination threshold calculation module, for the current intensity of illumination by the third preset quantity period
Threshold coefficient is limited in average value, preset night intensity of illumination upper limit threshold coefficient and preset night intensity of illumination, again really
Determine to limit threshold value in night intensity of illumination upper limit threshold and night intensity of illumination, so that in second decision condition in period later
In, using limiting threshold value in the night intensity of illumination upper limit threshold and night intensity of illumination redefined.
12. according to the devices described in claim 11, which is characterized in that the night intensity of illumination threshold calculation module, specifically
For:
Night intensity of illumination upper limit threshold and night are redefined according to formula th_high=i_avg* α and th_mid=i_avg* β
Threshold value is limited in late intensity of illumination;Wherein, the th_high is the night intensity of illumination upper limit threshold, and the i_avg is described
The average value of the current intensity of illumination in third preset quantity period, the α are the preset night intensity of illumination upper limit
Threshold coefficient, the th_mid are that threshold value is limited in the night intensity of illumination, and the β is in the preset night intensity of illumination
Limit threshold coefficient.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710014669.XA CN108289164B (en) | 2017-01-10 | 2017-01-10 | Mode switching method and device of camera with infrared light supplement lamp |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710014669.XA CN108289164B (en) | 2017-01-10 | 2017-01-10 | Mode switching method and device of camera with infrared light supplement lamp |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108289164A true CN108289164A (en) | 2018-07-17 |
CN108289164B CN108289164B (en) | 2020-07-03 |
Family
ID=62819644
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710014669.XA Active CN108289164B (en) | 2017-01-10 | 2017-01-10 | Mode switching method and device of camera with infrared light supplement lamp |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108289164B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109040540A (en) * | 2018-07-20 | 2018-12-18 | 王健 | A kind of night vision switching method and supervisory-controlled robot based on characteristics of image |
CN109302566A (en) * | 2018-11-22 | 2019-02-01 | 深圳市景阳科技股份有限公司 | A kind of method, apparatus and terminal device of determining screening-mode |
CN110505377A (en) * | 2019-05-31 | 2019-11-26 | 杭州海康威视数字技术股份有限公司 | Image co-registration device and method |
CN111385477A (en) * | 2020-03-17 | 2020-07-07 | 浙江大华技术股份有限公司 | Mode switching control method and device for camera, camera and storage medium |
CN111510636A (en) * | 2019-01-30 | 2020-08-07 | 华为技术有限公司 | Method and device for acquiring brightness evaluation value and computer storage medium |
CN111601041A (en) * | 2020-06-03 | 2020-08-28 | 普联技术有限公司 | Camera scene mode switching method and device and intelligent equipment |
CN111988532A (en) * | 2020-07-16 | 2020-11-24 | 哈尔滨海能达科技有限公司 | Control method and device for night vision compensation lamp switch |
CN112235506A (en) * | 2020-10-09 | 2021-01-15 | 浙江大华技术股份有限公司 | Camera focusing processing method, device, storage medium and electronic device |
CN112383688A (en) * | 2020-11-10 | 2021-02-19 | 珠海格力电器股份有限公司 | Camera shooting light supplement method and device, electronic equipment and intelligent terminal |
CN113132616A (en) * | 2019-12-31 | 2021-07-16 | 国基电子(上海)有限公司 | Working mode switching device and working mode switching detection method |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110193967A1 (en) * | 2010-02-10 | 2011-08-11 | Sony Corporation | Imaging device, imaging device control method and program |
JP2012095223A (en) * | 2010-10-28 | 2012-05-17 | Canon Inc | Imaging device, imaging method, and program |
KR20130019519A (en) * | 2011-08-17 | 2013-02-27 | 엘지이노텍 주식회사 | Network camera having infrared light emitting diode illumination |
CN103716527A (en) * | 2012-09-29 | 2014-04-09 | 浙江大华技术股份有限公司 | Method and equipment for determining working mode of camera equipment |
CN103781261A (en) * | 2014-02-28 | 2014-05-07 | 深圳英飞拓科技股份有限公司 | Infrared lamp control method for infrared network camera |
CN104301616A (en) * | 2014-10-31 | 2015-01-21 | 苏州科达科技股份有限公司 | Method and system for controlling day-to-night switching mode of camera and method and system for controlling night-to-day switching mode of camera |
CN104980639A (en) * | 2014-04-03 | 2015-10-14 | 杭州华为企业通信技术有限公司 | Infrared control device, infrared control method and image camera |
CN105554409A (en) * | 2015-12-16 | 2016-05-04 | 浙江宇视科技有限公司 | Method and device for detecting day-night switching |
CN106101549A (en) * | 2016-07-07 | 2016-11-09 | 浙江宇视科技有限公司 | Automatic switching method, Apparatus and system round the clock |
-
2017
- 2017-01-10 CN CN201710014669.XA patent/CN108289164B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110193967A1 (en) * | 2010-02-10 | 2011-08-11 | Sony Corporation | Imaging device, imaging device control method and program |
JP2012095223A (en) * | 2010-10-28 | 2012-05-17 | Canon Inc | Imaging device, imaging method, and program |
KR20130019519A (en) * | 2011-08-17 | 2013-02-27 | 엘지이노텍 주식회사 | Network camera having infrared light emitting diode illumination |
CN103716527A (en) * | 2012-09-29 | 2014-04-09 | 浙江大华技术股份有限公司 | Method and equipment for determining working mode of camera equipment |
CN103781261A (en) * | 2014-02-28 | 2014-05-07 | 深圳英飞拓科技股份有限公司 | Infrared lamp control method for infrared network camera |
CN104980639A (en) * | 2014-04-03 | 2015-10-14 | 杭州华为企业通信技术有限公司 | Infrared control device, infrared control method and image camera |
CN104301616A (en) * | 2014-10-31 | 2015-01-21 | 苏州科达科技股份有限公司 | Method and system for controlling day-to-night switching mode of camera and method and system for controlling night-to-day switching mode of camera |
CN105554409A (en) * | 2015-12-16 | 2016-05-04 | 浙江宇视科技有限公司 | Method and device for detecting day-night switching |
CN106101549A (en) * | 2016-07-07 | 2016-11-09 | 浙江宇视科技有限公司 | Automatic switching method, Apparatus and system round the clock |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109040540A (en) * | 2018-07-20 | 2018-12-18 | 王健 | A kind of night vision switching method and supervisory-controlled robot based on characteristics of image |
CN109302566A (en) * | 2018-11-22 | 2019-02-01 | 深圳市景阳科技股份有限公司 | A kind of method, apparatus and terminal device of determining screening-mode |
CN111510636B (en) * | 2019-01-30 | 2021-07-09 | 华为技术有限公司 | Method and device for acquiring brightness evaluation value and computer storage medium |
CN111510636A (en) * | 2019-01-30 | 2020-08-07 | 华为技术有限公司 | Method and device for acquiring brightness evaluation value and computer storage medium |
CN110505377A (en) * | 2019-05-31 | 2019-11-26 | 杭州海康威视数字技术股份有限公司 | Image co-registration device and method |
CN113132616B (en) * | 2019-12-31 | 2022-07-22 | 富联国基(上海)电子有限公司 | Working mode switching device and working mode switching detection method |
CN113132616A (en) * | 2019-12-31 | 2021-07-16 | 国基电子(上海)有限公司 | Working mode switching device and working mode switching detection method |
CN111385477A (en) * | 2020-03-17 | 2020-07-07 | 浙江大华技术股份有限公司 | Mode switching control method and device for camera, camera and storage medium |
CN111601041B (en) * | 2020-06-03 | 2021-12-31 | 普联技术有限公司 | Camera scene mode switching method and device and intelligent equipment |
CN111601041A (en) * | 2020-06-03 | 2020-08-28 | 普联技术有限公司 | Camera scene mode switching method and device and intelligent equipment |
CN111988532A (en) * | 2020-07-16 | 2020-11-24 | 哈尔滨海能达科技有限公司 | Control method and device for night vision compensation lamp switch |
CN111988532B (en) * | 2020-07-16 | 2022-07-12 | 哈尔滨海能达科技有限公司 | Control method and device for night vision compensation lamp switch |
CN112235506A (en) * | 2020-10-09 | 2021-01-15 | 浙江大华技术股份有限公司 | Camera focusing processing method, device, storage medium and electronic device |
CN112383688A (en) * | 2020-11-10 | 2021-02-19 | 珠海格力电器股份有限公司 | Camera shooting light supplement method and device, electronic equipment and intelligent terminal |
Also Published As
Publication number | Publication date |
---|---|
CN108289164B (en) | 2020-07-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108289164A (en) | A kind of mode switching method and device of the video camera with infrared light compensating lamp | |
CN103533252B (en) | Method and device for automatically switching day and night modes | |
US6151073A (en) | Intelligent camera flash system | |
CN108377340A (en) | One kind being based on RGB-IR sensor diurnal pattern automatic switching methods and device | |
CN106101549B (en) | Automatic switching method, apparatus and system round the clock | |
CN107948521A (en) | A kind of video camera diurnal pattern switching system based on AE and AWB statistical informations | |
CN105939451A (en) | Image exposure processing system and method for capsule endoscope system | |
CN110536051A (en) | Picture pick-up device and its control method and storage medium | |
CN107026967A (en) | A kind of camera operation mode switching method and device | |
JP2002374539A (en) | Camera capable of correcting white balance | |
CN105491283B (en) | Method and system for photographic device Setting pattern | |
CN107438170A (en) | A kind of image Penetrating Fog method and the image capture device for realizing image Penetrating Fog | |
US20210306546A1 (en) | Method for assessing ambient light during night mode image acquisition | |
CN110493535A (en) | The method of image collecting device and Image Acquisition | |
CN104297176B (en) | The devices, systems and methods of round-the-clock monitoring the Changjiang river mountain area section visibility | |
CN105827898B (en) | Gamma curve method of adjustment and device applied to video camera | |
CN105635595A (en) | Flash lamp control method, flash lamp control device and mobile terminal | |
CN105869602A (en) | Display screen adaptive adjustment method and system, and defibrillator | |
CN108278066A (en) | Protective device based on image procossing | |
CN106686313A (en) | Controlling method, controlling device and electronic device thereof | |
CN105934941B (en) | Photographic device, video signal processing method and storage medium | |
CN108391044A (en) | A kind of video camera and its mode switch control method, device | |
CN113873155B (en) | Method and device for enhancing soft photosensitive mode judgment accuracy | |
EP0411665B1 (en) | Display device | |
CN208273108U (en) | A kind of video camera of adjustable light brightness |
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 |