Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their...

14

Transcript of Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their...

Page 1: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

Digital Halftoning Algorithms Based on Optimization Criteriaand their Experimental Evaluation�Tetsuo Asanoy Desh Ranjanz Thomas RoosxAbstractDigital halftoning is a well-known technique in image processing to convert an imagehaving several bits for brightness levels into a binary image consisting only of black andwhite dots. A great number of algorithms have been presented for this problem, some ofwhich have only been evaluated just by comparison with human eyes. In this paper weformulate the digital halftoning problem as a combinatorial problem which allows an exactsolution with graph-theoretic tools.For this, we consider a d-dimensional grid of n := Nd pixels (d � 1). For each pixel, wede�ne a so-called k-neighborhood, k 2 f0; : : :N � 1g, which is the set of at most (2k + 1)dpixels that can be reached from the current pixel in a distance of � k. Now, in order tosolve the digital halftoning problem, we are going to minimize the sum of distances of allk-neighborhoods between the original picture and the halftoned one. We show that theproblem can be solved in linear time in the one-dimensional case while it looks hopeless tohave a polynomial-time algorithm in higher dimension including the usual two-dimensionalcase. We present an exact algorithm for the one-dimensional case which runs in O(n) timeif k is regarded to be a constant. For two-dimensional case we present fast approximationtechniques based on space �lling curves.An experimental comparison of several implementations of approximate algorithmsproves that our algorithms are of practical interest.1 IntroductionOne of the most fundamental techniques in image processing is digital halftoning. It is theintention of this method to convert a given image which consists of several bits for brightnesslevels into a binary image having only black and white pixels. This kind of technique isindispensable when dealing with images which have to be printed on output devices producingblack dots only, such as facsimile and laser printer.Up to now, a large number of methods and algorithms for digital halftoning have beenproposed (see, e.g., [4, 3, 1, 5, 6]). However, there have been only very few studies discussingreasonable criteria for evaluating the quality of output images; maybe because the problemitself is very practically oriented. Actually, the most common criterion of almost all existingstudies on digital halftoning is to judge the quality of the output picture by human eyes.Unfortunately, to the authors' knowledge up to now no mathematical criterion is known. Even�Part of the work was done while the �rst and last author were visiting the Max-Planck Institut f�ur Informatik,Germany. This work is partly supported by Grant in Aid for Scienti�c Research of the Ministry of Education,Science and Cultures of Japan.yDept. of Engineering Informatics, Osaka Electro-Communication Univ., JapanzDept. of COmputer Science, New Mexico State University, U.S.A.xTheoretische Informatik, ETH Zentrum, Switzerland1

Page 2: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

the Ph.D Thesis by Ulichney [7] which summarizes the results obtained so far in a neat manner,does not give a mathematical criterion.So, one of the main purposes of this paper is to settle some reasonable mathematicalcriterion for this problem and, doing this, formulating the digital halftoning problem as acombinatorial optimization problem which allows an exact optimal solution. Our new criterionmeasures some (weighted) \di�erence" between the average gray level and the number of blackdots in a small region surrounding each pixel. The size of this small region is representedby a parameter k which can be regarded as the window size. Although the problem itself isde�ned in the two-dimensional plane, it is possible to de�ne its one-dimensional version inwhich a sequence of real numbers are given. Then, we show that this one-dimensional versioncan be solved in time linear in the number of input numbers (pixels) by using the technique ofpseudo-boolean programming. Although the two-dimensional version can also be formulated asa pseudo-boolean program, it does not give us a polynomial-time solution. This di�culty in thetwo-dimensional case gives rise to a number of approximation algorithms based on space-�llingcurves which perform very well in practice.The paper is organized as follows. The optimization criterion and the corresponding com-binatorial optimization problem are formulated in Section 2. After that, Section 3 investigatesthe one-dimensional version of the problem and presents a simple linear-time and linear-spacealgorithm for �nding an optimal solution. Here, the fundamental idea is to convert the probleminto that of �nding a minimum-weight path in a directed acyclic graph. In Section 4, we studythe two-dimensional case which turns out to be signi�cantly more complex. Here, an exact so-lution can only be found if the combinatorial problem can be reduced to computing an optimalassignment of pseudo-boolean variables. This approach allows to �nd an optimal assignmentof binary values to variables of some given polynomial expression with real coe�cients by us-ing the algorithm by Crama et al. [2] which may require exponential time. However, in orderto avoid time-consuming exact algorithms we present approximation algorithms by convertingthe problem into a one-dimensional one. For this, we investigate classes of space-�lling curveswhich �ll the two-dimensional plane in various ways. This provides an approximate solutionto the two-dimensional problem by reducing the dimension. Again, these algorithms run intime and space which is linear in the number of pixels concerned, but with signi�cantly smallerconstants than their exact counterparts. Finally, Section 5 describes some computational ex-periments which compare the algorithms proposed in this paper with other existing methodsand heuristics.Up to now, no exact optimal algorithm for digital halftoning has been known. Thus, it hasbeen impossible to improve defects of heuristics by comparing the outputs with correspondingoptimal solutions. In this sense, we can now use the above-mentioned algorithms for judgingheuristic algorithms.2 Formulation of Digital HalftoningLet A = (aij)i;j=1;:::;N , 0 � aij � 1, be an image of size n := N � N . Here, we assume thateach pixel aij has a gray level (brightness level) represented by a real number between 0 and 1.In addition, let B = (bij)i;j=1;:::;N be a binary matrix with integer pixel values bij of 0 and 1.Now, digital halftoning is a method which converts real images of type A to binary images oftype B such that the image B is (or at least looks) \most similar" to the original image A.The main task of this section is to de�ne the digital halftoning problem as a combinatorialoptimization problem by de�ning a quite reasonable unambiguous mathematical criterion. Tomotivate our approach, imagine that we look at some pixel (i; j) of the grey-level image A.What happens is, we actually perceive an average of gray levels of some (small) neighborhood ofthat point. Using the same observation, the intensity around the pixel (i; j) of the binary image2

Page 3: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

B is proportional to the number of black points in the corresponding neighborhood. Therefore,both density values should be roughly equal at any pixel to get an output binary image Bwhich is very similar to the input image A. For simplicity, in this paper we consider localneighborhoods of the pixel (i; j) consisting of square regions (with odd integer side lengths) inwhich the (weighted) sums of input values aij and output values bij are taken. Nevertheless,our approach can be easily generalized to other kinds of neighborhoods, as well.Figure 1: The 1-neighborhood of the central pixel in the plane.Formally, the set of pixels whose L1-distance from a pixel (i; j) is less than or equal to kis called the k�neighborhood of (i; j), denoted by Wk(i; j). Thereby, k is a �xed parameterspecifying the size of the neighborhood (cf. �gure 1). In other words, the neighborhoodWk(i; j)of a point (i; j) is de�ned byWk(i; j) := f(i0; j 0) : ji� i0j � k and jj � j 0j � kgNow, the average gray level in the k-neighborhood Wk(i; j) of pixel (i; j) of the input image Acan be expressed as X(i0;j0)2Wk(i;j)ai0j0 = jWk(i; j)jSimilarly, the density of black points in the binary output image B can be de�ned byX(i0;j0)2Wk(i;j) bi0j0 = jWk(i; j)jThereby, jWk(i; j)j = (2k + 1)2 denotes the number of pixels in Wk(i; j). If the di�erencebetween these two values at each pixel of the image is small, the binary picture B is expectedto look very similar to the original picture A; at least B is a very good approximation of A(without further knowledge of the contents of the image). With that, we can now de�ne theerror E(i; j) at pixel (i; j) by the following expression:E(i; j) := X(i0;j0)2Wk(i;j) �ai0j0 � bi0j0�This error function will be in the focus of our interest, although our approach can be generalizedin various ways, e.g., by assigning larger weights to the pixels near the center (i; j).1 Thus, our1In this case, we use an adequate weight matrix D = (di0j0)i0 ;j0=�k;::: ;k and de�ne the weighted error ~E(i; j)to be ~E(i; j) := X(i0;j0)2Wk(i;j) di0j0 � (ai0j0 � bi0j0 )3

Page 4: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

goal is to bring the local error E(i; j) close to 0 for any pixel (i; j). So, it is useful to minimizethe sum of absolute values of the errors over the entire image. Finally, this enables us to statethe digital halftoning problem as a combinatorial optimization problem in the following way:(Problem A) Given an N �N image A = (aij)i;j=1;:::;N with 0 � aij � 1, �nd an N �Nimage B = (bij)i;j=1;:::;N that minimizes the sum of absolute errorsNXi=1 NXj=1 jE(i; j)jInstead of summing the absolute values of the errors, we can also consider the squared sumor other simple functions of the local errors. Surprisingly, our approach allows to handle allconstant-time computable functions, as we'll see in the following.3 The One-Dimensional CaseAlthough digital halftoning is an inherently two-dimensional problem, we shall �rst considerits one-dimensional version. Here, we are given a sequence (a1; a2; : : : ; aN) of real numbersbetween 0 and 1, and want to �nd a sequence (b1; b2; : : : ; bN) of binary numbers such thatNXi=1 ��E 0(i)��is minimized. Thereby, the de�nition of the k-neighborhood W 0k(i) := fi0 : ji � i0j � kgand the error function E 0(i) :=Pi02W 0k(i) (ai � bi) is straightforward from the two-dimensionalde�nition. Again, there are lots of imaginable generalizations of the error- or objective function.With that, problem (A) specializes to its corresponding one-dimensional problem:(Problem A') Given a vector A = (ai)i=1;:::;N with 0 � ai � 1, �nd a binary vectorB = (bi)i=1;:::;N that minimizes NXi=1 ��E 0(i)��In the following, we present an algorithm for the one-dimensional problem (A0) which �nds anoptimal solution in linear time when k is considered to be a constant. For that, imagine someinput sequence (a1; a2; : : : ; aN). Now, if we want to assign each value of the binary outputsequence (b1; b2; : : : ; bN) to be either 0 or 1, we observe that the local error E 0(i) at position iis a�ected only by the variables bi�k; : : : ; bi+k. Since the output of each of these bj is either 0or 1, there exist 22k+1 di�erent ways in total to assign bit patterns to (bi�k; : : : ; bi+k). For eachassignment we can calculate the error E 0(i) at position i. Now, if we regard the neighboringposition i+ 1, the relevant bit pattern string is (bi�k+1; : : : ; bi+k+1). Obviously, 2k of the bits,namely (bi�k+1; : : : ; bi+k), are identical to the corresponding bits at position i. That means,if we once have determined the values bi�k ; : : : ; bi+k for position i, there is only one degree offreedom, namely to �x bi+k+1 for position i + 1. If we do this for all positions i, we create(possibly) overlapping bitstrings of length 2k+1. This fact enables us to reduce the complexityof the problem signi�cantly. The overlapping bitstrings can best be described by a graph GIwhich is de�ned as follows (see �gure 2). 4

Page 5: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

Construction of GI(1) For each i = 1; : : : ; N , create a set Vi of vertices corresponding to the 22k+1 di�erentcombinations of the output values (bi�k; : : : ; bi+k).(2) For each i = 1; : : : ; N and each vertex of Vi, assign the weight of the vertex to be theabsolute local error jE 0(i)j.(3) For each pair of vertices of neighboring levels, draw a directed edge from the vertex ofthe lower level to the higher level node, if the corresponding bitstrings matches in thecommon 2k positions.(4) Finally, add two special vertices s and t and connect s to each vertex of V1 and eachvertex of VN to t. ..................................................................................................................................................................................... ..................................................................................................................................................................................... ......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................r r r000001010011100101000001101110111

000001010011100101110111010011100111110.....................................................................................................................................................................................s t ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Figure 2: Graph GI (k = 1).Doing that, we create N � 22k+1 vertices in total. Notice that each vertex (except s and t) hasconstant degree; this shows that the entire graph has complexity O(22k+2N). The edges of thegraph GI represent the non-con icting pairs of assignments of neighboring positions. Thus, thegraph GI can be regarded as a consistency graph, i.e. a graph where all consistent relations oflocal neighboring sequences are expressed by edges. In fact, it is evident from the de�nition ofthis graph that there is a one-to-one mapping between the output values (b1; b2; : : : ; bN) andpaths between s and t in the graph GI . As we have assigned the local errors to the vertices, wecan determine a solution of the one-dimensional problem (A0) by computing a minimum-weightpath in the graph GI .Lemma 1 Finding an optimal solution to Problem (A0) is equivalent to �nding a minimum-weight path from s to t in the graph GI.Here it is worth noting that the error function jE 0(i)j can be replaced by any other objectivefunction of the type PNi=1 jf(ai�k ; : : : ; ai+k; bi�k; : : : ; bi+k)j just by modifying the third step of5

Page 6: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

the algorithm. Since the graph GI is a directed acyclic graph, a minimum-weight path canbe found in time proportional to the number of vertices, that is, in O(22k+2N) time by awave-propagation algorithm.Algorithm for �nding an optimal sequence for problem (A0)(1) Let (a1; a2; : : : ; aN) be the input sequence and k < N an integer.(2) Construct the graph GI . Here, the vertex on the i-th level having label p is denoted byv(i; p) and its weight by w(i; p). In addition, the weight of the minimum-weight pathfrom s to v(i; p) is denoted by L(i; p).(3) Initially L(1; p) is set to w(1; p) for each p of the �rst level.For i = 2 to N dofor p = 0 to 22k+1 � 1 dolet v(i� 1; p0) and v(i� 1; p") be the two nodes incident to v(i; p).assign L(i; p) := minfL(i� 1; p0); L(i� 1; p")g+ w(i; p):(4) Finally, choose the minimum value L(N; p).Although the above procedure only �nds the minimum weight of a path from s to t, it is veryeasy to modify the algorithm to �nd a corresponding minimum-weight path by maintainingsome pointer structure. Thus, we have the following theorem.Theorem 1 The one-dimensional halftoning problem can be solved in O(22k+2N) time andspace.The space complexity can be reduced toO(N+22k+2pN) while keeping the time complexity.The idea is to apply the m-block search technique. The �rst step is to decompose the wholegraph into N=m stages. Each stage consists of m consecutive sets Vi's of vertices. Here notethat each stage is of the identical structure and only weights are di�erent. Exactly speaking, astage Si consists of m sets of vertices Vm(i�1)+1; : : : ; Vmi. Then, in each stage Si we computea minimum-cost path to each vertex in the set Vmi. Since each stage is identical in its graphstructure, this step can be done in O(22k+2m) space and O(22k+2N) time in total. Then,the information obtained for each stage can be represented as a bipartite graph with weightson edges which are costs of minimum-cost paths found above. A collection of those bipartitegraph de�nes a weighted graph. It is easy to see that the shortest path of the graph exactlycorresponds to a minimum-cost path of the whole graph GI . This step is done in O(22k+2N=m)time and space. This shortest path speci�es an edge in each bipartite graph. The next step isto �nd the detailed path corresponding to each edge of bipartite graph on the shortest path.For this purpose it su�ces to solve a single-source single-target shortest path problem in agraph for each stage. It is done in O(22k+2pN) space and O(22k+2N) time. Thus, the totaltime and space complexities are O(22k+2N) and O(22k+2(N=m+ m), respectively. Choosingm = pN , the space complexity is minimized.4 The Two-Dimensional CaseThere is a crucial property that is used in obtaining an e�cient solution in one-dimensionalcase. In this case the neighboring \windows" could be linearly ordered (i.e. given a numberfrom 1 to N) in a fashion such that one only needed to check consistency between adjacentwindows to ensure that these windows really came from some solution of the problem. Inother words, linear local consistency implied global consistency in the one-dimensional case.6

Page 7: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

Ideally, one would like to use a similar approach for solving the two-dimensional case. So,one would like to assign numbers to these windows from 1 to N2 such that all neighbors ofa window numbered M have numbers within M � d and M + d for some constant d. If thiswas possible, we would get a polynomial time solution to the problem. In what follows, weprove a combinatorial result which shows that this is not possible. Hence a di�erent approachwill be required to e�ciently solve the problem exactly. However, we use the ideas from thiscombinatorial result to develop heuristics which should be intuitively good. Before we stateand prove the results, we need some de�nitions.De�nition 1 A numbering P of a N �N array is a one-to-one mapping P : N �N �! N2.The distance between two pixels (or windows) (i; j) and (i0; j 0) in a numbering P is de�ned tobe j P(i; j)� P(i0; j 0) j.Notice that if we connect (i; j) and (i0; j 0) via an edge i� they have consecutive numbers in anumbering P , then the resulting graph is a path in which the graph-distance between (u; v) and(u0; v0) is the same as the distance in the P numbering. So, one can think of these numberingsas curves that cover all points of the array. We use the terms numberings and space-�llingcurves interchangeably.The idea for developing heuristics is to obtain reduction in the dimension of the problemwith the help of space-�lling curves. More precisely, we choose a numbering such that as manyneighbors of each cell as possible are within a given constant distance d in the numbering. Ifthere exist good space-�lling curves, i.e. curves which have many neighbors at close distance,we expect good solutions in the two-dimensional case, by considering the one-dimensional curvewhich is given by the numbering of the pixels together with the d-neighborhood.This section is divided into two parts. First, we give a combinatorial result on space-�llingcurves which is interesting in its own right. Afterwards, we outline a class of space-�lling curveswhich prove that the result is optimal. For that, we need another notion. A pixel is called aninterior pixel i� its k-neighborhood does not contain boundary pixels of the array A.Lemma 2 There do not exist numberings from 1 to N2 such that each interior pixel containsat least k(2k + 3) + 2 out of (2k + 1)2 neighbors within a �xed constant distance d in thenumbering.We can prove this lemma by contradiction. Assume that there exists such a numbering of thepixels from 1 to N2 such that each interior pixel contains at least k(2k + 3) + 2 out of its(2k+1)2 neighbors within a �xed constant distance d in the numbering. To simplify the proof,imagine for each pixel a connection to each of its \close" neighbors in the numbering. Now,consider only the (N � 2k)2 interior pixels and among them the two pixels with the smallestand largest number, respectively. Obviously, the numbers assigned to these two pixels di�erby at least (N � 2k)2. Furthermore, these two pixels have a distance of at most N � 2k� 1 inthe two-dimensional array. Now, the idea is to prove the existence of a path (consisting onlyof interior pixels) of length at most 4(N � 2k � 1) connecting these two pixels. In this case,there must be two adjacent pixels on that path which have a distance of at least(N � 2k)24(N � 2k � 1) > N � 2k4which contradicts the assumption. 7

Page 8: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

rrrrrr r rrrrrrr r r rr............................. ............................. ............................. ............................. ............................. .......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... ............................. ............................. ............................. ............................. ............................. ........................................................................................................................................................................................................................................ rere.............................................................................................................. .......... .......... .......... .......... .......... .......... .......... .......... .......... ........................................................................................................................................................................................................Figure 3: Two adjacent pixels with the intersection of their k-neighborhoods.In order to prove the existence of such a path imagine two adjacent interior pixels withthe same i or j index. Assume without loss of generality that these pixels have indices (i; j)and (i+ 1; j) (compare �gure 3). Notice that their k-neighborhoods Wk(i; j) and Wk(i+ 1; j)intersect in exactlyjWk(i; j) \ Wk(i+ 1; j)j = (2k+ 1)2 � (2k + 1) = 4k2 + 2kpixels. Due to the assumption, there are at leastk(2k+3)+2�jWk(i; j) n Wk(i+1; j)j = k(2k+3)+2�jWk(i+1; j) n Wk(i; j)j = 2k2+k+1\close" neighbors for each of the two pixels in their common intersection Wk(i; j) \ Wk(i+1; j)of the k-neighborhoods.Both facts together imply that there must be a pixel in Wk(i; j) \ Wk(i+1; j) which is \close"to both pixels. Thus we can connect both pixels by a path of length at most two which uses onlythe close neighborhood connections. This proves that we can reach any adjacent interior pixelof a given interior pixel in at most four steps by using only close neighborhood connections.Finally, this establishes the existence of the desired path and concludes the proof.Now, we present a special class of space-�lling curves which achieve the bounds presentedin the last lemma.Lemma 3 There exists a class of space-�lling curves such that each interior pixel contains atleast k(2k+ 3) + 1 out of (2k+ 1)2 neighbors within a distance of k(2k+ 2) in the numbering.For that we partition the two-dimensional array in horizontal stripes of bandwidth 2k+ 1 (weassume for simplicity that N is a multiple of 2k + 1). Each of these stripes is covered by asimple curve as depicted in �gure 4. An easy analysis proves that this class of curves obeysthe preceding lemma.As k(2k+ 3) > 12(2k+ 1)2 for k � 1, each pixel contains at least half of its k-neighborhoodwithin a distance of k(2k + 2). Thus we should expect a good approximation of the optimalsolution when applying this technique to our two-dimensional problem. Naturally, we can usealso other locality-preserving space-�lling curves. Finally, we obtain the following result.Theorem 2 There exists a heuristic for the two-dimensional halftoning problem which runsin O(2(2k+2)2N2) time and space with the help of space-�lling curves.Thus, we have seen that our one-dimensional approach can also be used to give an approximatesolution to the two-dimensional problem with the help of space-�lling curves. In fact, we haveimplemented lots of di�erent kinds of space �lling curves. The results of this experimentalcomparison is outlined in the next section. 8

Page 9: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

There is a totally di�erent approach which solves the two-dimensional problem exactly. Thiscan be achieved in the case of polynomial error functions by using pseudo-boolean programmingmethods (cf. [2]). For any �xed value of k, we can write down the (slightly modi�ed) objectivefunction NXi=1 NXj=1E(i; j)2as a pseudo-boolean polynomial of N2 binary variables bij with real coe�cients. This becomesapparent if we consider for each pixel (i; j) and each assignment of the (2k + 1)2 variables(bi�k;j�k ; : : : ; bi+k;j+k) in the k-neighborhood Wk(i; j) the local error functionE(i; j) := X(i0;j0)2Wk(i;j) �ai0j0 � bi0j0�Here, we can apply the algorithm by Crama et al. [2] for minimizing the obtained pseudo-boolean polynomial. In the algorithm we construct a graph in which vertices are booleanvariables and two vertices are joined by an edge if corresponding variables appear in the sameterm of the polynomial. If the graph �nds to be a partial K-tree, then an optimal solution isobtained in O(2Kn) time where n is the number of boolean variables. In our case the graphincludes a lattice graph as a subgraph which is a partial N -tree. In fact, the whole tree also�nds to be a partial N -tree. Thus we obtained the following theorem.Theorem 3 The two-dimensional digital halftoning problem can be solved in O(2N N2) time.This latter approach is only of theoretical interest. This is why we concentrate our interestin the remaining section on experimental results using di�erent kinds of space �lling curves toreduce the dimension. Thereby, the space-�lling curves are selected in such a way that theypreserve locality, i.e. neighboring pixels should have numbers which are close in the numbering,as far as it is possible by lemma 2. Beyond the classical space �lling curves, such as the Hilbertcurve, the Peano curve, the Sierpinski curve, the Spiral- and Serpentine rack (see �gure 5), wealso apply our recently investigated Snake curve (cf. �gure 4).5 Computer ExperimentsWe have made several computer experiments to compare the existing methods for digitalhalftoning (such as error-di�usion and ordered-dither) with the optimal one-dimensional al-gorithm using space-�lling curves.The error-di�usion method is a technique in which errors occurring in thresholding oper-ations are propagated (compare �gure 6a). Although this method is not suitable to parallelcomputation, it is superior in its quality of the output picture.The ordered-dither method is the one which aims at parallel implementation of the thresh-olding operations. This algorithm is considered to be the best halftoning algorithm so far (see�gure 6b). It is superior in the computation time, but it has the disadvantage that some regularpatterns may appear due to the dither matrix.Figures 6c � 6n display the results of applying the optimal one-dimensional algorithm tosome pixel orderings which are de�ned by space-�lling curves described in the previous sections.We input 8-bit gray-level pictures using an image scanner (EPSON GT8000). The size ofinput pictures is 640� 480 with 256 intensity levels. All experiments have been implementedusing a Fujitsu Workstation (S-4/EC, 20.3 SPECmark). The CPU times for computing thesepictures range from 20 seconds for the error-di�usion- and the ordered-dither method (�gures 6a9

Page 10: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

and 6b) over 4 minutes in the case of k = 1 (�gures 6c, 6e, 6g, 6i, 6k and 6m) to approximately100 minutes for k = 3 (�gures 6d, 6f, 6h, 6j, 6l and 6n).Summarizing the results, an improvement of the ordinary techniques (error-di�usion andordered-dither) can only be achieved if k is selected greater than 1. In this case, however,the running time of the space-�lling curve based algorithms are signi�cantly higher than theseclassical methods. The Hilbert curve, the Sierpinski curve and the Serpentine rack provide thebest results while the Peano curve, the Spiral rack and Snake curve are too regular to avoiddisturbing patterns.Conclusions and RemarksIn this paper we have de�ned the digital halftoning problem as a combinatorial optimizationproblem under some reasonable criterion. We have presented a linear-time and -space algorithmfor the one-dimensional version of the problem. We have also presented some clues to show thedi�culty of the original two-dimensional problem. In this line we have presented approximationalgorithms using space-�lling curves. A comparison with existing methods in this area veri�esthe e�ectiveness of the methods proposed.AcknowledgementMost of the ideas in this paper were obtained while the authors were staying at the Max-Planck Institut f�ur Informatik, Germany. For that, they would like to thank Kurt Mehlhornfor inviting them and for his valuable comments and suggestions. In addition, the �rst authorwould like to express their thanks to Prof. Shiozaki for some stimulating discussions. Theyalso would like to thank John Gilbert of Xerox Palo Alto Research Center for his valuablecomments on partial k-trees. Most of the experiments were done by Mr. Atsushi Hasegawa ofOsaka Electrocommunication University. They express their special thanks to his great e�orts.References[1] B. E. Bayer: "An optimum method for two-level rendition of continuous-tone pictures,"Conference Record, IEEE International Conference on Communications, Vol. 1, IEEE,New York, pp.(26-11)-(26-15), 1973.[2] Y. Crama, P. Hansen and B. Jaumard: "The basic algorithm for pseudo-boolean pro-gramming revisited", Discrete Applied Mathematics, 29, pp.171-185, 1990.[3] R. W. Floyd and L. Steinberg: "An adaptive algorithm for spatial grey scale", SID 75Digest, Society for Information Display, pp.36-37, 1975.[4] D. E. Knuth: "Digital halftones by dot di�usion", ACM Trans. on Graphics, Vol. 6, No.4, pp.245-273, 1987.[5] J. O. Limb: "Design of dither waveforms for quantized visual signals", Bell Syst. Tech.J., 48, 7, pp. 2555-2582, 1969.[6] B. Lippel and M. Kurland: "The e�ect of dither on luminance quantization of pictures,"IEEE Trans. Commun. Tech., COM-19, pp.879-888, 1971.[7] R. Ulichney: "Digital halftoning", MIT Press10

Page 11: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

Figure 4: A space �lling curve for k = 2 which incorporates the maximum possible number ofneighbors: the Snake curve.

Figure 5: Space-�lling curves11

Page 12: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

(a) Error Di�usion (b) Ordered-Dither(c) Hilbert curve (k = 1) (d) Hilbert curve (k = 3)(e) Peano curve (k = 1) (f) Peano curve (k = 3)12

Page 13: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

(g) Sierpinski curve (k = 1) (h) Sierpinski curve (k = 3)(i) Spiral rack (k = 1) (j) Spiral rack (k = 3)

(k) Serpentine rack (k = 1) (l) Serpentine rack (k = 3)13

Page 14: Digital - Semantic Scholar...Digital Halftoning Algorithms Based on Optimization Criteria and their Exp erimen tal Ev aluation T etsuo Asano y Desh Ranjan z Thomas Ro os x Abstract

(m) snake curve (k = 1) (n) snake curve (k = 3)Figure 6: Experimental results of several digital halftoning methods.14