Embodiment
The embodiment of the invention provides a kind of method and device of automatic measuring ambient brightness, makes that the realization of determining ambient brightness is simpler, and required cost is lower.
The imaging device of mentioning in the embodiment of the invention, all support the imaging device of automatic exposure modes to comprise camera, digital camera, video camera and other.The embodiment of the invention need not to increase additional hardware just can measure ambient brightness according to the exposure parameter of imaging device.
Generally speaking, imaging device all can show the human eye acceptable image for the brightness that conforms under various environmental baseline, all can comprise an automatic exposure module.This module can be according to the difference of ambient brightness, adjusts the time shutter (ET_Step) of sensor devices, thereby all accepts the image of scope at human eye can obtaining brightness of image and contrast under the darker environmental baseline and under the brighter environmental baseline.
General automatic exposure algorithm all can set in advance the brightness range of final output image, according to the brightness of current images acquired, judges this brightness of image whether in final brightness range, if, then do not handle; If do not exist, then regulate ET_Step, when the figure kine bias of gathering is bright, just reduce ET_Step, when the figure kine bias of gathering is dark, then improve ET_Step.Like this, the mean flow rate of image can be stabilized in certain scope, but the value of time shutter is but changing, and this variation has reflected the variation of ambient brightness.Under common indoor illumination condition, time shutter and the ambient brightness relation of being inversely proportional to, promptly when environment was brighter, ET_Step was less; And when environment was dark, ET_Step was bigger.
Generally speaking, ambient brightness is when 30Lux is in the 500lLux scope, and corresponding ET_Step can be transferred to the 1st grade (corresponding time shutter scope is about 0.2 second to 0.01 second) from the 20th grade, and the two all is similar to and is inverse relation.
In actual applications, do not need the fine description of ambient brightness, but the rough rank that only needs to know ambient brightness gets final product, thereby the embodiment of the invention can be measured the rank of ambient brightness according to the scope of ET_Step.
Below in conjunction with accompanying drawing, describing the embodiment of the invention in detail is how to realize automatic measuring ambient brightness.
Referring to Fig. 1, the method that the embodiment of the invention provides comprises:
S101, set in advance time shutter scope and other corresponding relation of ambient light level.
For example, ambient brightness need be divided into the N level, and the brightness at different levels scope of corresponding ET_Step respectively are [TET1n, TET2n), TET wherein1nBe the minimum value of scope of the ET_Step of n level ambient brightness correspondence, TET2nBe the maximal value of scope of the ET_Step of n level ambient brightness correspondence, and satisfyIt is the maximal value of the scope of the minimum value of scope of the ET_Step of other ambient brightness correspondence of a certain level ET_Step that equals other ambient brightness correspondence of its upper level.
S102, search the time shutter scope under the current ET_Step.
S103, according to the time shutter scope, determine corresponding ambient brightness rank.
If current ET_Step has dropped on ambient light levels when being n in the pairing time shutter scope, determine that then current environment brightness is the n level.
For example, suppose and need be divided into 5 grades to ambient brightness, can followingly set:
The 1st grade of ambient brightness: TET11Equal the time shutter of the 1st grade of ET_Step correspondence, TET21Equal the time shutter of 3rd level ET_Step correspondence;
The 2nd grade of ambient brightness: TET12Equal the time shutter of 3rd level ET_Step correspondence, TET22Equal the time shutter of the 7th grade of ET_Step correspondence;
Ambient brightness 3rd level: TET13Equal the time shutter of the 7th grade of ET_Step correspondence, TET23Equal the time shutter of the 13rd grade of ET_Step correspondence;
The 4th grade of ambient brightness: TET14Equal the time shutter of the 13rd grade of ET_Step correspondence, TET24Equal the time shutter of the 19th grade of ET_Step correspondence;
The 5th grade of ambient brightness: TET15Equal the time shutter of the 19th grade of ET_Step correspondence, TET25Equal the time shutter of the 20th grade of ET_Step correspondence.
Like this, each constantly all can obtain an ambient light levels, and in application, surround lighting is in the continuous variation, and the brightness degree that above-mentioned steps obtains also can constantly change, and can't stablize.And, when changing, ambient brightness enters the automatic exposure adjustment process, before automatic exposure does not settle out, ET_Step also is in continuous variation, at this moment, the brightness of output image is not in limited range, and ET_Step can't normally reflect the variation of ambient brightness.Therefore, for fear of above-mentioned situation, before judging the ambient brightness rank, step below carrying out.
The average of ET_Step in S104, the computation of Period a period of time TWith variance δET
S105, work as δETLess than pre-set threshold Tσ ET, determine that then automatic exposure this moment is stable.Can think that also the time shutter is constant, then automatic exposure is in steady state (SS), need not to judge according to the time shutter variance.It is constant promptly to work as time shutter ET_Step, perhaps the variance δ of ET_Step in the time TETLess than threshold value Tσ ETThe time, determine that automatic exposure is stable, carry out ambient brightness rank determination step then.
If
In the pairing time shutter scope, determine that then current environment brightness is the n level when having dropped on ambient light levels and being n.
Even after handling like this,, may appear at the situation of frequently beating between certain two brightness degree, in order to overcome this problem, need to adopt the embodiment of dual threshold, step below promptly carrying out if ambient brightness is in the variation.
S106, according to the time shutter scope of the ambient brightness rank correspondence of determining last time, obtain the first threshold and second threshold value of time shutter.
S107, judgement
Whether more than or equal to described first threshold, and, less than described second threshold value, if, execution in step S108 then; Otherwise, execution in step S109.
S108, determine that current ambient brightness rank is the ambient brightness rank of determining last time.
S109, basis
Affiliated time shutter scope, and described corresponding relation are determined corresponding ambient brightness rank.
Suppose that the ambient brightness rank of measuring last time is n
p, pairing time shutter scope is [TET
1n, TET
2n), if then
Drop on [TET
1n-γ
1, TET
2n+ γ
2) in the scope, think that ambient light levels still is n
pOtherwise, judge
Whether dropped in the time shutter scope of certain ambient light levels correspondence, to determine the current environment brightness degree.Wherein, γ
1, γ
2Be the preset threshold protection domain, the brightness degree that causes when being used to prevent the ambient brightness variation is beated.
Yet the ET_Step range of adjustment is limited, when ET_Step arrives the adjustable extent end points, can't continue to regulate ET_Step, makes output image brightness in target zone, and ET_Step just can't accurately reflect the variation range of ambient brightness.At this moment, generally can be then adjusting brightness of image entire gain (Global_Gain) and/or sensor devices gain (Sensor_Gain).
Referring to Fig. 2, the method that another embodiment of the present invention provides comprises:
S201, set in advance time shutter scope and other first corresponding relation of ambient light level, and the gain of brightness of image (Gain) scope and other second corresponding relation of ambient light level.
For example, the ambient brightness rank of Gain scope correspondence is the M level, and the ambient brightnesss at different levels scope of corresponding Gain respectively are [TGT1m, TGT2m).
And, Gain=Global_Gain, or Gain=Sensor_Gain, or Gain=Global_Gain*Sensor_Gain.
S202, when ET_Step exceeds time shutter of setting in advance during scope, search the gain margin under the current Gain.
S203, according to the gain margin under the Gain, and described second corresponding relation is determined the ambient brightness rank.
Introduce the device that the embodiment of the invention provides below.
Referring to Fig. 3, the device that the embodiment of the invention provides comprises: first is provided withunit 31, second is provided withunit 32, judges automaticexposure stabilization element 33, first determiningunit 34,trigger element 35 and second determiningunit 36.
First is provided withunit 31, is used to store time shutter scope and other first corresponding relation of ambient light level of setting in advance.
Second is provided withunit 32, is used to store gain margin and other second corresponding relation of ambient light level of the brightness of image that sets in advance.
Judge automaticexposure stabilization element 33, be used for the variance of time shutter in computation of Period a period of time; When described variance during, determine that automatic exposure this moment is stable, and trigger described first determiningunit 34 less than pre-set threshold.
Described first determiningunit 34, when being used to receive the triggering of described judgement automaticexposure stabilization element 33, according to the time shutter scope under the time shutter, and described first corresponding relation, determine the ambient brightness rank.
Described first determiningunit 34 can be according to the time shutter scope under the current time shutter, and described first corresponding relation, determines the ambient brightness rank; Can also be according to the time shutter scope under the average of time shutter in described a period of time, and described first corresponding relation, determine the ambient brightness rank.
In addition, for fear of the problem appearance of the frequent shake of ambient brightness, referring to Fig. 4, preferably, described first determiningunit 34 comprises:dual threshold unit 341, judgingunit 342,first module 343 andsecond unit 344.
Describeddual threshold unit 341 when being used to receive the triggering of described judgement automaticexposure stabilization element 33, according to the time shutter scope of the ambient brightness rank correspondence of determining last time, obtains the first threshold and second threshold value of time shutter.
Whether described judgingunit 342, the average that is used to judge the time shutter in described a period of time more than or equal to described first threshold, and, less than described second threshold value, if then trigger describedfirst module 343; Otherwise, trigger describedsecond unit 344.
Describedfirst module 343 is used for the triggering 342 according to described judging unit, determines that current ambient brightness rank is the ambient brightness rank of determining last time.
Describedsecond unit 344 is used for the triggering 342 according to described judging unit, according to the time shutter scope under the average of time shutter in described a period of time, and described first corresponding relation, determine corresponding ambient brightness rank.
Describedtrigger element 35 is used for exceeding the described time shutter that sets in advance during scope when the described time shutter, triggers described second determiningunit 36;
Described second determiningunit 36, when being used to receive the triggering of describedtrigger element 35, according to the gain margin under the gain of brightness of image, and described second corresponding relation, determine the ambient brightness rank.
The gain of described brightness of image is: the product of brightness of image entire gain, sensor devices gain or brightness of image entire gain and sensor devices gain.
In sum, the embodiment of the invention is for all imaging devices, need not to increase additional hardware and just can measure ambient brightness, utilize the increase cost of measurement environment brightness schemes such as photoresistance and the shortcoming of equipment complexity thereby overcome prior art according to the exposure parameter of imaging device.Further, for device, can also realize the brightness of control display device according to the ambient brightness that records with display device.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.