Patent Publication Number: US-5293430-A

Title: Automatic image segmentation using local area maximum and minimum image signals

Description:
This is a continuation of application Ser. No. 07/722,568, filed Jun. 27, 1991 abandoned. 
    
    
     The present invention relates generally to a system for processing image pixels, and more particularly to the detection of halftone frequency prior to processing. 
     INCORPORATION BY REFERENCE 
     U.S. Pat. No. 4,194,221 to Stoffel and U.S. Pat. No. 4,811,115 to Lin et al. are herein incorporated by reference for their teachings. 
     BACKGROUND OF THE INVENTION 
     In the reproduction of copies of an original from video image data created, for example, by electronic raster input scanning from an original document, one is faced with the limited resolution capabilities of the reproducing system and the fact the output devices, are mostly binary. This is particularly evident when attempting to reproduce halftones, lines and continuous tone images. Of course, an image data processing system may be tailored so as to offset the limited resolution capabilities of the reproducing apparatus used, but this is difficult due to the divergent processing needs required by the different types of image which may be encountered. In this respect, it should be understood that the image content of the original document may consist entirely of high frequency halftones, low frequency halftones, continuous tones, or line copy, or a combination, in some unknown degree, of some or all of the above. In the face of these possibilities, optimizing the image processing system for one image type in an effort to offset the limitations in the resolution capability of the reproducing apparatus used, may not be possible, requiring a compromise choice which may not produce acceptable results. Thus, for example, where one optimizes the system for low frequency halftones, it is often at the expense of degraded reproduction of high frequency halftones, or of line copy, and vice versa. 
     In U.S. Pat. No. 4,194,221 to Stoffel, this problem was addressed by applying a discrimination function instructing the image processing system as to the type of image data present and particularly, an auto correlation function to the stream of pixel data, to determine the existence of halftone image data. Such a function is expressed as: ##EQU1## where n=the bit or pixel number; 
     p=the pixel voltage value; and 
     t=the pixel position in the data stream. 
     Stoffel describes a method of processing automatically a stream of image pixels representing unknown combinations of high and low frequency halftones, continuous tones, and/or lines to provide binary level output pixels representative of the image. The described function is applied to the stream of image pixels and, for the portions of the stream that contained high frequency halftone image data, notes a large number of closely spaced peaks in the resultant signal. The correlator circuits described in Stoffel&#39;s embodiment, however, are very expensive, as they must provide a digital multiplication function. Accordingly, as a practical matter, Stoffel requires as a first step, reduction of the amount of data handled, by initially thresholding image data against a single threshold value, to reduce the image to a high contrast black or white image. However, depending on the selection of the threshold as compared to the intensity of the image, significant amounts of information may be lost in the thresholding process. For example, if the threshold level is set to distinguish in the middle of the intensity range, but the image has significant variations through the darker gray levels, the thresholded result does not indicate the variations. This results in an undesirable loss of image information. While it may be possible to vary the threshold value adaptively from original to original and from image area to image area, such algorithms tend to be complicated and work well only for a restricted class of images such as line images. In U.S. Pat. No. 4,811,115 to Lin et al, the auto correlation function is calculated for the stream of halftone image data at selected time delays which are predicted to be indicative of the image frequency characteristics, without prior thresholding. The arithmetic function used in that auto correlation system is an approximation of the auto correlation function using logical functions and addition, rather than the multiplication function used in U.S. Pat. No. 4,194,221 to Stoffel. Valleys in the resulting auto correlated function are detected to determine whether high frequency halftone image data is present. 
     GB 2,153,619A provides a similar determination of the type of image data. However in that case, a threshold is applied to the image data at a certain level, and subsequent to thresholding the number of transitions from light to dark within a small area is counted. The system operates on the presumption that data with a low number of transitions after thresholding is probably a high frequency halftone or continuous tone image. The thresholding step in this method has the same undesirable effect as described for Stoffel. 
     Of background interest in this area are U.S. Pat. No. 4,556,918 to Yamazaki et al. showing an arrangement assuming a periodicity of an area of halftone dots which are thresholded against an average value derived from the area to produce a density related video signal; U.S. Pat. No. 4,251,837 to Janeway, Ill. which shows the use of a three decision mode selection for determining threshold selection based on gradient constants for each pixel; U.S. Pat. No. 4,578,714 to Sugiura et al. which shos random data added to the output signal to eliminate pseudo-outlines; U.S. Pat. No. 4,559,563 to Joiner, Jr. suggests an adaptive prediction for compressing data based on a predictor which worked best for a previous pixel block; and U.S. Pat. No. 3,294,896 to Young, Jr. teaches the usefulness of thresholding in producing an image from a binary digital transmission system. 
     U.S. Pat. No. 4,509,195 to Nadler describes a method for binarization of a pattern wherein two concentric rings around a pixel are evaluated to determine contrast values, and the contrast values are used then to determine whether the pixel and the surrounding areas have a light or dark quality. U.S. Pat. No. 4,547,811 to Ochi et al. teaches a method of processing gray level values, depending on the density level of blocks of pixels, and their difference from a minimum or maximum value. The blocks are then processable by a halftone processing matrix depending on the difference value, U.S. Pat. No. 4,730,221 to Roetling discloses a screening technique where values of gray over an image are evaluated to determine a minimum and maximum level, in order to determine constant levels of gray. U.S. Pat. No. 4,736,253 to Shida discloses a method of producing a halftone dot by selectively comparing image signals with highlight and shadow reference values, for determination of the binarization process. 
     A particular problem noted in the use of the auto correlation function is the false characterization of a portion of the image as a halftone, when in fact it would be preferable for the image to be processed as a line image. Examples of this defect are noted particularly in the processing of Japanese Kanji characters and small Roman letters. In these examples, the auto correlation function may detect the image as halftones and process accordingly, instead of applying a common threshold through the character image. The described computations of auto correlation are one dimensional in nature, and this problem of false detection will occur whenever a fine pattern that is periodic in the scan line or fast scan direction is detected. In the same vein, shadow areas and highlight areas are often not detected as halftones, and are then processed with the application of a uniform threshold. 
     Another similar problem is in the detection of color halftones, which typically include the superposition of plural separations of image data, at selected frequencies, but having the screens processed at angles with respect to each of the other screens. Accordingly, the response obtained after auto correlation is not the same as a response from a black and white image having a single screen frequency. 
     SUMMARY OF THE INVENTION 
     In accordance with the invention there is provided a method and apparatus for applying the auto correlation function for the determination of the presence of high frequency halftone image data, which improves detection of halftones. 
     In accordance with one aspect of the invention, for each pixel in a stream of image data, that pixel is compared to a predetermined group of neighbors, to establish whether that pixel is a minimum or maximum value with respect to the neighbors. A pattern or function is derived representative of those pixels which are local minima, and of those pixels which are local maxima. To this function, the auto correlation function is applied with a delay or offset selected to determine whether the halftone is a high or low frequency. 
     In accordance with another aspect of the invention, the resultant minima or maxima functions can be represented as a simple series of 1&#39;s and 0&#39;s, where the 1&#39;s representing the minima or maxima, depending on which function is being examined. Accordingly, the calculation of the auto correlation function is greatly simplified, and can be represented by a simple logical AND function. 
     In accordance with yet another aspect of the invention, once the function representing the local area minima or maxima has been derived, if the auto correlation function is applied with a zero offset value, a determination of the presence of color halftones may be made. 
     In accordance with still another aspect of the invention, there is provided a method of processing image pixels in an image to determine the presence of halftone images, the steps comprising: 
     for each pixel in the image, comparing said pixel to each of its neighbors to determine whether it is a local area minimum or maximum; 
     from said determination step, deriving two image signals, a first image signal representing local area maximums of the image, and a second image signal representing local area minimums of the image; 
     measuring image density over a block of T pixels with respect to a reference; 
     auto correlating the first image signal if measured image density is relatively high with respect to the reference, or auto correlating the second image signal if measured image density is relatively low with respect to the reference, the auto correlation function evaluated over the block of T pixels, and for each of a plurality of offset values selected as corresponding to probable halftone frequencies; 
     from the auto correlated image signal, determining for each offset value whether the result of the auto correlation function evaluation is a zero or non-zero value, the presence of a non-zero value indicating the presence of halftone images at the frequency corresponding to the offset value. 
     In one embodiment of the aforementioned method, the auto correlation function A(n) is given by: ##EQU2## where n is a selected offset of the auto correlation function; 
     p is the pixel value; and 
     t=a pixel position in the block of T pixels selected. 
     In accordance with yet another aspect of the invention, there is provided a method of determining whether to process an image area in accordance with a halftone image processing method, the steps comprising: 
     for each block of T pixels within the image area, determining whether said block represents halftones images; 
     for each positive determination within a selected area, increasing a count of halftone blocks, and for each negative within the selected area, decreasing the count of halftone blocks; 
     using said determination count, to generate a weighting factor, said weighting factor indicative of the probability of a particular block of pixels representing halftone images; 
     irrespective of the determination of whether said block represents halftones images, providing an indication of the block of pixels as representing halftones images when the weighting factor is greater than a preselected value. 
    
    
     These and other aspects of the invention will become apparent from the following description used to illustrate a preferred embodiment of the invention read in conjunction with the accompanying drawings in which: 
     FIG. 1 demonstrates a block diagram of an image data processing system wherein the present invention finds particular use; 
     FIG. 2 is a block diagram of the main system elements of the auto correlator of FIG. 1 
     FIGS. 3A, 3B and 3C demonstrate an example of the process of generating the video minimum and maximum functions, and the results of the application of the auto correlation function on the video minimum and maximum functions for a monochrome image; FIGS. 3D, 3E, and 3F demonstrate a similar example for a polychrome image. 
     FIGS. 4A and 4B shows a block diagram of one possible embodiment implementing various aspects of the present invention; 
     FIG. 5A shows an image wherein halftones have been micro detected, while FIG. 5B shows the same image portions connected with macro detection; and 
     FIG. 6 shows a flow chart demonstrating the process of macro detection. 
    
    
     Image data in the form of video image data picture elements, (hereinafter, pixels), which may be either analog or digital voltage representations of the image, is provided from a suitable source. For example, the image data pixels may be obtained through line by line scanning of an image bearing original by one or more photosensitive element, such as a multiple photosite array of charge coupled devices, commonly referred to as CCD&#39;s. Line by line scanning of an image bearing original for the derivation of image data is well known and does not form a part of the present invention. 
     In content, the original may be composed entirely of lines, or low frequency halftone image(s), or high frequency halftone image(s), or continuous tone image(s), or combinations thereof. Where the original consists of lines, as for example a typed page, the image pixels may be converted to either one of two voltage levels, one representing non-image or background areas and the other image areas. 
     A continuous tone image comprises an unscreened image, typically a photograph. When scanned, the voltage values of the pixels produced are representative of the gray levels making up the picture. 
     A halftone image, typically a picture or scene, is one which has been reproduced through a screening process. One example is a newspaper picture. The screen used may be either a high or low frequency screen. A high frequency screen is arbitrarily defined herein as one having a frequency of 100 cycles per inch or more, while a low frequency screen is defined as one having a frequency less than 100 cycles per inch. Halftone images, therefore, comprise a pattern of discrete dots, the frequency of which depends upon the screening frequency used. 
     With reference now to the drawings where the showings are for the purpose of illustrating a preferred embodiment of the invention and not for limiting same, in an application incorporation the present invention, such as that described, for example, in U.S. Pat. No. 4,194,221 to Stoffel, FIG. 1 demonstrates handling of image data, which may be derived from any number of sources, including a raster input scanner, a graphics workstation, an electronic memory or other storage element, etc. The stream of image pixels from an image data input is fed to a data buffer 20. Buffer 20, which comprises any suitable commercially available serial in/serial out multi-row buffer having a bit storage capacity sufficient to temporarily store lines of image pixels, permits processing of image data in blocks of several lines. 
     Image data is made available to the image processing system along data bus 22. Image data at this point is in its raw gray format, for example, 6-8 bits per pixel. To detect the presence of high frequency halftone image data, a one dimensional block of image pixels is unloaded from buffer 20 onto a data bus 22. The block of image pixels is passed to halftone detector 24 which as will be explained herein below, auto correlates each pixel group in accordance with a predetermined algorithm to determine if the image data contains halftones or not. An output on line 26 instructs the image processing control 28 to handle the data in accordance with whether high or frequency halftone image data has been detected. A suitable block size is 16 pixels at a time at 400 spots/inch, or 12 pixels at a time at 300 spots/inch. Too large a sample size has a tendency to cause a blurred result, while too small a sample size does not contain a large enough amount of data for a good sample of the function. Either case results in inaccuracies in detecting halftone image data. 
     The presence of line copy and/or continuous tone data is determined by discriminator 34. Discriminator 34 functions to produce an output on line 35 indicative of the presence of line copy or continuous tone image data, instructing image processing control 28 to handle data in accordance therewith. 
     Image processing control 28 serves essentially as a switch to allow data from the image processing sections, including high frequency halftone processing section 30, low frequency halftone processing 31 and line image processing section 32 and continuous tone processing section 34, to flow through bus 36 to an output buffer 38 in accordance with the detection of data in the particular mode. Image processing control 28 controls data bus 36 to allow data flow from each processing section, in accordance with the signals passed thereto from halftone detector 24 or discriminator 34. Each processing section processes all image data in accordance with its function, but only that data appropriately processed is allowed to pass to the output buffer 38. Data improperly processed is discarded. 
     With reference now to FIG. 2, the halftone detector broadly includes two sections. Microdetector 41 operates to detect and establish discrete spans of detected halftone pixels. Macrodetector 44 operates to join detected halftones into continuous regions. A signal from macrodetector 44 establishes the image processing method with which image processing control 28 handles the image data. 
     With reference now to FIGS. 3A and 3B, which represent operation in accordance with the invention on a highlight area of a 26 pixel by 20 scan line image portion, including a 120 line per inch (lpi), 45° halftone scanned at 400 spi in each direction. FIG. 3A shows a portion of an image, which for illustration purposes, has been previously thresholded, although this is not a requirement of the invention. Each pixel V i ,j, where the index i refers to scanlines, and the index j refers to pixels in a scan line, is then compared with a preselected group of neighbors, in this case 8  adjacent pixels, and their average value Avg i ,j. Pixel V i ,j is determined to be a maximum if the gray level value of the pixel is greater than all 8 of the neighboring bits. In a preferred arrangement, to be declared a maximum, pixel V i ,j must also be greater than the neighborhood average by a predefined noise margin. Pixel V i ,j is likewise declared a minimum if V i ,j is less than all of the neighboring pixels, and also is less than the neighborhood average by a predefined noise margin. In the described example, the noise margin is 8 levels, out of 0-255 levels. The results of this step are minima and maxima functions, having one bit per pixel patterns, shown in FIG. 3B. The periodic nature of the halftone becomes much more apparent when the local area minima/maxima function is taken, as shown in FIG. 3B. A running average of the video is kept over the area to determine whether the image is relatively light or dark. In accordance with this determination, the minima function is used when the image is relatively light, and the maxima function is used when the image is relatively dark. The selected pattern (in this case, a minima pattern) is then used to compute the auto correlation function, given by ##EQU3## where n=a selected offset or time delay of the auto correlation; 
     p=the pixel voltage value; and 
     t=the pixel position in the data stream. 
     The approximate auto correlation function of U.S. Pat. No. 4,811,115 to Lin et al. may be used, given by ##EQU4## where k is a selected time delay along the function, 
     f(l)is the pixel intensity value, and 
     l is a selected pixel position in the data stream; 
     However, the one bit video max/min function upon which the auto correlation function operates is now greatly simplified over the requirements noted by U.S. Pat. No. 4,811,115 to Lin et al., and the standard auto correlation function described by Stoffel may be used. The auto correlation function can be treated as a logical AND operation operable on the image data. FIG. 3C, then shows the results of the auto correlation function for blocks of 16 pixels at 11 offsets, (n=0, 1, 2, . . . 10) for each scan line. Non-zero entries are found at shifts 4, 5 and 9, 10, corresponding to the projected wavelength and multiples of the 45° halftone. 
     The following is a chart showing some common halftone screen frequencies and the probable image shift positions at which non-zero entries will be noted for auto correlation at 400 spi. 
     
         ______________________________________                                    
Screen    Screen                  Shift for Auto                          
Frequencies @                                                             
          Frequencies @                                                   
                      Screen Period                                       
                                  Correlation                             
45° in Ipi                                                         
          0° in Ipi                                                
                      @ 0°, in Pixels                              
                                  Peaks                                   
______________________________________                                    
 65       46          8.7         8-9                                     
 85       60          6.7         6-7                                     
100       71          5.7         5-6                                     
110       78          5.1         5                                       
120       85          4.7         4-5                                     
133       94          4.3         4                                       
150       106         3.8         3-4                                     
175       124         3.2         3                                       
______________________________________                                    
 
    
     In accordance with another aspect of the invention, color halftones are usually a superposition of halftones in each separation at slightly differing angles. Using the plot similar to that shown in FIG. 3C for a monochrome reproduction of a multicolor image, resulting from treatment of the image data as described for FIGS. 3A and 3B, it is first noted at FIG. 3E, that the patterns of color halftones scanned by a monochrome scanner do not have the regularity of monochrome images at 45 degree angles. A sample plot in FIGS. 3D, 3E, and 3F, shows that the offset of non-zero entries of the auto correlation varies from scan line to scan line. However, it can also be noted in FIG. 3F that the zero position offset entries of the auto correlation are mostly non-zero, while in the monochrome case (FIG. 3C), the zero offset is marked by two or more zeros in the vertical direction. This feature can be used to distinguish high frequency color halftones from low frequency 45 degree halftones. 
     With reference now to FIG. 4, wherein a block diagram of one possible embodiment of a halftone detection arrangement in accordance with the invention is shown, video input is initially delivered to a context buffer 100, which for a pixel V i ,j under consideration, stores a 5×5 matrix of pixel values centered on pixel V i ,j. The values are initially directed to low frequency halftone min/max qualifier 102, which is directed to confirming, for low frequency halftones, that the center pixel V i ,j has a value either lower or higher than the neighboring pixels. The output flags of qualifier 102, QualD2 and QualP2, are used to qualify the decision to set the pattern bits D2 and P2 for low frequency halftones. The four neighbors in a 3×3 kernel centered on V i ,j, which are directly above, below and to the right and left of the pixel V i ,j are compared with the four neighbors in the expanded 5×5 kernel which are directly above, below and to the right and left of these neighbors. The flag, QualP2, is set if the neighbors in the 3× 3 kernel are greater than or equal to the neighbors in the 5×5 context (insuring the pixel V i ,j is a peak). The flag, QualD2, is set if the neighbors in the 3×3 kernel are less than or equal to the neighbors in the 5×5 context (insuring the pixel V i ,j is a valley). 
     Image signals are also directed from context buffer 100 to neighbor maximum detector 104 and neighborhood minimum detector 106, which respectively detect whether pixel V i ,j is a maximum or minimum with respect to its neighbors. In the neighbor maximum detector 104, a determination is made whether the gray level value of the center pixel being processed, V i ,j, is greater than the values of its eight neighbors. This is accomplished by successively comparing two pixels at a series of comparators which produces outputs indicative of the neighborhood maximum V max . Once the maximum video value V max  within the eight neighbors is found, it is compared to the center pixel, V i ,j. If V i ,j is greater than this maximum value then a flag, MaxExist, is set. This is repeated for each pixel in the scan line. The neighbor minimum detector 106, operates in essentially the same manner, except that the determination tests whether the pixel, V i ,j, has the smallest gray value when compared to its eight neighbors, V min . If V i ,j is the minimum value in a 3×3 kernel then a flag, MinExist, is set. This is repeated for each pixel in the scan line. The two flags, MaxExist and MinExist, will be used in the min/max pattern generator, as well as in the generation of the halftone micro detection flags, as will be explained further below. 
     Neighborhood averagers 108, 110 and 112 sum and average the eight neighbors of center pixel V i ,j. Each averager respectively derives average values M i-1 ,j, M i ,j, M i+1 ,j, for locations Vi,j, Vi-1,j and Vi+1,j, by summing the values of the 8 neighbors, and subsequently dropping the three least significant bits. This average value is used to determine both a Laplacian sum, as will be described hereafter, as well as the D 1 , D 2 , P 1 , and P 2  pattern bits. The three averages are used to compute the Laplacian sums needed for context when computing the Laplacian Sum, S i ,j. The average of V i ,j and its neighbors, termed, Avg i ,j is also derived. 
     The absolute value of the Laplacian is found by subtracting the center pixel from the average of its eight neighbors, M i ,j and taking the two&#39;s complement of the result if it is negative. (|L i ,j |=|M i ,j -V i ,j |). The absolute Laplacian values are determined at block 114 (operating on M i-1 ), 116 (operating on M i ) and 118 (operating on M i+1 ). The absolute Laplacian values are then summed at Laplacian summer 120. The absolute value of the Laplacian for V i ,j and each of its eight neighbors is summed together and termed S i ,j. This value is used as a discriminator for text and continuous tone. Image areas which are determined not to be halftones, having video near background or black, and having a high Laplacian sums are classified as text. Otherwise, those image portions are classified as continuous tone. 
     Min/max pattern generator 122 determines if the following relationships are true: S i ,j ≧NoiseSum, (V i ,j -LowNoise)&gt;M i ,j, (V i ,j -HighNoise)&gt;M i ,j, (V i ,j +LowNoise)&lt;M i ,j and (V i ,j +HighNoise)&lt;M i ,j. The noise values are programmed values as previously described. The results of these tests, the flags MinExist and MaxExist, and the low frequency qualifiers QualD 2  and QualP 2 , are used to set the maximum pattern bits P 2 , P 1 , and minimum pattern bits D 2 , D 1 , which represent the maxima and minima functions which will be subjected to the auto correlation function. P 1  and P 2  represent peaks of the signal while D 1  and D 2  represent valleys of the signal. The auto correlation function is then applied to the data signals D 1  and P 1  at high frequency halftone auto correlator 124. The auto correlation function operates on either D 1  or P 1 , depending on a flag D/P generated at low frequency auto correlator 126, as to whether the average value of pixel V i ,j and Avg i ,j over the auto correlation block is greater than a reference value representing a mid-tone value, which represents whether the image is relatively dark or light. At high frequency auto correlator 124, the auto correlation function for testing the presence of high frequency halftones is applied to obtain results for pixel shift positions 2, 3, 4, 5 and 6. 
     Low frequency auto correlator 126 is essentially the same as high frequency auto correlator 124 with the exception that the D2 and P2 bit patterns are used from min/max pattern generator 122. There is also a longer shift register for the D2 and P2 bits since more auto correlation shift positions are examined for low frequency halftones. The auto correlation function for testing the presence of low frequency halftone is applied to obtain results for shift positions 4, 5, 6, 7, 8, 9 and 10. In addition, the previously mentioned flag, D/P, is generated in this module for use in both high and low frequency auto correlation modules as well as the peak count storage module. 
     The values for each of the shift positions derived by auto correlation of the min/max function are directed to high frequency halftone detector 128. Auto correlation values of adjacent shift positions are summed and compared to a programmable threshold. If any one of the sums is greater than or equal to this threshold and if there were both a minimum and maximum found within the auto correlation block, then a flag indicating high frequency halftones is set, indicating the presence thereof. If all the auto correlation values are equal to zero then the micro detection flag is reset to zero. Low frequency halftone detector 130 operates similarly. 
     Input video at 300 spi resolution represents a special case for the micro detection flag generation. For 300 spi shift positions 4 and 5 are not used to determine the presence of high frequency halftones but are used to detect low frequency halftones. 
     Where the auto correlation function may fail to indicate the presence of high frequency halftones, i.e. for color halftones, the peak count from the peak counter and storage 132 is used. The peak count value represents the number of peaks in a given block of auto ocrrelated pixels, accumulated over a fixed number of scan lines. This value is compared with two thresholds with typical values of 14 and 5. If the peak count value is greater than or equal to the higher threshold then the detection flag, for high frequency halftones, is set. If the peak count value is between the two thresholds then the flag for low frequency halftones is set. 
     With reference now to FIG. 2, where the microdetection method described only establishes discrete spans of detected halftones, and detects only halftones where the peak or valley of a halftone dot exists, these spans now need to be connected together into a continuous regions or area of halftones (compare microdetected halftones at FIGS. 5A and regions to be treated as halftones in FIG. 5B). This is a function of the macrodetector 44. With reference again to FIG. 4, the detected status of the block of auto correlated pixels, directed from the halftone microdetectors 128 and 130 to the halftone macro detector 134 is used to modify a set of counters in a memory, to establish a detection history. The number of previously microdetected halftones varies a weighting factor that is applied to the current detection of halftone. Detections of high frequency halftone and low frequency halftones are counted from the detection signals directed to halftone macrodetector 134 from halftone micro detectors 128 and 130. In the particular embodiment, the neighborhood of consideration is defined as the previous two blocks in the scanline currently processed, the block directly above the current block in the previous scanline and the two blocks to the right of the current block in the previous scanline. A combination of the detection results from the microdetection, the value of the block directly above the current block in the prior scanline, and the values of neighboring blocks determine the outcome of the macro detection level. In some the cases where the microdetection fails to indicate halftones due perhaps to extremes in halftone density range of the image, neighborhood information is used to determine the outcome of the micro detection level. This logic allows spanning of an area within a halftone pictorial that was not detected on the micro level. These counters, MCount1k, MCount1k-1, MCount1k-2, MCount1k+1, MCount1k+2, for each of the five auto correlated blocks, which as reviewed, provide context to determine whether a microdetected halftone span should actually be classified as halftone in the final output. A high output flag, mac-hi-hft (for high frequency halftone areas) or mac-low-hft (for low frequency halftones), is generated so long as the region should be classified as either a high or low frequency halftone based on the context of microdetections. The flow chart in FIG. 6 shows the decision process of the macro detection for the high frequency halftone. If a block of pixel is detected as high frequency halftone by the high frequency halftone detection block 128 for the first time as indicated by a zero history counter, the history counter is set to a high value, typically 32 for 400 scanlines per inch. The macro detection flag, mac-hi-hft, is set, only if one of the immediate neighboring blocks has a non-zero history count. This prevents an isolated false micro detection from being flagged as a macro detection. If the history counter of the current micro detected block is non zero, the mac-hi-hft flag is set. The counter is reset back to 32, if it is greater than 16 and set to 16 otherwise. 
     If the current block is not detected as high frequency halftone, yet its history counter is non-zero, indicating detection in the same block position of the previous scanlines, the adjacent blocks are then checked. If either of them also has non-zero count, the mac-hi-hft flag is set. This tends to fill up the block of undetected halftone inside those already detected. The history counter of the block is decreased by one so that unless further micro detection occurs in the same block in the subsequent scanlines, the block will not be classified as halftone after several scanlines. If the history counter of the undetected block is zero, the mac-hi-hft flag will not be set unless the previous two blocks or the next two blocks have non-zero history count. 
     The macro detection for the low frequency halftone is the same as the high frequency halftone with a different set of history counters. The macro detection process has the effect of merging the discrete micro detected blocks of pixel into continuous region of macro detected region as shown in FIGS. 5A and 5B. The extra macro detected region on both sides and below the actual halftone area can be re-classified in the final classification block 138. 
     For pixels in blocks not classified as halftones by the halftone micro detection, additional steps of classification into continuous tone or text/line art at block 138 is necessary. Background areas, identified at document background determination 140 are treated as belonging to text/line art, because the background and embedded text are best reproduced by simple thresholding. Text areas are characterized by pixels of low video levels corresponding to the black text and high video levels corresponding to the white background, connected by gray pixels that have high value of Laplacian sum at the edge of the text. In contrast to text, gray pixels inside a continuous tone picture, with the exception of textured area and high contrast edges, usually have a low value of Laplacian sum. The classification of text/line art versus continuous tone pixels thus could be done pixel by pixel, based on pixel V i ,j as well as the absolute Laplacian sum which is already computed for each pixel. In order to avoid classifying a dark area, a highly textured area or a high contrast edge inside a continuous tone picture as text, image run discriminator 136 is provided. An image run is defined as a continuous sequence of non-background pixels that have either small Laplacian sums, or are inside either a high frequency halftone block or an image run determined from the previous scanline. These image runs are represented by the beginning and ending pixel indices and are stored in appropriate memory. 
     We assume an average background value is available from a windowed region near the leading edge of the document. Once we have determined the background video value of the document being scanned, we determine two fractions of this value termed, White1 and White2. These fractions are programmable by the user, with typical values of 90% for White1 and 82% for White2. These values are used to qualify pixels as background, i.e. text, later. 
     Blocks that have been classified as halftones will be checked to see if they contain background pixels. If the Laplacian Sum, S i ,j, of a pixel is small and its video≧White 1, then the pixel is probably background and will be classified as text instead of halftone. This helps clean up borders of halftone images as well as regions extending below actual halftone by the macro detection. 
     Next, we examine the pixels that are not in blocks classified as halftone. If the pixel is not in an image run and its Laplacian Sum, S i ,j, is greater than or equal to a given threshold, with typical value of 60, then the pixel is probably part of a line or character and is classified as text. If not, we then compare the pixel against the second, smaller fraction of the background value, White2, to test for background around text. If the pixel value is greater than or equal to White2 and it is not inside an image run, then it is classified as text background. If it is inside an image run, then it will not be classified as text background unless it is greater than or equal to the higher threshold White 1. For those pixels with video less than White2, i.e. gray or black pixels, we classify as black text those pixels that are not in an image run and with video less than a black threshold, with typical value of 50. The black pixels that are inside an image run and all gray pixels, except those with a high Laplacian sum and outside of an image run, i.e. the edges of text, will be classified as continuous tone. 
     The text and continuous tone classifications require the knowledge of the video corresponding to the background level of the document. This background value is obtained at document background determination 140 from a running average of pixels inside a suitably specified window near the leading edge of the document. Before this value becomes available, a background default value is used. In determining the running average, it is also better to exclude pixels with video less than a certain level specified by a background threshold level. At the end of the window, the running average of background is checked against the lower bound, and the default value is used, if the running average is smaller than the lower bound. The background value provides the information necessary for text and continuous tone classification at block 138, by providing the indication background to that function. 
     The step involving the comparison of the absolute Laplacian sum of the pixel with its reference value can be substituted by comparing the absolute value of the output of a high pass filter, such as the difference between the center pixel and the average of its 5 by 7 neighbors with a referenced value. 
     The system has been illustrated with the pixel value 0 being black and pixel value 255 being white for an 8 bit video value. The description remains valid, with the appropriate changes of the inequality in comparing the pixel values with references, for a system where 0 is white and 255 is black. 
     The invention has been described with reference to a preferred embodiment. Obviously modifications will occur to others upon reading and understanding the specification taken together with the drawings. This embodiment is but one example, and various alternatives, modifications, variations or improvements may be made by those skilled in the art from this teaching which are intended to be encompassed by the following claims.