1. Field of the Invention
The present invention relates to a method of representing images with gray levels, particularly to the so-called "dither method" for representing images with gray levels approximately by binary images.
2. Prior Art
An outline of conventional methods for binarizing is shown in Table 1.
TABLE 1 ______________________________________ BINARIZATION FIXED AREA Processing with a (narrow sense) certain threshold in all areas. CHANGEABLE Processing with a THRESHOLD different threshold in every area or ever pixel. DITHER ORGANIZED Binarizing all areas DITHER with one or more dither matrices. RANDOM DITHER The cyclic feature of organized dither is eliminated by add- ing random compon- ents to dither matrix. BINARIZATION & DITHER Binarization is per- formed in a charact- er area and dither is performed in a gray-level area. ERROR Processing with a DIFFUSION threshold comparing METHOD the binary error of pixels in a neighbor- hood of a pixel to be processed. ______________________________________
Though the purpose of binarizing an image is generally to reduce the quantity of information, some image characteristics are lost as a matter of course because of the decrease of information. For example, when a character or configuration of an original image is to be shown clearly, the main characteristics are preserved by performing binarization (narrow sense) which can divide the original image into figures and background. On the other hand, when an original image is to be expressed with gray-levels, such as a solid natural image, it is to be expressed by pseudo-multi-levels through dither. If binarization (narrow sense) is performed in this case, the characteristics of gray-levels in the original image are lost. Actually, there are many cases in which an image including both characters and photographs are processed in the field of printing, facsimile and so on. Therefore, it is impossible to reproduce the characteristics of a whole image by a binarization method suitable only for gray-level image or characters.
To solve this problem, a method has been suggested in which binarization in a narrow sense is performed in a character area and dither is performed in a configuration area after dividing an image into a character area (the area on which to perform binarization in a narrow sense) and a configuration area (the area to be expressed by pseudo-multi-levels). When performing such compound processing, the boundary between two areas becomes discontinuous; consequently, the result expressed by binarization becomes an extremely unnatural image.
Generally, the image to be processed is binarized through the following steps:
i) Defining the threshold of each pixel in a square dither cell of n.times.n pixels, PA1 ii) Applying the dither cell to the image to be processed. PA1 fmn=&gt;R/2.fwdarw.R PA1 fmn&lt;R/2.fwdarw.0 PA1 e00=f00-[f00-R/2] PA1 a) Defining a non-rectangle dither cell and a macro dither cell consisting of a plurality of dither cells arranged in a predetermined form; PA1 b) Defining orders of magnitudes of thresholds of pixels in the dither cell; PA1 c) Defining orders of magnitudes of thresholds of the dither cells in the macro dither cell; PA1 d) Defining a threshold for each pixel of each dither cell in the macro dither cell according to the orders of magnitude of thresholds of the pixels in the dither cell as well as the dither cells in the macro dither cell. PA1 an original image is binarized by a systematic dither cell so that a dither image is generated; PA1 a representative density is calculated for each area in the dither image corresponding to the dither cell; PA1 a median value is calculated of representative densities of the dither image; PA1 the original image is binarized by a threshold of the median value.
Here, using dither of a dispersive type (such as Bayer type), a bigger dither cell is used for deepening the grade of depth. Consequently, the image becomes dim, and cyclic artifacts (which are a characteristic of dither) becomes significant because black pixels do not concentrate on edges. On the other hand, mesh-dot type and spiral-type dither have the following characteristics: it is possible to represent approximate mean densities more naturally, but it becomes a rough-dot image when the depth is deepened.
There is another method for binarization referred to as error diffusing method. It is possible to express an image by pseudo-multi-levels without limitation on the number of the levels of density. An error diffusing method is described below.
The principles of an error diffusing method are discussed with reference to FIG. 19. Assuming the pixel value (e.g. brightness) on the coordinate (m, n) of an original image to be fmn, fmn is binarized considering the influence of the binary error of pixels in a predetermined neighborhood. For example, suppose that fmn is binarized by R/2 (a threshold level which is one half of the image density range) and the conversion below is performed. The binarized error indicated in formula (1) is generated with respect to the first pixel f00 on the coordinate (0, 0).
where, [] means Gauss' notation (i.e., the maximum integer number less than the real number within the brackets) and R is the maximum range of densities in the image.
Concerning a general pixel fmn, binarized error emn can be obtained as discussed below. Defining a certain area (in FIG. 19, the area is comprised of 6 pixels including the pixel to be processed with the mark "X"), weights for each error in this area (in FIG. 19, from w1 to w6) are defined. The weight-addition-matrix for the peripheral pixel is called an error filter. Binary error emn for a pixel fmn is obtained by formula (2). EQU emn={fmn+.SIGMA.wiei}-R [fmn+.SIGMA.wiei-R/2] (2)
Here, fmn and gmn are defined as formula (3) and (4). EQU fmn=fmn+.SIGMA. wiei (3) EQU gmn=R [fmn-R/2] (4)
Therefore, formula (2) is equal to formula (5). EQU emn=fmn-gmn (5)
As shown in the formula above, binary error emn contains an integrated binary error of pixels in a neighborhood around the pixel to be processed. The difference between the brightness of a whole binarized image and a whole original image is minimized. Additionally, the density distributions of the binarized image and of the original image are substantially equal. The binary error of each pixel is stored in an error buffer. The characteristics of an image binarized with an error diffusion method is decided by the error filter, that is, there has been a poor possibility that both a character area and a configuration area would be expressed adequately.
An improved error diffusion method has been suggested. Namely, an error filter is defined as a forecast type so that stripes caused by an error filter are removed and simultaneously the distribution steepness of dark spots is sharp. An image processed by such a forecasting method emphasizes outlines and generates an unnatural image.
When darkness is not even over a whole image, the contrast of a part of the image is extremely unclear when processing the whole image with a certain threshold. Shading can be devised in order to overcome this problem. Shading is: dividing an image into some parts, the most appropriate threshold is calculated in each area by a so-called "mode method". (A. Rosenfeld & Avinash C. Kak, "Digital Picture Processing", 1976, Academic Press, Inc.)
"Mode method" is, however, the method for calculating a local minimal value of histogram of an image. It takes much time; consequently, the time for processing becomes vast when the number of areas in an image is large. It is not easy to reduce processing time, because, executing "mode method" by hardware is difficult.