The invention generally relates to a correction method, and in particular relates to a method for correcting the response of a charge coupled device (CCD).
Charge coupled devices (CCD) are being currently and widely used as image detecting elements. Charge coupled devices use photodiodes to convert light into electricity so that images are converted into digital data. Photodiode is a kind of semiconductor device that processes image pixel. A single-CCD camera is a camera including only a unit of CCD to convert both luminosity and color signals. Therefore, a tri-CCD camera is a camera having three units of CCD. The light passing through a special prism is separated into R (red), G (green) and B (blue) color lights. Each color light is processed by a CCD and converted into electrical signal. Then, an electrical circuit processes the signals into image signal, thus form a 3CCD system. In comparison with single-CCD, 3CCD separately uses three CCD units to convert red, green and blue signals, the photograph color reverted from the image signals is more accurate and natural than that from a single-CCD, the clarity and the signal to noise ratio is higher, the sensitivity is better, and the dynamic operation range is also wider.
The electrical signal from each pixel of the CCD is transferred orderly to the next pixel and outputted from the bottom portion, then amplified by an amplifier at the rim of the CCD.
The CCD imaging pixels are arranged in an X-Y array. Each pixel is composed of a photodiode and an adjacent serial buffer. The photodiode converts the photons of light into electrons that reflect the brightness of that pixel. The whole image electrons are gained at the same time and shifted off the CCD array using electron diffusion with a voltage gradient. The image is scanned through the serial buffer, amplified and shifted into an A to D converter so as to get a low noise, high performance image.
However, the image from CCD is usually imperfect that requires color correction. Each CCD unit has its response characteristics that even CCDs of the same model from a same maker have differences when processing the same image. Some serious imaging problems coming from deviation of pixels in the linear CCD, uneven illumination in the scanning environment and non-uniform components in the CCD make the output signal weak or defective that requires correction. Therefore, the correction is to adjust the color response to meet some standardized reference values so that the inputs can be transformed into qualified color outputs. Conventional correction manner is to use a multiplier and several gain ranges and reference values to adjust the gains into suitable ranges. However, this method is not well effective for CCD correction.
In order to solve the above problems, the object of the invention is to provide a method for correcting a CCD in which the optoelectronic signals are corrected so as to enhance the pixel response of the CCD.
In order to achieve the aforesaid objective, the method for correcting the response of a charge coupled device is provided. First fetches the black reference values and white reference values of each pixel of the CCD. Then, calculate the gain values according to the black and white reference values. Further, generate and store a correction table according to the black reference values and the gain values. Finally, adjust and get a correction value from the real response of the CCD according to the correction table. Therefore, the CCD response is corrected and improved.
The invention will become more fully understood from the detailed description given herein below. However, this description is for purposes of illustration only, and thus is not limitative of the invention, wherein:
Basically, each imaging pixel of a CCD performs a function of outputting voltage relative to the received optical energy in a linear way. However, the constant in the linear function has to be adjusted according to the variation of the pixels. Besides, the additional error caused by uneven illumination and non-uniform components in the CCD can be corrected through a linear transformation of each pixel.
As shown in
The first step is to fetch the black reference values Black_ref and white reference values White_ref of each pixel of the CCD. Then, check the relationship between the real response and the ideal response of the CCD.
wherein the “Offset” is an offset value to avoid that the correction value Correction_Value is negative.
The formula 1 can be simplified as:
is a constant, and the n is a positive integer.
Therefore, according Formula 2, the correction value Correction_Value can be calculated from the real response Input_Value, the gain values Gain_Value and the black reference value Black_ref.
The gain values Gain_Value and the black reference value Black_ref are pre-determined and stored in a correction table in memory, such as DRAM. The correction values are stored in a SCCR register in three formats of one-byte, two-byte and three-byte as in Table 1.
The operation for 1-byte value is only 8 bits gain. The operations for two-byte values include four combinations (16 bits in total) of black reference value Black_ref and gain value Gain_Value. The operation for three-byte value is an addition of 12 bits black reference value Black_ref and 12 bits gain values Gain_Value. Therefore, the corrections for CCD may include both gain correction and black reference value correction, or just the gain correction.
The black reference value of each pixel is first calculated by sum of black reference value and black value offset stored in the BLCR register. The black reference value is increased by multiplication of *1, *2, *4, *8, *16, then subtracted by the real response Input_Value. Then, performing post-scaling by multiplication of the black reference value and *1, *2, *4, *8, *16. Finally, correcting the pixel response with a suitable multiplication according to a gain range defined in the SCCR register.
Supposing the gain range is defined of 8 bits, the adjustment range is defined as * 1 to *5. For convenience of use, the gain value Gain_Value is encoded as a gain value in the table Table Gain Value, as shown in Table 2.
The relationship is:
Gain_Value=2n (Gain_Value−1)|n=6,7,8,9,11,12 Formula 3
in which
Shading_Value=Table_Gain_Value; and
Gain=Gain_Value.
The number n is determined by:
Max_Table_Gain_Value=2n (Max_Gain_Value−1)|n=6,7,8,9,10,11,12·
For an 8-bit encoding, the “Max_Table_Gain_Value” is 255. When the “Max_Gain_Value” is 5, Formula 3 is transformed into:
From formula 4 and formula 2, we get that:
The invention uses the formula 5 to get correction values. The black reference value Black_ref and the gain value in the table Table_Gain_Value are all stored in the correction table in memory. The formats of the correction table are shown in
The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.