Many image capture devices use either a charged coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) device to capture the image. Both types of devices are typically sensitive to light across the entire visible spectrum. When a device is used to captures a color image, the device is typically overlaid with a pattern of red, green and blue color filters. One common pattern used to arrange the color filters across a device is a Bayer pattern. In this application, a CCD will be used to represent both a CCD and a CMOS type of device.
The Bayer filter pattern is a repetitive grid of red, green, and blue sub-filters overlaying the CCD array (sec
There are times when it is desirable to capture an image as a grayscale image, instead of capturing the image in color. For example, when capturing an image of a printed document a grayscale image may be more useful. Unfortunately having a second CCD without color filters, is costly. Therefore most color capture devices convert the captured color image into a grayscale image when a grayscale image is desired.
Converting a color image into a grayscale image can be done using a number of different techniques. One technique is Green bi-linear interpolation. This is a somewhat low complexity solution that is susceptible to aliasing. It also yields a lower resolution grayscale image because it ignores the information in the red and blue pixels. Other techniques may provide a high quality grayscale image, but may require large amounts of computation, have large storage requirements, or require significant time to complete.
In operation, an image is captured using CCD 202. The image is transferred from CCD 202 into shift registers 204. Once in shift registers 204, the image, may be transferred into RAM 210, manipulated by micro-processor 208, ASIC 212, or both, or saved in NVRAM 214. Some digital imaging devices may have additional image processing components, for example a color matrix, that are not shown for clarity.
In one example embodiment of the invention, digital imaging device 200 may be a device that has a primary function of capturing digital images, for example a digital camera. In other example embodiments of the invention the digital device, may incorporate a image capture device into another device, for example a cell phone, a laptop computer, or the like.
In one example embodiment of the invention, the pixels in CCD 202 are covered with a Bayer pattern of red, green and blue color filters. Therefore CCD 202 produces a matrix of color intensities that represent the captured color image. One type of image manipulation that may occur in digital imaging device 200 is the conversion of the color image into a grayscale image. This type of conversion may be done by the micro-processor 208, the ASIC 212, or a combination of both the ASIC 212 and micro-processor 208. ASIC 212 may be a hardware implementation of the algorithm used to convert the color image into the grayscale image.
In some example embodiments of the invention, the color image may be transferred to a computer, and the computer may convert the color image into a grayscale image. The computer may be a personal computer (PC) or a network device, for example a server.
LADRE equalizes the dynamic range of the red and blue intensity values to match the dynamic range of the green intensity values inside small overlapping areas of the image. The red and blue intensity values are equalized to the dynamic range of nearby green pixels. In one example embodiment of the invention, the pixels in a 5 by 5 area or window surrounding each of the red or blue pixels, are used to determine a local green dynamic range. The red or blue intensity value is then equalized to this local green dynamic range. In other example embodiments, other size windows may be used to determine the local dynamic range of the green pixels. The dynamic range of the existing green intensity values do not need to be adjusted. Therefore the first step in converting the color image into a grayscale image is to copy the green intensity value into the target grayscale image as grayscale intensity values.
In one example embodiment of the invention, a sliding window is used in step 404 to determine the local dynamic ranges of the red, green and blue pixels in the original color image.
Zmax=max(Z0,Z1,Z2,Z3,Z) (1)
Zmin=min(Z0,Z1,Z2,Z3,Z) (2)
Gmax=max(G0,G1,G2,G3) (3)
Gmin=min(G0,G1,G2,G3) (4)
The local dynamic ranges are
Zrange=max(Zmax−Zmin,1) (5)
Grange=Gmax−Gmin (6)
Now, linear equalization of the dynamic ranges requires an offset term and a gain factor to stretch or compress the red or blue intensity range into the green intensity range. The offset term is simply the minimum green intensity value
offset=Gmin (7)
The gain term is
where <<8 denotes 8 up-shifts which is equivalent to a multiplication of 28. In one example embodiment of the invention, LADRE may be used in a low-cost embedded system. Therefore 8 bit/pixel is assumed for each color intensity value, and all operations are integer arithmetic. The <<8 in Equation (8) avoids the need for a fraction and therefore gain can be stored as an integer value rather than a float value. The new grayscale value Z′ for the pixel is given by equation 9.
Z′=(((Z−Zmin)*gain)>>8)+offset (9)
where >>8 denotes 8 downshifts which is equivalent to a division of 28. Equation (9) may produce erratic swings in Z′ if gain is large. A strong mosaic pattern occurring on an edge or thin line may cause a large gain. Experimentation shows that if gain exceeds approximately 40:1, then the dynamic range equalization produces excessive noise and edge aliasing. In this case, LADRE averages the surrounding green pixels. It applies Equation (10) instead of Equation (9).
Z′(G0+G1+G2+G3)>>2 (10)
In pseudo-code, the decision is
where k≅10240.
When the sliding window shown in
Local Area Dynamic Range Equalization (LADRE) was described equalizing the local dynamic range of red and blue pixels value to the green pixel values produced using a Bayer filter pattern. LADRE is not limited to use with color images produced using a Bayer color filter pattern, other color filter patterns can be equalized using the LADRE method. LADRE is also not limited to red, green and blue color images. Other color filter sets may be equalized, for example cyan, magenta, and yellow (CYM).
Number | Name | Date | Kind |
---|---|---|---|
20030068081 | Jia et al. | Apr 2003 | A1 |
20060227149 | Cain | Oct 2006 | A1 |
Number | Date | Country | |
---|---|---|---|
20110110584 A1 | May 2011 | US |