Automatic color processing to correct hue shift and incorrect exposure

Abstract: A digital color processing method for images from scanners and digital cameras processes image data suitable for display on monitors or color hardcopies produced by digital color printers and correct hue shift and incorrect exposure based on the image content. The method automatically corrects the data based on the histogram of the acquired image normalizing the image data(40) to correct for the hue shift and determining the gamma parameter(30) to correct the exposure of the image.

Description: Field of the Invention The invention is directed towards image processing and more specifically, towards correcting hue shift and incorrect exposure in scanners and digital cameras. BACKGROUND OF THE INVENTION In the 1940's, an integrate-to-gray method was proposed for automatically establishing processing parameters for an analog photo-finishing system. The method produces a good image if the image had many different hues from different parts of the color space. In other words, it assumes that the image has an overall gray content. For images that do not meet this condition, the results can be disappointing. For example, if the image is predominately green due to a large region of grass, the processing will make the grass yellower and paler, vastly different from the photographer's recollection. Other processing methods have been proposed more recently for digital systems. In U.S.P.N. 5,062,058, Morikawa described a method of identifying the highlight and shadow points in an image from the density histogram of the RGB signals in a scanner. However, the method requires a person to select the highlight and shadow points, according to the human eye, using an input device. This inherently random process is neither automatic nor efficient. In U.S.P.N. 4,984,071, Yonezawa described a method of identifying the highlight and shadow points in an image from the density histograms of each RGB channel, as well as the histogram of the average density. The resulting gradation curves are used for photosensitive films and are not applicable to monitors or digital color printers. What is desirable is a systematic method of performing color processing based on the image content. It would be of further benefit if the processed image could be displayed on a monitor or sent to a digital printer for a hardcopy output. SUMMARY OF THE INVENTION A digital color processing method for images from scanners and digital cameras processes image data suitable for display on monitors or color hardcopies produced by digital color printers and corrects hue shift and incorrect exposure based on the image content. Starting from an image with poor contrast and color cast, the system automatically looks for the appropriate correction parameters to produce images with vivid color and good contrast. The method automatically corrects the data based on the histogram of the acquired image. It consists of two steps. The first step is to find the bounding box of the image data in the RGB device space described in terms of highlight and shadow, and to normalize the image data. This corrects for the hue shift in the image. The second step is to find the gamma parameter for brightness control. This ensures that the image would have the correct exposure. Efficient implementation can be achieved by constructing a look-up-table from the bounding box parameters and the gamma parameters. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 illustrates a system for automatic color processing to correct hue shift and incorrect exposure in image data. Figure 2 illustrates a process flowchart of a digital color processing method implemented by the system shown in Figure 1. Figures 3A and 3B show a scanned image. Figure 4 illustrates histograms of the image in Figure 3. Figure 5 illustrates a cumulative gray level histogram of the image in Figure 3. Figure 6 illustrates the corrected image. Figure 7 is an embodiment of the look-up table. Figure 8 illustrates the histogram of the corrected image shown in Figure 6. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Figure 1 illustrates a system for automatic color processing to correct hue shift and incorrect exposure in image data. A digital scanner is connected to a microprocessor that is also connected to a printer. A digital processor, contained in the microprocessor or within the digital scanner, processes the image data to correct for hue shift and incorrect exposure. Although a digital scanner is used, an uninverted digital camera image or photo CD image may also be used. Figure 2 illustrates a process flowchart of a digital color processing method implemented by the digital processor shown in Figure 1. In step 10, the statistics of each channel is collected. In step 20, the extremas and median point for each channel is determined. The extremas determine the hue shift needed for each channel while the median point will be used to correct the exposure. The minimum hues for each channel when combined define the darkest point of the image while a combination of the maximum hues define the lightest. In step 30, a gamma curve fit is performed and an optional look-up table is generated according to the gamma curve. The gamma curve maps the minimum extrema to "black" and the maximum extrema to "white". The median point is shifted to approximately 50% gray level, the halfway point between "black" and "white". In step 40, each pixel of the image data is mapped according to the look-up table or transfer function. Figures 3A and 3B shows a scanned image. Figure 3A shows the scanned image in inverted while Figure 3B shows the scanned image uninverted. Figure 4 illustrates histograms of the image in Figure 3 as applied in RGB space. The RGB histograms are very different from one another. The image has a significant amount of blue component, but not much red and green components. Hence, as shown in Figure 3B, the image is predominantly blue. To correct for the blue cast, each color component of the histogram will be expanded in spectral frequency in step 30. Suppose the red component histogram has non-zero values between gray levels R min and R max . In Equation 1, the normalized red component R norm after mapping is determined as follows: R norm = R old - R min R max - R min where the R old is the red component before mapping. The new green and blue components are calculated in a similar way. In practice, to reduce the effect of noise, the maximum and minimum of each color component are chosen as the points where the cumulative histogram reaches a certain level, for example, 99.5% and 0.5% respectively. The underlying assumption of stretching the histogram is that the point (R max , G max , and B max ) corresponds to the white point of the image, and should be rendered as white in the RGB device space of a printer or a monitor. Similarly, the point (R min , G min , and B min ) corresponds to the black point of the image, and should be rendered as black in the RGB device space of a printer or a monitor. From most of the natural image, there exists highlight and shadow areas that need to be rendered as white and black respectively. Hence, the assumption that (R max , G max , and B max ) is the white point and (R min , G min , and B min ) is the black point is valid for most natural images. If a 3-dimensional view with the RGB channels as the axes is considered, then step 20 corresponds to finding a bounding box that encloses the image data. The above procedure ensures that white will be represented by white and black will be represented as black on a monitor or a printer. It ensures that there is no hue shift in the processed image. However, the image may still be too bright or too dark, i.e . the exposure level may be incorrect. Figure 5 illustrates a cumulative gray level histogram for the image shown in Figure 3. As described in step 20, a median point has been defined for each channel. As described in step 30, which corrects for the exposure, a gamma curve that defines the degree of correction for the red channel is identified. For each channel, the median point where half of the pixels have gray levels below it and half have levels above it is identified. In this embodiment, as shown in Equation 2, the gamma value is found as follows: γ R = log(0.4) log R med - R min R max - R min Step 30 is repeated to find the corresponding gammas for the green and blue components, γ G and γ B , respectively. As shown in Equation 3, the final gamma γ used is the average gamma for the RGB channels: γ = (γ R +γ G +γ B ) 3 The number 0.4 is a user defined parameter that effects the brightness when the image is produced. A larger value results in a lighter image. The criterion is that processed images should have a good brightness and contrast on the monitor and printer. However, once chosen, this value is used to process all images. As described in step 40, each pixel of the image data is mapped according to the gamma curve for each channel. The mapping used in this embodiment is described in equation 4. The new red component R new is: R new =255* R γ norm Green and blue components are calculated similarly. That is, a curve fit is performed for each histogram from the new maximum, minimum and median. Figure 6 illustrates the corrected image. Figure 7 is an embodiment of the look-up table. The look-up table can be constructed from the highlight, shadow, and gamma parameters for each of the RGB channels. Figure 8 illustrates the histogram of the corrected image shown in Figure 6.

Claims: A method of digital color processing of image data points from scanners and digital cameras, comprising the steps of: (1) for each of a plurality of colour components: (a) gathering image pixel data (10); (b) determining a first difference between a light intensity minimum and a light intensity maximum; and (c) determining a data median point for the image pixels (20); (2) for each image pixel in the gathered image data: (a) determining a second difference between the light intensity of that pixel and the light intensity minimum; and (b) determining a normalized image data pixel that is the ratio of the first and second differences (30); (3) determining a light intensity correction parameter (30) in dependence on the determined data median points; (4) correcting the light intensity by mapping each normalized image pixel in accordance with the determined light intensity correction parameter (40); and (5) imprinting the mapped normalized image pixel. A method as claimed in claim 1, wherein the step of determining a light intensity correction parameter (30) comprises: (a) determining, for each colour component, a third difference between the light intensity of the data median point and the light intensity minimum; (b) selecting a desired brightness; (c) defining, for each colour component, a gamma value that reflects the first difference, the third difference and the desired brightness; and (d) averaging the gamma values of each of said colour components to determine a final gamma value constituting said light intensity correction parameter. A method as claimed in claim 2, wherein the step of correcting the light intensity (30) further includes constructing a look-up table according to the final gamma value. A method as claimed in claim 2, wherein the step of correcting the light intensity (30) includes determining a transfer function according to the gamma value. A method as claimed in any one of claims 2 to 4, wherein the step of mapping each normalized image pixel (40) translates the normalized image pixel in accordance with the gamma value.

Inventors: LIN QLAN, LIN, QLAN
Applicants: HEWLETT PACKARD CO, HEWLETT-PACKARD COMPANY
Application year: 1996
Main classification: H04N1
IPC codes: H04N9, H04N1