Improved automatic image segmentation

Abstract: Method and apparatus for processing image pixels to determine the presence of high frequency halftone images. Prior to auto correlation, each pixel in the image is examined to determine whether it is a local area maximum or minimum. A binary image function composed of the image local area maximum or minimums is made available for auto correlation. The presence of peaks at shifts indicative of predetermined halftone image frequencies is detected, and an output signal indicative of the presence or absence of peaks at the predetermined halftone image frequencies is provided. The arrangement is combined with a run length encoder to reduce false microdetection results.

Description: The present invention relates generally to a system for processing image pixels, and more particularly to the detection of halftone frequency prior to processing. 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 that 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, optimising 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 optimises 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 US-A 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: 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'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 US-A 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 US-A 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, 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 US-A 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; US-A 4,251,837 to Janeway, III which shows the use of a three decision mode selection for determining threshold selection based on gradient constants for each pixel; US-A 4,578,714 to Sugiura et al. which shows random data added to the output signal to eliminate pseudo-outlines; US-A 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 US-A 3,294,896 to Young, Jr. teaches the usefulness of thresholding in producing an image from a binary digital transmission system. US-A 4,509,195 to Nadler describes a method for binarisation 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. US-A 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, US-A 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. US-A 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 binarisation process. A particular problem noted in the use of the auto correlation function is the false characterisation 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 colour 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. In accordance with 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 a preselected group of 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 or 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 function, 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 accordance with another aspect of the invention, the resultant minima or maxima functions can be represented as a simple series of 1's and 0's, where the 1'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 colour halftones may be made. In a further aspect of the invention there is provided an apparatus for processing image pixels in an image represented by a plurality of scan lines of pixels, to determine the presence of halftones in the image, the apparatus comprising: means to compare each pixel with a group of neighboring pixels to determine whether it is a local area minimum or maximum, and provide an output signal indicative thereof; signal forming means, for forming a minimum signal and maximum signal each representing the set of minimum pixels and the set of maximum pixels within the image; thresholding means operable on the average value of a block of T pixels in the image, for determining whether the image is relatively dark or light, and producing a dark signal if the average value is less than a threshold value and a light signal if the average value is greater than the threshold value; means for evaluating the auto correlation function for each block of T pixels, said auto correlation means operable on the maximum signal if the image has been determined to be light or said auto correlation means being operable on the minimum signal if the image has been found to be dark, 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; offset comparison means for determining from said auto correlation means whether the evaluation at each offset value is a non-zero value, such determination indicating the presences of halftone at the corresponding halftone frequency. Preferably, the maximum signal and the minimum signal are each represented by a one bit per pixel function. In certain embodiments the aforementioned, auto correlation function A(n) may be given by: 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. According to one embodiment, the pixel value p is equal to 1 if the pixel is a minimum or maximum, else equal to 0. Preferably, the determination of whether a block of T pixels represents halftone images including the following steps: for each pixel in the block, comparing said pixel to each of its neighbours in the image 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 the block of T pixels with respect to a reference; auto correlating the first function if measured image density is high with respect to the reference, or auto correlating the second function if measured image density is 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 function, 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 producing a positive determination of the presence of halftone images. Preferably the value of the determination count for each block M in scan line N, is the counter value resulting from halftone determination at blocks M, M + 1 and M + 2 in scan line N-1 and blocks M, M-1, and M-2, in scanline N. 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. According to a further aspect of the invention there is provided a method of distinguishing in an image portions thereof classifiable as halftone image portions and background image portions, comprising the steps of: determining an average background value for the image; determining portions of the image to be treated as including halftones images; within areas of the image determined to be treated halftone images, determining for each pixel the average value of its neighbouring pixels; determining the absolute value of the Laplacian of the pixel, by subtracting the value of the pixel from the average value, and for a negative value so determined, determining two's complement of the negative value; summing the absolute value of the Laplacian sum for each pixel, and its neighbouring pixels, and comparing the absolute value sum to a predetermined reference value selected to discriminate between halftone image portions and text background image portions; comparing the pixel value to a predetermined fraction of the background value of the image; producing an indication of background image portions in accordance with the comparison of the absolute value sum with the reference value, and an in accordance with the comparison of the pixel value with the predetermined fraction of the background value. According to another aspect of the invention there is provided a method of determining the presence within an image of portions thereof classifiable as continuous tone or line/text, comprising the steps of: determining that the portion does not include halftones; for each pixel in the portion determined not to include halftones, determining the average value of its neighbouring pixels; determining the absolute value of the Laplacian of the pixel, by subtracting the value of the pixel from the average value of its neighbouring pixels, and for a negative value so determined, determining two's complement of the negative value; summing the absolute value of the Laplacian for each pixel, and its neighbouring pixels, and comparing said result to a predetermined reference value selected to discriminate between continuous tone image portions and text/line image portions; producing an indication of continuous tone image portions or text/line portions in accordance with the comparison of the Laplacian sum and the reference value. According to another aspect of the invention there is provided a method of determining the presence within an image of portions thereof classifiable as line/text, continuous tone, or background, wherein pixel values range from a minimum value representing a black pixel and a maximum value representing a white pixel, comprising the steps of: determining an average background value for the image; determining first and second fractional values of the average background value, with the first value being greater than the second one; determining those portions of the image including high frequency halftone; determining for each scanline in the image whether the scan line is in a portion of the image classifiable as an image run, and storing the location of each image runs; each image run including a continuous sequence of pixels, wherein each pixel in the image run may be classified into at least one of three classifications wherein pixels in the first class have a pixel value less than the first fraction of the average background value and an absolute Laplacian sum less than a reference value, pixels in the second class includes pixels that are inside a portion of the image classified as including high frequency halftone and pixels of the third class include pixels that are located inside an image run of the preceding scanline; for each pixel, producing an indication of a line/text image portion, when the absolute Laplacian sum for the pixel is greater than the reference value and the pixel is not inside the image run of the previous scanline; for each pixel, producing an indication of background image portion when the pixel value is greater than the second fractional value and the pixel is not inside an image run of the previous scanline; for each pixel, producing an indication of background image portion when the pixel value is greater than the first fractional value and the pixel is inside an image run of the previous scanline; for each pixel, producing an indication of continuous tone image portion when the pixel value is less than the first fractional value and the pixel is inside an image run of the previous scanline; for each pixel, producing an indication of text/line image portion when the pixels value is less than a black reference value and the pixel is not inside an image run of the previous scanline; and for each pixel, producing an indication of continuous tone image portion when the pixel value is less than the second fractional value of background value and the pixel is either inside an image run or with pixel value greater than the black reference value. According to another aspect of the invention there is provided a method of determining the presence within an image of portions thereof classifiable as line/text, continuous tone, or background wherein pixel values range from a maximum value representing a black pixel and a minimum value representing a white pixel, comprising the steps of: determining an average background value for the image; determining first and second fractional values of the average background value, with the first value being less than the second one; determining those portions of the image including high frequency halftone; determining for each scanline in the image whether the scan line is in a portion of the image classifiable as an image run, and storing the location of each image runs; each image run including a continuous sequence of pixels, wherein each pixel in the image run may be classified into at least one of three classifications wherein pixels in the first class have a pixel value greater than the first fraction of the average background value and an absolute Laplacian sum greater than a reference value, pixels in the second class includes pixels that are inside a portion of the image classified as including high frequency halftone and pixels of the third class include pixels that are located inside an image run of the preceding scanline; for each pixel, producing an indication of a line/text image portion, when the absolute Laplacian sum for the pixel is less than the reference value and the pixel is not inside the image run of the previous scanline; for each pixel, producing an indication of background image portion when the pixel value is less than the second fractional value and the pixel is not inside an image run of the previous scanline; for each pixel, producing an indication of background image portion when the pixel value is less than the first fractional value and the pixel is inside an image run of the previous scanline; for each pixel, producing an indication of continuous tone image portion when the pixel value is greater than the first fractional value and the pixel is inside an image run of the previous scanline; for each pixel, producing an indication of text/line image portion when the pixels value is greater than a black reference value and the pixel is not inside an image run of the previous scanline; and for each pixel, producing an indication of continuous tone image portion when the pixel value is greater than the second fractional value of background value and the pixel is either inside an image run or with pixel value greater than the black reference value. According to another aspect of the invention there is provided a method of determining the presence within an image of portions thereof classifiable as continuous tone or line/text, comprising the steps of: determining that the portion does not include halftones; comparing the absolute value of an output of a high frequency image passing filter to a predetermined reference value selected to discriminate between continuous tone image portions and text/line image portions; producing an indication of continuous tone image portions or text/line portions in accordance with the comparison of the output of the the absolute value of the high frequency image passing filter and the reference value. There is provided a method of determining the presence within an image of portions thereof classifiable as continuous tone or line/text, comprising the steps of: determining that the portion does not include halftones; for each pixel in the portion determined not to include halftones, determining the average value of its neighbouring pixels; determining the absolute value of a high frequency image filter output result and comparing said result to a predetermined reference value selected to discriminate between continuous tone image portions and text/line image portions; producing an indication of continuous tone image portions or text/line portions in accordance with the comparison of the the absolute value of high frequency image filter output result and the reference value. According to another aspect of the invention there is provided a method of determining the presence within an image of portions thereof classifiable as line/text, continuous tone, or background, wherein pixel values range from a minimum value representing a black pixel and a maximum value representing a white pixel, comprising the steps of: determining an average background value for the image; determining first and second fractional values of the average background value, with the first value being greater than the second one; determining those portions of the image including high frequency halftone; determining for each scanline in the image whether the scan line is in a portion of the image classifiable as an image run, and storing the location of each image runs; each image run including a continuous sequence of pixels, wherein each pixel in the image run may be classified into at least one of three classifications, wherein pixels in the first class have a pixel value less than the first fraction of the average background value and the absolute value of a high frequency image filter output less than a reference value, pixels in the second class includes pixels that are inside a portion of the image classified as including high frequency halftone and pixels of the third class include pixels that are located inside an image run of the preceding scanline; for each pixel, producing an indication of a line/text image portion, when the high frequency image filter output for the pixel is greater than the reference value and the pixel is not inside the image run of the previous scanline; for each pixel, producing an indication of background image portion when the pixel value is greater than the second fractional value and the pixel is not inside an image run of the previous scanline; for each pixel, producing an indication of background image portion when the pixel value is greater than the first fractional value and the pixel is inside an image run of the previous scanline; for each pixel, producing an indication of continuous tone image portion when the pixel value is less than the first fractional value and the pixel is inside an image run of the previous scanline; for each pixel, producing an indication of text/line image portion when the pixels value is less than a black reference value and the pixel is not inside an image run of the previous scanline; and for each pixel, producing an indication of continuous tone image portion when the pixel value is less than the second fractional value of background value and the pixel is either inside an image run or with pixel value greater than the black reference value. According to another aspect of the invention there is provided a method of determining the presence within an image of portions thereof classifiable as line/text, continuous tone, or background wherein pixel values range from a maximum value representing a black pixel and a minimum value representing a white pixel, comprising the steps of: determining an average background value for the image; determining first and second fractional values of the average background value, with the first value being less than the second one; determining those portions of the image including high frequency halftone; determining for each scanline in the image whether the scan line is in a portion of the image classifiable as an image run, and storing the location of each image runs; each image run including a continuous sequence of pixels, wherein each pixel in the image run may be classified into at least one of three classifications wherein pixels in the first class have a pixel value greater than the first fraction of the average background value and an the absolute value of a high frequency image filter output less than a reference value, pixels in the second class includes pixels that are inside a portion of the image classified as including high frequency halftone and pixels of the third class include pixels that are located inside an image run of the preceding scanline; for each pixel, producing an indication of a line/text image portion, when the absolute value of a high frequency image filter output for the pixel is less than the reference value and the pixel is not inside the image run of the previous scanline; for each pixel, producing an indication of background image portion when the pixel value is less than the second fractional value and the pixel is not inside an image run of the previous scanline; for each pixel, producing an indication of background image portion when the pixel value is less than the first fractional value and the pixel is inside an image run of the previous scanline; for each pixel, producing an indication of continuous tone image portion when the pixel value is greater than the first fractional value and the pixel is inside an image run of the previous scanline; for each pixel, producing an indication of text/line image portion when the pixels value is greater than a black reference value and the pixel is not inside an image run of the previous scanline; and for each pixel, producing an indication of continuous tone image portion when the pixel value is greater than the second fractional value of background value and the pixel is either inside an image run or with pixel value greater than the black reference 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: Figure 1 demonstrates a block diagram of an image data processing system wherein the present invention finds particular use; Figure 2 is a block diagram of the main system elements of the auto correlator of Figure 1 Figures 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; Figures 3D, 3E, and 3F demonstrate a similar example for a polychrome image. Figures 4A and 4B shows a block diagram of one possible embodiment implementing various aspects of the present invention; Figure 5A shows an image wherein halftones have been micro detected, while Figure 5B shows the same image portions connected with macro detection; and Figure 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'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 (4 cycles/mm) or more, while a low frequency screen is defined as one having a frequency less than 100 cycles per inch (4 cycles/mm). 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 incorporating the present invention, such as that described, for example, in US-A 4,194,221 to Stoffel, Figure 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 (16 spots/mm), or 12 pixels at a time at 300 spots/inch (12 spots/mm). 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 Figure 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 Figures 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 (Ipi) (4.72 line/mm), 45° halftone scanned at 400 spots/inch (spi) (16 spots/mm) in each direction. Figure 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 i refers to pixels in a scan line, is then compared with a preselected group of neighbours, 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 neighbouring bits. In a preferred arrangement, to be declared a maximum, pixel V i,j must also be greater than the neighbourhood 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 neighbouring pixels, and also is less than the neighbourhood 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 Figure 3B. The periodic nature of the halftone becomes much more apparent when the local area minima/maxima function is taken, as shown in Figure 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 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 US-A, 4,811,115 to Lin et al. may be used, given by where k is a selected time delay along the function, f( I )is the pixel intensity value, and I is 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 US-A 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. Figure 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. In accordance with another aspect of the invention, colour halftones are usually a superposition of halftones in each separation at slightly differing angles. Using the plot similar to that shown in Figure 3C for a monochrome reproduction of a multicolour image, resulting from treatment of the image data as described for Figures 3A and 3B, it is first noted at Figure 3E, that the patterns of colour halftones scanned by a monochrome scanner do not have the regularity of monochrome images at 45 degree angles. A sample plot in Figures 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 Figure 3F that the zero position offset entries of the auto correlation are mostly non-zero, while in the monochrome case (Figure 3C), the zero offset is Screen Frequencies @ 45° in lpi Screen Frequencies @ 0° in lpi Screen Period @ 0°, in Pixels Shift for Auto Correlation 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 marked by two or more zeros in the vertical direction. This feature can be used to distinguish high frequency colour halftones from low frequency 45 degree halftones. With reference now to Figure 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 x 5 matrix of pixel values centred 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 centre pixel V i,j has a value either lower or higher than the neighbouring 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 neighbours in a 3x3 kernel centred 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 neighbours in the expanded 5x5 kernel which are directly above, below and to the right and left of these neighbours. The flag, QualP2, is set if the neighbours in the 3x3 kernel are greater than or equal to the neighbours in the 5x5 context (insuring the pixel V i,j is a peak). The flag, QualD2, is set if the neighbours in the 3x3 kernel are less than or equal to the neighbours in the 5x5 context (insuring the pixel V i,j is a valley). Image signals are also directed from context buffer 100 to neighbour maximum detector 104 and neighbour maximum minimum detector 106, which respectively detect whether pixel V i,j is a maximum or minimum with respect to its neighbours. In the neighbour maximum detector 104, a determination is made whether the gray level value of the centre pixel being processed, V i,j , is greater than the values of its eight neighbours. This is accomplished by successively comparing two pixels at a series of comparators which produces outputs indicative of the neighbourhood maximum V max . Once the maximum video value V max within the eight neighbours is found, it is compared to the centre 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 neighbour 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 neighbours, V min . If V i,j is the minimum value in a 3x3 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. Neighbourhood averagers 108, 110 and 112 sum and average the eight neighbours of centre pixel V i,j . Each averager respectively derives average values M i-1,j , M i,j M i+1,j , for pixel locations Vi,j, Vi-1,j and Vi Vi+1,j, by summing the values of the 8 neighbours, 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 neighbours, termed, Avg i,j is also derived. The absolute value of the Laplacian is found by subtracting the centre pixel from the average of its eight neighbours, M i,j and taking the two'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 neighbours 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) > M i,j , (V i,j -HighNoise) > M i,j , (V i,j + LowNoise) < M i,j and (V i,j + HighNoise) < 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 halftones 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 (12 spots/mm) 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 colour 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 correlated 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 Figure 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 Figures 5A and regions to be treated as halftones in Figure 5B). This is a function of the macrodetector 44. With reference again to Figure 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 neighbourhood 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 neighbouring 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, neighbourhood information is used to determine the outcome of the macro detection level. This logic allows spanning of an area within a halftone pictorial that was not detected on the micro level. These counters, MCount1k, MCountlk-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 Figure 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 (16 scanlines/mm). The macro detection flag, mac-hi-hft, is set, only if one of the immediate neighbouring 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 Figures 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 centre pixel and the average of its 5 by 7 neighbours 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.

Claims: 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 a preselected group of 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 function, 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. The method as defined in claim 1, wherein the auto correlation function A(n) is given by: 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; or wherein the auto correlation function  (h) is given by: where k is a selected offset value at which the function is evaluated; f(l) is the pixel value; and t i is a selected pixel position in the block of T pixels. The method as defined in claim 1 or 2, where each pixel in the first image signal representing local area maximums of the image, and a second image signal representing local area minimums of the image are each represented by a one bit per pixel function. The method as defined in claim 3 when dependent on claim 1, wherein, the auto correlation function is given by: where n is a selected offset of the auto correlation function; p is the pixel value; t is a pixel position in the block of T pixels selected; and ∧ is a logical AND function. The method as defined in claim 1, wherein in the determination of local area minimum or maximum, to be determined a minimum or maximum, respectively, a pixel must be at less than or greater than, respectively, other pixels in the local area by a preselected amount. The method as defined in any of the preceding claims wherein in the determination of local area, the local area includes the closest eight neighboring pixels. The method as defined in any of the preceding claims wherein the determination of image density over the block of pixels is made by keeping a running average of pixel values in the block, and for each pixel determining whether the running average is greater than or less than a density reference. A method of processing image pixels in an image represented by a plurality of scan lines of pixels, to determine the presence of color halftones or rotated halftones in the image, the rotated halftones resulting from a combination of sweeps, where one sweep was placed upon the other in a relatively rotated relationship, the steps comprising: for each pixel in the image, comparing said pixel to a group of neighboring pixels 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 density; for each block of T pixels, auto correlating the first image signal if measured image density is relatively high with respect to the reference density, or auto correlating the second image signal if measured image density is relatively low with respect to the reference density, the auto correlation function evaluated over the block of T pixels, and for each of a plurality of offset values including n=0 selected as corresponding to probable halftone frequencies, the determination of image density with respect to a reference being made over the block of T pixels; from the auto correlated function, determining for the offset value n= 0 whether the result of the auto correlation evaluation is a zero or non-zero value; counting the number of non-zero values for each block of T pixels over a group of scan lines, and upon exceeding a predetermined threshold indicative of the presence of color halftones or rotated halftones in the image, producing an indication thereof. Apparatus for processing image pixels in an image represented by a plurality of scan lines of pixels, to determine the presence of halftones in the image, the apparatus comprising: means to compare each pixel with a group of neighboring pixels to determine whether it is a local area minimum or maximum, and provide an output signal indicative thereof; signal forming means, for forming a minimum signal and maximum signal each representing the set of minimum pixels and the set of maximum pixels within the image; thresholding means operable on the average value of a block of T pixels in the image, for determining whether the image is relatively dark or light, and producing a dark signal if the average value is less than a threshold value and a light signal if the average value is greater than the threshold value; means for evaluating the auto correlation function for each block of T pixels, said auto correlation means operable on the maximum signal if the image has been determined to be light or said auto correlation means being operable on the minimum signal if the image has been found to be dark, 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; offset comparison means for determining from said auto correlation means whether the evaluation at each offset value is a non-zero value, such determination indicating the presences of halftone at the corresponding halftone frequency.

Inventors: FARRELL BARBARA L, SHIAU JENG-NAN, FARRELL, BARBARA L., SHIAU, JENG-NAN
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1992
Main classification: H04N1
IPC codes: G06T5, H04N1