Embodiment
Be described below in detail embodiments of the invention, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Being exemplary below by the embodiment be described with reference to the drawings, only for explaining the present invention, and can not limitation of the present invention being interpreted as.On the contrary, embodiments of the invention comprise fall into attached claims spirit and intension within the scope of all changes, amendment and equivalent.
In describing the invention, it is to be appreciated that term " first ", " second " etc. are only for describing object, and instruction or hint relative importance can not be interpreted as.In describing the invention, it should be noted that, unless otherwise clearly defined and limited, term " is connected ", " connection " should be interpreted broadly, such as, can be fixedly connected with, also can be removably connect, or connect integratedly; Can be mechanical connection, also can be electrical connection; Can be directly be connected, also indirectly can be connected by intermediary.For the ordinary skill in the art, concrete condition above-mentioned term concrete meaning in the present invention can be understood.In addition, in describing the invention, except as otherwise noted, the implication of " multiple " is two or more.
Describe and can be understood in flow chart or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by embodiments of the invention person of ordinary skill in the field.
Below with reference to the accompanying drawings the method for adjustment of black level in the cmos sensor image according to the embodiment of the present invention, device and cmos sensor are described.
At present, black level in cmos image sensor is adjusted to the mean value of the black level normally first calculating odd column and even column Color Channel.Then compare by the desired value of its parity column respectively, and feedback regulation value given analog module (ASP, analog signal processing) or directly view data processed.But the adjustment only carrying out odd even two passages can cause wherein certain Color Channel to regulate not in place, color expression range and saturation are lost.
If the mode that simulation can be adopted to mix with numeral carries out black level adjustment to each Color Channel in cmos sensor, specifically, first by analog form, coarse adjustment is carried out to black level, by digital form, fine tuning is carried out to black level again, make mean value slowly its desired value of convergence of black level in cmos sensor image, until mean value is close with desired value, even make the mean value of black level in each Color Channel equal.Thus, more comprehensively flexibly and accurately, in cmos sensor, each Color Channel has more color expression range in the adjustment that can make black level, and toning and cause the problem of image flicker when can effectively prevent from simulating coarse adjustment.
Fig. 1 is the flow chart of the method for adjustment of black level in the cmos sensor image of one embodiment of the invention.
As shown in Figure 1, in cmos sensor image, the method for adjustment of black level comprises the following steps.
S101, calculates the mean value of black level in each Color Channel in cmos sensor image respectively.
In one embodiment of the invention, the black line flag signal in Color Channel and black row data can be obtained, and calculate the mean value of black level according to black line flag signal and black row data.Particularly, first, under common scenarios, cmos sensor first exports 8 row (any 1 row) black row, then, obtains respectively in cmos sensor image, in the black row of 8 row four Color Channels each Color Channel in black line flag signal and black row data.Subsequently, the mean value of black level corresponding to each Color Channel is calculated respectively according to the black line flag signal in each Color Channel and black row data.Be to be understood that, existing method can be used to realize when calculating the mean value of black level in each Color Channel in cmos sensor image, namely, by the computational methods of mean value, namely, according to the black line flag of two row, cumulative averaging is carried out to black row data, thus draws the black level mean value of four Color Channels.Therefore, in order to avoid redundancy, no longer repeat herein.
S102, calculates the desired value of black level in COMS sensor image.
In one embodiment of the invention, marking signal when Color Channel inherence reaches the maximum time of integration can be obtained, and according to the desired value of global gain calculated signals black level corresponding to the marking signal when reaching maximum time integration.Particularly, in COMS transducer, send black line flag signal and global gain signal by functional device.Therefore, when reaching the maximum time of integration, by this functional device acquisition global gain signal this moment time of integration.Wherein, size and the global gain of black level desired value are directly proportional, and according to the size of global gain signal, improve the black level desired value of four Color Channels linearly.The desired value of black level is larger, and the saturation of image is lower, and desired value is less, and the saturation of image is higher, and level is abundanter.Thus, the brightness of dark scene in sensor image can be improved.Existing method can be used to realize when should be appreciated that the desired value calculating black level in each Color Channel in cmos sensor image, in order to avoid redundancy, no longer repeat herein.
S103, calculates the absolute value of black level mean value and desired value difference in each Color Channel respectively.
Respectively the mean value of black level in four Color Channels and the desired value of black level are subtracted each other and draw the mean value of black level and the difference of desired value in each Color Channel.
S104, when the mean value of black level in certain Color Channel and the absolute value of desired value difference are greater than first threshold, carries out simulation adjustment to the black level mean value in the Color Channel of correspondence.
Wherein, first threshold is the critical value adopting simulation adjustment and numeral adjustment, and first threshold can be the value given tacit consent in the adjusting device of black level in cmos sensor image.Particularly, can compare the mean value of black level in each Color Channel and the absolute value of desired value difference and first threshold respectively, judge in the region that the absolute value of this difference drops on digital fine tuning or drop in the region of simulation coarse adjustment, thus, can determine to carry out simulation adjustment or numeral adjustment to the mean value of black level.If when the mean value of black level and the absolute value of desired value difference are greater than first threshold in certain Color Channel, simulation adjustment is carried out to the black level mean value in this Color Channel.Wherein, simulation adjustment refers to by comparing the mean value of black level and the desired value of correspondence thereof in Color Channel, rewrite and give the value of feedback of the forward voltage in the Color Channel of analog modules A SP, then by numeral/analog conversion module DAC, both are converted to corresponding positive voltage value, make to add/deduct different magnitudes of voltage in this passage, and the change of magnitude of voltage ground transforms after output can embody in the mean value of black level adjustment through analog-to-digital converting module ADC, and then the difference compared between the mean value of black level and desired value, and the positive voltage value of feedback in Color Channel is adjusted, thus, the mean value of the black level in passage can be made to level off to desired value gradually, thus reach the effect of adjustment.
In one embodiment of the invention, carry out simulating adjustment to the black level mean value in Color Channel specifically to comprise: obtain the forward voltage value of feedback in Color Channel, and adjust step-length accordingly according to the absolute value acquisition of black level mean value and desired value difference in Color Channel, and according to adjustment step-length, forward voltage feedback value is adjusted.Specifically, the forward voltage value of feedback that the mean value of black level and the absolute value of desired value difference are greater than in the Color Channel of first threshold is adjusted, if when the mean value of the black level in this Color Channel is greater than the desired value of its black level, then select to adjust step-length accordingly according to the size of the absolute value of black level mean value corresponding to this Color Channel and desired value difference.Wherein, the order of magnitude of the difference of adjustment step-length and black level mean value is one to one, and adjustment step-length is directly proportional to the absolute value of difference, and the absolute value of difference is larger, adjustment step-length is also larger, can find the corresponding step-length needing to change preset according to the order of magnitude of difference.Then, the forward voltage value of feedback of this Color Channel is added corresponding adjustment step-length, that is, increase forward voltage value of feedback.
If the mean value of the black level in certain Color Channel is less than the desired value of black level, then select to adjust step-length accordingly according to the size of the absolute value of black level mean value corresponding to this Color Channel and desired value difference, then, the forward voltage value of feedback of this Color Channel is deducted and adjusts step-length accordingly, that is, forward voltage value of feedback is reduced.
S105, when the absolute value of difference is less than first threshold, carries out numeral adjustment to the black level mean value in the Color Channel of correspondence.
Particularly, can compare with first threshold respectively the absolute value of the mean value of black level in each Color Channel and desired value difference, when the mean value of black level and the absolute value of desired value difference are less than first threshold in certain Color Channel, numeral adjustment is carried out to the black level mean value in this Color Channel.
It is to be further understood that after analog regulation completes, or during simulation manual adjustments, when the mean value of black level in certain Color Channel 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 this passage should be kept to remain unchanged.
In one embodiment of the invention, carry out numeral adjustment to the black level mean value in the Color Channel of correspondence specifically to comprise: by being greater than the absolute value of black level mean value and desired value difference in previous frame image when the absolute value of black level mean value and desired value difference in current frame image, and when in current frame image, black level mean value is identical with the difference symbol of desired value with black level mean value in previous frame image with the difference of desired value, then the difference of former frame is increased preset value, and according to the difference increased, the pixel value in current frame image is adjusted; Otherwise, the difference of former frame is reduced preset value, and according to the difference reduced, the pixel value in current frame image is adjusted.
Wherein, preset value can be the value given tacit consent in the adjusting device of black level in cmos sensor image.Such as, preset value is 1.Particularly, when certain Color Channel needs to carry out digital black level adjustment, first can to calculate in this Color Channel black level mean value and desired value difference in current frame image.If the black level mean value of the present frame calculated is identical with the difference symbol of former frame with the difference of desired value, and the absolute value of the difference of present frame is greater than the absolute value of former frame difference, then the difference of black level mean value and desired value in previous frame image in this Color Channel is added that preset value 1 obtains a new difference, and the pixel value in current frame image is added this new difference.Should be appreciated that the step cycle needing to carry out the black level mean value in this Color Channel numeral adjustment processes, until when in this Color Channel, the absolute value of black level mean value and desired value difference is less than Second Threshold, end number adjusts.Wherein, Second Threshold can be the value given tacit consent in the adjusting device of black level in cmos sensor image.
Be to be understood that, if the black level mean value of the present frame calculated is identical with the difference symbol of former frame with the difference of desired value, and the absolute value of the difference of present frame is greater than the absolute value of former frame difference, then the difference of black level mean value and desired value in previous frame image in this Color Channel is added that preset value 1 obtains a new difference, and the pixel value in current frame image is deducted this new difference.
Except the situation in above-mentioned, if the difference of the black level mean value of the present frame calculated and desired value is contrary with the difference symbol of former frame, and the absolute value of the difference of present frame is greater than/is less than the absolute value of former frame difference, then the difference of black level mean value and desired value in previous frame image in this Color Channel is deducted preset value 1 and obtain a new difference, and the pixel value in current frame image is deducted this new difference.
The method of adjustment of black level in the cmos sensor image of the embodiment of the present invention, by comparing the mean value of black level in each Color Channel and the absolute value of desired value difference and first threshold, and according to comparative result, simulation adjustment and numeral adjustment are carried out to the black level mean value in the Color Channel of correspondence, thus make mean value more and more its desired value of convergence of the black level of each Color Channel, until both are close, the mean value of the black level of each Color Channel more can be made to be tending towards equal, thus, each Color Channel can be made to have more color expression range, and can effectively avoid producing when carrying out simulation coarse adjustment to black level in cmos sensor excessively regulating and causing image flicker.
In order to realize above-described embodiment, the present invention also proposes the adjusting device of black level in a kind of cmos sensor image.
Fig. 2 is the structural representation of the adjusting device of black level in the cmos sensor image of one embodiment of the invention.
As shown in Figure 2, in cmos sensor image, the adjusting device of black level comprises: the first computing module 100, second computing module 200, the 3rd computing module 300, first adjusting module 400 and the second adjusting module 500.
Particularly, the first computing module 100 is for calculating the mean value of black level in each Color Channel in cmos sensor image respectively.
Second computing module 200 is for calculating the desired value of black level in COMS sensor image.
3rd computing module 300 is for calculating the absolute value of the desired value difference of black level mean value and black level in each Color Channel respectively.More specifically, the mean value of black level in four Color Channels and the desired value of black level subtract each other and draw the mean value of black level and the difference of desired value in each Color Channel by the 3rd computing module 300 respectively.
First adjusting module 400, for when the absolute value of difference is greater than first threshold, carries out simulation adjustment to the black level mean value in corresponding color passage.Wherein, first threshold is the critical value adopting simulation adjustment and numeral adjustment, and first threshold can be the value given tacit consent in the adjusting device of black level in cmos sensor image.More specifically, can compare the mean value of black level in each Color Channel and the absolute value of desired value difference and first threshold respectively, judge in the region that the absolute value of this difference drops on digital fine tuning or drop in the region of simulation coarse adjustment, thus, can determine to carry out simulation adjustment or numeral adjustment to the mean value of black level.If when in certain Color Channel, the mean value of black level and the absolute value of desired value difference are greater than first threshold, the first adjusting module 400 carries out simulation adjustment to the black level mean value in this Color Channel.Wherein, simulation adjustment refers to by comparing the mean value of black level and the desired value of correspondence thereof in Color Channel, rewrite and give the value of feedback of the forward voltage in the Color Channel of analog modules A SP, then by numeral/analog conversion module DAC, both are converted to corresponding positive voltage value, make to add/deduct different magnitudes of voltage in this passage, and magnitude of voltage must change through analog-to-digital converting module ADC transform export after can black level adjustment mean value in embody, and then the difference compared between the mean value of black level and desired value, and the positive voltage value of feedback in Color Channel is adjusted, thus, the mean value of the black level in passage can be made to level off to desired value gradually, thus reach the effect of adjustment.
Second adjusting module 500, for when the absolute value of difference is less than first threshold, carries out numeral adjustment to the black level mean value in the Color Channel of correspondence.More specifically, can compare with first threshold respectively the absolute value of the mean value of black level in each Color Channel and desired value difference, when in certain Color Channel, the mean value of black level and the absolute value of desired value difference are less than first threshold, the second adjusting module 500 carries out numeral adjustment to the black level mean value in this Color Channel.
The adjusting device of black level in the cmos sensor image of the embodiment of the present invention, by the first adjusting module and the second adjusting module, simulation adjustment and numeral adjustment are carried out to the black level mean value in the Color Channel of correspondence, thus make mean value more and more its desired value of convergence of the black level of each Color Channel, until both are close, the mean value of the black level of each Color Channel more can be made to be tending towards equal, thus, each Color Channel can be made to have more color expression range, and can effectively avoid producing when carrying out simulation coarse adjustment to black level in cmos sensor excessively regulating and causing image flicker.
Fig. 3 is the structural representation of the adjusting device of black level in the cmos sensor image of the present invention's specific embodiment.
As shown in Figure 3, in cmos sensor image, the adjusting device of black level comprises: the first computing module 100, second computing module 200, 3rd computing module 300, first adjusting module 400 and the second adjusting module 500, wherein, first computing module 100 comprises: the first acquiring unit 110 and the first computing unit 120, second computing module 200 comprises: second acquisition unit 210 and the second computing unit 220, first adjusting module 400 comprises: the 3rd acquiring unit 410, 4th acquiring unit 420 and adjustment unit 430, wherein, adjustment unit 430 comprises: the first adjustment subelement 431 and the second adjustment subelement 432, second adjusting module 500 comprises: the first adjustment unit 510 and the second adjustment unit 520.
Particularly, the first acquiring unit 110 in first computing module 100 is for obtaining the first black line flag signal in Color Channel and black row data, and the first computing unit 120 is for calculating the mean value of black level according to the first black line flag signal and black row data.Specifically, first, under common scenarios, cmos sensor first exports 8 row (any 1 row) black row, then, the first acquiring unit 110 obtains in cmos sensor image respectively, in the black row of 8 row four Color Channels each Color Channel in black line flag signal and black row data.Subsequently, the first computing unit 120 calculates the mean value of black level corresponding to each Color Channel respectively according to the black line flag signal in each Color Channel and black row data.
Particularly, in one embodiment of the invention, second acquisition unit 210 in second computing module 200 is for obtaining the marking signal of COMS sensor image when reaching the maximum time of integration, and the second computing unit 220 is for the desired value according to global gain calculated signals black level corresponding to marking signal when reaching maximum time integration.More specifically, in COMS transducer, send black line flag signal and global gain signal by functional device.Therefore, when reaching the maximum time of integration, second acquisition unit 210 obtains global gain signal this moment by this functional device time of integration.Wherein, size and the global gain of black level desired value are directly proportional, and according to the size of global gain signal, improve the black level desired value of four Color Channels linearly.Black level desired value is larger, and the saturation of image is lower, and desired value is less, and the saturation of image is lower, and level is abundanter.Thus, the brightness of dark scene in sensor image can be improved.Then, the global gain calculated signals that the second computing unit 220 is corresponding according to marking signal when reaching maximum time integration goes out the desired value of now black level.
In one embodiment of the invention, the 3rd acquiring unit 410 in first adjusting module 400 is for obtaining the forward voltage value of feedback in Color Channel, 4th acquiring unit 420 adjusts step-length accordingly for obtaining according to the absolute value of black level mean value and desired value difference in Color Channel, and adjustment unit 430 is for adjusting forward voltage feedback value according to adjustment step-length.Wherein, adjustment unit 430 specifically comprises: the first adjustment subelement 431 is for when the mean value of black level is greater than the desired value of black level, forward voltage value of feedback is increased according to adjustment step-length, second adjustment subelement 432, for when the mean value of black level is less than the desired value of black level, reduces forward voltage value of feedback according to adjustment step-length.Specifically, the forward voltage value of feedback that the mean value of adjustment unit 430 pairs of black levels and the absolute value of desired value difference are greater than in the Color Channel of first threshold adjusts, if when the mean value of the black level in this Color Channel is greater than the desired value of its black level, then the first adjustment subelement 431 is selected to adjust step-length accordingly according to the size of the absolute value of black level mean value corresponding to this Color Channel and desired value difference.Wherein, the order of magnitude adjusting the difference of step-length and black level mean value is one to one, adjustment step-length is directly proportional to the absolute value of difference, the absolute value of difference is larger, and adjustment step-length is also larger, can find the corresponding step-length needing to change preset according to the order of magnitude of difference.Then, the forward voltage value of feedback of this Color Channel is added corresponding adjustment step-length, that is, increase forward voltage value of feedback.
If the mean value of the black level in certain Color Channel is less than the desired value of black level, then the second adjustment subelement 432 is selected to adjust step-length accordingly according to the size of the absolute value of black level mean value corresponding to this Color Channel and desired value difference, then, the forward voltage value of feedback of this Color Channel is deducted and adjusts step-length accordingly, that is, forward voltage value of feedback is reduced.
In one embodiment of the invention, the first adjustment unit 510 in second adjusting module 500 is for being greater than the absolute value of black level mean value and desired value difference in previous frame image when the absolute value of black level mean value and desired value difference in current frame image, and when in current frame image, black level mean value is identical with the difference symbol of desired value with black level mean value in previous frame image with the difference of desired value, then the difference of former frame is increased preset value, and according to the difference increased, the pixel value in current frame image is adjusted, second adjustment unit 520 for otherwise time, the difference of former frame is reduced preset value, and according to the difference reduced, the pixel value in current frame image is adjusted.
Wherein, preset value can be the value given tacit consent in the adjusting device of black level in cmos sensor image.Such as, preset value is 1.Particularly, when certain Color Channel needs to carry out digital black level adjustment, first can to calculate in this Color Channel black level mean value and desired value difference in current frame image.If the black level mean value of the present frame calculated is identical with the difference symbol of former frame with the difference of desired value, and the absolute value of the difference of present frame is greater than the absolute value of former frame difference, then the difference of black level mean value and desired value in previous frame image in this Color Channel is added that preset value 1 obtains a new difference by the first adjustment unit 510, and the pixel value in current frame image is added this new difference.Should be appreciated that the step cycle needing to carry out the black level mean value in this Color Channel numeral adjustment processes, until when in this Color Channel, the absolute value of black level mean value and desired value difference is less than Second Threshold, end number adjusts.Wherein, Second Threshold can be the value given tacit consent in the adjusting device of black level in cmos sensor image.
In one embodiment of the invention, if the black level mean value of present frame of the second adjustment unit 520 also for calculating is contrary with the difference symbol of former frame with the difference of desired value, and the absolute value of the difference of present frame is greater than/is less than the absolute value of former frame difference, then the difference of black level mean value and desired value in previous frame image in this Color Channel is deducted preset value 1 and obtain a new difference, and the pixel value in current frame image is deducted this new difference.
The adjusting device of black level in the cmos sensor image of the embodiment of the present invention, first by the first adjusting module, simulation coarse adjustment is carried out to the black level in Color Channel, by the second adjusting module, numeral adjustment is carried out to it again, make mean value more and more its desired value of convergence of the black level of each Color Channel, until both are close, thus the mean value of the black level of each Color Channel is made to be tending towards equal.Thus, each Color Channel can be made to have more color expression range, and the quality of out image from cmos sensor can be improved further.
In order to realize above-described embodiment, the present invention also proposes a kind of cmos sensor.
A kind of cmos sensor, comprises the adjusting device of black level in the cmos sensor image of second aspect present invention embodiment.
The cmos sensor of the embodiment of the present invention, simulation adjustment and digital number adjustment can be carried out to the black level in Color Channel, thus make each Color Channel can have more color expression range, and the problem effectively can avoided producing excessively adjustment when only adopting simulation coarse adjustment black level and cause image flicker.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple step or method can with to store in memory and the software performed by suitable instruction execution system or firmware realize.Such as, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: the discrete logic with the logic gates for realizing logic function to data-signal, there is the application-specific integrated circuit (ASIC) of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
In the description of this specification, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention, those having ordinary skill in the art will appreciate that: can carry out multiple change, amendment, replacement and modification to these embodiments when not departing from principle of the present invention and aim, scope of the present invention is by claim and equivalents thereof.