1. Field of the Invention
The present application relates to compression techniques and, more particularly, improved compression techniques for use with the mixed raster content compression format.
2. Description of the Related Art
Image compression addresses the problem of reducing the amount of data required to represent a digital image. Compressed data (i.e., text and/or image data) may be easier to transmit by, for example, facsimile and/or e-mail than non-compressed data.
The underlying basis of the reduction process is the removal of redundant data during a scanning operation or, alternatively, from existing electronic files. Compression techniques typically fall into two broad categories: information preserving compression (i.e., lossless compression) and lossy compression. Lossless compression allows data to be compressed and decompressed without the loss of information. Lossy compression provides higher levels of data reduction as compared to lossless compression but results in a less than perfect reproduction of the original image (i.e., information loss).
Lossless compression methods (e.g., Lempel-Ziv or LZW) perform well on text but do not perform particularly well on scanned images. In contrast, lossy compression methods (e.g., JPEG) work fairly well on continuous-tone pixel arrays but do not work particularly well on text.
Accordingly, the mixed raster content (MRC) format may be used to compress documents including both text and images. The MRC format segments a document into two or more planes or layers. For example, each pixel in a document may be segmented into a text layer, a foreground layer and a background layer, as described in U.S. Pat. Nos. 5,778,092 and 6,324,305, the entire contents of which are incorporated herein by reference. The text layer may include only text data of the document, the foreground layer may include color information of the text data and the background layer may include any image that is not considered text data.
Once each pixel has been segmented between two or more layers, each layer may be separately compressed using an appropriate compression method based on the content of the layer. For example, the text layer may be compressed using a lossless compression method such as LZW while the foreground and background layers may be compressed using a lossy compression method such as Joint Photographic Experts Group (JPEG).
In the prior art, the segmentation step may be carried out by separating high frequency pixels, which typically are associated with text, from low frequency pixels, which typically are associated with image and background data. Such edge detection techniques often misclassify pixels belonging to large halftone dots (i.e., halftone dots having a size equal to or greater than the edge detector kernel) as high frequency pixels and therefore treat them as text pixels, thereby increasing the size of the compressed file.
Accordingly, there is a need for a segmentation technique having an improved capability for detecting the difference between halftone areas and text areas.
In one aspect, the segmentation method provides a method for segmenting a selected pixel of an array of pixels between at least two layers. The method includes identifying an N-by-N window centered upon the selected pixel, evaluating at least one pixel in the N-by-N window to determine whether the selected pixel is a potential text element, identifying an M-by-M window centered upon the selected pixel when the act of evaluating determines that the selected pixel is a potential text element, wherein the M-by-M window is smaller than the N-by-N window, and determining whether the potential text element includes text by comparing at least two pixels within the M-by-M window.
In another aspect, the segmentation method provides a method for segmenting a selected pixel of an array of pixels between at least two layers. The method includes identifying a N-by-N window centered on the selected pixel, obtaining a total intensity value for each row, column and major diagonal of the N-by-N window, comparing the total intensity values to determine whether the selected pixel is a potential text element, identifying a M-by-M window centered on the selected pixel when the selected pixel is determined to be a potential text element, wherein the M-by-M window is smaller than the N-by-N window, and comparing at least two oppositely positioned pixels within the M-by-M window to determine whether the potential text element includes text.
Other aspects of the segmentation method will become apparent from the following description, the accompanying drawings and the appended claims.
As shown in
As shown in
The first act in the process (i.e., PTE detection), as shown in boxes 116 and 118, may include determining whether the selected pixel is a PTE. PTE detection may begin by identifying an N-by-N window 132 around the selected pixel 130. “N” may be any number and may be selected by the user or may be pre-programmed. “N” should be sufficiently large to allow the method 110 to identify halftone dots, edges and the like. In one aspect, “N” may be a number between about 5 and about 500.
For example, as shown in
Each pixel in the array 100 may have an associated intensity value (i.e., a pixel intensity), as shown by numbers 50 and 250 throughout
Once a window 132 around selected pixel 130 has been identified, the method 110 may proceed to sum the intensity values of each row of pixels (i.e., a summation of the pixel intensity of each pixel in a row for each row in the window 132), each column of pixels (i.e., a summation of the pixel intensity of each pixel in a column for each column in the window 132) and each major diagonal of pixels (i.e., a summation of the pixel intensity of each pixel in a diagonal for each major diagonal in the window 132).
For example, as shown in
The summation of the intensity values for each column of window 132 (i.e., columns B to R) are provided in Table 2:
The summation of the intensity values for each major diagonal of window 132 (i.e., diagonal D1 is pixel B-2 to pixel R-18 and diagonal D2 is pixel R-2 to pixel B-18) are provides in Table 3:
Once the total intensities for each row and column have been obtained, the method 110 identifies a maximum (i.e., Mr) and a minimum (i.e., mr) total intensity of all the rows and a maximum (i.e., Mc) and a minimum (i.e., mc) total intensity of all the columns and makes a comparison, as follows:
Mr−mr≦T1 (1)
Mc−mc≦T1 (2)
wherein T1 is a predetermined threshold value. Furthermore, the method compares the total intensity values of the major diagonals, as follows:
|D1−D2|≦T2 (3)
wherein T2 is a predetermined threshold value. The threshold values T1 and T2 may be selected by the user or may be preprogrammed.
If each comparison is less than the associated threshold value (i.e., each of equations 1, 2 and 3 are true), the pixel is not a PTE. However, if at least one comparison exceeds the associated threshold value (i.e., at least one of equations (1), (2) and (3) is false), the pixel is considered a PTE.
For example, using
T1=1000(predetermined value) (4)
T2=500(predetermined value) (5)
and applying the results of Tables 1, 2 and 3 to equations (1), (2) and (3), the following is obtained:
Mr=3250(per row 13,see Table 1) (6)
mr=850(per rows 2-12,see Table 1) (7)
Mc=2050(per column D,see Table 2) (8)
mc=850(per columns N-R,see Table 2) (9)
D1=1050(see Table 3) (10)
D2=1250(see Table 3) (11)
Substituting the values for Mr and mr for (6) and (7) into equation (1) provides:
3250−850≦1000(false) (12)
Substituting the values for Mc and mc for (8) and (9) into equation (2) provides:
2050−850≦1000(false) (13)
Substituting the values for D1 and D2 for (10) and (11) into equation (3) provides:
|1050−1250|≦500(true) (14)
Thus, equation (1) (i.e., 2400≦1000) and equation (2) (i.e., 1200≦1000) would and equation (3) (i.e., 200≦500) would be true for the results of Tables 1, 2 and 3. Therefore, the pixel 130 (i.e., pixel J-10) may be classified as a PTE, and the method 110 may proceed as shown in boxes 122 and 124.
The second act (i.e., text detection), as shown in boxes 122 and 124 of
Text detection of the method 110 may begin by identifying an M-by-M window 134 around the selected pixel 130, wherein the M-by-M window 134 is smaller than the N-by-N window 132. “M” may be selected by the user or may be pre-programmed. In one aspect, “M” may be a number between about 2 and about 300.
For example, as shown in
The method 110 may proceed to compare intensity values of each pixel in a first row and/or column to a corresponding pixel in an opposite row and/or column to determine whether each pixel in the first row and/or column has an intensity greater than the intensity of the corresponding pixel in the opposite row and/or column by a predetermined threshold value T3.
In one aspect, the method 110 may only compare the pixels directly bordering the M-by-M window 134. For example, referring to
The comparison may ask, for example, whether any of the following is true:
|IG-7−IG-13|≧T3 (15)
|IH-7−IH-13|≧T3 (16)
|II-7−II-13|≧T3 (17)
|IJ-7−IJ-13|≧T3 (18)
|IK-7−IK-13|≧T3 (19)
|IL-7−IL-13|≧T3 (20)
or
|IM-7−IM-13|≧T3 (21)
wherein IY-X is the intensity of the pixel located at column Y and row X. If any of equations 4-10 are true, then the selected pixel 130 may be designated as a true text pixel and segmented to the text layer, as shown in box 126 of
Applying equations 15-21 to the selected pixel 130 of
|50−250|≧100 (22)
or
200≧100(true) (23)
Therefore, pixel J-10 may be designated as a true text pixel and segmented to the text layer.
If we were to compare each pixel in column G to its corresponding pixel in column M we would obtain a different result. In particular, we would obtain 0≧100 for each comparison (i.e., |50−50| for rows 7 through 12 and |250−250| for row 13), which is false. However, so long as one comparison (either column or row) yields a result that is greater than the threshold T3, the selected pixel 130 may be segmented as a text pixel.
Once each pixel in the array 100 is segmented into at least two layers (e.g., a text layer and background layer, as described above), the document may be separated into the at least two layers, and each layer may be compressed using a compression technique appropriate for that layer (e.g., LZW for the text layer and JPEG for the background layer).
Although the segmentation method is shown and described with respect to certain aspects, it is obvious that modifications will occur to those skilled in the art upon reading and understanding this specification. The segmentation method includes all such modifications and is limited only by the scope of the claims.
Number | Name | Date | Kind |
---|---|---|---|
4668995 | Chen et al. | May 1987 | A |
5050222 | Lee | Sep 1991 | A |
5202933 | Bloomberg | Apr 1993 | A |
5321770 | Huttenlocher et al. | Jun 1994 | A |
5392362 | Kimura et al. | Feb 1995 | A |
5416604 | Park | May 1995 | A |
5638498 | Tyler et al. | Jun 1997 | A |
5745596 | Jefferson | Apr 1998 | A |
5767978 | Revankar et al. | Jun 1998 | A |
5774579 | Wang et al. | Jun 1998 | A |
5778092 | MacLeod et al. | Jul 1998 | A |
5850474 | Fan et al. | Dec 1998 | A |
5875041 | Nakatani et al. | Feb 1999 | A |
5982937 | Accad | Nov 1999 | A |
6044178 | Lin | Mar 2000 | A |
6163625 | Ng et al. | Dec 2000 | A |
6173088 | Koh et al. | Jan 2001 | B1 |
6185329 | Zhang et al. | Feb 2001 | B1 |
6195459 | Zhu | Feb 2001 | B1 |
6229923 | Williams et al. | May 2001 | B1 |
6249604 | Huttennlocher et al. | Jun 2001 | B1 |
6324305 | Holladay et al. | Nov 2001 | B1 |
6411733 | Saund | Jun 2002 | B1 |
6437881 | Baba et al. | Aug 2002 | B1 |
6587583 | Kurzweil et al. | Jul 2003 | B1 |
6608928 | Queiroz | Aug 2003 | B1 |
6625323 | Henderson et al. | Sep 2003 | B2 |
6633670 | Matthews | Oct 2003 | B1 |
6701012 | Matthews | Mar 2004 | B1 |
6731800 | Barthel et al. | May 2004 | B1 |
6731814 | Zeck et al. | May 2004 | B2 |
6836564 | Katayama et al. | Dec 2004 | B2 |
6853755 | Li | Feb 2005 | B2 |
7035463 | Monobe et al. | Apr 2006 | B1 |
7039235 | Katsuyama | May 2006 | B1 |
7245740 | Suzaki | Jul 2007 | B2 |
20020037100 | Toda et al. | Mar 2002 | A1 |
20020136460 | Bottou et al. | Sep 2002 | A1 |
20030031361 | Said | Feb 2003 | A1 |
Number | Date | Country | |
---|---|---|---|
20070150803 A1 | Jun 2007 | US |