• No results found

Inverse Halftoning Using Inverse Methods

N/A
N/A
Protected

Academic year: 2021

Share "Inverse Halftoning Using Inverse Methods"

Copied!
49
0
0

Loading.... (view fulltext now)

Full text

(1)

Department of Science and Technology Institutionen för teknik och naturvetenskap

Linköpings Universitet Linköpings Universitet

Examensarbete

LITH-ITN-MT-EX--07/004--SE

Inverse Halftoning Using

Inverse Methods

Oscar Gustavsson

(2)

LITH-ITN-MT-EX--07/004--SE

Inverse Halftoning Using

Inverse Methods

Examensarbete utfört i medieteknik

vid Linköpings Tekniska Högskola, Campus

Norrköping

Oscar Gustavsson

Handledare Björn Kruse

Examinator Björn Kruse

Norrköping 2007-02-09

(3)

Rapporttyp Report category Examensarbete B-uppsats C-uppsats D-uppsats _ ________________ Språk Language Svenska/Swedish Engelska/English _ ________________ Titel Title Författare Author Sammanfattning Abstract ISBN _____________________________________________________ ISRN _________________________________________________________________

Serietitel och serienummer ISSN

Title of series, numbering ___________________________________

Datum Date

URL för elektronisk version

Avdelning, Institution Division, Department

Institutionen för teknik och naturvetenskap Department of Science and Technology

2007-02-09

x

x

LITH-ITN-MT-EX--07/004--SE

Inverse Halftoning Using Inverse Methods

Oscar Gustavsson

This Master´s thesis discusses the problems concerning inverse halftoning, which means converting a halftone image into a continuous tone one. The thesis evaluates the use of inverse methods, showing promising results. The algorithm is implemented and tested using Matlab and serves as a prototype for possible full scale applications.

The work is based upon previously published articles on the subject, along with basic halftoning and printing theory. This serves as a starting point from which the proposed method is developed, and the results are in some areas competitive against other, previously published approaches.

(4)

Upphovsrätt

Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare –

under en längre tid från publiceringsdatum under förutsättning att inga

extra-ordinära omständigheter uppstår.

Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner,

skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för

ickekommersiell forskning och för undervisning. Överföring av upphovsrätten

vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av

dokumentet kräver upphovsmannens medgivande. För att garantera äktheten,

säkerheten och tillgängligheten finns det lösningar av teknisk och administrativ

art.

Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i

den omfattning som god sed kräver vid användning av dokumentet på ovan

beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan

form eller i sådant sammanhang som är kränkande för upphovsmannens litterära

eller konstnärliga anseende eller egenart.

För ytterligare information om Linköping University Electronic Press se

förlagets hemsida

http://www.ep.liu.se/

Copyright

The publishers will keep this document online on the Internet - or its possible

replacement - for a considerable time from the date of publication barring

exceptional circumstances.

The online availability of the document implies a permanent permission for

anyone to read, to download, to print out single copies for your own use and to

use it unchanged for any non-commercial research and educational purpose.

Subsequent transfers of copyright cannot revoke this permission. All other uses

of the document are conditional on the consent of the copyright owner. The

publisher has taken technical and administrative measures to assure authenticity,

security and accessibility.

According to intellectual property law the author has the right to be

mentioned when his/her work is accessed as described above and to be protected

against infringement.

For additional information about the Linköping University Electronic Press

and its procedures for publication and for assurance of document integrity,

(5)

Abstract

This Master´s thesis discusses the problems concerning inverse halftoning, which means con-verting a halftone image into a continuous tone one. The thesis evaluates the use of inverse methods, showing promising results. The algorithm is implemented and tested using Matlab and serves as a prototype for possible full scale applications.

The work is based upon previously published articles on the subject, along with basic halfton-ing and printhalfton-ing theory. This serves as a starthalfton-ing point from which the proposed method is developed, and the results are in some areas competitive against other, previously published approaches.

(6)

Acknowledgements

I would like to thank Tobias Lindahl and Bj¨orn Kruse for many interesting discussions. I also send my deepest gratitude to Ancie Eriksson for proof reading the report, and my father for all his support.

(7)

Contents

1 Introduction 1 1.1 Background . . . 1 1.2 Methods . . . 1 1.3 Outline . . . 2 2 Basic Concepts 3 2.1 Inverse Methods . . . 3

2.2 The Printing Process . . . 3

2.3 Halftoning . . . 4

2.3.1 Halftoning Methods . . . 4

2.4 Colour Halftones . . . 6

3 Inverse Halftoning 7 3.1 Why Inverse Halftoning? . . . 7

3.2 Approaches . . . 7

3.2.1 Frequency or Spatial Filtering . . . 8

3.2.2 Adaptive Filtering . . . 8

3.2.3 Machine Learning . . . 8

4 Halftones in the Fourier Domain 9 4.1 Colour Halftones . . . 9

4.1.1 Moir´e Peaks . . . 10

4.2 Extracting the Screen . . . 11

4.2.1 Gaussian Interpolation . . . 12

4.2.2 Interpolate Phase Angle . . . 12

5 Proposed Method 14 5.1 Identify Screen Pattern . . . 15

5.2 Reproducing Halftone . . . 16

5.3 Enhance . . . 18

5.4 Colour Halftones . . . 20

(8)

6 Conclusions 24

6.1 Results . . . 24

6.2 Future Research . . . 24

A Colour Spaces 27 A.1 RGB . . . 27

A.2 CMY and CMYK . . . 28

B Fourier Analysis 29 B.1 Varieties of the Fourier Transform . . . 29

B.2 Fourier Analysis of Images in Matlab . . . 30

B.2.1 Basic Matlab Commands . . . 30

B.2.2 The Log Transform . . . 30

C Images 32

(9)

List of Figures

1.1 Inverse halftoning performed using the proposed method. Original image courtesy of Bj¨orn Kruse. . . . 1 2.1 The halftone dot is built up piece by piece by the exposure dots. This figure shows

a 4x4 screen cell that has 17 gray levels. . . . 4 2.2 An image halftoned using three different methods. Original image courtesy of

Oscar Gustafsson. . . . 5 2.3 Halftoning notations. . . . 6 2.4 Moir´e patterns are formed when two or more patterns are combined. . . . 6 2.5 An image halftoned using two different angles. Note that the screen pattern is

less noticeable at 45◦. . . . 6 4.1 A halftoned image (a) and its Fourier spectra (b). Please note the peaks that are

formed due to the screen pattern. Original image courtesy of Oscar Gustafsson. 10 4.2 Fourier spectra of the C channel of a halftoned image. Note the residue from the

other screens. . . 10

4.3 Cropped Fourier spectra illustrating the formation of a moir´e peak, here as a sum of the cyan and magenta vectors. . . 11

4.4 The notation of the vectors u and v. . . 12

4.5 Visualizing the accuracy of the screen parameter estimation. The image is of size 1000x1000 and the cell width is about seven pixels. . . 13

4.6 Showing a 9x9 area of the phase angle interpolated using bicubic interpolation. The image used is 1000x1000 pixels in size. . . 13

5.1 A diagram visualizing the method. . . . 14 5.2 The original halftone used in this example. . . 15

5.3 Artifacts caused by filtering with a Gaussian low pass filter kernel. The ruined pixels at the left and bottom of (a) are the result of large filter kernels. (b) is the result after cutting off the Gaussian curve too early. The images are cropped. . . 16

5.4 A Gaussian curve and how much of the area different standard deviations account for. Note that this is the two dimensional case, and that the kernels used for filtering in this thesis are three dimensional. . . 16

5.5 The fourier spectra of the image found in figure 5.2. Note that the spectra is stretched horizontally due to the fact that the image is not square. . . 16

(10)

5.6 The original image low passed with a Gaussian filter kernel that just about

re-moves the screen pattern. Compare with figure 5.2. . . 16

5.7 The reproduced halftone is created using the parameters extracted from the orig-inal halftone. . . 17

5.8 The accuracy of the screen parameter estimation is illustrated. . . 18

5.9 The correlation between an original halftone and the reproduced one. The peak in the middle suggests that the difference is small. It is possible, if one wants to, to interpolate and find the maximum so that the offset vector can be made even more accurate. . . . 18

5.10 The result from equation 5.4. The image is altered, so that a gray level of 0.5 corresponds to a value of zero. Also, the image is enhanced by multiplying all components by three. The screen pattern is visible. . . 19

5.11 The result after low pass filtering the image in figure 5.10 to hide the screen pattern. 19 5.12 High pass filtering the image in figure 5.11 yields this result. Note how well the sharp edges are preserved, while smooth areas are removed. . . . 20

5.14 The average influence per pixel Idif f has at different recursions. . . 20

5.15 The result after applying the method. Compare it to the original halftone in figure 5.2 and its low passed version in figure 5.6. . . 20

5.13 Histograms of the band passed version of Idif f using 256 bins at three different recursions. The histograms are cropped. . . 21

5.16 The Fourier spectra of the result in figure 5.15. Compare it to figure 5.5. . . 21

5.17 The colour halftone used in this example. Original image courtesy of Ford. . . 21

5.18 The C colour channel after having been converted to CMYK. . . . 22

5.19 The parameter estimation is less accurate in this case, as seen in this figure. . . . 22

5.20 The result after applying the method to all four colour channels. . . 22

5.21 This figure illustrates moir´e formation when halftoning an already halftoned im-age with (a) and without (b) using the proposed method first. . . . 23

A.1 The RGB corrdinate system, or the RGB cube. . . 27

A.2 Primary and secondary colors of the additive colour space RGB. . . . 28

A.3 Primary and secondary colors of the subtractive colour space CMY. . . 28

B.1 An image (a) and its Fourier spectra (b). The spectra is normalized. Original image courtesy of Oscar Gustafsson. . . 31

B.2 The Fourier spectra in B.1(b) with the log transform in equation B.6 applied to it. Note how the lower values are enhanced. The spectra is normalized. . . 31

C.1 Two of the halftones used for testing in this thesis. (a) is a gray scale halftone that has not left the computer, while (b) is a scanned, colour halftone printed in CMYK. . . 33

(11)

C.2 Images illustrating inverse halftoning on the gray scale halftone in figure C.1(a)

using the proposed method. (b) is the result of low pass filtering the original using a Gaussian filter kernel that just about removes the screen pattern. (a) shows the resulting continuous tone image after twelve recursions. Note the difference in sharpness between (a) and (b). . . . 34 C.3 Images illustrating inverse halftoning on the colour halftone in figure C.1(b) using

the proposed method. (b) shows the low passed version of the original. (a) shows the resulting image after twelve recursions. . . 35

C.4 Histograms of the images used to enhance the low passed versions of the original

at different states of the algorithm. (a-c) are the result of a perfect gray scale image, (d-f ) a gray scale scanned image, (g-i) a scanned colour image (C channel) and (j-l) a perfect colour image (also C channel). Note the convergence present in all cases. . . 36

(12)

Chapter 1

Introduction

Most large scale printing devices today are in-capable of printing an image directly from a computer without any processing. Printing can only be done binary; either an area is cov-ered with ink, or it is not. This causes prob-lems when trying to print images with contin-uous tone, so therefore a binary representation (halftone) built up by small dots is created [3]. This process makes the image printable, but it also degrades it. This thesis discusses the prob-lems in trying to use this scrambled image, and to restore the continuous tone.

1.1

Background

Several publications have been made during the last decade in the inverse halftoning area. Many focus on only one type of halftones, and many only deal with gray scale images. This thesis evaluates a new approach to the problem that turns out to be quite promising. The re-sulting image is free from the screen pattern it previously had, and can be printed, or perhaps saved in a database. The method evaluated is of inverse nature, which means that the prob-lem is solved using backward reasoning. The desired result is a continuous tone image free from patterns and noise up to the point where it is possible to print it again perhaps us-ing different techniques, parameters or printus-ing

Figure 1.1: Inverse halftoning performed using

the proposed method. Original image courtesy of Bj¨orn Kruse.

media. Only if this is possible, the method´s performance is satisfactory. This thesis will discuss whether the given approach will meet up to these standards. In figure 1.1 an example of how the proposed method performs is given.

1.2

Methods

The project started with literature studies and research on the subject. It turned out that there were many interesting articles available,

(13)

and many useful ideas that in fact have been implemented here in this thesis. These articles, together with the initial idea of using inverse methods, served as a basis for the upcoming work. The algorithm was implemented in Mat-lab and tests on various kinds of halftones were conducted during the whole development. It is obvious that inverse halftoning is an in-verse process; the main idea is to restore what the halftoning has done to the image. The con-cept of an inverse method, however, can be de-scribed as a way of reasoning backward in order to go forward [4]. It is important to distinguish between them, as they might sound alike. The results when it comes to image quality are rather subjective. SNR1 will not be measured since the original continuous tone image since long is gone. The aim is to get as close to re-trieving the original halftone detail as possible, not the original, continuous tone image detail.

1.3

Outline

This thesis has a few sections that an experi-enced reader might want to skip. These covers some basics that are essential to readers not familiar with them. Here follows a short com-pilation of what the chapters contain.

Chapter 2 covers the basics of printing and

what halftoning is.

Chapter 3 brings up what inverse

halfton-ing involves, what problems one might be faced with and how others have tried to solve them.

Chapter 4 explains how halftones behave in

the Fourier domain and what information can be extracted from them. Especially

1Signal to noise ratio.

important is section 4.2 which brings up essential parts of the final algorithm.

Chapter 5 presents the proposed method by

giving an example. This is the single most important part of this report.

Chapter 6 discusses the method and

pro-poses future work.

Appendix A is a brief summary of colour

spaces one should be familiar with.

Appendix B explains a fundamental part of

this thesis, namely Fourier analysis. Some important Fourier domain properties are discussed and some examples are given.

Appendix C contains resulting images. Appendix D lists a number of expressions

(14)

Chapter 2

Basic Concepts

This chapter covers some basics in printing and halftoning theory along with some notation clarifications. This chapter is written primar-ily for readers unfamiliar with the subject, as is appendix D, which is a glossary of technical terms. Sections 2.2, 2.3 and 2.4 are based on [3], unless otherwise stated.

2.1

Inverse Methods

Inverse methods are discussed in [4], and this section is a small compilation what they are and how they are defined.

When trying to prove theorems or problems, one often (maybe unintentionally) uses one or several methods. These have been categorized and named, and someone familiar with the sub-ject might recognize terms such as

resolution-based or resolution-based methods. The

tableau-based methods try to break down goals into subgoals, which are then broken down into even smaller subgoals until the level of axiom1 is met. This kind of problem solving is called

forward reasoning.

The inverse method is in a sense the opposite of the above; it tries not to create subgoals out of goals, but rather to define new goals out of already solved subgoals, or to build the tree

1A self-evident truth that requires no proof.

from the leaves. It can also be described as a method that tries to prove or solve something by starting at the axioms and working its way upward. This is a rather delicate task, as the number of axioms often are infinite.

The concept of solving problems in inverse manners is less known than the forward ap-proach, and this thesis will try to utilize some of its properties to solve the problems with in-verse halftoning. If you are interested in this subject, then [4] is a good starting point.

2.2

The Printing Process

The printing process involves the transferral of some kind of document (text, images or both) from a computer to a printing media of choice. Everything from paper to glass can be printed, and of course all these different types of mate-rials have specific properties, and therefore re-quire specific printing techniques. When print-ing small quantities, an ink jet printer is often used (not covered in this thesis). This tech-nique however, is not fast enough nor econom-ically feasible when it comes to printing large quantities. This is where printing presses are used.

The most commonly used printing technique for standard applications today is offset print-ing. This method is based on the lithographic

(15)

principal which involves separating printing and non printing areas of the plates using chemical properties. Other methods for print-ing is flexograph and screen printprint-ing. The most significant advantage of these methods is that they can print on some media that offset print-ing cannot. They do however produce lower quality results. All these methods uses binary printing plates of some kind, and can be used both for colour and gray scale printing.

2.3

Halftoning

The biggest issue when printing today is the fact that an image produced on a computer normally cannot be reproduced in continuous tone on paper. Printing plates are in reality binary; a specific area is either covered in ink, or it is not. To solve the problem of repro-ducing tones, the image has to be converted in some way to make it compatible with the printer. The technique for doing this is called

halftoning, and the main idea is to create a

binary image with small dots of ink and, by adjusting the size or density of them, fool the eye in seeing different intensities. In order to create this binary version of the image, a RIP (Raster Image Processor) is used. The result-ing binary image is transferred to the printresult-ing plates, which later on is used in the printing process, as described in section 2.2. The up-coming section covers different ways that the binary image can be constructed.

2.3.1 Halftoning Methods

There are several ways that the binary image (halftone) can be built up in order to simulate the continuous tone of the original image. The different methods all have their advantages and drawbacks. The halftoning techniques most commonly used today are:

Figure 2.1: The halftone dot is built up piece by

piece by the exposure dots. This figure shows a 4x4 screen cell that has 17 gray levels.

Amplitude modulated - The screen is build

up by different sized halftone dots in a reg-ular pattern.

Frequency modulated - Exposure dots are

dispersed in an irregular pattern.

Hybrid - A mixture of the two mentioned

above [7].

Amplitude modulated halftoning, or AM, is most common today due to its simplicity and low production cost. The image is, in this case, represented as a regular screen pattern rotated at an arbitrary angle. The pattern consists of small dots, and to fool the eye to see different intensities, the size of these dots varies. The method is best suited for reproduc-ing smoother areas, whereas sharp edges are slightly blurred. There are two major subcat-egories of AM halftoning, namely clustered dot and dispersed dot [8]. The first method tries to put the exposure dots as close to each other as possible, while the latter does the opposite. An example of how a 4x4 clustered halftone dot is built up from zero to 100% intensity is found in figure 2.1. The number of intensities

(16)

(a) AM, clustered dot. (b) AM, dispersed dot. (c) FM halftoning

Figure 2.2: An image halftoned using three different methods. Original image courtesy of Oscar

Gustafsson.

that can be represented is:

gray levels =  dpi lpi 2 + 1 (2.1)

The number of gray levels can also be calcu-lated using the width A and height B of the screen cell:

gray levels = A∗ B + 1; (2.2) A more compact representation of the screen cell buildup is to use a matrix:

Tr= ⎛ ⎜ ⎜ ⎝ 13 7 8 14 5 1 2 9 6 4 3 10 16 12 11 15 ⎞ ⎟ ⎟ ⎠ (2.3)

The approach of frequency modulated (FM ) halftoning is somewhat different. This time, the size of the dot is constant, but instead the number of points printed in a specific area varies. This method is more seldom used because it demands a much more controlled and expensive printing process. On the pos-itive side, it preserves high frequencies bet-ter. There are no angles in FM halftoning, so therefore there is no interference between dif-ferent screens in colour printing. This method can be combined with AM halftoning, and is then called hybrid halftoning. If AM is used in

smooth areas, and FM at sharper edges, both methods are used where they perform best. This idea is not used often in real life, but it is interesting and some research has been done on the subject. [7] explains hybrid halftoning further.

When it comes to this thesis, it only covers the inverse halftoning of AM, clustered dot halftones. The halftone techniques are all dif-ferent, and the method proposed is specifically created to deal with the properties this type of halftoning has. The three different meth-ods AM clustered dot, dispersed dot and FM halftoning are illustrated in figure 2.2.

In order to fully understand how a halftone is built up, the following list clarifies some nota-tions. Also see figure 2.3.

Exposure dot - The small, binary dot that a

printer prints. The resolution is measured in dpi, or dots per inch.

Halftone dot - A cluster of several exposure

dots.

Halftone cell - A (most often) quadratic cell

which contains a halftone dot. Measured in lpi (lines per inch).

Screen - A number of cells in a regular

(17)

Screen Cell Halftone Dot Exposure Dot

Figure 2.3: Halftoning notations.

Depending on the material to be printed, dif-ferent resolutions are used. An offset printer can print at about 65-300 lpi, but for example newspaper paper is so low in quality that it is only possible to print at a maximum of 85 lpi on it. With high quality magazine paper it is however possible to print at 150-300 lpi.

2.4

Colour Halftones

When printing in colour, the same methods as above apply, with the difference that the image is printed using several halftones in different coloured inks. The by far most common way to print today is by using the CMYK (cyan, ma-genta, yellow and black) colour space. Images to be printed often reside on a hard drive in a computer being composed of the three colours R, G and B (red, green and blue). Hence a conversion to CMYK must be done, which un-fortunately is quite troublesome. The C, M, Y and K components heavily depend on what kind of printing media is to be used. For ex-ample a newspaper or a poster needs different colour compositions to give the same result. This is discussed more thoroughly in [3]. When the correct CMYK image has been constructed, the four layers are individually

+ =

Figure 2.4: Moir´e patterns are formed when two or more patterns are combined.

(a) 75 (b) 45

Figure 2.5: An image halftoned using two

dif-ferent angles. Note that the screen pattern is less noticeable at 45◦.

halftoned. If the case of AM, clustered dot halftoning, the angles with which each colour channel is printed is important when it comes to image quality. Some default angles often mentioned in literature are 15 (cyan), 75 (magenta), 0 (yellow) and 45 (black). These are chosen to minimize the interference be-tween the colours (see figure 2.4). The rea-son for choosing 0 for yellow is because it is the angle at which the screen pattern is most visible, and it is therefore used for the colour which is less dominant. 45 on the other hand hides the screen significantly more, and it is therefore used for the most prominent colour (black). The angles chosen for cyan and ma-genta are somewhere in between. Look at fig-ure 2.5 to see a halftone at two different angles.

(18)

Chapter 3

Inverse Halftoning

This chapter covers the problems with inverse halftoning and how one might solve them. Sev-eral publications covering the subject have been made, and some of the most interesting ones are presented in section 3.2.

3.1

Why Inverse Halftoning?

Inverse halftoning is the process of converting a halftoned image into a continuous tone version of itself. The input image is often scanned from a magazine or newspaper. The main reason for spending time and effort doing inverse halfton-ing is the fact that an already halftoned image will produce moir´e patterns when halftoned once more [1]. The reason for this is that the screen pattern already present in the image will interfere with the screen pattern used when halftoning once more.

The definition of what inverse halftoning is would be: To remove all signs of introduced

patterns in a halftone. These patterns can

ei-ther be the screen itself or moir´e caused by in-terference from the different printing colours.

3.2

Approaches

Today, there are several commercial products available that can handle inverse halftoning.

These are, however, often for professional use and are therefore expensive. Some examples of software that can be used for inverse halftoning are:

RepliDot, Layout Ltd - A Photoshop plug

in used to handle scanned halftones [12]. It costs 2000 US dollars.

Silverfast, LaserSoft Imaging - A Scanner

software that costs about 300-900 US dol-lars [13].

DescreenIt, Jetsoft Development -

Stan-dalone application that is used for de-screening [14]. Price: 100 US dollars.

FoveaPro, Reindeer Graphics - An Image

processing software [15]. Price: 800 US dollars.

None of these products have been tested in this thesis, and the reason for listing them is to show that there is in fact a market for inverse halftoning.

During the project, an Epson Perfection 1260 scanner was used, and its inverse halftoning software did not perform well at all. It seems like the image has been slightly low pass fil-tered, leaving the screen pattern visible. The scanner test performed in [9] confirms this ex-perience; all scanners in the test performed poorly.

(19)

Common to all software mentioned above is that there is little to no information on the technical details and what methods have been used, which is unfortunate, but not surprising. Of course, the developers have no interest in sharing the methods used in their software to competing companies. The following sections will instead cover some interesting techniques found in literature.

3.2.1 Frequency or Spatial Filtering

The most straightforward way to handle the problem would be to use some kind of low pass filter to remove the screen pattern. The screen is very distinct in frequency and angle, so cre-ating a filter that removes the screen is no problem. The problem lies in the removal of high frequency information, and the absence of it will show in the end result.

A simple approach is to use a Gaussian low pass filter, either in the spatial or the Fourier domain. The result when filtering with a Gaus-sian kernel that just about removes the screen pattern will be significantly blurred. To solve this problem, one might think that a steeper curve would cut off less of the higher frequen-cies. The fact is that it does, but it will also cause ringing effects, and the closer to the ideal low pass filter a kernel gets, the worse the arti-facts [2]. It gets even worse if one wishes to re-move the moir´e patterns in the halftone. These lie at frequencies lower than those of the screen patterns, so therefore a lower cutoff frequency is needed in order to remove them [1].

3.2.2 Adaptive Filtering

Adaptive filtering means using a filter that changes based on how the underlying image looks. In [1], the author uses a spatial ker-nel rotated to the same angle as the screen,

and this seems to preserve at least some of the higher frequencies. The removal of the moir´e is then done manually by suppressing its peaks in the Fourier spectra. This method produces an image free from the screen and moir´e pat-terns with a higher sharpness than that of a Gaussian low pass filtered one.

The authors of [5] proposes another adaptive filtering technique to perform inverse halfton-ing. The main problem this method addresses is the removal of moir´e patterns. The averag-ing kernel that traverses the image changes size depending on the moir´e strength in the current pixel. The authors find the method somewhat satisfying, but sharp edges in the resulting im-ages could be sharper.

3.2.3 Machine Learning

There are several different kinds of halftoning methods, and to create a method that can deal with all of them is a challenge. The authors of [6] use a decision tree learning algorithm called ID3 to achieve just that. The method has has the ability of handing several halftone techniques, and the implemented program uses halftone images as training sets, which it builds the tree from. This learning process takes some time, but the actual inverse halftoning is quite fast. Also, the algorithm seems to perform very well, but is only tested on perfect, gray scale halftones that have never left the computer.

(20)

Chapter 4

Halftones in the Fourier Domain

When looking at the Fourier spectra of a nat-ural image taken by a camera, one might ob-serve that it is often lacking high, concentrated peaks. This is due to the fact that nature is very stochastic, and does not contain many reg-ular patterns. This fact can be used when ana-lyzing halftones, because a halftone is in fact a natural image with the introduction of a regular pattern which shows in the Fourier domain.

Figure 4.1 is an example of a natural, halftoned image and its transform, showing high peaks representing the frequency and angle of the screen pattern. The spectra is, if the input image contains real and positive values, conju-gate symmetric [2]:

F(u, v) = F(−u, −v) (4.1)

From the spectra in figure 4.1(b) it is easy to get information about the screen used. In the halftone,the screen pattern has an angle of ap-proximately 75counter clockwise, which is the same angle as the peaks are rotated. The four most dominant peaks represent the frequency in both directions of the screen and its mir-rored counterparts. The lesser dominant peaks are in fact integer multiples of the real peaks [1]. There is a relationship between the dis-tance from the center of the spectra to the peak and the cell width in the spatial plane. The in-terpretation of all these peaks will be discussed further in 4.2.

4.1

Colour Halftones

Colour halftones behave somewhat differently in the Fourier domain than gray scale halftones do, and introduce several obstacles and prob-lems. First of all, a colour image is made up of several colour channels. The image was orig-inally printed in cyan, magenta, yellow and black, then scanned and converted into red, green and blue. This conversion along with the printing makes it hard, if not impossible to perfectly separate all printing colours. When using four different printing colours there are sixteen ways to mix them, and out of of these, nine are black [1]. One of the black colours is made up of cyan, magenta and yellow mixed together, and the other eight are combinations of the primary colours and black. The RGB to CMYK conversion algorithm in A.2 does separate the colours somewhat, but the result-ing channels do have residue from the other channels. One example of a spectra belong-ing to a former CMYK image converted from RGB back to CMYK is found in figure 4.2. The figure shows the C channel of the im-age, and here it is important to distinguish between all the different peaks, as it is easy to get confused. The notations are the same as in [5]. Firstly, and most importantly are the peaks representing the cyan screen. These peaks should, if the colour separation process has performed according to plan, be second

(21)

(a)

(b)

Figure 4.1: A halftoned image (a) and its Fourier spectra (b). Please note the peaks that are formed due to the screen pattern. Original image courtesy of Oscar Gustafsson.

most dominant (most dominant is the compo-nent in the middle of the spectra). Also, if the screen pattern is orthogonal, the angle between the peaks is 90. These kinds of peaks are from now on referred to as channel peaks. These

Figure 4.2: Fourier spectra of the C channel of

a halftoned image. Note the residue from the other screens.

peaks also have integer multiples at higher fre-quencies than the channel peaks themselves [1]. Apart from the C channel peaks, residue peaks (and their integer multiples) from M, Y and K are also present at their respective angle and frequency being less dominant than the main channel peak.

4.1.1 Moir´e Peaks

The peaks mentioned above lie at the fre-quency of the channel peaks or higher. Unfor-tunately, the printing process, using different screens at different angles, introduces interfer-ence patterns, or peaks. These moir´e patterns

are originating from integer multiple combina-tions of all channel peaks [1]. Most of the moir´e peaks formed are so weak that they are not even visible [1]. However, some of the peaks can be rather strong, and clearly noticeable. There is one moir´e peak for each pair of chan-nel (and residue) peaks, and they are formed at the location of the sum of the two vectors for

(22)

C

M

Moiré

Figure 4.3: Cropped Fourier spectra illustrating

the formation of a moir´e peak, here as a sum of the cyan and magenta vectors.

each channel peak [5] (see figure 4.3). As seen in the figure, the frequency of the moir´e peak is somewhat lower than those of the channel peaks. This implies that a lower cutoff fquency has to be chosen if they are to be re-moved by low pass filtering. This is a problem, as a cutoff frequency this low will remove a lot of important detail.

4.2

Extracting the Screen

The Fourier domain is a powerful tool for iden-tifying the screen within a halftone. In more detail, this extraction process involves obtain-ing the followobtain-ing parameters:

• Screen angle

• Screen frequency, or cell width in pixels • Screen offset vector

This section will not cover the estimation of the following:

• Threshold matrix • Halftoning method

The reason for not trying to obtain the thresh-old matrix is that this information would be hard to get to because the halftone dots are blurred in the printing process. It might be possible, however, to extract the threshold ma-trix out of halftones not yet printed. The screen pattern with which the halftone is pro-duced is presumed to be orthogonal and of clustered dot type, and the frequencies are assumed to be the same in both directions. This simplifies the calculations as only one fre-quency and angle must be extracted. For clar-ity, however, both screen vectors are taken into consideration. It is also presupposed that the Fourier spectra on which the extraction should be performed has dominant channel peaks with magnitude higher than that of all other com-ponents (center of spectra excluded). If this is true, all that has to be done is to write an algorithm that finds the position of the chan-nel peaks representing the screen pattern. The following notations, extraction and Gaussian interpolation is taken from [1].

It is important to take into consideration that the spectra is symmetric (see equation 4.1), which means that a peak has a mirrored coun-terpart. When trying to extract two vectors orthogonal to each other, the extraction algo-rithm has four different vectors to choose a pair from from. The notation of choice is found in figure 4.4 and equation 4.2.

u1> 0; v1≤ 0; u2 ≤ 0; v2> 0 (4.2) The relationship between screen vectors in the spatial plane and the previously extracted vec-tors in the Fourier domain is:

 x1 y1  = 1 u1v2− u2v1  0−M N 0   u1 v1  (4.3)  x2 y2  = 1 u1v2− u2v1  0 M −N 0   u2 v2  (4.4)

(23)

u

v

u

1

v

1

u

2

v

2

(0,0)

Figure 4.4: The notation of the vectors u and

v.

where M and N is the width and height of the image. The two screen vectors should, if the screen is orthogonal, have the same length and should be rotated 90 relative to each other. These vectors are used to calculate the angle and frequency of the dominant screen pattern, but in order to exactly position it, an offset vector is needed. It is given by:

 x0 y0  =−φ(u1,v1)  x2 y2  +−φ(u2,v2)  x1 y1  (4.5) The screen angle can easily be calculated from the vectors (x1, y1)t or (x2, y2)t as follows:

α = tan−1  y1 x1  = 90◦+ tan−1  y2 x2  (4.6) The screen size (in pixels) is given by:

l =

x21+ y12=

x22+ y22 (4.7) The resolution of a Fourier spectra is often quite coarse, especially if a small image has been used. This results in inaccurate estima-tions. The upcoming sections covers a few techniques to make the estimations more ex-act.

4.2.1 Gaussian Interpolation

This method interpolates new positions of the peaks found by fitting them onto a Gaussian curve. The peak position is fundamental in the sense that all information (angle, frequency and offset vector) depend on it. The interpo-lation is done using the following equations:

 ucorr vcorr  = 1 2 ⎛ ⎜ ⎝ qu2−qu1 qu2+qu1 qv2−qv1 qv2+qv1 ⎞ ⎟ ⎠ (4.8) qu1 = log  |F (u, v)| |F (u + 1, v)|  (4.9) qu2 = log  |F (u, v)| |F (u − 1, v)|  (4.10) qv1 = log  |F (u, v)| |F (u, v + 1)|  (4.11) qv2 = log  |F (u, v)| |F (u, v − 1)|  (4.12) Where (ucorr vcorr)t is the new coordinate.

This produces more accurate positions, but will most probably make the coordinates non integers. Equation 4.5 takes a coordinate as an argument, and because the Fourier spectra is discreet, some kind of interpolation of the phase angle is needed. This is discussed in the upcoming section.

4.2.2 Interpolate Phase Angle

If the peak coordinate is not an integer, then some kind of interpolation has to be done in order to calculate the phase angle. The most commonly used interpolation techniques are:

• Nearest neighbour interpolation • Bilinear interpolation

(24)

Figure 4.5: Visualizing the accuracy of the screen parameter estimation. The image is of size 1000x1000 and the cell width is about seven pixels.

Figure 4.6: Showing a 9x9 area of the phase

angle interpolated using bicubic interpolation. The image used is 1000x1000 pixels in size.

The bicubic interpolation method is illustrated in figure 4.6 using a 1000x1000 image halftoned with a cell width of seven pixels. Because of the fact that the phase shifts so rapidly, the interpolation techniques have difficulties giv-ing accurate results. In cases of smaller im-ages with smaller cell widths, the accuracy gets even lower. In this thesis, bicubic interpolation is used as its smoothness intuitively should

re-semble the continuous phase angle most out of the three interpolation techniques.

The result after performing the extraction can be seen in figure 4.5, and it looks promising. This example is, however, done on a perfect halftone that has not left the computer. The accuracy has proved to be at its best on larger images with clear screen patterns and with a cell width of at least five pixels.

(25)

Chapter 5

Proposed Method

The method proposed in this thesis uses a somewhat new approach. The main idea is to try to use an inverse method which basically uses a low passed, screen pattern free version of the original halftone, which later on is im-proved by addition of high frequency informa-tion. This information is collected by halfton-ing the low passed image in the same way as the original, then looking at the difference between the result and the original halftone. The new, improved result is then fed back into the algo-rithm to be improved even further. Recursions are done either a predefined number of times, or until some condition is fulfilled. The method is more thoroughly explained in this chapter, and is visualized in figure 5.1.

For an inverse halftoning method to work in reality, it has to meet several requirements. With these fulfilled, the method The ones this method tries to fulfill are:

• It must be reasonably fast and memory

efficient.

• It should work on images acquired using a

scanner and on digital halftones that have never left the computer.

• It should work on AM, clustered dot type

halftones.

• It should be fully automatic, and none of

the parameters concerning screen angle,

Original halftone Extract screen Low pass 7 5 9 4 1 3 8 2 6 Halftoning Calculate difference Result Enhance

Figure 5.1: A diagram visualizing the method.

screen frequency or offset vector should be required.

• The result should be able to be halftoned

again without any disturbing moir´e ef-fects.

• It should work on both CMYK colour and

on gray scale halftones.

This thesis proposes a method that tries to meet these demands, and it shows promising results. The following sections is a chronolog-ically ordered list of the steps the method in-volves. The method is presented with an ex-ample, as it is an intuitive way of explaining it. The example explains inverse halftoning of the

(26)

Figure 5.2: The original halftone used in this

example.

grayscale image of size 800x528 pixels found in figure 5.2. The image has not been scanned, and serves as an example of when the method performs at its best. At the end of this chapter, a colour halftone example is discussed.

Most images are too small to show any fine detail, so therefore they are also found in ap-pendix C in larger versions.

5.1

Identify Screen Pattern

The upcoming step utilizes the equations and algorithms found in 4.2 to, as accurately as possible, extract the parameters involving the screen pattern. The algorithm searches the Fourier spectra for peaks, which it uses to cal-culate the following:

Cell width - the distance between the center

of the screen cells in pixels.

Screen angle - the angle in degrees with

which the screen is rotated.

Offset vector - the vector from the center of

the image to the closest black cell.

The image in this example yielded the follow-ing results:

• Cell width: 6.34 pixels. • Screen angle: 44.92◦.

• Offset vector (−5.50, −0.13)t

The spectra used is found in figure 5.5, and with the information gained it is now possi-ble to create a spatial, low pass Gaussian filter kernel to smooth out the screen pattern. This kernel is used to filter the image using the Mat-lab function filter2 that basically uses convo-lution. The choice of kernel design parameters (the standard deviation σ, and the size of the kernel) are somewhat subjective as the filter must be able to completely remove the screen, but must not blur it excessively. σ determines how steep the cutoff should be, and can be de-fined as the distance from the curve center to the point where the curve has reached 60.7% of its maximum value. Tests on various halftones have shown that to choose a σ that is half the distance between two screen cells plus one is a compromise that works well. In this case σ is set to 6.34/2 + 1. When it comes to the size of the kernel, a size that cuts of the curve at three times the value of σ is suitable. In the two di-mensional case, outside this value only 0.13% of the area resides [10]. This is also a compro-mise between the artifacts at the edges of the image a large kernel causes and the rectangu-lar pattern superimposed on the image a too abruptly cut off Gaussian curve creates. Look at figure 5.3 for an example of these effects. The size of the kernel must be an integer, so therefore 3σ is rounded upwards. See figure 5.4 for a feeling of what the Gaussian curve looks like.

The low pass filtered version of the image is found in figure 5.6. The filtering done to re-move the screen pattern causes the loss of high frequency detail, and it is this hard to reach information that all inverse halftoning algo-rithms try to preserve; as does this one. The method proposed uses this screen pattern free

(27)

(a) (b)

Figure 5.3: Artifacts caused by filtering with

a Gaussian low pass filter kernel. The ruined pixels at the left and bottom of (a) are the result of large filter kernels. (b) is the result after cutting off the Gaussian curve too early. The images are cropped.

1σ 2σ 3σ

-2σ -1σ 0

-3σ

34.1%

13.6% 2.1% 0.1%

Figure 5.4: A Gaussian curve and how much of

the area different standard deviations account for. Note that this is the two dimensional case, and that the kernels used for filtering in this thesis are three dimensional.

image as a starting point, and tries to add the high frequencies to it later on.

As of now, the low passed version of the orig-inal halftone is the best result available in the effort of removing the screen pattern. This result is not adequate, and a comparison be-tween the original halftone and the low passed version of it will show that the original is in fact sharper in detailed areas. The pro-posed method deals with the problem of restor-ing the high frequencies in an inverse manner, as described in section 2.1. Instead of solv-ing the task at hand by traverssolv-ing downward

Figure 5.5: The fourier spectra of the image

found in figure 5.2. Note that the spectra is stretched horizontally due to the fact that the image is not square.

Figure 5.6: The original image low passed with

a Gaussian filter kernel that just about removes the screen pattern. Compare with figure 5.2.

via subgoals, which is basically what has been done so far, the algorithm now tries to work its way backwards by reproducing the original halftone, and with it, tries to achieve a result as sharp in detail as the original halftone as possible.

5.2

Reproducing Halftone

Apart from being useful in determining the ap-propriate Gaussian filter kernel, the informa-tion gained in the last secinforma-tion can be used to

(28)

create a screen pattern that mimics the one of the original. In this case, the halftoning method is supposed to be of AM, clustered dot type (described in section 2.3.1). The method used is of great importance, as they are totally different in many aspects. If any other halftone is used, then the results will be ill-defined. There are surely several ways to create a halftone with a certain cell width, angle and offset. This thesis proposes a straightforward approach that performs well. The first prob-lem that arises is that it is hard to create a threshold matrix with dimensions that are not integers. This is solved by choosing a matrix of integer size that is larger than the cell width of the screen that is to be reproduced, then the original image is resized to fit. An easy way is to for example use a threshold matrix of size 7x7 specified as (inspired by a 4x4 ma-trix found in [3]): Tr = ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ 46 42 30 26 31 38 47 41 25 14 10 15 22 43 37 21 9 2 6 16 32 29 13 5 1 3 11 27 36 20 8 4 7 17 33 45 24 19 12 18 23 39 49 40 35 28 34 44 48 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ (5.1)

This matrix will create a clustered dot, but it is somewhat arbitrary, and not necessarily the same as used in the original. The reason for this is that the original threshold matrix is unknown. If the image has a cell width of five pixels, and a threshold matrix of size 7x7 is used, then the image should be resized by a factor K defined as:

K = threshold size

cell width (5.2)

This means a factor of 1.4 in this case. When resizing, bilinear interpolation is used. This interpolation technique is simple, fast and per-forms well. The threshold matrix is concate-nated to cover the whole image, plus some

Figure 5.7: The reproduced halftone is created

using the parameters extracted from the origi-nal halftone.

more to make room for rotation. This large matrix is hereafter called the threshold image. It is important that the cell width of the origi-nal image is smaller than 7 (in this case); then the image will be enlarged, thus introducing information and not removing it. An arbi-trary rotation of the threshold image is made, as is an offset of the original image specified by the results from the screen extraction algo-rithm. Both are performed using bilinear in-terpolation. Now, simple threshold halftoning is done using the low passed original halftone and the concatenated, rotated threshold im-age. The result (found in figure 5.7) should produce a screen pattern that resembles the original one, although with a slightly blurred underlying picture. Figure 5.8 tries to illus-trate how well the parameter estimation works. The most sensitive parameter is the offset vec-tor that is calculated via the phase angle at the peaks. As seen in figure 4.6, the phase an-gle is fluctuating rapidly and it is difficult to estimate it.

One way to create a more accurate offset would be to analyze the correlation between the two halftones, and then try to interpolate a new coordinate and feedback it into the algorithm. The correlation coefficient is best suited for

(29)

γ(x, y) = s t[f (s, t)− ¯f (s, t)][w(x + s, y + t)− ¯w] s t[f (s, t)− ¯f (s, t)]2 s t[w(x + s, y + t)− ¯w]2 1 2 (5.3)

Figure 5.8: The accuracy of the screen

param-eter estimation is illustrated.

this task as it is independent of changes in am-plitude of the two input images [2]. The algo-rithm for calculating it is found in equation 5.3, where one of the images is defined as f and the other one as w. w should be cropped uniformly around its center. It is enough to remove two to three pixels on each edge, but that depends on how well the images match the cell width.

¯

w is the average value of w (only computed

once) while ¯f is the average of f at the

coordi-nates currently common to both images. If f is 500x500 pixels and w is 498x498 the result will be a 5x5 matrix. The higher the values of this matrix, the more the images resemble each other at that offset vector. Using bicubic interpolation a new maximum and its position can be found (look at figure 5.9 for an exam-ple). This information can then be fed back into the algorithm as described above. This method, unfortunately, turned out to be at its

1 2 3 4 5 1 2 3 4 5 0.2 0.4 0.6 0.8 1

Figure 5.9: The correlation between an original

halftone and the reproduced one. The peak in the middle suggests that the difference is small. It is possible, if one wants to, to interpolate and find the maximum so that the offset vector can be made even more accurate.

best when it is not needed; that is when dealing with large images. When dealing with smaller images (500x500 pixels or smaller) with small cell widths (about four pixels or smaller) the accuracy is not good enough. The results in this thesis have not been achieved using this method, but it is an interesting thought and is therefore brought up.

5.3

Enhance

Now a reproduced halftone has been made, with dots that coincide with the original ones. If the difference between the two halftones is calculated, some interesting features will emerge. Both images have screen patterns that lie on top of each other (at least in the perfect case). If the screens are put aside for a mo-ment, and the underlying images are in focus,

(30)

the reproduced image is slightly blurred when compared to the original. The difference be-tween the images is small (close to zero) in low detail areas, while the edges differ more notice-ably. The difference is given by:

Idif f = Horiginal− Hreproduced (5.4)

When applying this idea on the current ex-ample, a result such as the one in figure 5.10 will be achieved. If the images Horiginal and

Hreproducedwere the same, the result would be

all zero. A low pass filtering is done to remove the screen pattern, and because the frequency of the pattern is the same, or higher than that of the original screen, the same standard devi-ation is used. This time, however, the curve is cut off at 4σ instead of 3σ. This is because the artifacts in figure 5.3(b) will accumulate in the upcoming recursions. The downside of a larger kernel is a slightly larger band of ruined pixels at the edges of the image (see figure 5.3(a)). The result of the low pass filtering is found in figure 5.11 and contains little information in the low frequency areas while sharp edges are enhanced. One problem arises when calculat-ing the difference in equation 5.4 and that is the possibility of both low frequency noise and new moir´e effects (moir´e is appearing if the re-produced screen does not match the original one). This time though, these patterns can be removed, as they are formed at low frequen-cies, while the sharp edges lie at higher ones. A high pass filtering is made by removing the re-sult after low pass filtering the image with the ordinary Gaussian kernel one more time. If the low frequencies are removed the high ones must be left. The σ and size of the kernel are the same as before. This assumption is rather em-pirical, but has proved to produce good results. These two sub sequential filters leave a band of frequencies more or less untouched. These fre-quencies lie approximately at the sharp edges as can be seen in figure 5.12.

Figure 5.10: The result from equation 5.4. The

image is altered, so that a gray level of 0.5 cor-responds to a value of zero. Also, the image is enhanced by multiplying all components by three. The screen pattern is visible.

Figure 5.11: The result after low pass

filter-ing the image in figure 5.10 to hide the screen pattern.

Now Idif f is free from most low frequency

in-formation, and it is time to use it to enhance the low passed original. This is done by adding the images:

Hresult= Hlp+ Idif f (5.5)

Hlp is the low passed original. Now, Hresult

should appear slightly sharper than Hlp. The

resulting image is now fed back into the algo-rithm a number of times and serves as new starting points just as Hlp has done so far.

(31)

Figure 5.12: High pass filtering the image in

figure 5.11 yields this result. Note how well the sharp edges are preserved, while smooth areas are removed.

and a new Idif f is created to sharpen the

im-age, making it closer and closer to the original. Intuitively, the difference between the two im-ages (Idif f) should get less and less influential

as the images look more and more alike. Fig-ure 5.14 shows a diagram of how much Idif f

influences the image on an average per pixel basis given by:

Iinf luence= N x=1 M y=1 |Idif f(x, y)| (5.6)

The difference is slowly declining until about twelve recursions are made. At this point, the difference starts to converge and fluctu-ate. Experiments have shown that any recur-sions beyond this point only seems to add un-wanted noise to the image, therefore these are not recommended. Surprisingly, this conver-gence has appeared simultaneously in almost all halftones that has been tested. Figure 5.13 shows three histograms of the band passed ver-sion of Idif f (as the one in figure 5.12)

us-ing 256 bins. These show that the image is converging toward somewhere around bin 128, which means a value around zero. In ap-pendix C, more histograms from other cases are presented. 0 5 10 15 20 25 1.5 2 2.5 3 3.5 4 4.5 5 5.5x 10 −3 Recursions Mean influence

Figure 5.14: The average influence per pixel

Idif f has at different recursions.

Figure 5.15: The result after applying the method. Compare it to the original halftone in figure 5.2 and its low passed version in fig-ure 5.6.

Figure 5.15 shows the final result after twelve recursions. The first impression is that it is sig-nificantly sharper than the low passed halftone (see figure 5.6). The images are found in ap-pendix C in larger versions. All results will be discussed thoroughly in section 5.5.

5.4

Colour Halftones

Colour halftones have previously been dis-cussed in this thesis, and they behave in many

(32)

110 115 120 125 130 135 140 145 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Bin P(I)

(a) One recursion

110 115 120 125 130 135 140 145 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Bin P(I) (b) Five recursions 110 115 120 125 130 135 140 145 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Bin P(I) (c) Nine recursions

Figure 5.13: Histograms of the band passed version of Idif f using 256 bins at three different

recursions. The histograms are cropped.

Figure 5.16: The Fourier spectra of the result

in figure 5.15. Compare it to figure 5.5.

ways just like gray scale halftones. This section will discuss how the method performs when colour halftones are used and which problems that arise.

The image in this example is scanned using an Epson Perfection 1260 scanner with a resolu-tion of 600 dpi and is found in figure 5.17. The scanner is a commercially available unit made in 2002 [16] that produces images in the RGB colour space. The first task at hand is to con-vert the image to CMYK as explained in A.2. The C channel of the output can be found in figure 5.18. Inaccuracy in the colour separa-tion will produce weaker and mixed up screen patterns, resulting in less dominant peaks in the Fourier spectra which makes the

estima-Figure 5.17: The colour halftone used in this

example. Original image courtesy of Ford.

tion of the screen parameters more uncertain. In this case, the image size is 512x512 pixels and has a cell width of about five pixels, which are both on the lower end of what the parame-ter extraction algorithm tolerates. The screen parameter accuracy is illustrated in figure 5.19, and is slightly lower than in the previous exam-ple (see figure 5.8). Despite all these setbacks and problems, the method produces the image found in figure 5.20. This time, the screens do not lie on top of each other as in previous

(33)

Figure 5.18: The C colour channel after having

been converted to CMYK.

cases. This does not seem to affect the method performance significantly (resulting images are found in appendix C). As seen in the result, there is some moir´e left in the image. As de-scribed in section 4.1.1, the moir´e peaks are formed at frequencies lower than those of the channel and residue peaks. The low pass fil-tering has been performed to remove the two latter peaks; no effort has been done to remove the moir´e.

5.5

Results

At the beginning of this chapter, a list of im-portant properties of inverse halftoning meth-ods were listed. The first demand was that it should be reasonably fast and memory effi-cient. When using the program on a 800x500 pixel gray scale, halftoned image using an av-erage, up to date computer, the computation time at twelve recursions is below two min-utes and the maximum memory usage 170 megabytes. These tests are performed using

Figure 5.19: The parameter estimation is less

accurate in this case, as seen in this figure.

Figure 5.20: The result after applying the method to all four colour channels.

the tic and toc commands in Matlab and the available memory presented by the Task

Man-ager in Windows XP. It is clear that a

contem-porary computer has no problem in handling this method. An optimized version of the pro-gram would probably run faster.

(34)

(a) (b)

Figure 5.21: This figure illustrates moir´e for-mation when halftoning an already halftoned image with (a) and without (b) using the pro-posed method first.

Other demands were that the method should work on both gray scale and colour AM, clus-tered dot halftones that are either printed or unprinted. The only problems here are when using colour halftones. The transformation from RGB to CMYK colour space is sensitive, and the presence of moir´e from the printing is still present in the end result. A better colour separation would help in solving the first prob-lem, but when it comes to the latter, some other method must be applied. This problem has been discussed in [1] and [5].

When it comes to automatization, there is not much more to wish for. The method takes an RGB or gray scale image, and produces an end result completely without user interaction. One thing that possibly could be improved is the choice number of recursions the program should perform. At this point, a fixed, prede-fined number of recursions are made, but it would be possible to automatically stop the process at any point, given any condition. The last demand of the method, is that there must not be any disturbing patterns prominent enough to show in another, arbitrary halfton-ing. This means that the image must be print-able after the method is applied. The images in figure 5.21 shows how moir´e is formed when a

halftone is halftoned once more with and with-out proper inverse halftoning. AM, clustered dot halftoning is used.

One thing that comes to mind when evaluating this method is to discuss how sensitive it is to changes in the parameter estimations. Several experiments were made by manually introduc-ing errors to different parameters. It turns out that the cell width estimation is of most im-portance. The cell width determines the size and shape of the Gaussian curve, so a small er-ror here will either blur the image too much or leave a screen pattern visible. The angle esti-mation is less important, however, an error of about one to two degrees will start to produce patterns. The last parameter, the offset vector, has turned out to be of very little importance. The initial low pass filtering of Idif f seems to

produce virtually the exact same result, even when the offset vector is several pixels away from its correct position. Further investiga-tions showed that the offset does affect the end result, but to such a small degree that it is neg-ligible. This is most probably the reason why colour halftones turn out so well, despite the incorrect offset vector.

(35)

Chapter 6

Conclusions

A new method for inverse halftoning has been developed in Matlab, and it shows promising results. The images produced are definitely sharper than those produced using just low pass filtering.

6.1

Results

The method can handle scanned images or per-fect halftones that has not been printed, and the demands from chapter 5 are all met. The algorithm requires no information whatsoever concerning the halftoning method used, other than the fact that it is of AM, clustered dot type, and a standard computer of today has no problems with handling the method when it comes to performance issues. Considering that the method is implemented in Matlab without performance and optimization taken into con-sideration, it is safe to say that it would run significantly faster when implemented in, for example, C++.

The method is fully capable of handling gray scale halftones, and is competitive compared to other methods discussed in literature. Its incapabilities of removing moir´e from colour halftones makes it, or at least in its current state, somewhat improper to use on colour halftones as a real life application.

6.2

Future Research

The main problem is the moir´e mentioned above, which can be removed, or at least re-duced using various methods. My suggestion for dealing with this problem is that some kind of adaptive low pass filtering is used such the one explained in [5]. In [1], the author uses a more blunt approach which involves manual deletion of the peaks. This is also an alterna-tive.

Another problem is if the scanned image is dis-torted in some way which makes the screen pattern non orthogonal or if the screen fre-quency varies. This must be dealt with in some way using some other approach. Perhaps it is necessary to look at the image in the spatial do-main and not do a generalization of the screens using Fourier analysis as is done in this thesis. Also, the overall accuracy in determining how a halftone is built up can be better. One idea is to use integer multiples of the peaks in the Fourier spectra to create averages, which prob-ably will produce better results. This idea is also discussed in [1]. The method could also be improve if the result could be surveyed in some way during the recursions, and that the recur-sions would seize at some point, given some condition.

(36)

Bibliography

[1] J. Rydenius, ”Inverse Halftoning of Scanned Colour Images”, Master’s Thesis, Dept. of Electrical Engineering, Link¨oping University, Sweden, 1997.

[2] Rafael C. Gonzales and Richard E. Woods, Digital Image Processing, Prentice-Hall, Inc, 2002, ISBN 0-201-18075-8.

[3] K. Johansson, P. Lundberg and R. Ryberg, A Guide To Graphic Print Production, John Wiley & Sons, Inc, 2003, ISBN 0-471-27347-3.

[4] A. Degtyarev and A. Voronkov, The Inverse Method, in A. Robinson and A. Voronkov, eds, Handbook of Automated Reasoning, Vol. I, Elsevier Science, chapter 4, pp. 179-272, 2001.

[5] Youngmee Han, Jongmin Kim and Minhwan Kim, ”A New Moire [sic] Smoothing Method for Color Inverse Halftoning”, Korea ,2002.

[6] Hae Yong Kim and Ricardo L. de Queiroz, ”Inverse Halftoning By Decision Tree Learning”, Brazil ,2003.

[7] S. Gooran and B. Kruse, ”Hybrid Halftoning”, Internal Research Report LiTH-ITN-R-2004-1, Link¨oping University, Sweden, 2004.

[8] R. Ulichney, ”A Review of Halftoning Techniques,” in Proceedings SP1E Cot, Proc. SP1E 3963, pp. 378 391, 2000.

[9] BeHardware, ”Roundup: 6 Scanners”, available at www.behardware.com/art/lire/552, 8 December 2006.

[10] Wikipedia, ”CMYK Color Model”, available at wikipedia.org/wiki/Cmyk, 19 December 2006.

[11] Wikipedia, ”Normal Distribution”, available at wikipedia.org/wiki/Normal distribution, 21 December 2006.

[12] ThePowerXChange, available at www.thepowerxchange.com/product 1644 detailed.html, 8 January 2007.

References

Related documents

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

Coad (2007) presenterar resultat som indikerar att små företag inom tillverkningsindustrin i Frankrike generellt kännetecknas av att tillväxten är negativt korrelerad över

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

I regleringsbrevet för 2014 uppdrog Regeringen åt Tillväxtanalys att ”föreslå mätmetoder och indikatorer som kan användas vid utvärdering av de samhällsekonomiska effekterna av

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

• Utbildningsnivåerna i Sveriges FA-regioner varierar kraftigt. I Stockholm har 46 procent av de sysselsatta eftergymnasial utbildning, medan samma andel i Dorotea endast