Optimal Parameters for Error-Diffusion Halftoning with Bilateral Filter

We propose a procedure for determining the parameters in the bilateral filter (BF) used for the error-diffusion halftoning where pixels are scanned in the ascending order of errors. In this halftoning, binarization errors produced at each pixel are diffused using the BF which contains two parameters, one of which is a spatial coefficient and another is for the signal intensity. The optimal values of these two parameters are determined by maximizing the PSNR of an output binary images against their input images. It is shown by experiments that the optimal value of the signal coefficient is slightly negative in contrast to popular usage of BF where the signal coefficient is usually set to a positive value.


Introduction
Error diffusion techniques have widely been used for image halftoning, typically transforming gray-scale images to black-white binary images. In the error diffusion technique, critically important are the order of scanning of pixels and filters for distributing the discretization error at each pixel to its neighborhood.
The simplest and fundamental ordering of pixels is the normal raster scan which, however, produces the so-called worm patterns which degrade the visual quality of outputted binary images. For preventing such artificial patterns, zigzag or random scan [1] has been proposed. These scan procedures, however, depend only on the place of pixels without taking account of pixel values. More elaborated error diffusion techniques incorporating pixel values have been developed for preserving image structures [2] [3]. These techniques are, however, computationally complex. Hence, there has been proposed a simple and efficient pixel scan procedure where pixels are scanned according to the increasing order of the discretization error [4]. In this paper, we also adopt this signal adaptive ordering scan for discretizing pixel values.
Among various filters for diffusing errors, the Gaussian filter (GF) is simplest and standardly used. Improved from the GF is the bilateral filter (BF) [5] which is highly adaptive to edges in grayscale images. This BF has also been applied to halftoning with the error diffusion [6] where the efficiency of the coefficient-reversed BF was verified.
A standard usage of BF is image smoothing where the optimal value of parameters in BF has been examined. In its application to the halftoning with BF, however, such discussion has not been reported for optimal parameters. In this paper, we propose a procedure for determining the value of parameters in BF according to the PSNR between an input and its blurred binary images on the basis of the principle of image halftoning which is an image display technique exploiting the blur process occurring in our visual perception of scenes.

Halftoning with Error Diffusion
Let the value of a pixel in an input grayscale image be c i j ∈ [0, 255] and its size (total number of pixels) be n. In the error diffusion method, the value of c i j is successively updated at every distribution of an error produced at each pixel. Hence, we save the original pixel value as g i j = c i j , i.e. this g i j is fixed while c xy is sequentially changed. We introduce a variable u i j representing the current status of binarization at each pixel: if the pixel (i, j) is already binarized then u i j = 0, else not yet treated u i j = 1.
In the halftoning with the error diffusion, the order of pixel scan is important for the visual quality of resultant binary images. The ordering of pixels according to the binarization error at each pixel was examined and the ascending order has been reported to work well [4]. In binarization of images with the error diffusion where pixels are scanned in the ascending order of the binarization error at each pixel, an output pixel value f i j ∈ {0, 255} is calculated in the following way: 1) The value of u i j is initially set to u i j = 1 at every (i, j).
2) Attach the number k(= 1, 2, ..., n) to every pixel in the ascending order of d i j = |c i j − 127.5| + n i j where n i j ∈ [0, 1] is a uniformly distributed random number.
where u i j is the above mentioned variable denoting whether that pixel is already treated or not yet and v i jlm is the filter coefficient expressed by where α is the spatial coefficient, i.e. the coefficient along the spatial coordinate, and β is the signal coefficient, i.e. the coefficient that along the signal intensity axis. Note that the filter coefficient v i jlm is calculated from not the updated c i j but the original pixel value g i j .
If we set β = 0, then this filter reduces to the standard GF. If β is not 0, then the filter becomes BF in which the usual usage is with β > 0, while that with β < 0 is called the coefficient-reversed BF [6].

Determining Filter Parameters
The above is the procedure of the error-diffusion halftoning of grayscale images. The quality of its output binary images depends on the value of two parameters α and β in eq.(2). Hence it is critical for image quality how to set them to their optimal values. In the previous methods, their values were set empirically to not necessarily optimal values [6]. In this paper, we take into account of the property of the halftoning techniques exploiting our visual blur of observed images. From this knowledge, we examine a method for determining the parameter values to those maximizing the PSNR between the input image and its binarized and blurred images. For this blurring of output binary images, the BF is also suitable. Direct application of BF to binary images, however, results in no change in images, hence we first smooth binary images using GF in advance to the application of BF. From the preliminary experiments for many halftoned images, we found appropriate values of these blurring filters as p = 5, α = 0.2 for the first GF and for the next BF p = 5, α = 0.2, β = 0.005 is adequate. If only GF is used for this smoothing, edges in images are blurred hence the PSNR is small. Next application of BF to those outputs of GF sharpens such blurred edges and raises the PSNR. The window size in eq.(1) for the error diffusion is set to p = 2 considering the balance between the range of diffusion and the computational cost.

Determining Value of α
If we try to determine α and β in eq.(2) simultaneously, we should search all of their combination, i.e. the 2dimesional variation in them, which is computationally intensive. Hence we determine them sequentially, at first α and next β. Especially, we firstly fix β = 0 which reduces the BF to GF and search the optimal value of α minimizing the PSNR of errors, i.e. PSNR between each input image and its binarized one. The variation in this PSNR with the value of α is shown in Fig.2 for six images (size of all of them is 300 × 300) in Fig.1. Figure 2 reveals that the PSNR A. Yu, N. Ono, K. Inoue, K. Hara and K. Urahama  takes its maximum at a moderate value of α. All curves in Fig.2 are singly peaked, hence the maximum point can be easily calculated using a simple algorithm, e.g. the bisection method. The value of α at which the PSNR becomes maximum and the PSNR there are shown in table 1 where "gold" denotes "goldhill", "pepp" is for "peppers" and "mand" is "mandrill". These optimal values of α are considered to depend on the higher frequency component contained in the input image. For confirming this supposition, we calculate the PSNR between input images and them directly blurred with firstly GF and next with BF similarly to the above blurring process for binary images. The value of this PSNR is shown in table 2. The larger this PNR represents the lesser high frequency components in input images.  The rank of the PSNR in table 1 is identical to that in table 2, from which the above supposition for the PSNR in table 1 is ascertained.

Determining value of β
We next change the value of β with fixing α to these optimal values for each image. The value of PSNR varies with β as shown in Fig.3. From these graphs, we find that the PSNR becomes maximum at slightly negative value of β though its precise value is hard to discriminate visually in Fig.3 due to its rather broad horizontal scale for showing their global profile of the value of PSNR. These maximal points can also be calculated using a simple bisection method starting from a narrow range, e.g. [-0.1,0]. The practical value of β maximizing PSNR is shown in table 3 where all of the optimal values of β are indeed negative. This peculiar property of the PSNR in the halftoning is in contrast to the popular usage of BF for smoothing grayscale images for which β > 0 is usually used. The optimal value of β is nearly -0.001 for all images. Hence a simple way for setting the value of β is always β = −0.001 for all images. The reason for β to be best at slightly negative value may be due to its compensating effect for edges blurred by image halftoning. The halftoned image for the image "lena" at β = 0 and that at β = −0.001 are shown in Fig.4(a),(b) where edges and textures are clearer in Fig.4(b) than Fig.4(a). The results of blurring Fig.4(a),(b) with the filter GF+BF are shown in Fig.4(c),(d) where Fig.4(d) is closer to Fig.1(b) than Fig.4(c), which is a satisfied result for the main propose of this research. Thus we found that the PSNR becomes its maximum when the coefficient β in BF for diffusing the halftoning errors takes a slightly negative value. In the above halftoning procedure, pixels are scanned in the ascending order of halftoning errors. We also examined other scanning processes, e.g. descending order of halftoning errors or random ordering of pixels. When the values of BF parameters are α = 0.6, β = 0, the PSNR for "lena" image is 25.37 for descending order, 27.36 for random ordering and 28.22 for the ascending order. When we set α = 0.6, β = −0.001, the PSNR is 25.67 for descending order, 27.50 for random ordering and 28.66 for the ascending order. From these experimental results, it is reconfirmed that the scanning in the ascending order leads to the maximal PSNR.

Conclusion
We have presented a procedure for determining the parameters in BF for distributing errors in the image halftoning with the error diffusion with the pixel scan in the order according to the halftoning errors. It is revealed that the PSNR of the halftoned outputs becomes maximum when the signal coefficient in the BF is set to a slightly negative value. A method for determining the optimal values of filter parameters automatically for each input image is under study.