Kiyoshi Tanaka and Hern´an Aguirre
4.2. Image halftoning scheme using GA (basic approach) 1 Individual representation
An input image is first divided into nonoverlapping blocksDconsisting ofr×r
pixels to reduce the search space of solutions [23,24]. The GA uses an individual
xwith anr×r two-dimensional representation for the chromosome. In case of bilevel halftoning, each element of the chromosomex(i,j) (i,j=0, 1,. . .,r−1)∈
{0, 1}.Figure 4.1illustrates the image division into blocks and an example of in-
dividualxcorresponding to a current blockD.
4.2.2. Evaluation
Chromosomes are evaluated with two kinds of evaluation criteria. (i) One is high gray level precision (local mean gray levels close to the original image), and (ii) the other is high spatial resolution (appropriate contrast near edges) [23,24]. First we calculate a gray level precision error by
Em=
(i,j)∈D
1
r2g(i,j)−g(i,j), (4.1)
whereg(i,j) (i,j =0, 1,. . .,r−1) is the gray level of the (i,j)th pixel in the in- put image blockD, andg(i,j) is the estimated gray level associated to the (i,j)th pixel of the generated halftone block (x(i,j)). To obtaing(i,j), a reference region aroundx(i,j) is convoluted by a Gaussian filter that models the correlation among pixels. An example of a 5×5 filter is shown inFigure 4.2. In order to reduce dis- continuity around block boundaries, the pixel pattern ofxis copied around the boundary regions as shown inFigure 4.3, and used to calculate the gray level esti- mationg(i,j).
K. Tanaka and H. Aguirre 67 1 4 7 4 1 4 20 33 20 4 7 33 54 33 7 4 20 33 20 4 1 4 7 4 1
Figure4.2. An example of a 5×5 Gaussian filter. Generated halftone block
Turned over
Figure4.3. Discontinuity reduction by copying binary pattern of a current generated blockxaround block boundaries.
In order to preserve the edge information of the input image well, we calculate the spatial resolution error by
Ec= (i,j)∈D 1 r2G(i,j)−B(i,j), G(i,j)=g(i,j)−g(i,j), B(i,j)= x(i,j)−1 2 N, (4.2)
whereG(i,j) is the difference between the gray levelg(i,j) and its neighboring local mean valueg(i,j).g(i,j) is calculated with a 5×5 local average filter having uniform coefficients, andNdenotes the dynamic range of input image.
These two errorsEm andEcare combined into one single objective function as
E=αmEm+αcEc, (4.3)
whereαm andαcare weighting parameters ofEmandEc, respectively. The chro- mosome’s fitness is assigned by
68 Halftone image generation using EC Parents Interchange rows (ct=0) Interchange columns (ct=1) Offspring cp
Figure4.4.Illustration of two-dimensional crossover.
0 0 0 1 1 0 1 1 1 1 1 0 1 1 1 0 0 1 0 1 1 0 0 1 1 1 1 0 1 1 1 0
Figure4.5. Illustration of bit-flipping mutation (block size is 4×4 pixels).
whereEmax is the error associated with the worst chromosome in a population.
UsingEmax helps to induce a better scaling among solutions in order to assign
selection probabilities, especially during the latest stages of the search. The GA is used to search for an optimum compromise between grey level precision and spatial resolution with the above fitness function.
4.2.3. Genetic operators and selection
Since we operate two-dimensional image data, crossover [17,19] is implemented for two-dimentional chromosomes. Two random numbers, ct andcp, define its method of operation. First,ct = N[0, 1] is sampled to decide whether to inter- change chromosomes’ rows or columns from two selected parents, say (i) ifct=0, interchange rows and (ii) ifct =1, interchange columns. Then,cp =N[0,r) in- dicates the crossing point as shown inFigure 4.4. Bothctandcpare sampled new for each individual created by crossover. Although crossover can potentially create two offspring at a time, only one of them is randomly selected in this scheme.
After crossover, mutation inverts bits with a small probability per bit, pm, analogous to canonical GA [17,19]. For every bit actually selected for mutation, 0 becomes 1 and vice versa, as shown inFigure 4.5. In the following sections, we call the application of crossover followed by mutation as “CM.”
K. Tanaka and H. Aguirre 69 100 102 104 106 108 110 e ( x ( t )) 8000 16000 24000 32000 40000 Evaluation
Figure4.6. Average error transition over evaluation numbers for “Lenna.”
After offspring creation by genetic operators, proportional selection [17,19] is applied for all individuals in the populationP(t) to select parent individuals for the next generation.
4.2.4. Results and discussion for basic scheme 4.2.4.1. Experimental setup
Through this chapter, to verify the performance of the schemes explained, we mainly use “Lenna” in SIDBA (Standard Image DataBAse) as benchmark image. The size of the original images is 256×256 pixels withN =256 gray levels and the generated images are bilevel halftone images (n = 2). The image block size isr×r =16×16 and the population size isλ=200 (200 offspring are created from 200 parents). The weighting parameters in (4.3) are set toαm =0.2 and to
αc =0.8, which are suggested for an appropriate balance betweenEm andEc by visual assessment [23,24]. The crossover and mutation rates are set topc=1 and
pm=0.001, respectively.
4.2.4.2. Error transition and generated images
Figure 4.6shows the image’s average-error transition over evaluation numbers,
which is calculated as the average of the best individuals’ error in all (256 pieces) image blocks. From the results, it can be seen that the error gradually converges to a constant value by spending more than 32 000 evaluations. The error value of (4.3) achieved by canonical GA (cGA) [17,19] with the above settings after
T =40 000 evaluations will be used as a reference value for image quality in the following sections. This value is shown as a broken line in the figure.
Figure 4.7shows the original image “Lenna” and several generated halftone
70 Halftone image generation using EC
(a) Original image “Lenna” (b) Ordered dithering (Bayer matrix [34])
(c) Error diffusion (Javis ma- trix [34])
(d) cGA(200) (r×r=16×16,
T =40 000,αm :αc =0.2 :
0.8)
Figure4.7. Original and generated halftone images (“Lenna”).
generated by conventional ordered dithering and error diffusion in Figures4.7(b)
and4.7(c), respectively. We can see that image quality achieved by ordered dither-
ing (Bayer matrix [34]) is insufficient with particular patterns caused by the pe- riodic use of threshold matrix and low gray level precision. Error diffusion (Javis matrix [34]) fairly improves image quality but still has a few problems, that is, there are missing dots in high-light regions and particular patterns like worms can be clearly seen. On the other hand, a halftone image generated by cGA(200) withT =40 000 evaluations inFigure 4.7(d), which gives the image quality ref- erence value, is quite smooth and less prone to particular patterns having both high gray level precision and high spatial resolution.Table 4.1shows the values of the two kinds of errors,EmandEc, and the combined errorEobtained for each method. From this table, we can see that both gray level precision and special reso- lution errors are remarkably reduced by using GA compared to the errors obtained by the conventional methods. By observing the difference with the error scale in
Figure 4.6, we can see the significance of improvement by GA’s optimization.