Abstract:
A method and apparatus for processing an input image to remove color marks from the input image. The method includes the steps of detecting RGB entries in a CMS table that are not on a gray diagonal proximity. Next, the method changes output space values for the RGB entries to a shade of gray. Finally, the method converts the input image to an output image by referencing the CMS table.

Description:
BACKGROUND OF THE INVENTION  
         [0001]    1. Field of the Invention  
           [0002]    The invention relates in general to image processing. More particularly, this invention relates to a method for removing color marks in a black and white document to restore the original black and white document.  
           [0003]    2. Description of the Related Art  
           [0004]    In the processing of images, the removal of stray marks is desired. For example, color marks may be applied to a black and white image. The black and white original may be altered by colored pens, highlighted with markers, or stamped. It is often desired to remove the color marks, thus restoring the original black and white image.  
           [0005]    In U.S. Pat. No. 5,850,298, Narahara discloses an image processing device forming a reproduced image from a plurality of color recording signals, each of which is generated at a corresponding one of scans on an original image and derived from color digital signals obtained at the corresponding one of the scans, includes a threshold value generation unit generating a threshold value based on the color digital signals at a first one of the scans, and a background removal unit reducing background noise in the reproduced image by using the threshold value at second and following ones of the scans. In summary, the image-processing device of Narahara uses the background removal unit to remove pixels below the threshold value. The subject invention, on the other hand, removes colored marks by modifying a color matching system table. The subject invention does not use a background removal unit or generate a threshold value based on color digital signals.  
           [0006]    In U.S. Pat. No. 5,048,109, Bloomberg discloses a method and apparatus for detection of highlighted regions of a document. A document containing highlighted regions is scanned using a gray scale scanner. Morphology and threshold reduction techniques are used to separate highlighted and non-highlighted portions of the document. Having separated the highlighted and non-highlighted portions, optical character recognition (OCR) techniques can then be used to extract text from the highlighted regions. The method in Bloomberg performs morphology and threshold reduction techniques on a gray scale copy of the original image. The subject invention, on the other hand, detects color marks in the original image deviating from the RGB gray-scale diagonal (i.e. the straight line where Red=Green=Blue). Once detected, the method of the subject invention removes the color marks.  
         SUMMARY OF THE INVENTION  
         [0007]    Accordingly, one object of the present invention is to provide an image processing device and method that detect color marks in an image.  
           [0008]    A second object of the invention is to provide an image processing device and method that remove color marks from an image.  
           [0009]    To achieve these and other advantages and in accordance with the purpose of the invention, as embodied and broadly described herein, the invention provides a method and apparatus for processing an input image to remove color marks from the input image. The method includes the steps of detecting RGB entries in a CMS table that are not on a gray diagonal proximity. Next, the method changes output space values for the RGB entries to a shade of gray. Finally, the method converts the input image to an output image by referencing the CMS table.  
           [0010]    Both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0011]    [0011]FIG. 1 is an overall block diagram illustrating the process of the present invention;  
         [0012]    [0012]FIG. 2 is a block diagram that illustrates the process of updating the CMS table;  
         [0013]    [0013]FIG. 3 illustrates an example of an updated CMS table;  
         [0014]    [0014]FIG. 4 illustrates the gray diagonal in the RGB color space;  
     
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0015]    Before proceeding with a description of the method and apparatus of the present invention, a summary of the RGB color space, which may be helpful in understanding the disclosed embodiment, is provided RGB color is composed of specified values of red, green, and blue components. A combination of these three colors create all of the other colors in a digital representation of an image.  
         [0016]    In a 24-bit color system, the red, green, and blue components are each allotted 8 bits. This may be referred to as an “RGB color triplet.” Each color component within the RGB color triplet has a value in the range of 0 to 255. (R,G,B)=(0,0,0) represents black, an absence of color. (R,G,B)=(255,255,255), on the other hand, represents white. Any value where R=G=B is a shade of gray, and falls along the gray diagonal.  
         [0017]    In the method of the present invention, removal of color marks is accomplished by modifying the Color Matching System (CMS) table, which converts input in RGB color space into a proper output color space. An often-used output space is Cyan-Magenta-Yellow (CMY) or Cyan-Magenta-Yellow-Black (CMYK) space, which is the common format for color printing.  
         [0018]    CMYK color is specified by the cyan, magenta, yellow and black components in a color. Cyan is equivalent to “not red” or 255 red-intensity. Magenta may be thought of as “not green” or  255  green-intensity. Yellow is “not blue” or  255  blue-intensity.  
         [0019]    This patent uses CMYK as an example, but other color spaces may also be used.  
         [0020]    Referring now to FIG. 1, a block diagram of the overall process of the present invention is shown. The process begins with start bubble  10  followed by a process step of updating the CMS table (block  11 ). When updating the CMS table, the method of the present invention sets all RGB entries away from the gray diagonal to a gray diagonal background color. Modification of the CMS table is further described in FIG. 2. Once the table is modified, process step  12  converts the inputted RGB image into a proper output color space. In this example, the output space used is the CMYK space. As stated above, other output spaces may be used. FIG. 3 illustrates a sample conversion table from RGB input to CMYK output. After converting the image to the appropriate output space, a process step outputs the image (block  13 ). The process then exits (end bubble  14 ).  
         [0021]    With reference to FIG. 2, a block diagram illustrates the process of updating the CMS table. The process begins with start bubble  20  followed by an inquiry as to whether the next RGB entry is on the gray diagonal proximity (decision diamond  21 ). The gray diagonal proximity represents all RGB color triplets directly on the gray diagonal, or within an allowed proximity of the gray diagonal. The gray diagonal proximity is further described in FIG. 4. If the answer to the inquiry posed by decision diamond  21  is no, the process modifies the CMYK values associated with the RGB entry. In modifying the CMYK values, the C, M and Y components are set to 0, and the black component (K) is set to the gray diagonal background color. Next, the process poses an inquiry as to whether the entire CMS table has been processed (decision diamond  23 ). If the answer to this inquiry is no, the process returns to decision diamond  21 , and continues until all RGB entries within the CMS table are accounted for. The process then exits (end bubble  24 ).  
         [0022]    Referring now to FIG. 3, an example of an updated CMS table  30  is shown. CMS table  30  contains RGB values like  31   a ,  32   a ,  33   a ,  34   a  and  35   a . For each RGB value, CMS table  30  contains a corresponding CMYK value such as  31   b ,  32   b ,  33   b ,  34   b  and  35   b . In practice, CMS table  30  may not provide entries for all possible input RGB values. In this case, some uniformly or non-uniformly spaced RGB lattice values and their transform to, CMYK space is provided, while other in-between RGB-to-CMYK transformation is obtained by interpolating from neighboring RGB-to-CMYK table entries.  
         [0023]    With reference to FIG. 3, some of the CMYK entries have been modified because they are not on the gray diagonal proximity. For example, RGB entry  33   a  has a value of (0,0,10). Since this value is not on the gray diagonal proximity, the original CMYK value of (0,0,253,253) was updated by the method of the present invention to (C,M,Y,K)=( 0 , 0 , 0 ,g).  
         [0024]    With reference to FIG. 4, a diagram of the gray diagonal  44  in the RGB color space  40  is shown. This diagram corresponds to a 17×17×17 CMS table. The RGB color space  40  includes a red component  41 , a green component  42 , and a blue component  43 . RGB color triplet (0,0,0) represents black, the absence of color. RGB color triplet (16, 16, 16), on the other hand, represents white. The diagonal line connecting the white and black corners represents the gray diagonal  44 , i.e. the straight line where R=G=B. Between the gray diagonal  44  and the cube&#39;s surface, colors would grade from a gray shade to a pure color. The method of the present invention keeps the colors near the gray diagonal unchanged because they represent the original black-and-white image. Colors away from the gray diagonal are color marks, and are reset to a gray diagonal background color.  
         [0025]    Referring to FIG. 4, all RGB cubes in a TxTxT CMS table on the gray diagonal  44  have the eight vertices (d,d,d), (d,d,d+1), (d,d+1,d), (d,d+1,d+1), (d+1,d,d), (d+1,d,d+1), (d+1,d+1,d), (d+1,d+1,d+1), where 0&lt;=d&lt;(T−1). The method of the present invention keeps the corresponding table entries unchanged. For all other entries, the process sets CMYK to the background color. For example, if the background color is white, the method of the present invention sets (C,M,Y,K)=(0,0,0,0). If the background color is a gray color, the process sets (C,M,Y,K)=(0, 0, 0, g). That is, for every RGB entry (R,G,B), the process sets (C,M,Y,K)=(0,0,0,g) if:  
         [0026]    R&lt;d or d+1&lt;R  
         [0027]    G&lt;d or d+1&lt;G where 0&lt;=d&lt;(T−1)  
         [0028]    B&lt;d or d+1&lt;B  
         [0029]    where g is the gray scale of the background color corresponding to (R,G,B) in the proximity of (d,d,d).  
         [0030]    In practical cases, color deviation from the gray diagonal is inevitable. Some tolerance parameter DT may be inserted into the process. Every RGB entry in the proximity of the gray diagonal has a modified CMYK value. For every RGB entry (R,G,B), the process sets (Q,M,Y,K)=(0,0,0,g) if:  
         [0031]    R&lt;d−DT or d+1+DT&lt;R  
         [0032]    G&lt;d−DT or d+1+DT&lt;G where 0&lt;=d&lt;(T−1)  
         [0033]    B&lt;d−DT or d+1+DT&lt;B  
         [0034]    Other embodiments of the invention will appear to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. It is intended that the specification and examples to be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.