SYSTEM AND METHOD FOR ENHANCING SCANNED DOCUMENT IMAGES FOR COLOR PRINTING

Abstract: A system and method for enhancing scanned document images utilizes an estimated background luminance (118) of a given digital image to remove or reduce (720) visual "see-through" noise. The estimated background luminance is dependent on the luminance values of the edges pixels of detected text edges of the image. In one embodiment, the estimated background luminance is generated using only the edge pixels that are on the lighter side of the detected edges. In addition to the see-through removal, the system and method may further enhance the scanned document images by removing (714) color fringes and sharpening and/or darkening (712) edges of text contained in the images.

Description: SYSTEM AND METHOD FOR ENHANCING SCANNED DOCUMENT IMAGES FOR COLOR PRINTING FIELD OF THE INVENTION The invention relates generally to the field of image processing, and more particularly to a system and method for enhancing scanned document images. BACKGROUND OF THE INVENTION Two-sided documents, i.e., documents having text and/or pictorial content on both sides of the paper, present challenges for producing quality copies of the original documents. When two-sided documents are scanned in a copy machine or a scanner, visual noise may appear in the copies that was not present on the scanned surfaces of the original documents. The visual noise may be the result of digitally captured text and/or pictorial content printed on the opposite side of a scanned surface. Visual noise may also appear in copies when multiple documents are placed on a scanning device. In this situation, the visual noise may be the result of digitally captured text and/or pictorial content on a document that was adjacent to the scanned document. The appearance of visual noise caused by unwanted text and/or pictorial content will be referred to herein as the "see-through" effect. The see-through effect is more prevalent for copies of documents having a white or very light color background. In addition, the thickness of the scanned documents may increase the intensity of the visual noise, since thinner paper is more transparent than thicker paper. In general, documents typically contain black characters that are printed on thin white paper. Thus, the quality of document copies can be significantly increased if the visual "see-through" noise can be effectively removed from the copies. In addition to the see-through problem, another copy quality issue arises when documents are reproduced using color scanners and color printers. This copy quality issue is the appearance of color fringes around the reproduced text. These color fringes are primarily due to scanning and printing errors. The scanning and printing errors cause the edges of the text in the copies to appear to be something other than black. The appearance of color fringes is a significant factor that degrades the overall quality of document copies. Conventional image enhancement approaches use variations of unsharp-masking to sharpen features in digitally captured document images. For example, according to one method, the sharpness is altered in the reproduction of an electronically encoded natural scene image by applying a filter function that increases maximum local contrast to a predetermined target value and increases all other contrast to an amount proportional thereto. According to another method, an adaptive spatial filter for digital image processing selectively performs spatial high pass filtering of an input digital signal to produce output pixel values having enhanced signal levels using a gain factor that effects a variable degree of enhancement of the input pixels. Thus, the pixels with activity values that are close to an iteratively adjustable activity threshold level will be emphasized significantly less than the pixels with associated activity values that are substantially above the threshold level. In still another method, a spatial-filter performs an adaptive edge-enhancement process that enhances the sharpness of edges, which are parts of an image having steep tone gradients. These conventional image enhancement approaches are effective for their intended purposes. However, these conventional methods do not address the problems of color fringe and see-through. In view of this deficiency, there is a need for a system and method to enhance scanned document images by eliminating or reducing color fringes and visual "see- through" noise. SUMMARY OF THE INVENTION A system and method for enhancing scanned document images utilizes an estimated background luminance of a given digital image to remove or reduce visual "see-through" noise. In addition to the see- through removal, the system and method may further enhance the scanned document images by removing color fringes and sharpening and/or darkening edges of text contained in the images. These image enhancements allow the system and method to significantly increase the overall quality of the scanned document images. In an exemplary embodiment, the system includes an edge detector, a background luminance estimator, and an image enhancer. These components may be implemented in any combination of hardware, firmware and software. In one embodiment, these components are embodied in the system as software that is executable by a processor of the system. The edge detector operates to detect edges of text contained in a given digital image containing visual noise. The background luminance estimator operates to generate a background threshold that is based on an estimation of the image background luminance. The background threshold is dependent on the luminance values of the edge pixels of the detected edges. In one embodiment, the background threshold is generated using only the edge pixels that are on the lighter side of the detected edges. The image enhancer operates to at least partially remove the visual noise by selectively modifying pixel values of the image using the background threshold. The image enhancer may also perform color fringe removal and text enhancements, such as edge sharpening and edge darkening. In an exemplary embodiment, the method in accordance with the invention includes the steps of receiving a digital image that contains visual noise, detecting edges of text contained in the digital image, and generating a background threshold based on an estimation of the image background luminance. The background threshold is dependent on the luminance values of the edge pixels of the text edges contained in the image. In one embodiment, the background threshold is generated using only the edge pixels that are on the lighter side of the detected edges. The method further includes a step of modifying pixel values of the image using the background threshold to at least partially remove the visual noise from the image. The method may also include the step of selectively removing color data from the edges pixels to reduce color fringe or the step of enhancing the text contained in the image by sharpening or darkening the text edges. Other aspects and advantages of the present invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrated by way of example of the principles of the invention. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is an illustration of an image enhancing system in accordance with the present invention. Fig. 2 is an illustration of vertical differences for the luminance channel that are used to detect text edges in accordance with the invention. Fig. 3 is an illustration of horizontal differences for the luminance channel that are used to detect text edges in accordance with the invention. Figs. 4 and 5 are process flow diagrams that illustrate the operation of a background luminance estimator of the image enhancing system in accordance with the invention. Fig. 6 shows an exemplary limiting function that may be used by the background luminance estimator. Fig. 7 is a process flow diagram of a method for enhancing scanned document images in accordance with the invention. DETAILED DESCRIPTION With reference to Fig. 1 , an image enhancing system 102 in accordance with the present invention is shown. The image enhancing system operates to perform a number of image enhancements for scanned document images. These image enhancements include text edge sharpening, text edge darkening, color fringe removal, and "see- through" removal. Color fringe is the appearance of color around the text of a scanned document image that may be due to an image capturing error. See-through is the appearance of visual noise that was captured during the scanning process. The visual noise may be the result of digitally captured text and/or pictorial content printed on the opposite side of the scanned surface. Alternatively, the visual noise may be the result of digitally captured text and/or pictorial content on an adjacent document. The image enhancing system 102 includes an input interface 104, a volatile memory 106 and a non-volatile memory 108 that are connected to a processor 110. These components 104-110 are computer components that are readily found in a conventional personal computer. The image enhancing system further includes a color space converter 112, a low- pass filter 114, an edge detector 116, a background luminance estimator 118, and an image enhancer 120, which are also connected to the processor 110. Although the components 112-120 are illustrated in Fig. 1 as separate components of the image enhancing system 102, two or more of these components may be integrated, decreasing the number of components included in the image enhancing system. The components 112-120 may be implemented in any combination of hardware, firmware and software. Preferably, the components 112-120 are embodied in the image enhancing system 102 as a software program that performs the functions of the components 112-120 when executed by the processor 110. The input interface 104 provides a means to receive digital images from an external image capturing device, such as a scanner 122. The input interface may be a USB port, a serial port or any other interface port that is designed to interface the image capturing device to the image enhancing system 102. Alternatively, the input interface may be a network interface to receive digital images from a local network (not shown) or from the Internet (not shown). The color space converter 112 of the image enhancing system 102 operates to convert a scan line of an input digital image between an original color space, such as an RGB color space, and a luminance/chrominance space, such as a YC r C b space. Although the YC r C b space is preferred, other color spaces that include separate luminance components may be utilized. The color space conversion may be performed using a pre-calculated look-up table, which may be stored in the color space converter 112 or the non-volatile memory 108. The low-pass filter 114 of the image enhancing system 102 operates to smooth each of the YC r C b components of the image scan line. The low-pass filter applies a Gaussian filtering to the luminance channel Y. The Gaussian filter/mask may be designed according to the following equation. 0 ≤ i < M, 0 ≤ j < M, where Mis an odd integer, c=(M-1)/2 is the center of the mask and £ is a M-lM-l normalization factor such that ^ ∑OD ' jL/] = 1.0. An example of such a mask (with =5 and /3=1.1) is shown below: " 0.009 0.023 0.032 0.023 0.009 0.023 0.058 0.078 0.058 0.023 0.032 0.078 0.106 0.078 0.032 0.023 0.058 0.078 0.058 0.023 0.009 0.023 0.032 0.023 0.009 For the chrominance channels C r and C b , the low-pass filter 114 applies an Mx Maveraging filter, which is the same size as the Gaussian filter applied to the luminance channel Y. The Mx Maveraging filter may be seen as a special case of the Gaussian filter with β=0. However, the averaging operation can be performed more efficiently than the Gaussian filtering. The reason why Gaussian smoothing is applied to the luminance channel Y instead of averaging is that the Gaussian smoothing is needed to preserve text edge locations of the digital image. The edge detector 116 of the image enhancing system 102 operates to detect the preserved edges of text contained in the image scan line. From the Gaussian smoothed luminance data, the edge detector calculates two metrics Dl and E>2. The metric Dl is the sum of absolute values of adjacent differences. The metric Dl is used to determine whether a pixel of interest is a part of a text edge by comparing it to a threshold value T e . For a pixel of interest with index (3,3), the sum Dl of absolute values of adjacent luminance differences is defined by the following equation. Wn 23 - V r Δ ι 3 ι + ' \ rV 3n3 -V ' 2v3 . ι + ' \ iV ' M3 - V + \ 5 3 ■ v«\ + ■ v + Dl= I Vr, - vx + \ V n - V + \ λ - vx + 1 JA - v„ | + 12 ■ w 33 3 „2| + | 3 4, - 33 l + | F 3 „5 - 3 4 + \ 42 ■ w « V 42 + \V 4 λλ 4 - V + \ V Λ 45 < - V A 441' where the variable F " stands for Gaussian smoothed luminance f . The Dl value is illustrated by Figs. 2 and 3. Fig. 2 shows the vertical differences, while Fig. 3 shows the horizontal differences. The metric D2 is a second-order derivative that is used to determine whether a text edge pixel is on the dark side or the bright side of the edge. The following second order derivative equation may be used to make the determination for a pixel of interest with index (3,3). 2 = ^ 3 + ^ 3 + ^ + ^ -4^ 33 If D2>0, the pixel is determined to be on the dark side of the edge. Otherwise, the pixel is determined to be on the bright side of the edge. In operation, the threshold value T e is initially set at a minimum value. In order to make the threshold value T e adaptive to some extent, the threshold value T e is allowed to float with the maximum value of the metric Dl. The maximum value Dl max is updated for every pixel, and for each image scan line, the threshold value T e is updated to T e =k-Dl max , if r e <k-Dl max . Thus, the threshold value T e can only be increased. The minimum value of T e and the parameter k should be empirically determined by experiments. The background luminance estimator 118 of the image enhancing system 102 operates to compute an estimated background luminance Y D for each image scan line, which is used by the image enhancer 120 for see-through removal. Initially, the estimated background luminance Y D is set to 255. The estimated background luminance Y 0 is then updated once per image scan line as described in detail below. The estimated background luminance Y 0 is computed using two histograms. The first histogram is a histogram of all pixel luminance values, and is denoted H y . The second histogram is a histogram of text edge pixels on the lighter side of edges, and is denoted H e . Both histograms are updated for each new pixel. The operation of the background luminance estimator 118 to update the estimated background luminance F/> is described with reference to Figs. 4 and 5. At step 402, the histograms H e and H y are computed. Next, at step 404, copies of the histograms H e and H y are made. The original histograms H e and Hy are used to update the histograms. The copies of the histograms H e and H y are used to compute the updated estimated background luminance r&. For the histogram H e , steps 406, 408, 410, 412 and 414 are performed. At step 406, a determination is made whether the total edge pixel count (pixels on the lighter side of detected edges) is greater than a given threshold C e . As an example, the threshold C e may be 100. If the total edge pixel count is greater than the threshold C e , the process proceeds to step 408, at which a windowed averaging is applied to smooth out small local noise. As an example, a window size of 7 may be used for the averaging. However, if the total edge pixel count is not greater than the threshold C e , the process skips to step 410. At step 410, an object/background threshold τ e is computed. The object/background threshold τ e is a luminance value on the histogram H e that optimally separates the dominant values of object and background intensities. The object/background threshold τ e may be computed using Kittler- lllingsworth algorithm, as described in J. Kittler and J. Illingworth, "Minimum Error Thresholding", Pattern Recognition, Vol. 19, No. 1 , 41-47, 1986, which is specifically incorporated herein by reference. For a grayscale image with pixel value g in the range of [0,n], a histogram h(g) that summarizes the gray level distribution of the image can be viewed as an estimate of the probability density function p(g) of the mixture population comprising gray levels of object and background pixels. Assuming that each of the two components (object and background) p(gli) is a Gaussian distribution with mean μj, standard deviation σ and a priori probability Pj, the probability density function p(g) can be expressed by the following equation. where For a given p(glϊ) and P,-, there exists a threshold τ that satisfies the following conditions. For g ≤ τ, P lP (g/l) > P 2 p(g/2) For g > τ, P lP (g/ϊ) < P 2 p(g/2) However, the parameters μι, σ r - and R j are unknown. The Kittler-lllingsworth algorithm utilizes an arbitrary level Tto threshold the gray level data and model each of the resulting pixel populations by a normal density h(g\i,T) with parameters μj(T), σ z (7) and R z (7), which are defined by the following equations. P t (T) = ∑h(g), g=a u,(T) = ∑Kg)g IP ; (T) and g=a b σf(T) = ∑{g = μ- TJf h(g) iP t i ), g=a where a = These definitions are used to express a criterion function J(T) which characterizes the average performance of replacing a gray level g by a correct binary value. The criterion function J(7) is defined by the following equation. JV ) = + 2logσ λ (T) - 2logP x (T) + ∑ Kg) - + 2logσ 2 (T) -2logP 2 (T) g=T+l σ 2 (T) Substituting the equations for μ (7), σj(T) and Pj(T) into the criterion function J(J) yields the following equation. J(T) = 1 + 2[i » (T) log σ (T) + R 2 (T) log σ 2 (T) -2[R 1 (r)iogR 1 (r) + R 2 (r)io g R 2 (r) The optimal threshold τ, or a minimum error threshold, is determined by finding a value that minimizes the above equation. After the object/background threshold x e is computed, a background peak eWhite on the histogram H e is determined, at step 412. The background peak eWhite corresponds to the peak in the upside range between the object/background threshold τ e and 255 on the histogram H e . At step 414, a spread index S e is calculated. The spread index S e is defined as S e = (I hjφ -I low )l 256, where Itøgh and 7 ow are high and low luminance values of the spread that fall to half of the peak value. The Ihigh value is located on the left side of the eWhite value, while the Ihigh value is located on the right side of the eWhite value. For the histogram H y , steps 502, 504, 506 and 508 are performed. At step 502, a determination is made whether the total pixel count is greater than a given threshold C y . As an example, the threshold C y may be 10,000. If the total edge pixel count is greater than the threshold C y , the process proceeds to step 504, at which a windowed averaging is then applied to smooth out small local noise. As an example, a window size of 7 may be used for the averaging. However, if the total pixel count is not greater than the threshold C y , the process skips to step 506. At step 506, an object/background threshold τ y is computed. Similar to the object/background threshold τ e , the object/background threshold τ y is a luminance value on the histogram H y that optimally separates the dominant values of object and background intensities. At step 508, a background peak aWhite on the histogram H y is determined. The background peak aWhite corresponds to the peak in the upside range between the object/background threshold τ y and 255 on the histogram H y . Although the steps 406-414 and 502-508 have been described in a sequential order, these steps do not have to be performed in " the described order. The steps 406-414 and 502-508 may be performed such that steps 406-414 are interweaved with steps 502-508. Alternatively, some of the steps 502-508 may be performed simultaneously with steps 406-414. Next, at step 510, a minimum acceptable value MIN_WHITE is established for the background peaks eWhite and aWhite by embedding MIN_WHITE in a non-linear function/ That is, eWhite' =f(e White) and aWhite' =f(aWhite). The simplest of such functions is a two segment linear function as defined below. f v, if v > MIN _ WHITE [MIN _ WHITE, otherwise However, for images with mostly black figures and little unprinted regions, the background peaks eWhite and aWhite are usually far below the minimum acceptable value. In these cases, it may be desirable to reduce the effect of see-through removal that will be performed by the image enhancer 120 of the system 102, or even to not apply the see-through removal. This can be effectively realized by functions such as the following limiting function. v, if v > MIN XWHITE /(v) = (255.0 - MIN XWHITE) ■ exp(-(r • MIN XWHITE 1255 • v 1255) 2 ) + M7N WHITE, otherwise A limiting function (v) with MIN_WHITE=220 and r=3.5 is shown in Fig. 6. Other functions characterized by three distinct regions may also be used to achieve a similar effect. The three distinct regions are as follows: 1) a linear region from 255 down to MIN_WHITE1or effective see-through removal; 2) a flat holding-up region from MIN_WHITE down to a set value; and 3) a gradual blackout region. Next, at step 512, weighted-averaging is applied to the background peaks eWhite and aWhite using the following formula to derive an initial background luminance white(ή) for the current line n. white(n) = p • eWhite'+(l - p) ■ aWhite', . _ J 0.8 - (l -S e ) + 0.2, if number of edge pixels inH e > C e [0.2, otherwise At step 514, the estimated background luminance Y D is calculated using the following formula. Y b (n + ϊ) = β(ή) ■ Y„ (ή) + (1 - β(ή)) ■ white(n); 7, (0) = 255; β( n = Anax - (Λflax - Λnin ) ' e p( ~ g ■ « / H), where n is the current line number, His the height (in pixels) of the image and g is the adaptation boost. As an example, the parameters β m i n , β ma χ, and g may be set as follows: β mia = 0.9; ? max = 0.995; and g = 10. The above formula introduces a spatial (scan line) dependent smoothing for see-through effect in the vertical direction. Turning back to Fig. 1 , the image enhancer 120 of the image enhancing system 102 operates to enhance a given document image by performing text edge sharpening, text edge darkening, color fringe removal, and see-through removal. The enhancement operations that are performed by the image enhancer differ for edge and non-edge pixels of the image, as described in the following C-style pseudo-code. if Dl>T e { //edge pixel Y oul — (k + 1) • Y — k • Y; // unsharp - masking if D2>0 //pixel on dark side of edge γ o t = (You f 3)/4; //darkening if ( \C + C , ) < T { // low - chroma edge pixel, strip color ' =0; else { // keep the original color κ~- r — ^ r , γOIlt s-ιOUt s-tOUl _^ nOUt s-iOltt TxOUt . else { // non-edge pixel YC r C b => RGB; // see-through removal / background control R 01 " =Q(R,Y b ); G mu =Q(G,Y h ); B 01 " =Q(B,Y b ); In the above pseudo-code, the parameter T c is a "colorful" threshold for determining the application of color fringe removal, and parameter k is a positive value for determining the strength of the edge sharpening. As an example, r c =15 and k = 2.5 may be used. The function Q for see-through removal can take several forms. The simplest form is the following two-segment linear function. f255, ifx>Y„ [x ■ 255 / Y b , otherwise A more complex form is the following continuous non-linear function, which is commonly used for tone modification. 255, if x > Y b Q(x,Y b ) = - 255-[l.0-0.5-(2(Y b -x)/Y„) a ] Ur , else if x>Y b l2 255 • [0.5 • (2x I Y b ) a f r , otherwise In the above equation, the parameters a and γ control the contrast and the gamma, respectively. In order to increase computational speed, the function Q(χ,Y σ ) can be implemented as a look-up table and updated for each scan line. After the enhancement operations, the enhanced image may be output to a printer 124 or a display 126, as shown in Fig.1. Although the image enhancing system 102 has been described as a separate system, the system may 102 be a sub-system that is part of a larger system, such as a copying machine (not shown). A method of enhancing scanned document images in accordance with the invention is described with references to Fig. 7. At step 702, a scan line of a digital image is received. The digital image may be a scanned image of a document that contains text and/or pictorial content. At step 704, the image scan line is converted from the original color space to a luminance/chrominance space. As an example, the original color space may be an RGB space, and the luminance/chrominance space may be a YC r C b space. At step 706, low-pass filtering is applied to luminance/chrominance channels. A Gaussian filter is applied to the luminance channel, while an averaging filter is applied to both chrominance channels. Next, at step 708, text edges are detected by identifying edge pixels and then classifying the edge pixels on the basis of whether the pixels are on the dark side or the bright side of the edge. The edge detection involves calculating Dl and D2 values. The Dl value is used to identify the edge pixels using an adaptive threshold T e . The D2 value is used to classify the edge pixels. Next, at step 710, the background luminance is estimated to derive an estimated background luminance Yb. For edge pixels, steps 712, 714 and 716 are performed. At step 712, text enhancement is performed on the edge pixels. The text enhancement includes edge sharpening and/or edge darkening. At step 714, color fringe removal is performed for the edge pixels. The edge pixels are then converted to the original color space, e.g., an RGB space, at step 716. For non-edge pixels, steps 718 and 720 are performed. At step 718, the non-edge pixels are converted to the original color space. A see-through removal is then performed on the non-edge pixels, at step 720. Next, at step 722, a determination is made whether the current image scan line is the last scan line of the image. If it is the last scan line, the method comes to an end. However, if the current image scan line is not the last scan line of the image, the method proceeds back to step 702 to receive the next scan line of the image. The steps 702-722 are repeated until the last scan line of the image has been processed.

Claims: WHAT IS CLAIMED IS: 1. A method of enhancing digital images comprising: receiving (702) an input digital image containing visual noise; detecting (708) edges of a feature within said input digital image; generating (710) a background threshold based on an estimation of background luminance of said input digital image, said background threshold being dependent on luminance values of edge pixels of said edges; and selectively modifying (720) pixel values of said input digital image using said background threshold to at least partially remove said visual noise from said input digital image. 2. The method of claim 1 wherein said step of generating (710) said background threshold includes using only said edge pixels that are on a lighter side of said edges of said feature to generate said background threshold. 3. The method of claim 1 or 2 wherein said step of generating (710) said background threshold includes locating (412, 508) a peak on a histogram of selected luminance values of said edge pixels that likely corresponds to said background luminance. 4. The method of claim 3 wherein said step of locating (412, 508) said peak on said histogram includes computing (410, 506) a minimum error threshold of said histogram. 5. The method of claim 3 or 4 wherein said step of generating (710) said background threshold includes calculating (414) the spread of a luminance distribution of said histogram defined by said peak. 6. A system for enhancing an input digital image containing visual noise comprising: an edge detector (116) for detecting edges of a feature within said input digital image; a background luminance estimator (118) for generating a background threshold based on an estimation of background luminance of said input digital image, said background threshold being dependent on luminance values of edge pixels of said edges; and an image enhancer (120) for selectively modifying pixel values of said input digital image using said background threshold to at least partially remove said visual noise from said input digital image. 7. The system of claim 6 wherein said background luminance estimator (118) is configured to generate said background threshold using only said edge pixels that are on a lighter side of said edges of said feature. 8. The system of claim 6 or 7 wherein said background luminance estimator (118) is configured to locate (412, 508) a peak on a histogram of selected luminance values of said edge pixels that likely corresponds to said background luminance. 9. The system of claim 8 wherein said background luminance estimator (118) is configured to compute (410, 506) a minimum error threshold of said histogram to locate said peak on said histogram. 10. The system of claim 8 or 9 wherein said background luminance estimator (118) is further configured to calculate (414) the spread of a luminance distribution of said histogram defined by said peak.

Inventors: FAN JIAN, LIN QIAN, TRETTER DANIEL, FAN, JIAN, LIN, QIAN, TRETTER, DANIEL
Applicants: HEWLETT PACKARD CO, HEWLETT-PACKARD COMPANY
Application year: 2001
Main classification: H04N1
IPC codes: G06T1, G06T5, H04N1