Specific implementation mode
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end
Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached
The embodiment of figure description is exemplary, and is only used for explaining the present invention, and is not considered as limiting the invention.On the contrary, this
The embodiment of invention includes all changes fallen within the scope of the spiritual and intension of attached claims, modification and is equal
Object.
In the description of the present invention, it is to be understood that, term " first ", " second " etc. are used for description purposes only, without
It can be interpreted as indicating or implying relative importance.In the description of the present invention, it should be noted that unless otherwise specific regulation
And restriction, term " connected ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection,
Or it is integrally connected;It can be mechanical connection, can also be electrical connection;It can be directly connected, intermediary can also be passed through
It is indirectly connected.For the ordinary skill in the art, the tool of above-mentioned term in the present invention can be understood with concrete condition
Body meaning.In addition, in the description of the present invention, unless otherwise indicated, the meaning of " plurality " is two or more.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable
Sequence, include according to involved function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
Below with reference to the accompanying drawings the method for adjustment of black level in cmos sensor image according to the ... of the embodiment of the present invention, dress are described
It sets and cmos sensor.
Odd column and even column Color Channel are typically first calculated currently, being adjusted to black level in cmos image sensor
The average value of black level.Then compared respectively with the desired value of its parity column, and feedback regulation value is given at analog signal
Manage module(ASP, analog signal processing)Or directly image data is handled.However only carry out odd even two
The adjustment in a channel can cause wherein some Color Channel adjusting not in place, and color expression range and saturation degree are lost.
If the mode that simulation is mixed with number may be used carries out black level to each Color Channel in cmos sensor
Adjustment carries out coarse adjustment to black level specifically, first passing through analog form, then carries out fine tuning to black level by digital form,
So that the average value of black level slowly approaches its desired value in cmos sensor image, until average value and desired value are close, very
To so that the average value of black level is equal in each Color Channel.The adjustment of black level can be made more comprehensively flexibly and accurate as a result,
Really, each Color Channel possesses more color expression ranges in cmos sensor, and can effectively prevent simulation coarse adjustment when mistake
The problem of adjusting and leading to image flicker.
Fig. 1 be one embodiment of the invention cmos sensor image in black level method of adjustment flow chart.
As shown in Figure 1, the method for adjustment of black level includes the following steps in cmos sensor image.
S101 calculates separately the average value of black level in each Color Channel in cmos sensor image.
In one embodiment of the invention, the black line flag signal in Color Channel and black row data can be obtained, and
The average value of black level is calculated according to black line flag signal and black row data.Specifically, first, under common scenarios, CMOS is passed
Sensor first exports 8 rows(Arbitrary 1 row)Then black row obtains in cmos sensor image respectively, four colors are logical in the black row of 8 rows
Black line flag signal in each Color Channel in road and black row data.Subsequently, according to the black rower in each Color Channel
Will signal and black row data calculate separately the average value of the corresponding black level of each Color Channel.It is passed it should be appreciated that calculating CMOS
Existing method can be used to realize in sensor image in each Color Channel when the average value of black level, that is, to pass through average value
Computational methods, that is, according to the black line flag of two rows, black row data add up and are averaged, to obtain four Color Channels
Black level average value.Therefore, it in order to avoid redundancy, is no longer repeated herein.
S102 calculates the desired value of black level in CMOS sensor images.
In one embodiment of the invention, the mark letter when reaching the maximum time of integration in Color Channel can be obtained
Number, and according to the target of the corresponding global gain signal calculating black level of marking signal when reaching maximum time integral
Value.Specifically, in CMOS sensors, black line flag signal and global gain signal are sent out by functional device.Therefore, exist
When the time of integration reaches the maximum time of integration, global gain signal this moment can be obtained by the functional device.Wherein, black level
The size and global gain of desired value are directly proportional, according to the size of global gain signal, linearly improve four Color Channels
Black level desired value.The desired value of black level is bigger, and the saturation degree of image is lower, and desired value is smaller, and the saturation degree of image is higher,
Level is abundanter.The brightness of dark scene in sensor image can be improved as a result,.It should be appreciated that calculating in cmos sensor image
It existing method can be used to realize when the desired value of black level in each Color Channel, in order to avoid redundancy, no longer carry out herein
It repeats.
S103 calculates separately the absolute value of black level average value and desired value difference in each Color Channel.
Respectively by four Color Channels the average value of black level and the desired value of black level subtract each other and obtain each color
The difference of the average value of black level and desired value in channel.
S104, when the average value of black level in some Color Channel and the absolute value of desired value difference are more than first threshold
When, simulation adjustment is carried out to the black level average value in corresponding Color Channel.
Wherein, first threshold is using the critical value of simulation adjustment and number adjustment, and first threshold can be CMOS sensings
The value given tacit consent in the adjusting apparatus of black level in device image.Specifically, it can be averaged respectively to black level in each Color Channel
The absolute value of value and desired value difference is compared with first threshold, judges that the absolute value of the difference is fallen in the region of digital fine tuning
Interior either fall carries out simulation adjustment or number thus, it is possible to determine in the region of simulation coarse adjustment to the average value of black level
Adjustment.If the average value of black level and the absolute value of desired value difference are more than first threshold in some Color Channel, to this
Black level average value in Color Channel carries out simulation adjustment.Wherein, simulation adjustment refers to by comparing black appliances in Color Channel
Flat average value and its corresponding desired value rewrite the forward voltage given in the Color Channel of analog signal processing modules A SP
Then the two is converted to corresponding positive voltage value by value of feedback by numeral/analog conversion module DAC so that add in the channel
Go up/subtract different voltage values, and voltage value change after analog-to-digital converting module ADC conversion outputs can be
It is embodied in the average value of black level adjustment, then compares the difference between the average value of black level and desired value again, and to face
Positive voltage value of feedback in chrominance channel is adjusted, and may make that the average value of the black level in channel gradually levels off to mesh as a result,
Scale value, to achieve the effect that adjusting.
In one embodiment of the invention, the specific packet of simulation adjustment is carried out to the black level average value in Color Channel
It includes:The forward voltage value of feedback in Color Channel is obtained, and according to black level average value in Color Channel and desired value difference
Absolute value obtain corresponding adjusting step, and forward voltage value of feedback is adjusted according to adjusting step.Specifically, right
The average value of black level and the absolute value of desired value difference be more than the forward voltage value of feedback in the Color Channel of first threshold into
Row adjustment, it is logical according to the color if the average value of the black level in the Color Channel is more than the desired value of its black level
The size of the corresponding black level average value in road and the absolute value of desired value difference selects corresponding adjusting step.Wherein, adjustment step
The order of magnitude of long and black level average value difference is one-to-one, and adjusting step is directly proportional to the absolute value of difference,
The absolute value of difference is bigger, and adjusting step is also bigger, and the corresponding need preset can be found according to the order of magnitude of difference
The step-length to be changed.Then, the forward voltage value of feedback of the Color Channel is added into corresponding adjusting step, that is to say, that
Increase forward voltage value of feedback.
If the average value of the black level in some Color Channel is less than the desired value of black level, according to the Color Channel
The size of corresponding black level average value and the absolute value of desired value difference selects corresponding adjusting step, then, by the color
The forward voltage value of feedback in channel subtracts corresponding adjusting step, that is to say, that reduces forward voltage value of feedback.
S105, when the absolute value of difference be less than first threshold when, to the black level average value in corresponding Color Channel into
Line number word adjusts.
It specifically, can be to the absolute value of the average value of black level in each Color Channel and desired value difference respectively with first
Threshold value is compared, and the average value of black level and the absolute value of desired value difference are less than first threshold in some Color Channel
When, digital adjustment is carried out to the black level average value in the Color Channel.
It is to be further understood that after the completion of the analog regulation, or when simulation is adjusted manually, when some Color Channel
When the average value of interior black level and the absolute value of desired value difference are less than first threshold, digital black level adjustment should be switched to.
Before digital black level adjustment, the forward voltage value of feedback in the channel should be kept to remain unchanged.
In one embodiment of the invention, number adjustment tool is carried out to the black level average value in corresponding Color Channel
Body includes:By being more than black appliances in previous frame image when black level average value in current frame image and the absolute value of desired value difference
The absolute value of average mean value and desired value difference, and in current frame image black level average value and desired value difference and former frame
When black level average value is identical with the difference symbol of desired value in image, then by the difference of former frame increase preset value, and according to
Increased difference is adjusted the pixel value in current frame image;Otherwise, by the difference of former frame reduction preset value, and according to
The difference of reduction is adjusted the pixel value in current frame image.
Wherein, preset value can be the value given tacit consent in the adjusting apparatus of black level in cmos sensor image.For example, default
Value is 1.Specifically, it when some Color Channel needs to carry out digital black level adjustment, can first calculate current in the Color Channel
Black level average value and desired value difference in frame image.If the black level average value of calculated present frame and the difference of desired value
Value is identical as the difference symbol of former frame, and the absolute value of the difference of present frame is more than the absolute value of former frame difference, then should
The difference of black level average value and desired value obtains a new difference plus preset value 1 in previous frame image in Color Channel,
And the pixel value in current frame image is added into the new difference.It should be appreciated that needing average to the black appliances in the Color Channel
Mean value carries out the step of number adjustment cycle and is handled, until black level average value and desired value difference in the Color Channel
When absolute value is less than second threshold, end number adjustment.Wherein, second threshold can be black level in cmos sensor image
The value given tacit consent in adjusting apparatus.
If it should be appreciated that the black level average value and the difference of desired value and the difference of former frame of calculated present frame
Symbol is identical, and the absolute value of the difference of present frame is more than the absolute value of former frame difference, then by former frame in the Color Channel
The difference of black level average value and desired value obtains a new difference plus preset value 1 in image, and will be in current frame image
Pixel value subtract the new difference.
Other than in addition among the above the case where, if the difference of the black level average value of calculated present frame and desired value with
The difference symbol of former frame on the contrary, and the absolute value of the difference of present frame be more than/be less than the absolute value of former frame difference, then should
The difference of black level average value and desired value subtracts preset value 1 and obtains a new difference in previous frame image in Color Channel,
And the pixel value in current frame image is subtracted into the new difference.
The method of adjustment of black level in the cmos sensor image of the embodiment of the present invention, by black in each Color Channel
The average value of level and the absolute value of desired value difference are compared with first threshold, and according to comparison result to corresponding color
Black level average value in channel carries out simulation adjustment and number adjustment, so that the black level of each Color Channel is averaged
Value increasingly approaches its desired value, until the two is close, more the average value of the black level of each Color Channel can be made to tend to
It is equal, each Color Channel can be made to possess more color expression ranges as a result, and can effectively avoid in cmos sensor
It is generated when black level carries out simulation coarse adjustment and excessively adjusts and lead to image flicker.
In order to realize above-described embodiment, the present invention also proposes a kind of adjusting apparatus of black level in cmos sensor image.
Fig. 2 be one embodiment of the invention cmos sensor image in black level adjusting apparatus structural schematic diagram.
As shown in Fig. 2, the adjusting apparatus of black level includes in cmos sensor image:First computing module 100, second is counted
Calculate module 200, third computing module 300, the first adjustment module 400 and second adjustment module 500.
Specifically, the first computing module 100 is used to calculate separately in cmos sensor image black appliances in each Color Channel
Flat average value.
Second computing module 200 is used to calculate the desired value of black level in CMOS sensor images.
Third computing module 300 is used to calculate separately the desired value of black level average value and black level in each Color Channel
The absolute value of difference.More specifically, third computing module 300 respectively by the average value of the black level in four Color Channels with it is black
The desired value of level subtracts each other the difference for obtaining the average value of black level and desired value in each Color Channel.
The first adjustment module 400 is used for when the absolute value of difference is more than first threshold, to black in corresponding color channel
Level average carries out simulation adjustment.Wherein, first threshold is using the critical value of simulation adjustment and number adjustment, first threshold
It can be the value given tacit consent in the adjusting apparatus of black level in cmos sensor image.More specifically, can be logical to each color respectively
The average value of black level and the absolute value of desired value difference are compared with first threshold in road, judge that the absolute value of the difference is fallen
It in the region of digital fine tuning or falls in the region of simulation coarse adjustment, the average value of black level is carried out thus, it is possible to determine
Simulation adjustment or number adjustment.If the average value of black level and the absolute value of desired value difference are more than in some Color Channel
When first threshold, the first adjustment module 400 carries out simulation adjustment to the black level average value in the Color Channel.Wherein, it simulates
Adjustment refers to the average value and its corresponding desired value by comparing black level in Color Channel, and analog signal processing is given in rewriting
Then forward voltage value of feedback in the Color Channel of modules A SP is converted to the two by numeral/analog conversion module DAC
Corresponding positive voltage value so that different voltage values is added/subtracted from the channel, and voltage value must change by analog/digital
It can be embodied in the average value that black level adjusts again after conversion module ADC conversion outputs, then compare the flat of black level again
Difference between mean value and desired value, and the positive voltage value of feedback in Color Channel is adjusted, thus, it is possible to so that channel
The average value of interior black level gradually levels off to desired value, to achieve the effect that adjusting.
Second adjustment module 500 is used for when the absolute value of difference is less than first threshold, in corresponding Color Channel
Black level average value carries out digital adjustment.More specifically, can be to the average value and target value difference of black level in each Color Channel
The absolute value of value is compared with first threshold respectively, the average value of black level and desired value difference in some Color Channel
When absolute value is less than first threshold, second adjustment module 500 carries out digital adjustment to the black level average value in the Color Channel.
The adjusting apparatus of black level, passes through the first adjustment module and second in the cmos sensor image of the embodiment of the present invention
Adjustment module carries out simulation adjustment to the black level average value in corresponding Color Channel and number adjusts, so that each face
The average value of the black level of chrominance channel increasingly approaches its desired value, until the two is close, can more make each Color Channel
The average value of black level tend to be equal, each Color Channel can be made to possess more color expression ranges as a result, and can have
It is generated when effect avoids carrying out simulation coarse adjustment to black level in cmos sensor and excessively adjusts and lead to image flicker.
Fig. 3 be a specific embodiment of the invention cmos sensor image in black level adjusting apparatus structural representation
Figure.
As shown in figure 3, the adjusting apparatus of black level includes in cmos sensor image:First computing module 100, second is counted
Calculate module 200, third computing module 300, the first adjustment module 400 and second adjustment module 500, wherein the first computing module
100 include:First acquisition unit 110 and the first computing unit 120, the second computing module 200 include:Second acquisition unit 210
With the second computing unit 220, the first adjustment module 400 includes:Third acquiring unit 410, the 4th acquiring unit 420 and adjustment are single
Member 430, wherein adjustment unit 430 includes:The first adjustment subelement 431 and second adjustment subelement 432, second adjustment module
500 include:The first adjustment unit 510 and second adjustment unit 520.
Specifically, the first acquisition unit 110 in the first computing module 100 is used to obtain the first black row in Color Channel
Marking signal and black row data and the first computing unit 120 are used to be calculated according to the first black line flag signal and black row data
The average value of black level.Specifically, first, under common scenarios, cmos sensor first exports 8 rows(Arbitrary 1 row)Black row, so
Afterwards, first acquisition unit 110 obtains in cmos sensor image respectively, and each color of four Color Channels is logical in the black row of 8 rows
Black line flag signal in road and black row data.Subsequently, the first computing unit 120 is according to the black rower in each Color Channel
Will signal and black row data calculate separately the average value of the corresponding black level of each Color Channel.
Specifically, in one embodiment of the invention, the second acquisition unit 210 in the second computing module 200 is used for
It obtains marking signal and second computing unit 220 of the CMOS sensor images when reaching the maximum time of integration and is used for basis
The corresponding global gain signal of marking signal when reaching maximum time integral calculates the desired value of black level.More specifically,
In CMOS sensors, black line flag signal and global gain signal are sent out by functional device.Therefore, it is reached in the time of integration
When to the maximum time of integration, second acquisition unit 210 can obtain global gain signal this moment by the functional device.Wherein,
The size and global gain of black level desired value are directly proportional, according to the size of global gain signal, linearly improve four colors
The black level desired value in channel.Black level desired value is bigger, and the saturation degree of image is lower, and desired value is smaller, the saturation degree of image
Lower, level is abundanter.The brightness of dark scene in sensor image can be improved as a result,.Then, 220 basis of the second computing unit
The corresponding global gain signal of marking signal when reaching maximum time integral calculates the desired value of black level at this time.
In one embodiment of the invention, the third acquiring unit 410 in the first adjustment module 400 is for obtaining color
Forward voltage value of feedback in channel, the 4th acquiring unit 420 are used for according to black level average value and desired value in Color Channel
The absolute value of difference obtains corresponding adjusting step and adjustment unit 430 is used to feed back forward voltage according to adjusting step
Value is adjusted.Wherein, adjustment unit 430 specifically includes:The first adjustment subelement 431 is used to be more than when the average value of black level
When the desired value of black level, forward voltage value of feedback is increased according to adjusting step, second adjustment subelement 432 is for working as black level
Average value be less than black level desired value when, according to adjusting step reduce forward voltage value of feedback.Specifically, adjustment unit
The average value of 430 pairs of black levels and the absolute value of desired value difference are more than the forward voltage feedback in the Color Channel of first threshold
Value is adjusted, if the average value of the black level in the Color Channel is more than the desired value of its black level, the first adjustment
Subelement 431 selects corresponding according to the size of the corresponding black level average value of the Color Channel and the absolute value of desired value difference
Adjusting step.Wherein, the order of magnitude of adjusting step and the difference of black level average value is one-to-one, adjustment step
Length is directly proportional to the absolute value of difference, and the absolute value of difference is bigger, and adjusting step is also bigger, can according to the order of magnitude of difference
To find the step-length for needing to change accordingly preset.Then, by the forward voltage value of feedback of the Color Channel plus opposite
The adjusting step answered, that is to say, that increase forward voltage value of feedback.
If the average value of the black level in some Color Channel is less than the desired value of black level, second adjustment subelement
432 select corresponding adjustment step according to the size of the corresponding black level average value of the Color Channel and the absolute value of desired value difference
It is long, then, the forward voltage value of feedback of the Color Channel is subtracted into corresponding adjusting step, that is to say, that reduce forward voltage
Value of feedback.
In one embodiment of the invention, the first adjustment unit 510 in second adjustment module 500 is for working as present frame
Black level average value and the absolute value of desired value difference are more than black level average value and target value difference in previous frame image in image
The absolute value of value, and black level average value in the difference and previous frame image of black level average value and desired value in current frame image
When identical with the difference symbol of desired value, then the difference of former frame is increased into preset value, and according to increased difference to present frame
Pixel value in image is adjusted, and second adjustment unit 520 is used for when otherwise, and the difference of former frame is reduced preset value,
And the pixel value in current frame image is adjusted according to the difference of reduction.
Wherein, preset value can be the value given tacit consent in the adjusting apparatus of black level in cmos sensor image.For example, default
Value is 1.Specifically, it when some Color Channel needs to carry out digital black level adjustment, can first calculate current in the Color Channel
Black level average value and desired value difference in frame image.If the black level average value of calculated present frame and the difference of desired value
Value is identical with the difference symbol of former frame, and the absolute value of the difference of present frame is more than the absolute value of former frame difference, then and first
Adjustment unit 510 obtains the difference of black level average value and desired value in previous frame image in the Color Channel plus preset value 1
The difference new to one, and the pixel value in current frame image is added into the new difference.It should be appreciated that needing logical to the color
Black level average value in road carries out the step of number adjustment cycle and is handled, until black level average value in the Color Channel
When being less than second threshold with the absolute value of desired value difference, end number adjustment.Wherein, second threshold can be cmos sensor
The value given tacit consent in the adjusting apparatus of black level in image.
In one embodiment of the invention, if second adjustment unit 520 is additionally operable to the black appliances of calculated present frame
The difference symbol of the difference and former frame of average mean value and desired value on the contrary, and the absolute value of the difference of present frame be more than/be less than
The absolute value of former frame difference then subtracts the difference of black level average value and desired value in previous frame image in the Color Channel
Preset value 1 obtains a new difference, and the pixel value in current frame image is subtracted the new difference.
The adjusting apparatus of black level, passes through the first adjustment module pair first in the cmos sensor image of the embodiment of the present invention
Black level in Color Channel carries out simulation coarse adjustment, then carries out digital adjustment to it by second adjustment module so that Mei Geyan
The average value of the black level of chrominance channel increasingly approaches its desired value, until the two is close, so that each Color Channel
The average value of black level tends to be equal.Each Color Channel can be made to possess more color expression ranges as a result, and can be further
Improve the quality that image is come out from cmos sensor in ground.
In order to realize that above-described embodiment, the present invention also propose a kind of cmos sensor.
The adjustment of black level in a kind of cmos sensor, including the cmos sensor image of second aspect of the present invention embodiment
Device.
The cmos sensor of the embodiment of the present invention can carry out the black level in Color Channel simulation adjustment and digital number
Adjustment so that each Color Channel can possess more color expression ranges, and can effectively avoid thick only with simulation
It is led to the problem of when adjusting black level and excessively adjusts and lead to image flicker.
It should be appreciated that each section of the present invention can be realized with hardware, software, firmware or combination thereof.Above-mentioned
In embodiment, software that multiple steps or method can in memory and by suitable instruction execution system be executed with storage
Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware
Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal
Discrete logic, with suitable combinational logic gate circuit application-specific integrated circuit, programmable gate array(PGA), scene
Programmable gate array(FPGA)Deng.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not
Centainly refer to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be any
One or more embodiments or example in can be combined in any suitable manner.
Although an embodiment of the present invention has been shown and described, it will be understood by those skilled in the art that:Not
In the case of being detached from the principle of the present invention and objective a variety of change, modification, replacement and modification can be carried out to these embodiments, this
The range of invention is limited by claim and its equivalent.