This application claims priority of Taiwanese Application No. 094117650, filed on May 30, 2005.
1. Field of the Invention
The present invention relates to a pixel compensation method for an image sensor, more particularly to a method for performing compensation of response intensities of pixels in a pattern obtained by an image sensor.
2. Description of the Related Art
An image-capturing device, such as a digital camera, includes an image sensor. The image sensor is typically a complementary metal oxide semiconductor (CMOS) sensor or a charge coupled device (CCD) sensor. The image sensor converts light into electrons at photosites. By placing a color filter array, such as a Bayer filter, over the sensor, a mosaic pattern of red, green, and blue pixels of different intensities is obtained. A demosaicing algorithm is then used to convert the mosaic of separate colors into an equally sized mosaic of true colors. As an example, the true color of a single pixel can be determined by averaging the values from the closest surrounding pixels by using interpolation techniques.
However, prior to performing demosaicing, the response intensities of the pixels may be uneven at areas where there should be uniformity due to such factors as lighting, circuit design characteristics, color differences, and defects in a lens of the image-capturing device. Such an adverse affect to the response intensities of the pixels is particularly marked among pixels of different columns and rows of the obtained pattern. Differences in pixel response intensities may cause color spots of localized color unevenness.
Therefore, the object of this invention is to provide a pixel compensation method for an image sensor that can make uniform response intensities of pixels in a pattern obtained by the image sensor, and in so doing overcome the problem of image color unevenness.
According to this invention, a pixel compensation method is implemented by an image-capturing device having an image sensor for obtaining a pixel pattern of a plurality of pixels, in which each of the pixels of the pixel pattern has a response intensity. The pixel compensation method includes: a) selecting a first block of a predetermined number of pixels from the pixel pattern obtained by the image sensor, the predetermined number of pixels of the first block being less than a total number of pixels of the pixel pattern; b) designating at least one pixel from the pixels of the first block as a stand-by compensation pixel; c) determining a first compensation value according to the response intensities of the pixels of the first block; and d) adjusting the response intensity of the stand-by compensation pixel according to the first compensation value.
Other features and advantages of the present invention will become apparent in the following detailed description of the preferred embodiment with reference to the accompanying drawings, of which:
The pattern 10 includes a plurality of blue rows 1, and a plurality of red rows 2 arranged alternatingly with the blue rows 1. Within each of the blue rows 1, a plurality of blue pixels 11 and a plurality of blue-row green pixels 12 are alternatingly arranged, and within each of the red rows 2, a plurality of red pixels 21 and a plurality of red-row green pixels 22 are alternatingly arranged. Further, the blue pixels 11 and the red-row green pixels 22 are arranged alternatingly in columns, and the blue-row green pixels 12 and the red pixels 21 are arranged alternatingly in columns. Hence, the columns formed by the blue pixels 11 and the red-row green pixels 22 are alternatingly arranged with the columns formed by the blue-row green pixels 12 and the red pixels 21.
The blue pixels 11, the red pixels 21, the blue-row green pixels 12, and the red-row green pixels 22 respectively exhibit different response intensities during operation of the image sensor. However, greater differences between the response intensities of the pixels in the blue rows 1 and the response intensities of the pixels in the red rows 2 may occur due to various factors, such as lighting, circuit design characteristics, color differences, lens characteristics of the image-capturing device, etc. With respect to the green pixels, non-uniform color is especially problematic when there is unevenness between the blue-row green pixels 12 and the red-row green pixels 22. The pixel compensation method of the present invention is able to solve color non-uniformity problems caused by such factors.
It is to be noted that the present invention is not limited with respect to the pattern 10 obtained by the image sensor as described above. That is, the method of the present invention contemplates application to image sensors used in conjunction with various types of color filter arrays, and is not limited to application to image sensors using a Bayer filter.
A pixel compensation method according to a preferred embodiment of the present invention will now be described with reference to
Referring first to
The pixels completely surrounded by the other pixels of the first block 3 are designated as pixels that are to undergo compensation (hereinafter referred to as “stand-by compensation pixels”). In this particular example, therefore, the pixels 322 and 323 are the stand-by compensation pixels of the first block 3. The response intensities of the pixels of the first block 3 determine an area characteristic with respect to the particular area where the first block 3 is located. The area characteristic is used to determine whether or not the stand-by compensation pixels will undergo compensation. When the first block 3 is in a high frequency response area, a relatively high frequency response area, or an extremely high frequency response area, a first compensation value is set at zero, and compensation of the response intensities of the stand-by compensation pixels of the first block 3 is performed using the first compensation value. That is, when the first block 3 is in one of the above three “high” areas, effectively no compensation of the stand-by compensation pixels of the first block 3 is performed. The meanings of these response area terms will become evident from the explanation provided below.
Subsequently, with reference to
The following are the steps involved in determining the response area where a selected block is positioned. The first block 3 of
In Step 1, it is determined if the first block 3 is in a high frequency response area or a flat response area. The sub-steps involved in Step 1 are described below.
A first threshold value is obtained. In the preferred embodiment, the first threshold value is a predetermined value. When a difference in the response intensities of any two identically colored pixels of the first block 3 is greater than or equal to the first threshold value, the first block 3 is determined to be in a high frequency response area. If this condition is not met, i.e., the differences in the response intensities of all pairs of identically colored pixels of the first block 3 are smaller than the first threshold value, it is determined that the first block 3 is in a flat response area.
In the example shown in
When selected from edges of the pattern 10 or from boundary portions corresponding to objects within the pattern 10, the first block 3 is typically determined to be in a high frequency response area. Therefore, Step 1 can ensure that pixels are not erroneously compensated.
In Step 2, if it is determined that the first block 3 is in a flat response area, it is then determined if the first block 3 is in a relatively high frequency response area or a relatively flat response area. The sub-steps involved in Step 2 are described below.
First, using a process that will be described hereinbelow, a second threshold value is obtained. When the difference in response intensities of identically colored pixels in any two rows and in the same column of the first block 3 is greater than the second threshold value, and optionally also has the same gradient, for example, the response intensities of the pixels in these rows are all larger or smaller than the response intensities of identically colored pixels in another row and in the same column, it is determined that the first block 3 is in a relatively high frequency response area. If, on the other hand, the difference in response intensities of identically colored pixels in any two rows and in the same column of the first block 3 is smaller than or equal to the second threshold value, it is determined that the first block 3 is in a relatively flat response area. It is to be noted that the above determinations may also be made on the basis of the response intensities of pixels in any two columns and of the same row, rather than on the basis of the response intensities of pixels in any two rows and in the same column as described above. Use of this alternative approach will be described in the example below.
In the example shown in
In Step 3, if it is determined that the first block 3 is in a relatively flat response area, then it is determined if the first block 3 is in an extremely high frequency response area or an extremely flat response area. The sub-steps associated with Step 3 will be described below.
First, a predetermined third threshold value is obtained. In the first block 3, when a difference between (a) an average value of the response intensities of four pixels of the same color and adjacent to one of the stand-by compensation pixels, and (b) the response intensity of the stand-by compensation pixel is greater than or equal to the third threshold value, it is determined that the first block 3 is in an extremely high frequency response area. Otherwise, it is determined that the first block 3 is in an extremely flat response area.
In the example shown in
Through the above steps, it may be determined whether the first block 3 is in a high frequency response area, a relatively high frequency response area, or an extremely high frequency response area. It is to be noted that during the above determinations, there are no limitations with respect to which of the determinations is made prior or subsequent to any other determination. Preferably, the present invention further includes step 1-1 in which a contrast area where the first block 3 is located is determined based on the response intensities of all the pixels of the first block 3. The second threshold value is then established according to the contrast area where the first block 3 is located, thereby resulting in more efficient and accurate removal of factors causing erroneous compensation. More preferably, step 1-1 of determining the contrast area where the first block 3 is located is performed subsequent to step 1 of determining if the first block 3 is in a high frequency response area, and prior to step 2 of determining if the first block 3 is in a relatively high frequency response area. Step 1-1 is described in more detail below.
Using predetermined first, second, and third contrast threshold values, where the first contrast threshold value is smaller than the second contrast threshold value, and the second contrast threshold value is smaller than the third contrast threshold value, the contrast area where the first block 3 is positioned is determined according to the response intensities of all the pixels of the first block 3 considered individually. When the response intensity of each of the pixels 311, 312, 313, 314, 321, 322, 323, 324, 331, 332, 333, 334 of the first block 3 is smaller than the first contrast threshold value, it is determined that the first block 3 is in a first contrast area. However, when the response intensity of any one of the pixels 311, 312, 313, 314, 321, 322, 323, 324, 331, 332, 333, 334 of the first block 3 is greater than or equal to the first contrast threshold value and smaller than the second contrast threshold value, it is determined that the first block 3 is in a second contrast area. Further, when the response intensity of each of the pixels 311, 312, 313, 314, 321, 322, 323, 324, 331, 332, 333, 334 of the first block 3 is greater than or equal to the second contrast threshold value and smaller than the third contrast threshold value, it is determined that the first block 3 is in a third contrast area.
While performing step 2, the obtained second threshold value has different predetermined values according to the contrast area where the first block 3 is located. In the preferred embodiment, the value of the second threshold value corresponding to the first contrast area is smaller than the value of the second threshold value corresponding to the second contrast area, and the value of the second threshold value corresponding to the second contrast area is smaller than the value of the third threshold value corresponding to the third contrast area. Because the response intensities (brightnesses) of the pixels of the first block 3 are all different, the differences between the response intensities of the pixels are also all different. Therefore, in step 2, the determination as to whether the first block 3 is in a relatively high frequency response area or a relatively flat response area is made based on the second threshold value, which is obtained differently for the different contrast areas, thereby further enhancing compensation accuracy.
In the above steps, it is determined whether the first block 3 is in a high frequency response area, a relatively high frequency response area, or an extremely high frequency response area, and effectively no compensation is performed when the first block 3 is in one of these areas. Next, a subsequent second block 3′ is selected. When the first block 3 is not in a high frequency response area, a relatively high frequency response area, or an extremely high frequency response area, compensation is performed. That is, only when the first block 3 is in an extremely flat response area is compensation of the stand-by compensation pixels 322 and 323 of the first block 3 performed. The steps to perform compensation are described in the following.
First, the first compensation value is determined. The first compensation value is a difference between the response intensity of one of the stand-by compensation pixels and an average value of response intensities of identically colored pixels of the first block 3 adjacent to the one of the stand-by compensation pixels. Next, the first compensation value is used to adjust the response intensities of both of the stand-by compensation pixels.
As an example, an average value of the response intensities of the blue-row green pixels 312, 314, 334, 332 is obtained, and a difference between this average value and the response intensity of the stand-by compensation pixel 323 is determined. The first compensation value is determined according to this difference, and compensation of both of the stand-by compensation pixels 322 and 323 is performed using the first compensation value thus obtained.
Following compensation of the stand-by compensation pixels of the first block 3 in an extremely flat response area, a subsequent block, i.e., the second block 3′, is selected from the pattern 10, after which processes similar to those performed with respect to the first block 3 are performed. That is, in the preferred embodiment, a second compensation value is obtained, and compensation of the stand-by compensation pixels 322′ and 323′ of the second block 3′ is performed according to both this second compensation value and the first compensation value of the first block 3. Selection and compensation of blocks from the pattern 10 are continued in this manner until compensation of all the pixels in a particular set of rows has been performed, after which a new block is selected by, for example, shifting the present block downwardly by two rows and back to the start of a new set of rows. The shifting process along the new set of rows is then repeated. This process is continued until compensation of all the pixels in the pattern 10 has been performed. With compensation thus performed, the newly obtained pattern is one having color evenness.
It is important to note that since the selection and compensation of the blocks are consecutive processes, during compensation of the stand-by compensation pixels in the blocks, in addition to the compensation value obtained for the presently selected block, the compensation value obtained for the previously selected block may also be referenced to perform compensation as described above. In the example shown in
From the aforementioned, the present invention uses a difference in response intensities between stand-by compensation pixels and pixels adjacent thereto, such that color uniformity may be realized. In addition, by determining the area of location of the stand-by compensation pixels, it is possible to eliminate compensation errors. Further, using the inherent differences of pixels under different brightness levels, different threshold values are given to contrast areas of different brightness levels to determine whether or not to perform compensation, thereby further enhancing precision. Finally, by dynamically adjusting the compensation value each time compensation of the stand-by compensation pixels is performed, even greater compensation precision may be realized.
While the present invention has been described in connection with what is considered the most practical and preferred embodiment, it is understood that this invention is not limited to the disclosed embodiment but is intended to cover various arrangements included within the spirit and scope of the broadest interpretation so as to encompass all such modifications and equivalent arrangements.
Number | Date | Country | Kind |
---|---|---|---|
094117650 | May 2005 | TW | national |