DIGITAL WATERMARKING TECHNIQUES IN IMAGE PROCESSING

0 downloads 0 Views 10MB Size Report
First, it will be given a short review of image processing and methods of implementation visual information in digital forms. Then, it will be introduced some basic ...
DIGITAL WATERMARKING TECHNIQUES IN IMAGE PROCESSING

by SONYA INNA LYATSKAYA

A THESIS

Submitted in partial fulfillment of the requirements for the degree of Master of Science in the Department of Computer Science in the School of Graduate Studies

Alabama A&M University Normal, Alabama 35762 January 2006

Submitted by Sonya Lyatskaya in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE specializing in SOMPUTER SCIENCE.

Accepted on behalf of the Faculty of the Graduate School by the Thesis Committee:

____________________________________ Dr. Terrance Mizell

____________________________________ Dr. Arjun Tan

____________________________________ Dr. Joel Fu

____________________________________ Dr. Muhammad Ghanbari Major Advisor

____________________________________ Dr. Chandra Reddy Dean of the Graduate School ____________________________________ Date

ii

Copyright by SONYA INNA LYATSKAYA 2006

iii

DIGITAL WATERMARKING TECHNIQUES IN IMAGE PROCESSING Sonya Inna Lyatskaya, M.S. Alabama A&M University, 2006, 140 pp. Thesis Advisor: Dr. Muhammad Ghanbari

Digital watermarking is a modern technology of hiding information inside some digital media: for instance, text, image, video, or audio files. It was developed recently as a new method for copyright protection. This is a technique to insert into digital carrier some authentication data, which could be hardly either to detect or to remove. The carrier conceals secret messages by covering the form of their existence. This information allows ownership to be established and a user or transmitter to be identified. There are some different techniques of watermarking for various media. The main goal of this research is the analysis of techniques of hiding information inside digital images. First, it will be given a short review of image processing and methods of implementation visual information in digital forms. Then, it will be introduced some basic definitions, models and methods of watermarking for digital images, the features and specific algorithms and ways of their implementation, also main challenges and problems. Then, these methods will be implemented using MATLAB and their effectiveness and ability to recover the authentication information after some distortions of the images will be verified. KEY WORDS: image processing, watermarking, steganography

iv

TABLE OF CONTENTS CEFTIFICATE OF APPROVAL ......................................................................... i ABSTRACT AND KEYWORDS ......................................................................... ii LIST OF TABLES .............................................................................................. viii LIST OF FIGURES .............................................................................................. ix LIST OF ABBREVIATIONS .............................................................................. xii ACKNOLEDGEMENTS ..................................................................................... xiii 1. INTRODUCTION ....................................................................................................... 1 1.1. Problem Statement ................................................................................................... 1 1.2 Objective of the Investigation .................................................................................. 3 1.3. A Brief History of Steganography and Watermarking .................................... 5 1.4. Literature Review ................................................................................................... 10 2. WATERMARKING FOR DIGITAL IMAGES .................................................... 13 2.1. Basics of Image Processing ..................................................................................... 13 2.2. Common Image Formats ........................................................................................ 16 2.3. Color Image Structure ........................................................................................... 17 2.4. Watermarking Methods for Images .................................................................... 20 2.5. Applications of Watermarks ................................................................................ 22 2.6. Types and Features of Watermarks ................................................................... 24 2.7. Evaluation of Watermark .................................................................................... 27 3. DISCUSSION AND RESEARCH............................................................................ 30 3.1. Spatial Domain Watermarks ............................................................................... 30 3.1.1. Least Significant Bit Watermark .................................................................... 30 3.1.2. Correlation-Based Methods ............................................................................... 33 3.1.3. The Patchwork Algorithm ............................................................................... 34 3.2. Transform Domain Watermarks .......................................................................... 35 3.2.1. Transforms ......................................................................................................... 35 3.2.2. Fourier Transform ............................................................................................. 37 3.2.3. Discrete Cosine Transform ............................................................................. 40 3.2.4. Mellin-Fourier Transform ................................................................................ 43 3.2.5. Wavelet Transform ............................................................................................ 44 3.3. Implementation of Watermarks ......................................................................... 51 3.3.1. LSB blind image-to-image embedding .............................................................. 52 3.3.2. Implementation of the LSB Non-Blind Method ........................................... 55 3.3.3. Implementation of the Text Embedding Method ......................................... 57 3.3.4. Implementation of the Patchwork Algorithm ................................................. 60 3.3.5. Implementation of Fourier Transform Algorithm ...................................... 63 3.3.6. Implementation of Wavelet Transform Algorithm ........................................ 70 3.4. Testing of Watermarks ........................................................................................ 73 3.4.1. Testing the LSB Watermarks ........................................................................... 74 3.4.2. Testing the Patchwork Watermarks ............................................................... 79 3.4.3. Testing Frequency Domain Watermarks ...................................................... 81 3.4.4. Testing Wavelet Domain Watermarks ............................................................. 83 4. CONCLUSION ........................................................................................................ 84 APPENDIX A. Spatial Domain Watermark Codes .............................................. 86 v

A.1. Image to Image Embedding Procedure, Blind Method .................................... 86 A.2. Image from Image Extracting Procedure, Non-Blind Method .............. 90 A.3. Image to Image Embedding Procedure, Non-Blind Method ............................. 92 A.4. Image from Image Extracting Procedure, Non-Blind Method ....................... 95 A.5. Text to Image Embedding Procedure .................................................................. 97 A.6. Text from Image Extracting Procedure ............................................................ 102 A.7. Patchwork Watermark Embedding Procedure ............................................... 104 A.8. Patchwork Watermark Detecting Procedure .................................................. 107 APPENDIX B. Transform Domain Watermark Codes ........................................... 109 B.1. Frequency Domain Watermark Embedding Procedure ................................. 109 B.2. Frequency Domain Watermark Extracting Procedure .................................. 113 B.3. Wavelet Domain Watermark Embedding Procedure ..................................... 116 B.4. Wavelet Domain Watermark Extracting Procedure ...................................... 119 APPENDIX C. Supplementary Procedures ........................................................... 122 C.1. Opening File ........................................................................................................ 122 C.2. Opening Bitmap Image ........................................................................................ 123 C.3. Opening Watermarked File ............................................................................. 124 C.4. Text to Binary Transform Procedure ............................................................... 125 REFERENCES ........................................................................................................... 126

vi

LIST OF TABLES Table 1. Summary of Possible Perceptibility Assurance Levels .......................... 27 Table 2. Basic Robustness Requirements .................................................................. 29 Table 3. Comparative table of four kinds of watermarks tested ............................... 73

LIST OF FIGURES 1. Visible watermarks from web sites photosearch.com and istockphoto.com ..... 2 2. Digital image structure ......................................................................................... 14 3. The bitmap and grayscale image ......................................................................... 15 4. Resolution of the image ......................................................................................... 15 5. A structure of a color image ................................................................................. 19 6. General digital watermarking and steganography embedding scheme ........... 21 7. Extracting messages and watermarking information scheme .......................... 21 8. The least significant bit embedding technique .................................................... 30 9. Image with the pseudo-random noise embedded ................................................. 31 10. Mellin-Fourier transform and its related invariance properties ................... 44 11. Samples of wavelets ............................................................................................. 45 12. Image decomposition with three scale factors .................................................. 49 13. The grayscale carrier image and the bitmap symbol ....................................... 53 14. The result of image-to-image embedding procedure ...................................... 54 15. The result of image-from-image extracting procedure ................................... 54 16. The result of embedding image into a color image procedure ....................... 56 17. The image for text embedding procedure .......................................................... 58 18. The result of the text embedding procedure .................................................... 59 19. The result of patchwork watermark embedding procedure .......................... 61 20. Embedding patchwork watermark process .................................................... 62 21. Detecting patchwork watermark procedure ................................................... 62 22. Three-dimensional picture of the magnitude domain of frequency transform 64 23. The result of frequency domain watermark embedding procedure ............. 67 24. The result of extracting frequency domain watermark ................................. 68 25. Embedding frequency domain watermark procedure ................................... 69 26. Extracting frequency domain watermark procedure .................................... 69 27. The result of the detecting wavelet watermarks procedure .......................... 72 28. Results of extracting LSB watermark after various distortions ................. 75 29. Results of extracting LSB watermark after various distortions ......................... 76 30. Results of extracting LSB watermark after various distortions ....................... 78 31. Results of extracting frequency domain watermark operation ........................... 82

vii

LIST OF ABBREVIATIONS ASCII - American Standard Code for Information Interchange BMP – Basic Multilingual Plane image format DCT - discrete cosine transform DFT - discrete Fourier transform GIF – Graphics Interchange Format HVS - Human Visual System JPEG (JPG) – Joint Photographic Experts Group image format LPM - log-polar mapping LPM MFT - Mellin-Fourier transform PNG - Portable Network Graphics image format PRN - pseudo-random noise PSNR - Peak Signal-to-Noise Ratio RGB – red-green-blue color model SNR - signal to noise ratio TIFF (TIF) - Tagged Image File Format WT – wavelet transform LSB - the least significant bit

viii

ACKNOLEDGEMENTS

I would like to express my sincere appreciation to the advisory committee members Dr. Terrance Mizell, Dr. Joel Fu, and Dr. Arjun Tan and a special thanks to Dr. Muhammad Ghanbari, my major advisor for serving as a chairperson. Also I would like to express my sincere appreciation to many people who facilitated my research by providing me with documentation, book, necessary information, and opportunities to gain practical hands on experience.

ix

1. INTRODUCTION 1.1. Problem Statement After new technologies of digitizing information were developed, a huge amount of databases of texts, images, scientific data, video, audio files and other digital information had been appeared in the world. With developing network and internet technologies and connecting computers into the World Wide Web, databases became available not only for authorized access but for illegal access also. Much more digital data can be accessed via network nowadays. The problem of data protection is one of the most important, however it is generally understood that, as James Carswell said: “Whenever man comes up with a better mousetrap, nature immediately comes up with a better mouse.” It is impossible to create absolutely perfect protection against all types of intrusion. Therefore, along with enhancing defense methods, developers are discovering new methods of marking their produce placing into digital carrier additional invisible labeling information, so the owner of information could be identified and the ownership could be proven. The methods of coding and hiding information are well known from ancient times as cryptography and steganography. Computerization gives a new life to these techniques. Some special methods were developed for encrypting messages and for hiding information inside other messages or digital carriers. Many computer techniques were developed to make possible successful communication avoiding the third party eyes.

1

Cryptography methods are encrypting information using ciphers; steganography techniques let people to communicate hiding the very fact of communication. The message is hided inside other innocent information such as pictures, video, or audio files. The watermarking technique is a kind of steganography developed especially for possible authentication. This method takes its name from labeling of paper and money because of some similarities with traditional paper-based watermarking. Both of these marking methods change the structure of the carrier itself; they are hardly visible or even invisible. Both are difficult to reproduce and impossible to remove without destroying the carrier itself. Visible digital watermarking is one of the modern widely used techniques. Using this labeling, owners usually show in the picture some special signs, names, and logos, so these signs could be easily noticed. For example, some photo agencies and software developers often add watermarks of a copyright symbol or the agency’s name to previews images, so that the previews can not be used for high-quality copies of the product included with a license. In the Figure 1 there is an example of visible watermarks.

Figure 1. Visible watermarks from web sites photosearch.com and istockphoto.com 2

Invisible watermarking techniques hide some specific copyright, authentication, or other information inside the image for of author’s identification to protect author’s right and restrict the intruder’s ability of unlimited copying and unauthorized using the information. Also, these watermarks might add some other important information, for example, recipient marks to trace the image distribution, hidden annotation, key notes, etc. Simple watermarking helps the owner to keep the ownership information even if the picture was cropped and altered. For this goal, digital watermarking technique was developed as a branch of steganography. Like steganography, watermarking is a relatively new area of computer science related to hiding information in a digital carrier. There are some similarities between steganography and watermarking. Both these methods embed invisible information into digital carriers, though steganography in general related to conceal point-to-point communication between two parties and these methods “are usually not robust against modification of the data, or have only limited robustness and protect the embedded information against technical modifications that may occur during transmission and storage, like format conversion, compression, or digital-to-analog conversion.” [1] Watermarking, on the other hand, has the additional notion of resilience against attempts to remove the hidden data. Thus, watermarking, rather than steganography principles are used whenever the covert-data is available to parties who know the existence of the hidden data and may have an interest removing it. All these methods have their areas of use. In this research, the existing methods will be analyzed and some of them applied in Matlab.

3

1.2 Objective of the Investigation Invisible digital watermarking is comparatively new area of research; however it is useful and important and therefore quickly developed. This research is gives, first, a literature survey of existing digital watermark techniques; second, a practical implementation of some of methods described, third, testing the images with watermarks embedded for the purpose of analyzing different watermarks features. This paper is organized in few sections. The opening parts are introductory. Firstly, a brief history of steganography and watermarking techniques is given followed by a literature review. The third chapter gives several fundamentals of image processing; this part is important for readers who are not familiar with the subject. This part explains what raster image is, then describes methods of digitizing images, and gives some important background definitions such as pixel, resolution, etc. After that, there are explained some common image formats and methods of implementing color pictures. The fourth chapter explains the watermarking technology more fundamentally. Firstly, the embedding and extracting watermark process is described, and then some applications of watermarks, followed by methods, types, and features of watermarks based on various principles, and the description of evaluation of watermark techniques. The fifth chapter is completely dedicated to spatial domain watermarking techniques. Some important and widely spread methods are explained and illustrated, such as the least significant bit technique, patchwork algorithm, and correlation based method; their advantages, disadvantages and use are explained.

4

In the next chapter, the transform techniques are described. Firstly, the transform process explained and then transform domain watermarks are described based on different transforms, such as Fourier transform, Discrete Cosine transform, Wavelet transforms and some others. The next section shows the practical implementation of different types of watermarks using MATLAB. First, some spatial domain watermarks are implemented, and then frequency domain watermarks based on Discrete Fourier transform and Wavelet Transform. The features of each type of watermark is varied, analyzed, and tested to define better characteristics. In the final part, the images with watermarks embedded were tested and distorted in many ways, and then the features and quality of embedded watermarks are analyzed. The surviving abilities of watermarks are verified and the description of the testing process and results are given.

1.3 A Brief History of Steganography and Watermarking History of encrypting and hiding information is very long. There are well-known examples from ancient Greece, Egypt, and middle Ages. There are three the most important branches of encrypted communication known as cryptography, steganography, and watermarking. The word “cryptography” is derived from the Greek ‘kryptos’ which means ‘hidden’, and ‘graphia’, which means ‘writing’. The dictionary defines cryptography as hidden writing. The Ancient Egyptians, Greeks and Romans developed their own systems to encrypt messages using special ciphers for instance by rearranging

5

the order of letters in a message or substituting letters with other letters, signs, or numbers. There is the well-known example brilliantly described by Conan Doyle in The Dancing Men story from The Adventures of Sherlock Holmes. This example shows one of the wide-spread methods of encrypting and decrypting messages. The modern word Cryptography means the art and science of encrypting and decrypting information. Steganography is a term from Greek words ‘steganos’, which means ‘covered’. It is the art of concealed communication. The very existence of a message is a secret. The first examples from ancient Greece were documented by Herodotus. In accordance to his story, the messenger scraped the wax off the tablets and wrote a message on the underlying wood, and then he covered the tablets with wax again. The seemingly blank tablets passed inspection by the sentries without suspicion. Another method used in ancient Greece was to shave the head of a messenger and tattoo a message on his head. After allowing his hair to grow, the message would be undetected until the head was shaved at the recipient’s place. The most common form of invisible writing from ancient times was the use of invisible inks, which darken when heated. This allowed writing hidden messages between the lines of an innocent letter. Common sources for invisible inks were milk, juices and even urine. During the World War II, chemical inks came into use. They had to be developed similar to photographs in a processing lab. Watermarking is also hiding information inside the content, however the purpose is different. This information should not be hided completely; it should be recoverable indicating the owner or the source of this carrier.

6

Historically, watermarks were identifiable images or pattern in paper that appear lighter, darker, or more transparently then other parts of the paper. These watermarks were made by impressing a water-coated metal stamp or dandy roll onto the paper during manufacturing. Watermarks were first introduced in Bologna, Italy in 1282; they have been used by papermakers to identify their product, and also on postage stamps, currency, and other government documents to discourage counterfeiting. Therefore, as we can see, the watermarking is sort of steganography which is not completely concealed but could be recovered for demand and identify the owner. The first example of technology close to the digital watermarking methods was invented by Emil Hembrooke of the Muzak Corporation, when the first patent for “watermarking” was filed. An identification code was inserted in music by intermittently applying a narrow notch filter centered at 1 kHz. “The absence of energy at this frequency indicated that the notch filter had been applied and the duration of the absence used to code either a dot or a dash. The identification signal used Morse code”. [2]. The 1961 U.S. Patent describing this invention states: “The present invention makes possible the positive identification of the origin of a musical presentation and thereby constitutes an effective means of preventing such piracy, i.e. it may be likened to a watermark in paper”. [3] In 1981, an interesting use of hided information was made in England. When some confidential government documents were being printed in newspapers, there were made some attempts to determine the leak of information. Margaret Thatcher arranged to distribute some uniquely identifiable copies of documents to each of her ministers. All copies had the similar text but a word spacing of each paper was different. That was used

7

to encode the identity of the recipient. When the paper was printed in newspaper again, the source of leak was identified. [4]. In 1979, Szepanski [5] described a machine-detectable pattern that could be placed on documents for anti-counterfeiting purposes. Nine years later, Holt described a method of embedding an identification code into an audio signal [6]. In 1988, Komatsu and Tominada have first used the term digital watermark [7]. The first publications that focused on watermarking of digital images were published by Tanaka at al. [8] in 1990 and by Lai [9], Caronni and Tirkel et al. [10] in 1993. Since 1995, interest in digital watermarking is growing up considerably. This topic has gained a lot of attention and has evolved very fast. Many practical working methods and systems have been developed. The First Information Hiding Workshop [11], which included digital watermarking as one of its primary topics, was held in 1996. Some conferences devoted to the subject started in 1999, for example, specifically related to Security and Watermarking of Multimedia Contents [12, 13]. Moreover, a number of organizations began considering watermarking technology for inclusion in various standards. The Copy Protection Technical Working Group [14] tested watermarking systems for protection of video on DVD disks. The Secure Digital Music Initiative [15] made watermarking a central component of their system for protecting music. Two projects sponsored by the European Union, VIVA [16] and Talisman [17], tested watermarking for broadcast monitoring. The international Organization for Standardization took an interest in the technology in the context of designing advanced digital video standards.

8

In the late 1990s several companies were established to market watermarking products. Technology from the Verance Corporation was adopted into the first phase of the Secure Digital Music Initiative and was used by Internet music distributors. In the area of image watermarking, Digmarc bundled its watermark embedders and detectors with Adobe’s Photoshop. First digital steganography messages and invisible watermarks were hidden in so called spatial domain, which means the visual data. It might be just noise embedded into a background of image [18]. There is impossible to detect such messages without computer processing. For example, the simplest invisible watermarks were just added as some additional bits to the original image. Actually, the least significant bits (LSB) were modified. These marks were unable to notice, however they were identifiable in the process of comparing the original image with transformed one. Exploring this technique showed the main problem: the LSB watermark was unable to resist even small distortions of the signal. Therefore, some new techniques were developed. One of the most interesting branches of watermarking was developed when some lossy compression techniques were investigated in image processing in the end of 1990th's. The problem of saving constantly growing amount of digital images finally came to a problem of storage space. After the information theory was developed and applied to image processing, the new methods of image compression were created. The main goal of image compression was to save the same image using less memory space. Therefore, in computer science, data compression is the process of encoding information using fewer bits than an original representation would use, through use of specific encoding schemes. For this goal, the special transformations were successfully applied to

9

images, and some other uses of these transformations were developed also by Cox et al. [19]. One of the very productive uses was watermarking based on transform techniques. These techniques will be explained later in this research.

1.4. Literature Review First publications related to watermarking appeared in the end of 70 th, however, it was only in 1990 that it increased a big worldwide attention. After the first articles, related to spatial domain, such as Spatial method for copyright labeling of digital images by Bruyndonckx [18], the other articles were already related to some transformed domains, such as Secure Spread Spectrum Watermarking For Multimedia by Cox et al. [19] or A New Wavelet-Based Scheme For Watermarking Images by Dugad et al.[20]. The steganography topic was also developed, for example by Rhoads in the articles 'Image Steganography System Featuring Perceptually Adaptive and Globally Scalable Signal Embedding' [21] and Steganography System [22] and others. The topic of robust watermarks was developed, where the marking information was analyzed by distortion the image: for example, applying rotation, crop, and resize. After the first approaches to the topic of hiding information, the first review articles appeared, such as Digital Watermarking: applications, techniques and challenges by R. Barnett [23] and Wolfgang et al Overview of Image Security Techniques with Applications in Multimedia Systems [24]. Some years later more comprehensive monographs of this topic appeared, such as Information Hiding Techniques for Steganography and Digital Watermarking by

10

Katzenbeisser [25]. This book is a high-quality introduction and reference on information hiding, covering the various aspects of the subject, such as pure steganography, public key and secure steganography, current watermarking techniques, etc. By that time, the research area was relatively young; therefore it was serious and helpful work. This still is an excellent introduction to steganography and watermarking. Next, the monograph Digital Watermarking by Cox and Bloom in Morgan Kaufmann Series in Multimedia and Information Systems [26] was published. Digital Watermarking was definitely one of the first books presented unified approach the foundations of digital watermarking. The text is clear and didactic and covers the background concepts on this subject. Watermarking technique is shown with side information, message coding and error analysis. However, the theoretical issues are left for a tiny appendix, and not much use of it is made throughout the book. Though, this is understandable in a book aimed to be a unified introduction to the subject. The book Disappearing Cryptography by Peter Wayner [27] is one of the most popular today. It explains some hiding data and steganographic algorithms, compression and encryption function, hidden bits and other. In general, the introductory parts of each chapter are accessible even to low-educated people; however the mathematics part well developed and understood by people with some background in algebra and statistics. Sample codes and various internet-addresses are provided. Amongst the latest books, this is the broadest description of modern steganography and watermarking techniques. Some recent works emphasized important aspects of the topic, for example, Johnson et al. Information Hiding: Steganography and Watermarking. Attacks and Countermeasures [28]. This book is interesting though might be too much introductory

11

and not much developed. However, the book goes into many important details on the attacks against steganography. As shown above, the watermarking is persistently developed area, therefore, lot of books devoted this topic appears every few years. Despite of well-elaborated books and articles published recent time; this area still needs some additional attention. Watermarking techniques are developing quickly; this is the important, attractive and valuable research area. Some interesting latest achievements are not included into the recent manuscripts and need to be described.

12

2. WATERMARKING FOR DIGITAL IMAGES 2.1. Basics of Image Processing To explain better the principles of watermarking, it is necessary to explain some fundamentals of image processing. There are two basic methods of implementing visual information in digital form: vector and raster. Vector technique is widely used for creating new images. The picture is implemented as a set of vectors which mathematically describe each line, curve, and plane in the picture and their features. The other method, called raster, is related to digitizing some existing images: for instance, photos, paintings, X-ray, UV-images, and other artistic, scientific, and engineering images. This method is created for keeping and managing huge databases of medical, artistic, physics, etc. pictures. In this technique, an image is described as a two-dimensional matrix, each cell of which has coordinates on the plane x and y, so called spatial coordinates, and keeps a value of the amplitude of the signal (Figure 2). For instance, in a grey scale image, the white color dot has maximum value 255, the black one has minimum value 0, and the other levels of grey colors are inside this interval. The square cell of this matrix is a picture element named pixel. Therefore, as we can see, the usual mathematical representation of an image is a function of two spatial variables: f (x, y). The value of the function f at some particular location (x, y) represents the intensity of the image in that point. The plane of the visual information of the image is referred as a spatial domain. 13

Figure 2. Digital image structure. The image is a set of square elements (pixels) which is easy noticeable in the right picture which is the detail of the left picture

The simplest picture (Figure 3, left) consists of black and white colors only and therefore could be described by ones and zeros using one bit for one pixel. The grey-scale image (Figure 3, right) shows up to 256 levels of shadows from black to white; each pixel of such image can be described by one Byte or 8 bits. The color image is created by a combination of three or four matrices; each of these matrices consists of full grey scale image representing the level of specific color in this picture. There are some special devices developed to transform images from real life into digital forms, such as scanners and digital photo cameras. During scanning process, the image has been divided into assigned amount of rows and columns then transmitted dot by dot into a digital carrier forming the matrix. The process of dividing the image on rows and columns is referred as sampling. The value of every pixel is calculated as an average brightness in the pixel rounded to the nearest integer value. This process is usually referred to as amplitude quantization or simply quantization.

14

The amount of pixels in the unit of the measurement is referred as resolution. This parameter defines the quality of the image. The more resolution the image has, the more elements and details could be seeing in the picture, as shown in the Figure 4.

Figure 3. The bitmap image (left) and grayscale image (right)

Figure 4. Resolution of the image (In the left picture, the resolution is four times higher than on the right one) 15

2.2. Common Image Formats There are some wide spread file formats for raster images. All these formats have their features, quality, and uses. The most widely spread formats are BMP, GIF, TIFF, JPEG, and PNG. BMP is an acronym for Basic Multilingual Plane or otherwise known as a Bitmap. BMP is the standard Microsoft Windows format that is not recognized by other computer systems (except within a few programs). GIF is an acronym for Graphics Interchange Format. It is a service mark of CompuServe Incorporated. GIF is probably the most widely used graphics format on the web for small-sized pictures. Both formats support up to 256 colors, however BMP mostly used for black and white pictures (1 bit per pixel). Each pixel in these formats has a defined color. The key disadvantage of these file formats is the limited number of colors. They are mostly used for simple graphics or logos containing few distinct colors and no gradients. Tagged Image File Format (TIFF) was originally developed for scanned images, providing high-quality graphics. It started as a grayscale format and then was transformed for multicolored images. Essentially, the TIFF format contains the maximum number of colors possible and performs very limited compression in a manner that does not affect the quality (so called lossless compression). TIFF is the most universal format which is compatible with a wide range of software applications and can be used across platforms such as Macintosh, Windows, and UNIX. Its format is complex, so files are generally much larger than files of other formats. TIFF is a flexible and extendable format that is supported by a wide variety of platforms and image-processing applications. TIFF files

16

can store images with an arbitrary number of bits per pixel and can employ a variety of compression algorithms. Portable Network Graphics (PNG) is another graphics format which is supported by most major web browsers. PNG uses a lossless compression method like GIF. It has two formats, PNG-8, which supports up to 256 colors, and PNG-24 which supports millions of colors. It has a better compression than GIF, meaning smaller files, without losing information. JPEG and some other formats were developed as a compressed image formats. JPEG is an acronym for Joint Photographic Experts Group. This is the original name of the committee that designed the standard image compression algorithm. JPEG is designed for compressing raster digital images of "natural", real-world scenes. It does not work so well on non-realistic images, such as cartoons, line drawings, black-and-white images, or moving pictures. JPEG is most suitable for images with lots of subtle color variations, such as a photograph. It can contain millions of colors. In the process of JPEG compression, the compressed data is stored as integers but the calculations for the quantization process require floating point calculations which are rounded. Errors of rounding define the characteristic of information loss of this method. JPEG images use the Discrete Cosine Transform technique to achieve image compression.

2.3. Color Image Structure As was shown above, the digitized grayscale image is a two-dimensional matrix. To show any color image in digital form, the two-dimensional matrix is not enough. The

17

first attempts to show colors were done by assigning 16 simple colors. It was good for the beginning; however this method couldn’t show full-colored pictures and provide enough information for art and scientific work. Therefore, some methods were developed where the color image appears as a combination of some matrices to make available as many colors on picture as possible. To describe colors in numbers or provide a physical color match using a variety of measurement instruments, some color models were developed. These models are simply a way of describing color and serve to show, explain, define, and specify color images. In this research, the only RGB color model will be described and used. RGB model was the first model used for digitizing information. However, this method was created earlier for color television. RGB stands for red, green, and blue - the three colors that make up an image on a monitor. This model based on human eye way of vision: the image in the eye is formed by three kinds of cones; each of them is tuned to absorb light from a portion of the spectrum of visible light: green, red and blue. The same way is used to form digital color image in RGB model: the image is separated by three color filters and then by special devices is generated by the same color dots in the screen surface. Therefore, in this model the image is saved as thee matrices, each of which looks like a gray-scale image. Each of these matrices specifies the amplitude of this exact color in each dot of the image. Figure 5 shows the image separated by 3 layers: red, green and blue as it is stored in digital form. RGB color model is an additive model. When the three primary colors, red, green, and blue, are combined together they make a white light; when all colors are absent, there is the black color formed in this place.

18

Figure 5. A structure of a color image. The original image (a) is separated into three layers by filters: red (b), green (c) and blue (d) and stored as 3 grayscale images

There are some other color schemes developed during the long time of the image processing exploring, for instance HUV, CMYK, etc. However, all these models actually not differ much, therefore in this research we decided to develop watermarking only for basic RGB model only.

19

2.4. Watermarking Methods for Images This part has introduced the background information, definitions, requirements and evaluation techniques required for the implementation and evaluation of watermarking. Embedding information into a digital carrier consists of some important steps and has some requirements. Using specific algorithms and keys, the information might be embedded into the image. For example, the picture might be covered invisibly by marks or it might be some text embedded invisibly. There are also more complicated techniques; where various transformation methods might be used. The image might be transformed by wavelet or fast Fourier transform and then the information embedded, after that the image might be transformed back. Actually, for embedding process we need 1) a carrier, 2) a message or another embedding information. 3) an algorithm of the embedding. A carrier is usually is an image, text, r movie file; a message is the information for transmit, for example, an image, text or just some pseudo-noise information. Figure 6 shows the process of embedding stego message or watermark into image. There are many ways to hide invisible information inside a digital image. The resulting image with the secret message inside is ready to be placed into the World Wide Web with some insurance that the author’s rights will not be violated.

20

Message or Watermark

Original Image

Embedding procedure

Stego or Watermarked Image

Stego Key

Figure 6. General digital watermarking and steganography embedding scheme

Figure 7 shows the inverse process. The message or watermark is extracted from the image. There is no necessity to remove watermarks from the picture completely; the owner just need to have a reliable procedure of defining the existence of watermark and extracting the embedded information to prove the ownership.

Stego Key

Stego or Watermarked Image

Decoding procedure

Message or Watermark

Figure 7. Extracting messages and watermarking information scheme

21

In steganographic techniques, the impossibility to detect existence of data and a volume of transmitted information are the most important features. Steganographic messages are typically not robust against alteration of the data, or have limited survival ability against technical modifications that might occur during transmission and storage, like format conversion or digital-to-analog conversion, etc. For watermarking, on the contrary, the survival ability of embedded information is the most important feature; watermarking methods should provide the additional feature of resistance to any alteration, distortion, and attempts to remove embedded information from the carrier. On the other hand, the volume of embedded data is not important. This volume might be much less than in steganography techniques. Therefore, “watermarking rather than steganography principles are used whenever the cover-data is available to parties who know the existence of the hidden data and may have interest removing it” [1, p.98].

2.5. Applications of Watermarks Watermarking can be used in a wide variety of applications; each application has its own demands of robustness, transparency, etc. It is clear that the copyright protection is one of the most important applications of watermarks. The objective is to embed information about the source, mainly a copyright owner, to make easy the owner identification, to give a proof of ownership of digital data by embedding copyright statements, and therefore to prevent other parties

22

from claiming the copyright of the data. It is understandable that such kind of watermarks requires the highest level of robustness. Another important application of watermark is to keep the information about the legal recipient for identifying single distributed copies of data. This type of application is called fingerprinting. This is useful to supervise or trace back illegally produced copies of the data that may circulate. Each copy of the distributed product has its own unique information embedded. Labeling is also a kind of unique watermarking, where the embedded data may contain any information of interest, such as a unique data identifier. This kind of watermark also requires high robustness against malicious attacks and standard data procedures such as compressing, changing a picture type, size, etc. This kind of watermarks is also used in broadcast monitoring, transaction tracking, authentication, copy control, and some forms of device control. It is obvious that for this application the embedded information should be robust against manipulations that may attempt to remove it and against collisions of multiple watermarks embedded. Some important scientific and medical use of watermark is to make a unique identification of data. For example, in medicine, it is very important to mark X-rays and tomography images with patient information on them to prevent any misplace, mistake, and information loss; in astronomy, to embed some unique information into images received from telescope to prevent time, date, and other technical information losses. This application of watermark usually doesn’t suggest any attacks; therefore there is no necessity of high robustness of such watermarks. Such kind of watermarks requires just regular level of robustness against common data processing actions.

23

2.6. Types and Features of Watermarks This section describes some of the current types of watermarks, and defines some commonly used watermarking terms. Some of the different types of watermarks that have been developed in the past few years are listed below: Visible watermarks are designed to be easily perceived by the viewer, and clearly identify the owner; however, the watermark must not detract from the image content itself. Most research currently focuses on invisible watermarks, which are imperceptible under normal viewing conditions. The performance of invisible watermarks can be evaluated on the basis of a small set of properties. Such watermarks could be fragile, semi-fragile, and robust and might have some other features. Robustness describes how well watermarks survive common signal processing operations. Actually, this is a quality of watermark to survive in many alterations of the signal, for example, lossy compression, brightness and contrast enhancing, any geometrical distortions, etc. In general, a watermark must be robust to transformation that includes common signal distortion as well as digital-to-analog and analog-to-digital conversion. Also, a watermark should be resistant to combinations of the same image watermarked with different watermarks which leads to collusion. In addition, a watermark should be robust to repeatedly watermarking in case of forgery [29]. Fragile watermarks are such marks that have very limited robustness. They are designed to be harmed or "broken" under the slightest changes to the image. It made exactly to signify that some alteration and modification was done to the picture.

24

Semi-fragile watermarks are designed to bear some distortions and to break under all changes that exceed a user-specified threshold. Therefore, the fragile watermark is a sort of semi-fragile one with the threshold of zero. Robust watermarks withstand even severe signal processing attacks on an image, such as compression, rescaling, rotating, cropping, etc. [30]. The relative importance of these properties depends on the application for which the system is designed. Transparency is a watermark quality of being perceptibility invisible. This demand is the most challenging for images with large homogeneous areas. Capacity is the feature of allowing embedding the maximum quantity of watermarks. Cox et al [4] discovered that the significant components of an image have a perceptual capacity that allows watermark addition without perceptual degradation. Therefore, any evil attempt to remove or destroy embedded watermarks will influence the significant components of an image thus lead to fidelity degradation. Two common models of embedding are spatial embedding and transform embedding. Spatial watermarks are constructed in the image spatial domain, and embedded directly into an image's pixel data. Spectral or transform-based watermarks are incorporated into an image's transform coefficients such as Fourier, Discrete Cosine, and Wavelet Transforms [31]. Image-adaptive watermarks are usually transform-based, and very robust. They locally adapt the strength of the watermark to the image content through perceptual models for human vision. These models originally developed for image compression. Blind (also called oblivious, public, or complete) watermarking techniques can perform verification of the mark without use of the original image. Other techniques rely

25

on the original to detect the watermark. Many applications require blind schemes; these techniques are often less robust than non-blind algorithms [30], [32]. There are some reasons of authentication without using original sources; the main is that searching for the original image in large digital libraries is time consuming. There are two major blind watermarking schemes [33]: source-based and destination-based. The source-based approach focuses on ownership authentication or identification. A unique watermark is detected or extracted to determine the owner of data. It is desirable to confirm ownership by retrieving the watermark without the original image. The destination-based method can be used to trace the end-user in case of illegal use, for instance, reselling, multiple unauthorized copying, etc. Private watermarking (also called non-blind watermarking) techniques rely on the original to detect the watermark. There is also semiprivate (or semi-blind) watermarking which use some combination of blind and non-blind techniques. Nevertheless, even some watermarking could be removed from the picture. It is generally understood that people, who are able to steal the pictures, might be able to remove the watermarks or claim that these watermarks are theirs. This is important to keep all copies of the picture including the original one and the other copies with the watermarks. Therefore, if the author has the best copy without marks on it and the copy with mark on it the ownership can be proven easily.

26

2.7. Evaluation of Watermark There were some metrics developed for the evaluation of watermarking techniques. Some of them pretty simple and obvious, for example, capacity can be easily evaluated by the number of bits per the area covered by watermarks. Evaluating perceptibility and robustness is more difficult. Petitcolas and some other developers propose the scheme listed below in a Table 1 for the evaluation of perceptibility [34].

Level of Assurance

Low

Moderate

Moderate High

High

Criteria

Peak Signal-to-Noise Ratio (PSNR), Slightly perceptible but not annoying

Metric Based on perceptual model, Not perceptible using mass market equipment

Not perceptible in comparison with original under studio conditions

Survives evaluation by large panel of persons under the strictest of conditions.

Table 1. Summary of Possible Perceptibility Assurance Levels 27

In the Table 1, the only parameter which can be mathematically defined and calculated is PSNR, Peak Signal-To-Noise Ratio [35]

Actually, there are no good thoroughly defined metrics which could take the effect of the Human Visual System (HVS) into account. PSNR could only give a rough approximation of the quality of the watermark. Further levels of evaluation rely strictly on observation under varied conditions, as shown in the Table 1. Petitcolas also provided with a rough set of reliability or robustness metrics, shown in the Table 2. In accordance to [34], the low level is the minimum requirements that a watermark must meet to be accepted as practical. Watermarks at this level should be resistant to common alterations that non-malicious users with inexpensive tools might do to pictures. To alter the image with increased robustness, it is necessary to have more specific tools and more detailed knowledge of the watermarking. The watermarks which are impossible to remove or disable computationally or mathematically using any tools are in the very top level of this scale.

28

Level Zero

Low Level

Moderate

100 – 90

100 – 75

100 – 50

Color Reduction (GIF)

256

256

16

Cropping

100 - 90%

100 – 75%

100 – 50%

Gamma Correction

0.7 – 1.2

0.5 – 1.5

Scaling

1/2 – 3/2

1/3 – 2

Rotation

+/– 0 – 2 deg.

+/– 0 – 5 deg. 90 deg.

Horizontal Flip

Yes

Yes

Uniform Noise

1 – 5%

1 – 15%

Contrast

+/– 0 – 10%

+/– 0 – 25%

Brightness

+/– 0 – 10%

+/– 0 – 25%

Standard JPEG Compression Quality

Median Filter

3×3

Table 2. Basic Robustness Requirements

29

3. DISCUSSION AND RESEARCH 3.1. Spatial Domain Watermarks 3.1.1. Least Significant Bit Watermark

LSB algorithms exploit the mathematical description of the image. Each picture is a matrix of numbers which represents the level of shade or light in the pixel. However, the number of these levels usually higher than human eyes can detect, therefore, insignificant changing of these levels could not be noticed by eyes but might be easily computed. Modulating the least significant bit does not result in a human-perceptible difference because the amplitude of the change is small [36]

Binary representation

Binary representation

of the original image

of watermarked image

1010 1010 1010 1011

LSB Replace

1011 1111

1

1010 1011

1

1010 1011

0

1011 1110

Figure 8. The least significant bit embedding technique

30

There are some variants of the LSB embedding, for instance, embedding a text, an image or just simple noise-like information, for instance a structure of so-called dirty paper. In any case, the embedded information is transformed into a binary sequence, and then this sequence bit by bit replaces LSB’s of pixels in the carrier image, see Figure 8. The most widely spread method is generating and embedding a pseudo-random noise sequence recognizable by owner’s computer. Some number of invisible dots were added into the picture. “Various technologies, such as direct replacement of the cover LSBs with message bits or an arithmetic combination between the two are used” [37]. This method doesn’t change the statistical representation of the image; therefore the watermark could not be detected statistically (Figure 9).

Figure 9. Image with the pseudo-random noise embedded (right) is the result of sum of the original image (left) and the pseudo-random noise structure (middle).

The text embedding procedure is the same: the text is transformed into a binary sequence and then added to a carrier picture. Embedding images is also possible if such images are pretty simple, for example, binary. A bitmap image consists of black and white pixels only; therefore it might be described by one-bit element matrix which can be

31

easily added to the LSB of the carrier image. The other images could be embedded after decreasing the number of levels of gray shades in the image. The LSB method practically achieves both high load and low perceptibility. Some simple watermarks may survive several geometrical transformations such as rotating and cropping. However, actually the LSB methods have a serious drawback. Any even insignificant changing of the amplitude of the signal will change LSB plane first, therefore any brightness and contrast alteration might destroy all the LSB watermarks. There are some other distortions, for instance, addition of noise, lossy compression, or resizing, might break the LSB watermark either. Therefore, such watermarks are vulnerable to many kinds of distortions. Sometimes, it is not important, whether the intruder is able to detect watermark existence in the image or not; if a burglars suspect a watermark existence in the image, they can provide a set of attack procedures which could easily destroy most of LSB watermarks if any. And one of the simplest and the most effective attacks is just removing (zeroing) the entire LSB plane with very little change in the perceptual quality of the modified stego-image [38. p. 3]. Nevertheless, there is the very important advantage of this method: the very high load. Using a standard ASCII 7 bit code for embedding one letter, a user can embed a big article into one picture. For example, using a color image screen size (1270x900), which consists of three grayscale matrix, it is possible to embed the whole big book ‘The Hound of Baskervilles’ by Conan Doyle into one picture, because this book consists of 315,572 letters with spaces at all. Therefore, as we can see, this method is very useful for steganography if there is a way to avoid distortions, standard alteration by compression and malicious attacks.

32

3.1.2. Correlation-Based Methods Correlation based method is a widely used spatial domain technique. Correlation properties of additive pseudo-random noise (PRN) patterns applied to an image [39] used as a major indicator which shows the watermark existence. A pseudo-random noise pattern Noise(x,y) is added to the cover image Image(x,y), according to the equation:

ImageNoise(x, y) = Image(x, y) + k* Noise(x, y); where k signifies a gain coefficient and ImageNoise is the resulting watermarked image. Increasing k increases the robustness of the watermark but decreases the quality of the image because the higher the amplitude of the embedded noise signals the more noticeable this noise is. For the watermark extracting, this PRN generator algorithm creates the same key sequences, and then the correlation between the noise pattern and the picture is calculated. If the correlation coefficient goes over a certain threshold, the watermark is considered as detected. There are some ways to increase the robustness and effectiveness of the PRN algorithm. For example, two separate pseudo-random noise patterns were created for two levels: one pattern is designated a logical “1” and the other a “0”. Therefore, the concept of a threshold can be eliminated. The embedding process then is completed once for each pattern, and the pattern with the upper resulting correlation is applied. This method enhances the probability of a proper detection, even after some distortions and alterations of the image were applied [39]. Advanced improvement of the method is achieved by some foregoing groundwork procedures applied before the embedding process. For example, filtering the 33

original image before applying the watermark can decrease the correlation coefficient between the image and the noise pattern. Such method increases the resistance of the watermark to additional noise.

3.1.3. The Patchwork Algorithm One of the simplest and yet effective spatial domain watermark algorithm was proposed in 1995 by Bender et al [40]. This algorithm is not for embedding the informative message; this method simply allows the question to be answered: “Does this person know the key which was used to embed and build a watermark?” [1, p. 123]. In the patchwork algorithm, a secret key is used to initialize a pseudorandom number generator which outputs the locations of the cover which will host the watermark. The basic version of the patchwork algorithm can be summarized as follows. In the insertion process, the owner selects n pairs of neighboring pixels pseudorandomly according to a secret key. Let’s describe the value of a pixel as f(xi, yj), then the pair of neighboring pixels should have the same y therefore, the pair of pixel could be described as f(xi) and f(xi+1). The owner modifies the luminance these values f(xi), f(xi+1) of the n pairs of pixels by using the following formula:

fm(xi) = f(xi) + 1 fm(xi+1) = f(xi+1) – 1 Therefore, the algorithm simply takes some pairs (vertically or horizontally located) and then adds 1 to the one pixel of the pair and subtracts 1 from the other neighboring pixel. Then the sum is calculated: 34

S = ∑ (fm(xi, yj) - fm(xi+1, yj)) If the image actually contained a watermark, we can expect the sum to be 2n, otherwise it should be close to zero:

∑ (f(xi) - f(xi+1)) ≈ 0 This algorithm creates a watermark independently of the cover image, and it uses blind detection, so the detector doesn’t require the original cover image to determine whether the image has been watermarked or not.

3.2. Transform Domain Watermarks 3.2.1. Transforms The main benefit of the spatial domain watermarks is simplicity; however this is the main drawback either. The watermark could be easily embedded into the picture and easily altered or even destroyed by malicious attack. There are many other limitations of the spatial domain information. Earlier developers of watermarking algorithms tried to avoid the disadvantages of this domain and apply new methods. Transform domains have been extensively studied in the context of image coding and compression, and a lot of research results seem to be very applicable to digital watermarking [41]. Transform domains watermarks are more complex than spatial domain ones; the image goes through complicated mathematical conversions to obtain the result which helps to achieve important benefits. It might be eliminating of redundant information to

35

save the image in more compact way like in data compression, or on the contrary adding some hidden information like in a case of embedding watermarks. The term transform refers to an alternative representation of a function. Mathematically, transform can be defined as an operator that maps a function from one functional space to another. Functionally, it is defined as an operation that associates a real number to every function from a selected class. Integration and differentiation are some examples of transforms. This term was introduced in the early 1800s by French mathematician Joseph Fourier. Transforms are useful for a wide range of purposes. Since the transforms were applied into image processing, many advantages of using this domain became obvious, including convolution, enhancement, feature detection, compression, and lately, the watermarking. In 1995-1996 Cox at al proposed the invisible robust watermarks based on transforms [20], [42], [38]. They insert watermark into the spectral components of the image using methods equivalent to spread spectrum communications. Since that time, many transforms were researched and some of them applied to watermarking such as discrete Fourier transform (DFT), the full-image (global) discrete cosine transform (DCT), the block-based DCT, the Fourier-Mellin transform, or wavelet transform (WT). From theory of image coding we know that in most images the colors of neighboring pixels are highly correlated. Mapping into a specific transform domain, such as DCT or WT, serves two purposes. It should de-correlate the original sample values and it should concentrate the energy of the original signal into just a few coefficients. For example, when a typical image is mapped into a spatial-frequency domain, the energy is concentrated in the low-index terms which are very large compared to the high-index

36

terms. This means that the low-frequency components are usually dominated in a common image. “Those low frequencies represent the overall shapes and outlines of features in the image, and its luminance and contrast characteristics. High frequencies represent sharp edges and crispness in the image, but contribute little spatial-frequency energy. As an example, a typical image might contain 90% of the energy in the lowest 5% of the spatial frequencies of the two dimensional DCT domain. Retention of these DCT components, together with sufficiently many higher frequency components to yield an image with enough sharpness to be acceptable to the human eye, was the objective for creation of an appropriate quantization table to be used for JPEG compression” [41, p.6].

3.2.2. Fourier Transform Fourier transform in image processing is one of the popular and widely used transforms. Fourier transform is a representation of an image as a sum of complex exponentials of varying magnitudes, frequencies, and phases. Most information about any typical image is contained in the phase, and the DFT magnitude coefficients convey very little information about the image [41]. The basic Fourier transform converts a signal into a continuous series of sine waves, each of which is of constant frequency and amplitude and of infinite duration. In contrast, most real-world signals (such as music or images) have a finite duration and abrupt changes in frequency. The Fourier transform is a representation of an image as a sum of complex exponentials of varying magnitudes, frequencies, and phases. The Fourier transform

37

plays a critical role in a broad range of image processing applications, including enhancement, analysis, restoration, and compression [44]. If f(m, n) is a function of two discrete spatial variables m and n, then the twodimensional Fourier transform of this function is defined by the relationship: ∞ ∞ F(ω 1, ω 2) = Σ Σ f(m, n) e – j m=-∞ n=-∞

ω

1

m

e –j

ω

2

n

The variables ω 1 and ω 2 are frequency variables; their units are radians per sample. F(ω 1,ω 2)

is often called the frequency-domain representation of f(m,n).

F(ω 1,ω 2) is a complex-valued function that is periodic both in ω 1 and ω 2, with period 2π. Because of the periodicity, usually only the range –π ≤ ω 1 ≤ π and –π ≤ ω 2 ≤ π is displayed. The inverse two-dimensional Fourier transform is given by

φ(µ, ν) = 1/4 π ∫ 2

π π ∫ Φ(ω , ω ) ε ω =−π ω =−π 1

1

2

ϕ ω µ 1

ε

ϕ ω

ν 2

δω δω 1

2

2

Actually, this equation means that f(m, n) can be represented as a sum of an infinite number of complex exponentials (sinusoids) with different frequencies. The magnitude and phase of the contribution at the frequencies ω 1, ω 2 are given by F(ω 1, ω 2). However the more useful form in image processing is the Discrete Fourier transform (DFT) because mathematically this method is much easier for implementation. M- 1

F(k, p) = b Σ m=0

N-2

Σ

f(m, n) e – j

n=0

with b = ( N * M ) -1/2 38

2 π

mk/M

e –j

2 π

np/N

Then the inverse DFT (IDFT) is given by Μ − 1

f(m, n) = b Σ k=0

Ν − 2

Σ

f(k, p) e j m k / M e j 2π



np/N

p=0

Adding a watermark to the phase of the DFT, as it was proposed in [45], makes the robustness of the watermark much stronger since any alteration of those visually vital image components will considerably damage the image and decrease the quality of it in an attempt to remove the watermark. Moreover, communication theory establishes that modulating phase is more resistant to noise than modulating amplitude. In addition, the phase based watermarks is relatively robust to changes in image brightness and contrast. Another way to embed watermark into DFT domain is to use magnitude coefficients ignoring phase [41]. DFT magnitude coefficients express very little information about an image and because of it embedding watermarks shouldn’t bring a noticeable degradation of the image. On the other hand, modifications of the DFT magnitude coefficients are much less perceptible than phase modifications; therefore, most image compression techniques pay more attention to save DFT phase components than magnitude coefficients, leaving the DFT magnitude based watermarking system might be more vulnerable to image compression. However, in the [41] proposed that all major schemes, such as JPEG and MPEG, preserved the magnitude coefficients as well as the phase components. The additional reason for using the DFT magnitude domain for watermarking is its translation or shift invariant property. “A cyclic translation of an image in the spatial

39

domain does not affect the DFT magnitude, and because of that the watermark embedded in the DFT magnitude domain will be translation invariant” [43]. Image translation, as well as image scaling and rotation, usually don’t influence a perceived image quality. However, translation or any other geometrical transformation de-synchronizes the image and therefore makes the watermark undetectable without reverse transformation. To make the watermark detectible again after applied geometrical modifications, the watermark needs to be re-synchronized. This synchronization process consists of wide-ranging scanning a large space that covers all possible location translation offsets, all possible angles of rotation, and also probable scaling factors. An alternative idea is to avoid synchronization search and even a necessity of it by transforming the image into a new workspace which is invariant to specific geometrical transformations and then use this space as a working domain for embedding the watermark. This idea will be explained later in the chapter about Mellin-Fourier transform.

3.2.3. Discrete Cosine Transform DCT is widely studied and has been used extensively for embedding a watermark for some important reasons. First of all because DCT is basic transform for the most popular methods of data compression such as JPEG and MPEG algorithms. This transform is useful for transferring multidimensional data to DCT frequency domain, where different operations, like spread-spectrum data watermarking, can be performed easier and more efficiently. A countless number of papers discussing DCT algorithms is strongly witnessing about its importance and applicability. 40

In watermarking, this transform is useful because it uses the same mechanism that compression uses. The DCT brakes up the image into different frequency bands, making it much easier to embed watermarking information in the visually important low to middle frequency transform bands. Sensitivities of the human visual system to changes in those bands have been extensively studied in the context of JPEG compression, and the result of those studies can be used to minimize the visual impact of the watermark embedding distortion [41]. Moreover, since the JPEG compression and watermarking algorithms use the same DCT decomposition, it makes possible to integrate watermarking with image coding or at least to avoid over-exposing watermark to removal through compression and noise attacks which mainly make effect in high frequencies [9] Moreover, in the DCT case, the watermarks could be even embedded directly into the compressed domain. Therefore, the owner can create very robust watermarks which survive JPEG compression alterations. The JPEG attacks could be prevented more effectively. An effective solution for watermarking in global DCT domain was introduced by Cox et. al [20]. This method based on spread spectrum algorithm. General spread spectrum system spreads a narrow band signal over a much wider frequency band so that the signal to noise ratio (SNR) in a single frequency band is low and looks like noise to an outsider. Though, a legitimate receiver with exact key information of the spreading function is able to extract the transmitted signal. Moreover, spreading the watermark signals over significant frequency bands, makes the single signal appears feeble and undetectable, making the watermark undetectable either. However, knowing the location and content of the watermark, allows

41

applying accumulative algorithm, so multiple single feeble watermark signals become concentrated into a strong and single output with high watermark to noise ratio. In this algorithm, the watermark is embedded in the first n lowest frequency component C = {ci}n1 of a full picture DCT to afford high level of robustness to JPEG compression. The watermark consists of a sequence of real number W = {wi}n1 drawn from a Normal distribution N(0,1), and it is embedded into the image using the formula ĉi = ci(1 + swi) where s is the watermark embedding strength factor. Watermark detection is performad using the following similarity measure: sim(W, W’) = W * W’ / ( √ W’ * W’) where W’ is the extracted watermark, calculated as: {wi’}1n = {( ĉi / c – 1) / s}1n where ĉi components are extracted from the original cover image. The watermark is considered as detected in the received image if sim(W, W’) is greater than some definite threshold. As we can see, in this case, the process of detecting and extracting watermarks W’ requires both the watermarked image and the original image. The original image is necessary for calculation of the extracted watermark; it is used as part of the watermark presence test. Therefore this watermarking system falls into the category of non-blind or private systems. The strength coefficient s is selected empirically to spread the watermark across 1000 lowest frequency DCT coefficient. Robustness test showed that this scheme is

42

robust to JPEG compression to the quality factor of 5% dithering, fax transmission, printing and photocopy scanning, multiple watermarking and collision attacks [41].

3.2.4. Mellin-Fourier Transform Most watermarking techniques have troubles in extracting watermarks after some geometric transformation has been applied on the watermarked image. To overcome this disadvantage, Ó Ruanaidh et al. [46] have introduced the use of the Mellin-Fourier transform (MFT) for watermarking. The transform space of MFT is based on translation property of the Fourier transform: f (x + a, y + b) ↔ F(k, p) e –j (a k + b p) We can see that only the phase is altered by translation. Consequently, if the space in which watermark will be embedded is limited to the subspace related to the amplitude of the Fourier transform, it will be insensitive to a spatial shift of the picture. In order to become insensitive to rotation and zoom, let us consider the log-polar mapping (LPM) defined as follows (x, y)



. x = e ρ cos θ / with ρ ∈ R and θ ∈ [0, 2π] 1 y = e ρ sin θ

It is evident that the rotation of any element (x, y) in the Cartesian coordinate system will result in a translation in the logarithmic coordinate system. Similarly, a zoom will result in a translation in the polar coordinate system, see Figure 10.

43

DFT -1

Invariant space for: Translation, Rotation, Zooming

LPM -1

Phase

DFT -1 Image

Phase

DFT

LPM

Amplitude

DFT

Amplitude

Figure 10. Mellin-Fourier transform and its related invariance properties [1, p.127]

3.2.5. Wavelet Transform With development of JPEG-2000 standard of compression, the wavelet transform (WT) turned out to be more attractive that DCT-based compression, therefore, wavelet domain became a focus for watermarking research either. The advantages of using the WT domain are essential robustness of the algorithm to the JPEG-2000 lossy compression, and possibility of significantly reducing computation time by embedding watermarks inside of a JPEG-2000 encoder. WT is bounded in both frequency and duration. Wavelet transforms provide an alternative to more traditional Fourier transforms used for analyzing waveforms. Wavelet transforms convert a signal into a series of wavelets. In theory, signals processed by the wavelet transform can be stored more efficiently than ones processed by Fourier transform. Wavelets can also be constructed with rough edges, to better approximate real-world signals. Historically, wavelet analysis is a new method, though its mathematical underpinnings date back to the work of Joseph Fourier in the nineteenth century. Fourier 44

laid the foundations with his theories of frequency analysis, which proved to be enormously important. The attention of researchers gradually turned from frequencybased analysis to scale-based analysis when it started to become clear that an approach measuring average fluctuations at different scales might prove less sensitive to noise. The first recorded mention of what we now call a "wavelet" seems to be in 1909, in a thesis by Alfred Haar. The concept of wavelets in its present theoretical form was first proposed by Jean Morlet and the team at the Marseille Theoretical Physics Center working under Alex Grossmann in France. The methods of wavelet analysis have been developed mainly by Y. Meyer and his colleagues, who have ensured the methods' dissemination. The main algorithm dates back to the work of Stephane Mallat in 1988. Since then, research on wavelets has become international. Such research is particularly active in the United States, where it is spearheaded by the work of scientists such as Ingrid Daubechies, Ronald Coifman, and Victor Wickerhauser. Barbara Burke Hubbard describes the birth, the history, and the seminal concepts in a very clear text. See "The World According to Wavelets, 1998 [47]. Figure 11 shows the examples of some wavelets.

Figure 11. Samples of wavelets

45

Technically speaking, the WT consists of multi-scale spatial-frequency decomposition of the image and provides multi-resolution representation of an image. This characteristic could be used to create more efficient watermark detection methods. For example, the detection procedure starts from the low-resolution sub-bands, and then if the detection in these sub-bands fails, the higher resolution sub-bands are taken. This feature makes WT very useful specifically for watermarking. Let’s consider the image f(x, y) of size M × N. Its discrete transform T(u, v, …) can be expressed in terms of general relation: T(u, v, …) = Σ x, y f(x, y) g u, v… (x, y) where x and y are spatial variables and u, v, … are transform domain variables. f(x, y) could be obtained using the generalized inverse discrete transform f(x, y) = Σ u, v, … T(u, v, …) h u, v… (x, y) The gu,v,… is called forward transformation kernel and hu,v,… is inverse transformation kernel. They determine the nature, computational complexity, and ultimate usefulness of the transform pair. Transform coefficients T(u, v, …) can be viewed as the expansion coefficients of a series expansion of f with respect to {hu, v, …}. The inverse transformation kernel defines a set of expansion functions for series expansion of f [43]. The DFT fits this series expansion formulation well. In this case h u, v (x, y) = g* u, v (x, y) = (MN) – R /2 u = 0, 1, … M – 1;

where R = e j 2 π (ux/M + vy/N)

v = 0, 1, … N – 1.

46

and

*

is the complex conjugate operator. Transform domain variables u and v

represent horizontal and vertical frequency respectively. The kernels are separable: hu, v(x, y) = hu(x) hv(y); for hu(x) = M -R1/2

hv(y) = N -R2/2

R1 = e j 2 π ux/M

R2 = e j 2 π vy/N

and orthonormal since the inner product is 〈hr, hs〉 = δr, s = { 1 if r = s and 0 otherwise } The separability of the kernels simplifies the computation of the two-dimensional (2-D) transform by allowing row-column or column-row passes of a one-dimensional transform (1-D) to be used. Orthonormality causes the forward and inverse kernels to be the complex conjugates of one another. While the DFT can be completely defined by two straightforward equations and uses a single pair of transformation kernels, the discrete wavelet transform (DWT) refers not to a pair of equations but to a set of unique transformations; we can not write a single equation that completely describes them all. Instead, we can characterize each DWT by a transform kernel pair or set of parameters that defines the pair. The various transformations are related by the fact that their expansion functions are small waves or wavelets of varying frequency and duration. Figure 12 shows image decomposition with three scale factors. The lowest frequency band at the lowest scale factor is found in the top-left corner LL. At the same resolution level, the block HL contains information about the highest horizontal and lowest vertical frequency band. Similarly, the block LH contains information about the

47

lowest horizontal and the highest vertical frequency band at the lowest scale factor. The same process is repeated for the intermediate and highest resolution levels.

Figure 12. Image decomposition with three scale factors

One way to construct these different levels of resolution is to cascade two-channel filter banks and a down-sampling process as suggested in figure 12. The two-channel filter banks must be orthogonal and are defined by the equations H(ω) = ∑ h k e –j k

ω

high pass

G(ω) = ∑ g k e –j k

ω

low pass

k

k

48

Then the iterative process of the decomposition is given by c j – 1, k = ∑ h n - 2k c j, n n d j – 1, k = ∑ g n - 2k c j, n n where the iterative reconstruction process is defined by c j, n = ∑ h n - 2k c j - 1, k n

+ ∑ g n - 2k d j - 1, k n

There were many efforts in using the WT in watermarking. Wang and Kuo [48] recommend a multi-threshold wavelet coding scheme allowing significant coefficient searching. They assume that these coefficients do not vary much after some signal processing procedures. Moreover, if these coefficients lose their fidelity significantly, the reconstructed image could be perceptually different from the original one. In the opposite to the methods which choose a predefined set of coefficients, the resulting method is image dependent. Therefore, this method is suitable for textured and smooth images. Kundur et al. [49] describe a watermarking method using wavelet-based synthesis. It consists in adding wavelet coefficients of the watermark and the image at different resolution levels. First, the wavelet coefficients of the watermark are modulated using a human visual-model constraint based on a measure called saliency and then added to the image [50]. Xia et al. [51] offer a hierarchical watermark extraction procedure based on wavelet transformation for saving computational load if the deformation of the watermarked image is not severe. The main concept is to decompose the received image and the original one with the discrete wavelet transform (DWT) into four bands. Then, 49

they compare the watermark added in the HH1 band and the difference of the DWT coefficients in HH1 bands of the received and the original images by calculating they cross correlations. If we can distinguish a peak in the cross correlations, the watermark is detected, otherwise they consider the other bands at the same level, i.e. HL1 and LH1. In case the watermarks can not be noticed, they compute a new level of the DWT and make a new attempt to detect watermarks for a second time. This procedure is executed until the watermark is detected or the last level if the DWT has been achieved. Zhu et al. [52] proposed a unified approach to digital watermarking of images and video based on the two-dimensional (2D) and three-dimensional (3D) DWT. This method is close to the Cox et al [20] described above, however, there is a difference. Zhu algorithm generates a random vector with N(0,1) distribution and spreads it across coefficients of all high-pass bands in the wavelet domain as a multi-resolution digital watermark, while Cox algorithm does it only across a small number of perceptually most important DCT coefficients. The watermark is implemented into a lower resolution and represents a nested version of the corresponding to a higher resolution, and the hierarchical organization of the wavelet representation allows detection of watermarks at all resolutions except the lowest one. The ability to detect lower resolution watermarks reduces computational complexity of watermarking algorithm because fewer frequency bands to image down sampling operation by power of two in either space or time [43].

50

3.3. Implementation of Watermarks For experimental testing, there are some methods are selected: LSB technique and patchwork algorithm for spatial domain watermark and Fourier and wavelet transform based watermarks for frequency domain embedding. The LSB embedding is implemented in few variants: image-to-image embedding using blind and non-blind technique, then text-to-image embedding. Then the patchwork algorithm implemented and tested. For the frequency domain watermark, first Fourier transform watermark was implemented with embedding watermark into a magnitude transform domain. Then, the wavelet transform using Haar decomposition with watermark embedded was used.

51

3.3.1. LSB blind image-to-image embedding In the blind scheme, the embedded watermark could be extracted without using the original image. As a preoperational process, we need to arrange the image in such way to be able to take out the information without using the original cover picture. In this case all least significant bits in the image are zeroed. After that, these matrices we can cover by the watermarks information. It might be a bitmap image, a text transformed into binary sequence, or noise-like binary sequences. Evidently, that in this case we need just to add ones from binary sequences to image pixel values; while zeroes had left as zeroes. The steps in the algorithm of watermark embedding can be described as shown below:

Embedding Algorithm Description: 1. Analyzing the carrier image: grayscale (1 matrix) or color (3 matrices) 2. Preprocess a carrier image: the LSB’s zeroed for all matrices. 3. Preprocess the watermarking image: the matrix of carrier image size is tiled by bitmap images. In the case of color image, there are three tiled matrices formed with bitmap image with 5 pixel shift between them to avoid visually noticeable effect on watermarked image. 4. Bitmap matrices added to carrier matrices. 5. Saving the resulting watermarked image with new name.

Extracting Algorithm: 1. Extracting the least significant bits from the image matrix (or matrices) and placing them to the same position in the same size matrix 52

2. Transforming the resulting matrix (matrices) into logical image 3. Showing the resulting image

Experimental Data: As a watermark image, the symbol of Alabama A&M University size 150 x 179 pixels was used (aamu1.bmp, Figure 12, right) and the image of the engineering building of AAMU as a carrier picture 502 x 372 pixels (bg.bmp, Figure 12 left):

Figure 13. The grayscale carrier image and the bitmap symbol

The code of the blind embedding is in the Appendix A.1. After running the procedure, the image in the screen appears:

53

Figure 14: The result of image-to-image embedding procedure

The image with the embedded pattern (Figure 14, middle) looks the same like the original one (left). The difference is impossible to notice by eyes however in the right picture we can see the difference between the original and modified pictures. As we can see, the embedded symbols tile the entire image surface. The number of embedded symbols depends on the size of the original image and the size of the embedded one: how many images could cover the surface of the image.

The extracting procedure is given in A.2. Figure 15 shows the result.

Figure 15. The result of image-from-image extracting procedure

54

3.3.2. Implementation of the LSB Non-Blind Method In non-blind scheme, to extract watermark from the carrier image, we need to use the original one. In this case we don’t need the preoperational zeroing LSB process; we just can add the bitmap image into the covering one. The steps in the algorithm of blind method of watermark embedding can be described as shown below:

Embedding Algorithm 1. Analyzing the carrier image: grayscale (1 matrix) or color (3 matrices) 2. Preprocess the watermarking image: the matrix of carrier image size is tiled by bitmap images. In the case of color image, there are three tiled matrices formed with bitmap image with 5 pixel shift between them to avoid visually noticeable effect. 3. Watermark matrices added to carrier matrices. 4. Saving the resulting watermarked image with new name.

Extracting algorithm 1. Opening the supposedly watermarked image 2. Opening the original image 3. Extract the original image from the watermarked one 4. The resulting matrix transformed into a logical image and shown in the screen. The code of the non-blind embedding is in the Appendix A.3. (embedding procedure) and A.4. (extracting procedure). For the demonstration, the color image of AAMU was used: b.bmp. The results of these procedures are analogous to the previous one; however it demonstrates the feature of three-matrix RGB color structure (Figure 16). 55

Figure 16. The result of embedding image into a color image procedure

56

3.3.3. Implementation of the Text Embedding Method The steps in the algorithm of stego text embedding can be described as under:

Embedding Algorithm 1. Analyzing the carrier image: grayscale (1 matrix) or color (3 matrices) 2. Preprocess a carrier image: LSB zeroed for all matrices. 3. Preprocess the text: it was opened and transformed into a binary sequence using the standard 7-bit ASCII codes for alphabet and other symbols. 4. The finishing code sequence is added into the end of stego message 5. Bitmap sequence added successively to carrier matrices 6. Saving the resulting watermarked image with a new name 7. The resulting image or images are shown in the screen

Extracting algorithm 1. Extracting the least significant bit from the image matrix (or matrices) 2. Transforming the resulting matrix (matrices) into logical sequence 3. Decoding the sequence by standard ASCII 7-bit code into the text 4. If the finishing symbol is found, the extracting stopped. 5. Saving the text extracted.

57

Experimental Process The code of the text embedding is in the Appendix A.5. (embedding procedure) and A.6 (extracting procedure). Supplementary procedure of text to binary sequence transformation is in C.4. For the text embedding the image b3.tif was used. Size: 1200 x 900 pixels, RGB color scheme. The text used is ‘The Hound of the Baskervilles’ by sir Arthur Conan Doyle was used from Free Online Library http://www.thefreelibrary.com/ http://doyle.thefreelibrary.com/The-Hound-of-the-Baskervilles The text was placed is saved as a notebook text file hound.txt (size 315 kB). In the Figure 15 we can see the result of the procedure tem.m. We can see that the text actually is embedded into first 2 color matrices and 10% of the last one.

Figure 17. The image for text embedding procedure 58

Figure 18. The result of the text embedding procedure

59

3.3.4. Implementation of the Patchwork Algorithm For the next LSB embedding, the patchwork algorithm was implemented; the codes are shown in the attachment A.7 (pem.m embedding procedure) and A.8 (pex.m extracting procedure). The steps in the algorithm of patchwork watermarking can be described as under: Embedding Algorithm Description 1. Analyzing the carrier image: grayscale (1 matrix) or color (3 matrices) 2. Analyzing the level of brightness of each pixel. 3. If the brightness is less than a threshold given, then analyzing the oddness or evenness of the column 4. Adding one to the odd column or extracting one from the even column 5. Calculating the control sum of odd and even columns 6. Displaying the result 7. Saving the file with watermark embedded Extracting algorithm 1. Calculating the control sums of all even and odd columns 2. Calculating the control sums of all even and odd rows (for comparing) 3. Displaying the result Experimental Process The embedding procedure work is demonstrated in the Figure 19.

60

Figure 19. The result of patchwork watermark embedding procedure

During the embedding process, the control information is displayed in the screen, as shown in the Figure 20. As we can see, the number of embedded bits is shown. The difference between odd and even columns is calculated. This difference could be saved by user and this control number could be used to make the comparison later. However, if the image was distorted, this control number will not be the same. The difference itself between odd and even columns will be the indicator of the watermark embedded. For the comparison, the difference between odd and even rows is calculated either and this number is low enough. If the difference between these two numbers is significant, for example few tens of thousands, we can be sure that the patchwork watermarks were embedded into this picture. As we can see, after embedding watermarks, the difference between odd and even rows before and after embedding did not changes practically, but the difference between odd and even columns before and after embedding differ significantly: 19 thousands and 140 thousands. Even after some distortions applied to the image, this difference will exist for some degree, as the testing experiments show. These tests will be described later. 61

The picture file opened: bg.tif The 60616 mark couples were embedded. check sum: difference between odd and even columns with no watermarks: 19900 difference with fork watermarks: 140988 difference between odd and even rows with no watermarks: 45730 difference with fork watermarks: 45744 The file with the embedded symbol is saved as: bgem.tif

Figure 20. Embedding patchwork watermark process

Extracting procedure in patchwork algorithm is not just taking out watermarks but rather defining these marks existence. The procedure is pretty simple: the control sums are calculated, as shown in the Figure 21. If the difference between odd and even columns is significantly bigger than the difference between odd and even rows, the existence o watermarks could be proven. In the Figure 21 we can see 140 thousands vs 45.

The picture file opened: bgem.tif difference between odd and even columns: 140988 difference between odd and even rows: 45744

Figure 21. Detecting patchwork watermark procedure 62

3.3.5. Implementation of Fourier Transform Algorithm The process of embedding watermarks into a magnitude domain of frequency transform consists of transforming the original image into this domain, then embedding the information into a magnitude plane, and then transforming back. All transform domain codes are given in the Appendix B: embedding procedure as fem.m (Appendix B.1) and extracting procedure as fex.m (Appendix B.2). During the process of study and coding, some features of frequency domain watermarks were defined. First, the volume of watermark information is analyzed. For authentication purposed, there is no necessity to embed big texts; moreover, the bigger the text, the more possibility of errors. The very few letters is enough. Therefore, as a watermark, the simple eight letter word was used. Second, different shapes of watermarks were tested. Experimentally, it was defined that there is no noticeable difference between different shapes of watermark embedded. There were circling marks which were placed like a ring around the middle; then some marks were placed diagonally from the middle to the corners of the picture. Finally, the simple shape was selected: the line of letters was embedded into some fixed positions on horizontal cross-sections of the pictures. Third, the most effective location of watermarks was defined experimentally. In the Figure 22 we can see the magnitude domain of the image after Fourier transform and four watermark locations: 22.a. and 22.b. show the watermark embedded into high frequency area, 22.c. demonstrates watermarks embedded into the middle region, and finally, 22.d. picture shows marks which placed very close to the main informational region in the low frequency area which looks like the mountain. 63

Figure 22. Three-dimensional picture of the magnitude domain of frequency transform of the image. Four examples of watermarks locations

The foundation of this mountain is the boundary place for watermarks because any alteration of the basic information is crucial for the image itself as experiments showed. The image was absolutely distorted by alteration the middle area. The experiments showed that robustness of watermarks depends of the watermark position significantly. The closer watermark to the middle of the picture (22.d.) the better surviving characteristics. By locating the watermark far from the center (22.a. and 22.b), we can make this mark fragile. Therefore, the optimal watermark location is considered as surrounding the middle 1/3 of the image. This is the ultimate place where watermarks are not distorting the image noticeably and have the best surviving characteristics.

64

Finally, some different amplitudes of watermark were applied. The most effective was image dependent magnitude. In the embedding process, the amplitude of the embedding area was measured and then the half of the maximum of this magnitude is taken for the embedding of ones, while zeros are embedded as real zeros of magnitude. In the process of embedding, the user also is allowed to change the amplitude of the watermark manually by entering the coefficient. This coefficient will be multiplied by the defined magnitude and therefore, will change the embedded signal. For example, the coefficient equals to 2 will double the magnitude while the coefficient 0.5 will decrease it on one half. It was done for better balance between visual characteristics and robustness. How we can handle this balance? Sometimes, if the image is homogeneous and has a small amount of details, it might be distorted by watermark, and some ripples appear in the image. In this case, it is better to decrease the embedded watermark amplitude by entering the coefficient less then 1, for example, 0.5 or 0.3, etc. This number can be selected experimentally till the ripples will not be noticed in the watermarked image. In the other case, if the image has many details, this coefficient might be increased for better watermark robustness. Also the user can define the text for embedding. As default, the procedure uses 4 simple 8-letter consequences: ‘aamuAAMU’ but the user can give any other eight or less letter text, for example: fem('8.bmp', 0.7, 'WWW');

Automatically, some

additional letters ‘|’ will be added into the given sequence, therefore the embedded watermark word will be: ‘WWW|||||’.

65

Embedding Algorithm Description 1. Calculating the location of the watermark 2. Fourier transform of the image 3. Watermark text transformed to binary sequence 4. In the watermark location area, the maximum amplitude level of the magnitude domain signal is defined and decreased by a half. 5. If the multiplicator is defined by a user, the signal is multiplied by this number. 6. The watermark is embedded using the p.5 level for embedding ones and zeroing the signal for embedding zeros. 7. Inverse Fourier transform of the image with embedded watermark. 8. Displaying the result. 9. Saving the watermarked image.

Experimental Process The codes are in attachment B.1. (embedding procedure) and B.2. (extracting procedure). The embedding procedure work is demonstrated in the Figure 23. As we can see, the watermarked image does not differ visibly from the original one. The watermark can be noticed in the images of magnitude domain, and in the middle row we can see the cross section of the magnitude domain image without and with embedded watermark.

66

Figure 23. The result of frequency domain watermark embedding procedure

67

The extracting procedure is shown in the Figure 24. We can see the watermarked image and the magnitude domain with embedded watermarks two-dimensional image, then the cross section in which we can notice the watermarks if any, and finally, the three-dimensional image of the magnitude domain. Also the code will give the decoded watermark words which were extracted from the watermark location.

Figure 24. The result of extracting frequency domain watermark

68

The text information will not be displayed in the image; this information will be shown in the Matlab processing screen: after embedding process the user will see the set of information like in the Figure 25:

>> fem('8.bmp', 0.7, 'WWW') The text for embedding: WWW||||| The picture file is opened is: 8.bmp The file with the embedded symbol is saved as: 8em.bmp

Figure 25. Embedding frequency domain watermark procedure

The extracting procedure asks for the name of the file with embedded watermarks from the previous procedure and gives the information extracted from the four places where the watermark was located, therefore, we can see the embedded word is repeated four times (Figure 26).

>> fex('8em.bmp') The picture file is opened: 8em.bmp The extracted text = WWW||||| WWW||||| WWW||||| WWW|||||

Figure 26. Extracting frequency domain watermark procedure

69

3.3.6. Implementation of Wavelet Transform Algorithm The process of embedding watermark into wavelet domain is close to the embedding into spatial domain. The image of a simple circle was used as a watermark. After some experiments, the Haar 2 wavelet decomposition was selected because of the best detecting watermarks characteristics. During the research, there were tested all planes for embedding watermarks, and finally, the vertical plane CVD1 was used. As experiments showed, there is no necessity to embed watermarks into all decomposition planes; embedding into one plane only make possible detection the watermarks in almost all other planes after inverse transformations. The vertical plane embedding was more effective respectively other planes embedding. The extracting procedure is actually a detecting procedure. This method is nonblind; for the detection, we need the watermarked image, the original image and the watermarking matrix. This watermarking matrix is a matrix of the same size like the original image, which is tiled by watermarking symbols. This matrix is saved during the embedding process and will be used during the detecting/extracting procedure. The detecting procedure consists of Haar 2 decomposition of the original and watermarked images and calculating difference between according planes. Afterward, these difference matrices are compared with the watermarking matrix and the correlation coefficient is calculated. However, we need to take into account that the embedded watermarks are usually shifted respectively their original position. Because of this shifting, we need to simulate some shifts and then calculate the correlation coefficient again. Actually, this procedure is a very time consuming and depends of the image size: the bigger the image, the more time is spend to all calculations. 70

Embedding Algorithm 1. The matrix size of the original image is tiled by watermarking image. 2. The watermarking matrix is multiplied by coefficient given (5 - 30) 3. Wavelet transformation of the original image using Haar 2 decomposition. 4. The watermarks are added to the vertical plane CVD1. 5. The inverse transform is taken, 6. The watermarked image is saved. 7. The watermarking matrix is saved. 8. The result is displayed.

Extracting Algorithm 1. Opening files: supposedly watermarked image, original image, and watermarking matrix. 2. Wavelet transformation of the original and watermarked images. 3. Calculating the difference between relevant planes of the original and watermarked transform matrices: CHD1 watermarked – CHD1 original, etc. 4. For each difference matrix, the correlation coefficient with the watermarking matrix is calculated. 5. The difference matrix is shifted respectively the watermarking matrix and step 4 is repeated. The results of these calculations are stored. 6. The correlation coefficient for each plane is displayed; and the conclusion about existence or extinction of watermarks is established.

71

The example of calculating the correlation coefficient is shown in the Figure 23. I decided to display all planes for better understanding the wavelet transform. As we can see, in some of the planes, there are no traces of watermarks embedded; on the others we can see very distinctive correlation with the watermarks. Actually, if we can detect the trace of watermarks even in one plane only, we can definitely consider the watermark existence in the image. As experiments showed, the correlation coefficient of the image, which was altered, is significantly lower, however even very small correlation coefficient is actually a proof of the watermark embedded.

Figure 27. The result of the detecting wavelet watermarks procedure

72

3.4. Testing of Watermarks After implementation, some test experiments were done. For different images with watermarks embedded, some distortions were applied and the watermark surviving characteristics were tested. The results were collected into the Table 3. This chapter is dedicated to explanations of these results. Watermarks tested LSB Blind

Patchwork

Frequency

Wavelet

Cropping

Visually detectable

Detectable

Detectable *

Detectable *

Resizing

Visually detectable

Detectable

Detectable *

Detectable *

Rotating

Visually detectable

Detectable *

Detectable *

Detectable *

Detectable

Detectable

Detectable

Detectable up to 30% changing Detectable up to 10% changing Detectable up to 0.3 pixel blur

Detectable

Detectable

Detectable

Detectable up to 0.5 pixel blur

Detectable up to 1.5 pixel blur

Detectable up to 0.3 pixel blur

Sharpening

Bad detectable

Detectable

Detectable

Detectable

Adding noise

Not detectable (even after 2%)

Detectable up to 5% noise

Detectable up to 15% noise

Detectable up to 5% noise

Compression

Not detectable

Detectable up to quality = 3 (low)

Detectable up to quality = 3 (low)

Detectable up to quality = 6 (medium)

Type changing

Bad detectable

Detectable

Detectable

Not Detectable

Brightness Contrast Blur operation

* the watermark is detectable after returning the image to the original geometrical position and shape

Table 3. Comparative table of four kinds of watermarks tested

73

3.4.1. Testing the LSB Watermarks It is generally understood that there no necessity to test surviving characteristics of the text embedded into an image because the loss of very few bits can make a fatal error. The text LSB watermark is pretty vulnerable. Mainly, the distortions were applied to images with blind LSB watermarks and patchwork watermarks. The blind technique was selected because it makes possible to detect watermark after geometrical distortion. The non-blind method requires the original image for extracting process; moreover, this original image should have absolutely the same geometrical proportions to make the extraction process possible. Even small geometrical alteration: cropping, rotation, etc. makes impossible the straight comparing process. All developed LSB watermarking detecting techniques require returning the watermarked image into maximum accordance to the initial state. Only when the image is placed into exact initial location, we are able to compare amplitudes of the original and supposedly watermarked images. As we can see below, the blind LSB image watermarks show good surviving characteristics against geometrical distortions and can not stand the amplitude and image type changing. Also, the JPEG transform is crucial for the image LSB embedded marks. 1. Cropping (Figure 24, a). The image with embedded watermark was cropped and then the extraction procedure was applied. The watermark is possible to detect. However, if the embedded pattern is not identifiable by eyes, for example, if it is random generated sequence of bits, it is impossible to identify the context without returning the image in original position. 2. Rotation of the image (Figure 24, b). The embedded pattern is easily identified. 3. Complicated distortion (Figure 24, c) didn’t remove the embedded pattern. 74

Figure 28. Results of extracting LSB watermark after various distortions applied: a) cropping procedure; b) rotating; c) complicated geometrical distortion.

75

Figure 29. Results of extracting LSB watermark after various distortions applied: a) resizing; b) 30% brightness increasing; c) 10% contrast increasing; d) 1% blur operation. 76

4. Resizing (Figure 25, a). The size of the watermarked image was decreased from 502 pixels to 200 pixels horizontally; the watermark is detectable. 5. Changing brightness of the signal (Figure 25, b) is linear procedure; therefore the embedded pattern could be detectable even after 30% changing brightness. 6. Changing contrast of the image (Figure 25, c) on the contrary is non-linear operation, therefore only 10% changing of the contrast almost destroyed the watermark. 7. Blur operation (Figure 25, d) is also amplitude non-linear distortion, therefore, the result is evident, and the watermark does not survived even smallest blur distortion. 8. Sharpening procedure (Figure 26, a) increases the contrast between detail borders in the image. Therefore, the watermarks are damaged in the places where the number of details is high and survive for some degree in the other places where the number of details is small. Watermark is detectable for some degree. 9. Adding noise (Figure 26, b) and any other pattern is crucial for LSB watermark because the LSB level is very much influenced by any adding structure procedures. There were uniform noise and Gaussian noise applied with the similar result. 10. Changing the type of the image from BMP to Grayscale (Figure 25, b) changes all LSB picture, the embedded pattern can not stand. Very close result appears after TIFF - JPEG format transformation; compression is unbearable for the watermarked image. The more squeezing JPEG coefficient is, the worse the watermark condition. The results of these experiments are displayed in the Table 3.

77

Figure 30. Results of extracting LSB watermark after various distortions applied: a) sharpening procedure; b) adding noise; c) changing image type from BMP to Grayscale.

78

3.4.2. Testing the Patchwork Watermarks Extracting procedure in patchwork algorithm is not just taking out watermarks but rather defining these marks existence. The difference between odd and even columns is calculated. If the image was distorted, this control number will be changed either. The pointer of the watermark embedded will be the difference between odd and even columns. For comparison, the difference between odd and even rows is calculated either and this number is low enough. If the difference between these two numbers is significant, for example few tens of thousands, we can be sure that the patchwork watermarks were embedded into this picture. 1. Cropping. The image with embedded watermark was cropped and then the extraction procedure was applied. The control numbers differ significantly, therefore the watermark is considered as detected. 2. Rotation of the image. It is understandable that changing oddness and evenness proportion changes control number. However the watermark is detected after returning the image into the original position. 3. Complicated distortion keeps the watermark for some degree; however, we have the same problem like in the point 2. 4. Resizing. The watermark is detectable if the oddness and evened proportion is kept. For example, if the size is changed from 400 pixels to 200 or 120 pixels, the difference between odd and even columns is still significant. If the size is changed from 400 pixels to 153 pixels, the watermark is broken.

79

5. Changing brightness of the signal does not changes the even-odd pixels relationships, therefore the embedded pattern could be detectable even after significant changing of brightness. 6. Changing contrast of the image; the watermark is detectable. 7. Blur operation is crucial; the watermark does not stand even 2 pixel blur. 8. Sharpening procedure increases the contrast between detail borders in the image. Watermark is detectable. 9. Adding noise and any other pattern is crucial for patchwork watermark. 10. Changing the type of the image. There were different transformations applied from one type to another: BMP, JPEG, GIF, and TIFF. The watermark stands all these transformations even compression for some degree. The results of these experiments are also displayed in the Table 3.

80

3.4.3. Testing Frequency Domain Watermarks As experiments showed, the frequency domain watermarks are the most robust against all types of distortions. The watermark has the best surviving characteristics though it depends of position and amplitude of watermarks as was described above. 1 - 3. After cropping, rotation, and for some degree complicated geometrical distortions, the watermark is detectable after returning the image into the initial position. 4. Resizing. The size of the image was changed from 502 to 402 pixels, then from 502 to 251 horizontally. After returning into the original size, the watermark is detectable, though with some errors: in the first case only one from the extracted four words had error, in the second case the only one word did not have any errors. The watermark is considered as detectable. 5. Changing brightness of the signal did not harm the watermark. 6. Changing contrast of the image; the watermark is detectable. 7. Blur operation; some of the watermark words are readable even after 1.5 or even 2 pixel blur! It is understandable that there are errors in the words, but the watermark stands. In the Figure 27 (b) it is shown the image after 2 pixel blur procedure along with the magnitude of the frequency transform. 8. Sharpening procedure: the watermark is easy detectable. 9. Adding noise: the watermark is detectable even after 15% noise added! The result of extracting watermark procedure is displayed in the Figure 27 (a). 10. Changing the type of the image. There were different transformations applied from one type to another: BMP, JPEG, GIF, and TIFF. The watermark stands all these transformations and even the image compression n with low quality coefficient = 3! 81

Figure 31. Results of extracting frequency domain watermark operation after a) 15% Gaussian noise added and b) after 2 pixel blur procedure 82

3.4.4. Testing Wavelet Domain Watermarks As experiments showed, the wavelet domain watermarks have some disadvantages of spatial domain watermarks; they are more vulnerable than frequency domain watermark though more robust than LSB watermarks. Additional disadvantage is that WT watermark has the most time consuming extracting process. Because of this disadvantage many of developers of these watermarks usually continue the detecting process till any traces of watermarks appears in any of the decomposition images. After the detection, the process of extracting is cancelled. 1 - 4. Cropping, rotation, distortion, and resizing: the watermark is feebly detectable after returning the image into the initial position. 5. Changing brightness: the watermark is detectable after 50% changing. 6. Changing contrast: the watermark is detectable after 50% changing. 7.

Blur operation: the watermark is unable to stand this procedure. The

watermark is feebly detectable after 0.3 pixel blur and undetectable after more severe blurring. 8. Sharpening procedure: the watermark is detectable. 9. Adding noise: the watermark is feebly detectable after only 5% noise added. 10. Changing the type of the image. There were different transformations applied from one type to another: BMP, JPEG, GIF, and TIFF. Actually, some of the type changing is crucial for this type of watermark. However, this watermark stands up to medium compression = 6.

83

4. CONCLUSION In this paper, the survey of digital watermarking for images was presented. First, the theoretical part was given, and then the description of practical implementation of different kinds of watermarks. In theoretical part, firstly, the image processing basic was given, then the fundamentals of watermarking. The image processing description part consists of necessary essential information about computer matrix representation of images and main principles of image processing. The next part is related to fundamentals of watermarking. There were described the history of hiding information techniques described, the applications of modern watermarking, types and features of different watermarks, and finally, the evaluating criteria of watermarks. The major part of the research consists of developed description of different basic methods of watermarking. Firstly, some types of spatial domain watermarks were reviewed; the principles of forming watermarks in spatial domain were described, the advantages and disadvantages of this kind of watermarks were shown. Then different transform domain based watermarks were surveyed. In this chapter, the most useful transforms were described as a basic for watermark, for example, the Fourier and Mellin-Fourier transforms, cosine transform, and wavelet transform. The watermarks based on each of these transforms were described and explained, along with advantages and drawbacks of these domains using. For the practical implementation, there were some LSB implementations were used, such as two versions of image to image embedding: blind and non-blind, text to

84

image embedding, and the patchwork watermark. The algorithms of each of the watermark were described and Matlab codes are attached in appendices. Then, the frequency domain watermark was also described from the algorithm to the code implementation and some particularities of this code working. Finally, the wavelet domain watermark was shown. The features of using this domain were described, and the results are shown. The final part of the research consists of a practical testing of the watermarks embedded by using each of these methods. It is understandable, that simulating some malicious attacks applied to the image we can see how the watermark stands these attacks. To test robustness of watermarks, some distortions were applied to watermarked images and then extracting process showed how the watermarks look. The main distortions applied were: geometrical distortions, such as cropping, resizing, rotating, etc, then amplitude distortions: changing brightness and contrast. Additionally, some specific image amplitude modification such as blur and sharp procedures were applied, and finally, image compression and changing image type. The results of these experiments were collected in the table 3. This research shows the weak and powerful sides of each of the watermarks. It is clear, that the most robust watermark should stand all of the attacks applied. And actually, as the research shows, the best surviving characteristics showed the frequency domain watermarks. This watermark stands all of the distortions applied till the image is distorted to the degree when it can not be used anymore by the attacker.

85

APPENDIX A. Spatial Domain Watermark Codes Appendix A.1 Image to Image Embedding Procedure, Blind Method: IEMB.M % ---------------------------------------function f = iemb(name, symbol) % ---------------------------------------%

image to image embedding (blind method)

% ---------------------------------------%

this

function embeds the bitmap image watermark into

%

the basic image. This algorithm uses the blind scheme

%

of embedding, so we can define watermark without

%

the original image

%

iemb('image_filename', 'symbol_filename')

%

examples:

iemb('picture.bmp', 'symbol.bmp')

% ---------------------------------------if nargin < 2 error('enter the name of 2 images, for example: ''a.bmp'''); end if nargin > 2 error('Too many input arguments.') end % ---------------------------------------% Opening file procedure openfileproc; % ---------------------------------------if fi_extn == '.jpg' error('jpeg files are not fitted for LSB embedding'); end % ---------------------------------------% Preparing the file for embedding information. Each least % significant bit LSB is replaced by zeroes for simplicity

86

% and visual effectiveness of defining the embedded % information (LSB = 0) This preparation

is done for

% the blind method only % ---------------------------------------II = I; for h = 1:height for w = 1:width for d = 1:dim r = rem(I(h, w, d), 2); if r == 1 if I(h, w, d) < 255 II(h, w, d) = I(h, w, d) + 1; else II(h, w, d) = I(h, w, d) - 1; end end end end end % ----------------------------------------% opening the image to embed, defining the size % of the matrix % ----------------------------------------fsym = imread(symbol); fsym = logical(fsym); [height_sym width_sym] = size(fsym); hei = ceil(height/height_sym); wid = ceil(width/width_sym); fsym1 = [fsym fsym]; for wi = 1:wid fsym1 = [fsym fsym1]; end fsym2 = [fsym1; fsym1]; for he = 1:hei fsym2 = [fsym2; fsym1];

87

end fsym1 = fsym2; if dim > 1 fsym2 = fsym1(5:height+4,5:width+4); fsym3 = fsym1(10:height+9,10:width+9); end fsym1 = fsym1(1:height,1:width); % ---------------------------------------% The embedding process: % ---------------------------------------if dim == 1 III = double(II) + double(fsym1); else III(:,:,1) = double(II(:,:,1)) + double(fsym1); III(:,:,2) = double(II(:,:,2)) + double(fsym2); III(:,:,3) = double(II(:,:,3)) + double(fsym3); end III = uint8(III); % ---------------------------------------%

demonstration

% ---------------------------------------% if the picture is grayscale dim = 1 (number of grayscale % pictures) in the picture is RGB then

dim = 3

% ---------------------------------------if dim == 1 IIII = III - II; IIII = imcomplement(logical(IIII)); figure; subplot(131); imshow(I); title('The original image','FontSize',10); subplot(132); imshow(III); title('The image with embedded sybmol','FontSize',10); subplot(133); imshow(IIII); title('The embedded pattern','FontSize',10); else

88

subplot(231); imshow(I); title('The original image','FontSize',10); subplot(232); imshow(III); title('The image with embedded sybmol','FontSize',10); r = III(:,:,1) - II(:,:,1); r = imcomplement(logical(r)); subplot(234); imshow(r); title('The pattern embedded into Red,','FontSize',10); g = III(:,:,2) - II(:,:,2); g = imcomplement(logical(g)); subplot(235); imshow(g); title('Green,','FontSize',10); b = III(:,:,3) - II(:,:,3); b = imcomplement(logical(b)); subplot(236); imshow(b); title('and Blue color matrix','FontSize',10); end % ----------------------------------------% the new picture file will be written in a file % with the 'em' added % for example: the original file - 001.tif % the picture with embedded text - 001em.tif % ----------------------------------------writefile = [fi_name, 'em', fi_extn]; imwrite(III, writefile); sprintf('The file with the embedded symbol is saved... as: %s', writefile) % -----------------------------------------

89

Appendix A.2 Image from Image Extracting Procedure, Non-Blind Method: IEXB.M % ----------------------------------------function f = iexb(name) % ----------------------------------------%

image extracting (blind method)

% ----------------------------------------% extracting the information written in a least significant % bit by code 'iemb.m'. This is the blinde scheme. Example: %

iexb('001em.bmp')

% ---------------------------------------if nargin < 1 error('enter the name of the image, for example: ''a.bmp'''); end if nargin > 1 error('Too many input arguments.') end % ---------------------------------------% Opening file procedure % ---------------------------------------openfileproc; % ---------------------------------------if fi_extn == '.jpg' error('jpeg files are not fitted for LSB embedding'); end % ---------------------------------------II = I;

% file for extracted symbol if any

% ---------------------------------------%

extracting

the

remainder

of

dividing

by

2

-

this

is

the

actually % the simplest extracting of the least significant bit to file 2 % ----------------------------------------

90

for d = 1:dim for z = 1:height for y = 1:width II(z, y, d) = rem(I(z, y, d), 2); end end end %

transformation

the

remainder

file

to

black-and-white

bitmap

file if dim == 1 II = logical(II); else IIr = imcomplement(logical(II(:,:,1))); IIg = imcomplement(logical(II(:,:,2))); IIb = imcomplement(logical(II(:,:,3))); end if dim == 1 II = imcomplement(II); subplot(121);imshow(I); title('The image with embedded pattern','FontSize',10); subplot(122);imshow(II); title('The embedded pattern','FontSize',10); else subplot(221);imshow(I); title('Image with embedded symbol','FontSize',10); subplot(222);imshow(IIr); title('The embedded pattern in red color','FontSize',10); subplot(223);imshow(IIg); title('The embedded pattern in green color','FontSize',10); subplot(224);imshow(IIb); title('The embedded pattern in blue color','FontSize',10); end % ----------------------------------------

91

Appendix A.3 Image to Image Embedding Procedure, Non-Blind Method: IEMN.M % ----------------------------------------------function f = iemn(name, symbol) % ----------------------------------------------% image embedding (non-blind method) % ----------------------------------------------%

this function embeds the bitmap picture to the image

%

iemn('image_filename', 'symbol_filename')

%

examples:

iemn('picture.bmp', 'symbol.bmp')

% ----------------------------------------------if nargin < 2 error('enter the name of 2 images'); end if nargin > 2 error('Too many input arguments.') end % ----------------------------------------------% Opening file procedure: openfileproc; if fi_extn == '.jpg' error('jpeg files are not fitted for LSB embedding'); end % ----------------------------------------------II = I; % ----------------------------------------------% opening the image to embed, defining the size of the matrix % ----------------------------------------------fsym = imread(symbol); fsym = logical(fsym); [height_sym width_sym] = size(fsym); hei = ceil(height/height_sym);

92

wid = ceil(width/width_sym); fsym1 = [fsym fsym]; for wi = 1:wid fsym1 = [fsym fsym1]; end fsym2 = [fsym1; fsym1]; for he = 1:hei fsym2 = [fsym2; fsym1]; end fsym1 = fsym2; if dim > 1 fsym2 = fsym1(5:height+4,5:width+4); fsym3 = fsym1(10:height+9,10:width+9); end fsym1 = fsym1(1:height,1:width); % ----------------------------------------------% The embedding process: % ----------------------------------------------if dim == 1 III = double(II) + double(fsym1); else III(:,:,1) = double(II(:,:,1)) + double(fsym1); III(:,:,2) = double(II(:,:,2)) + double(fsym2); III(:,:,3) = double(II(:,:,3)) + double(fsym3); end III = uint8(III); % ----------------------------------------------%

demonstration

% if the picture is grayscale dim = 1 (number of grayscale % pictures) in the picture is RGB then if dim == 1 IIII = III - II; IIII = imcomplement(logical(IIII)); figure; subplot(131); imshow(I);

93

dim = 3

title('The original image','FontSize',10); subplot(132); imshow(III); title('The image with embedded sybmol','FontSize',10); subplot(133); imshow(IIII); title('The embedded pattern','FontSize',10); else subplot(231); imshow(I); title('The original image','FontSize',10); subplot(232); imshow(III); title('The image with embedded sybmol','FontSize',10); r = III(:,:,1) - II(:,:,1); r = imcomplement(logical(r)); subplot(234); imshow(r); title('The pattern embedded into Red,','FontSize',10); g = III(:,:,2) - II(:,:,2); g = imcomplement(logical(g)); subplot(235); imshow(g); title('Green,','FontSize',10); b = III(:,:,3) - II(:,:,3); b = imcomplement(logical(b)); subplot(236); imshow(b); title('and Blue color matrix','FontSize',10); end % ----------------------------------------------% the new picture will be saved in a file with the 'em' added % for example: the original file - 001.tif % the picture with embedded text - 001em.tif % ----------------------------------------------writefile = [fi_name, 'em', fi_extn]; imwrite(III, writefile); sprintf('The file with the embedded symbol is saved as: %s', writefile) % -----------------------------------------------

94

Appendix A.4 Image from Image Extracting Procedure, Non-Blind Method: IEXN.M % ---------------------------------------function f = iexn(name) % ---------------------------------------% image extracting (non-blind method) % ---------------------------------------%

extracting the information written in a least significant

%

bit by code 'iemn.m'. This is the non-blinde scheme.

%

Example: iexn('001em.bmp')

% ---------------------------------------if nargin < 1 error('enter the name of the image, for example: ''a.bmp'''); end if nargin > 1 error('Too many input arguments.') end % ---------------------------------------% Opening file with embedded watermark procedure % ---------------------------------------openemfileproc; % ---------------------------------------if fi_extn == '.jpg' error('jpeg files are not fitted for LSB embedding'); end % ---------------------------------------II = I - IO; %

transformation

the

remainder

file

file if dim == 1 II = logical(II); else

95

to

black-and-white

bitmap

IIr = imcomplement(logical(II(:,:,1))); IIg = imcomplement(logical(II(:,:,2))); IIb = imcomplement(logical(II(:,:,3))); end if dim == 1 II = imcomplement(II); subplot(121); imshow(I); title('The image with embedded pattern','FontSize',10); subplot(122); imshow(II); title('The embedded pattern','FontSize',10); else subplot(221); imshow(I); title('Image with embedded symbol','FontSize',10); subplot(222); imshow(IIr); title('The embedded pattern in red color','FontSize',10); subplot(223); imshow(IIg); title('The embedded pattern in green color','FontSize',10); subplot(224); imshow(IIb); title('The embedded pattern in blue color','FontSize',10); end % ---------------------------------------------------

96

Appendix A.5 Text to Image Embedding Procedure: TEM.M % ---------------------------------------function f = tem(name, text) % ---------------------------------------%

this function embeds the text file to the LSB of the image.

% ---------------------------------------%

example:

%

tem('image_filename.bmp', 'text_filename.txt')

% ---------------------------------------if nargin < 2 error('enter the name of the image and the text file'); end if nargin > 2 error('Too many input arguments.') end % ---------------------------------------%

opening file procedure

% ---------------------------------------openfileproc; % ---------------------------------------if fi_extn == '.jpg' error('jpeg files are not fitted for LSB embedding'); end % ---------------------------------------if fi_extn == '.jpg' error('jpeg files are not fitted for LSB text embedding'); end % ---------------------------------------% defining the size and possible number of % letters to embed into this file % ----------------------------------------

97

PictureSize = height * width * dim; LettersToEmbed = floor(PictureSize/7); sprintf('How many letters could be embedded: %d', LettersToEmbed) % ---------------------------------------% opening the text, defining its size % ---------------------------------------sprintf('The text file to embed: %s', text) fid = fopen(text,'r'); TextFile = fread(fid); TextSize =length(TextFile); sprintf('How many letters in the text file: %d', TextSize) % ---------------------------------------% checking the amount of letters and free space % for embedding in the picture % ---------------------------------------if TextSize > LettersToEmbed error('Your text file has too many letters in your text.'); end % ---------------------------------------% Preparing the file for embedding information. Each least % significant bit LSB is replaced by zeroes for simplicity % and effectiveness of defining the embedded information % (LSB = 0) % ---------------------------------------II = I; for h = 1:height for w = 1:width for d = 1:dim r = rem(I(h, w, d), 2); if r == 1 if I(h, w, d) < 255 II(h, w, d) = I(h, w, d) + 1; else II(h, w, d) = I(h, w, d) - 1; end

98

end end end end % ----------------------------------------% The embedding process % ----------------------------------------III = II; h = 1;

w = 1;

picture_eof = 0;

d = 1; letternumber = 1;

% ----------------------------------------for letternumber = 1:(TextSize + 5) % after the text is embedded, % 5 ending symbols will be embedded = 127 if letternumber > TextSize m = dec2bin(127); else letter = TextFile(letternumber); % defining the ascii code of the letter n = double(letter); if n < 127 % defining the binary code of the letter m = dec2bin(n); else % unknown symbol will be replaced by '?' m = dec2bin(63); end end while length(m) < 7 % forming of the 7-symbol binary code zero = '0'; m = [zero,m]; end for p = 1:7 % taking the current number from

99

% the current letter take = str2num(m(p)); % adding it to the LSB III(h, w, d) = III(h, w, d) + take; h = h + 1; % defining the current position of the pixel % and switching to the next pixel if h > height h = 1; w = w + 1; if w > width w = 1; d = d + 1; if d > dim picture_eof = 1; end end end end if rem(letternumber, 10000) == 0 sprintf('the number of letters embedded: ... %d ...', letternumber) end end sprintf('Finally, the number of letters embedded is:... %d', letternumber) % ---------------------------------------% the final step: demonstration % ---------------------------------------IIII = III - II; % ---------------------------------------% if the picture is grayscale dim = 1 % in the picture is RGB then

dim = 3

% ---------------------------------------if dim == 1

100

IIII = logical(IIII); figure; subplot(121); imshow(I); title('The original image','FontSize',11); subplot(122); imshow(IIII); title('and the image with embedded text','FontSize',11); else subplot(231); imshow(I); title('Original image','FontSize',11); subplot(232); imshow(III); title('Image with embedded text','FontSize',11); red = IIII(:,:,1); red = logical(red); green = IIII(:,:,2); green = logical(green); blue = IIII(:,:,3); blue = logical(blue); subplot(234); imshow(red); title('Information embedded into red,','FontSize',11); subplot(235); imshow(green); title('green, and','FontSize',11); subplot(236); imshow(blue); title('blue color matrix','FontSize',11); end % ---------------------------------------% the new picture file will be written in a file with the % 'em' added % for example: the original file - 001.tif % the picture with embedded text - 001em.tif % ---------------------------------------writefile = [fi_name, 'em', fi_extn]; sprintf('the file with the text embedded: %s', writefile) imwrite(III, writefile); fclose(fid); % ----------------------------------------

101

Appendix A.6 Text from Image Extracting Procedure: TEX.M % --------------------------------------------function f = tex(name) % --------------------------------------------%

this function extracts the text embedded

%

by tem.m function into image

% --------------------------------------------%

example: tex('image_filename.bmp', 'symbol_filename.txt')

% -------------------------------------------%

preparation of the file name, defining the name and extention

% -------------------------------------------openfileproc; % --------------------------------------------% Preparing the file for extracting information. % --------------------------------------------text = ''; key = ''; endembed = 0; endofembeddedfile = 0; counter = 0; notext = 0; for d = 1:dim for w = 1:width for h = 1:height if endofembeddedfile < 1 r = rem(I(h, w, d), 2); key0 = num2str(r); key = [key,key0]; if length(key) > 6 numkey = bin2dec(key); if numkey == 127

102

endembed = endembed + 1; else endembed = 0; chr = char(numkey); text = [text, chr]; end if endembed == 5 endofembeddedfile = 1; end if numkey > 127 notext = notext+1; if notext > 10; sprintf('there is no meaningful... information embedded') end end key = ''; counter = counter + 1; if rem(counter, 10000) == 0 sprintf('%d letters extracted ...',unter) end end end end end end % ------------------------------------------% saving the extracted information text_file = [fi_name, '.txt']; fid = fopen(text_file,'w'); sprintf('The text file is written

as %s', text_file)

fwrite(fid, text); fclose(fid); % -------------------------------------------

103

Appendix A.7 Patchwork Watermark Embedding Procedure: PEM.M % ------------------------------------------function f = pem(name) % ------------------------------------------% Embedding the patchwork watermark into the image % ------------------------------------------if nargin < 1 error('you need to enter the name of the picture file'); end; if nargin > 1 error('too many inputs'); end %

opening file procedure

% ------------------------------------------openfileproc % ------------------------------------------II = I; counter = 0; for d = 1:dim for i = 1:width for j = 1:height if II(j, i, d) < 180 counter = counter + 1; % -----------------------------------% adding one into the every odd pixel % -----------------------------------if rem(i, 2) > 0 II(j, i, d) = II(j, i, d) + 1; else % -----------------------------------% extracting one from the every even pixel

104

% -----------------------------------II(j, i, d) = II(j, i, d) - 1; end end end end end sprintf('The %d mark couples were embedded', floor(counter/2)) % ------------------------------------------------% calculating the control sum for the image without watermark % and the image with watermark % ------------------------------------------------sumI = sum(I); sumII = sum(II); oddI = 0; oddII = 0; evnI = 0; evnII = 0; for i = 1:width if rem(i, 2) > 0 oddI = oddI + sumI(1, i, d); oddII = oddII + sumII(1, i, d); else evnI = evnI + sumI(1, i, d); evnII = evnII + sumII(1, i, d); end end dif_no_wm = abs(oddI) - abs(evnI); dif_fork = abs(oddII) - abs(evnII); sprintf('check sum: difference between odd and even columns ... with no watermarks: %d', abs(dif_no_wm)) sprintf('difference with fork watermarks: %d', abs(dif_fork)) for d = 1:dim sumI = sum(I(:,:,d)'); sumII = sum(II(:,:,d)'); oddI = 0; oddII = 0; evnI = 0; evnII = 0; for i = 1:height if rem(i, 2) > 0

105

oddI = oddI + sumI(1, i); oddII = oddII + sumII(1, i); else evnI = evnI + sumI(1, i); evnII = evnII + sumII(1, i); end end end dif_no_wm = abs(oddI) - abs(evnI); dif_fork = abs(oddII) - abs(evnII); % -------------------------------------------sprintf('difference

between

odd

and

even

rows

with

no

watermarks: %d', abs(dif_no_wm)) sprintf('difference with fork watermarks: %d', abs(dif_fork)) % -------------------------------------------subplot(121); imshow(I); title('The image without watermark'); subplot(122); imshow(II); title('The image with watermark'); % -------------------------------------------writefile = [fi_name, 'em', fi_extn]; imwrite(II, writefile); sprintf('The file with the embedded symbol is saved as: %s', writefile) % --------------------------------------------

106

Appendix A.8 Patchwork Watermark Detecting Procedure: PEX.M % -----------------------------------------------function f = pex(name) % -----------------------------------------------% This function calculates the control sum of odd end even % rows and columnd of the image to define whether the % patchwork watermarks are embedded or not. The embedding % code pem.m inputs additional ones into even columns % and extract ones from odd columns, therefore the sum % of odd and even columns should be considerably different. % If the patchwork marks are not embedded, the sum of odd % and even columns are close to each others. Additionally, % there is calculated the control sum of odd and even rows % in which there is no marks embedded, and it is proven that % control sum of odd and even rows are very close. % use: pex('filename.bmp') % -----------------------------------------------%

openinf file procedure:

openfileproc; % -----------------------------------------------% control sum defining % -----------------------------------------------sumI = sum(I); oddI = 0; evnI = 0; % ---------------- calculation of odd and even columns ----% for color images, each matrix is analyzed % -----------------------------------------------for d = 1:dim for i = 1:width if rem(i, 2) > 0 oddI = oddI + sumI(1, i, d);

107

else evnI = evnI + sumI(1, i, d); end end end % -----------------------------------------------difference = abs(oddI) - abs(evnI); sprintf('difference between odd and even columns: ... %d', abs(difference)) % -----------------------------------------------oddI = 0;

evnI = 0;

% -----------------------------------------------for d = 1: dim Id = I(:,:,d); Id = Id'; sumI = sum(Id); for i = 1:height if rem(i, 2) > 0 oddI = oddI + sumI(1, i); else evnI = evnI + sumI(1, i); end end end difference = abs(oddI) - abs(evnI); sprintf('difference between odd and even rows: ... %d', abs(difference)) % -----------------------------------------

108

Appendix B. Transform Domain Watermark Codes Appendix B.1 Frequency Domain Watermark Embedding Procedure: FEM.M % ------------------------------------------------function f = fem(name, multiplicator, text) % ------------------------------------------------% FEM = Frequency Domain Watermarking Embedding Function % ------------------------------------------------% for embedding procedure into frequency domain the user needs % to enter the name of the picture file, then the multiplicator % coefficient which could be from 0.5 to 3. As default % multiplicator = 1. % It is not recommended to make the coefficient too small because % the embedded signal will be impossible to read and recognize, % also it is not recommended to make this coefficient too big % because the distortions of the image will be significant. % It is better for each picture try this coefficient individually. % % using of the function: FEM('B.BMP', 2, 'aamu'); % here 'b.bmp' is the name of the file %

2 is the coefficient

%

'aamu' is the text for embedding

% -----------------------------------------------if nargin > 4, if nargin < 1,

error('too many inputs'); end; error('you need to enter the name of the picture

file'); end; if nargin == 1 multiplicator = 1; text = 'aamuAAMU'; end if nargin == 2

109

text = 'aamuAAMU'; end if nargin == 3 if length(text) > 8 text = text(1:8); else for i = 1:(8-length(text)) text = [text, '|']; end end end % -----------------------------------------% opening file procedure % -----------------------------------------openfileproc; if dim > 1 error('this function is for grayscale pictures only'); end subplot(221);

imshow(I);

colormap

gray;

title('The

image','FontSize',10); I = double(I); % -----------------------------------------% defining the place of embedding the watermark % -----------------------------------------loch = floor(height/3); locw = floor(width/3); % -----------------------------------------% fast fourier transform of the image % -----------------------------------------FI = fftshift(fft2(I)); % ---------------- magnitude ------------------------M = abs(FI); % ---------------- phase ----------------------------P = angle(FI);

110

original

% -----------------------------------------% text-to-binary transformation procedure % -----------------------------------------texttobinary; % -----------------------------------------% the maximum amplitude of the signal in the area of embedding is: % -----------------------------------------maxM = max(max(M(loch:loch+len, locw:locw+len))); % -----------------------------------------% this level of the signal is increased by multiplicator and % the sequence num is prepared for embedding % -----------------------------------------num = double(num); num = num * maxM * multiplicator * 0.3; %------------------------------------------subplot(223); plot(M(loch,:)) title('The crossection without watermark','FontSize',10); %------------------------------------------% the embedding process: % -----------------------------------------for i = 1:len if num(i)>0 M(loch,locw+i) = num(i); M(loch,width-locw-i) = num(i); M(height-loch,locw+i) = num(i); M(height-loch,width-locw-i) = num(i); else M(loch,locw+i) = 0; M(loch,width-locw-i) = 0; M(height-loch,locw+i) = 0; M(height-loch,width-locw-i) = 0; end end %-------------------------------------------

111

subplot(224); plot(M(loch,:)); title('The crossection with watermark','FontSize',10); % back transformation -------------------------------for i = 1:height for j = 1:width F(i,j) = M(i,j)* (cos(P(i,j))+sqrt(-1)*sin(P(i,j))); end end FW = fftshift(F); MT = real(ifft2(FW)); MT = uint8(MT); M = uint16(M); %------------------------------------------subplot(222); imshow(MT); title('The image with watermark','FontSize',10); figure; subplot(121); imshow(M); title('The magnitude domain with embedded... watermark','FontSize',10); N = double(M); subplot(122); surf(N); axis([0 width 0 height 0 50000]) camlight left; lighting phong shading flat; view([70 60]) colormap hsv title('The magnitude domain with ... embedded watermark','FontSize',10); % ----------------------------------------writefile = [fi_name, 'em', fi_extn]; imwrite(MT, writefile); sprintf('The file with the embedded symbol is saved as: %s', writefile) % -----------------------------------------

112

Appendix B.2 Frequency Domain Watermark Extracting Procedure: FEX.M % ----------------------------------------function f = fex(name) % ----------------------------------------% The process of extracting watermarks embedded into frequency % domain by fem.m procedure. The information is extracted and % the picturesof magnitude shown. % ----------------------------------------if nargin < 1 error('enter the name of the image, for example: ''a.bmp'''); end if nargin > 1 error('Too many input arguments.') end % ----------------------------------------% Opening file procedure: openfileproc; % ----------------------------------------% Defining the place of watermark embedded % ----------------------------------------loch = floor(height/3); locw = floor(width/3); subplot(221); imshow(I); title('The watermarked image','FontSize',10); I = double(I); % ----------------------------------------F = fftshift(fft2(I)); M = abs(F); maxM = max(M(loch,locw:locw+10)); subplot(223); plot(M(loch,:));

113

title('The watermark crossection','FontSize',10); % ----------------------------------------% Extracting the watermark % ----------------------------------------i = 0; bin1 = []; bin2 = []; bin3 = []; bin4 = []; for i = 1:56 A1 = M(loch, locw+i); A2 = M(loch, width-locw-i); A3 = M(height-loch, locw+i); A4 = M(height-loch, width-locw-i); level = maxM/2; if A1 > level bin1 = [bin1, '1']; else bin1 = [bin1, '0']; end if A2 > level bin2 = [bin2, '1']; else bin2 = [bin2, '0']; end if A3 > level bin3 = [bin3, '1']; else bin3 = [bin3, '0']; end if A4 > level bin4 = [bin4, '1']; else bin4 = [bin4, '0']; end end text = []; binletter = [];

114

n = 1; bin = [bin1, '0100000', bin2, '0100000', bin3, '0100000', bin4]; % ---------------------------------------% binary sequence to text transformation % ---------------------------------------len = length(bin); for i = 1:len key = bin(i); binletter = [binletter, key]; n = n + 1; if n > 7 s = bin2dec(binletter); letter = char(s); text = [text, letter]; binletter = []; n = 1; end end % ---------------------------------------% visualizing the magnitude domain % ---------------------------------------M = uint16(M); subplot(222); imshow(M) title('The magnitude domain','FontSize',10); N = double(M); subplot(224); surf(N) axis([0 width 0 height 0 50000]) camlight left; lighting phong shading flat; view([40 40]) % colormap(hsv) sprintf('The text extracted: %s', text) title('The magnitude domain','FontSize',10); % -------------------------------------------

115

Appendix B.3 Wavelet Domain Watermark Embedding Procedure: WEM.M % -----------------------------------------------function f = wem(name, sym, coef) % -----------------------------------------------%

this function embeds the bitmap picture to the wavelet

%

transform domain of the image. This watermark uses

%

non-blind scheme of extracting watermarks. Coef is a

%

coefficient for multiplication which is used for

%

increasing the amplitude of embedding signal.

% -----------------------------------------------%

coef = 5 as default.

%

wem('image_filename', 'symbol_filename', coef)

%

example:

wem('7.bmp', 'ring1.bmp', 20)

% -----------------------------------------------if nargin < 2 error('enter the name of 2 images'); end if nargin == 2 coef = 20; end if nargin > 3 error('Too many input arguments.') end % -----------------------------------------------% Opening files procedures: openfileproc; opensymproc; % -----------------------------------------------% Preparing the watermark image for embedding, % the matrix NN is constructed and tiled by watermark image % ------------------------------------------------

116

hei = ceil(height/heightn); wid = ceil(width/widthn); N1 = [N N]; for wi = 1:wid N1 = [N N1]; end N2 = [N1; N1]; for he = 1:hei N2 = [N2; N1]; end NN = N2; NN = double(NN); NN = NN*coef; % ND = NN(5:height+4,5:width+4); % NH = NN(10:height+9,10:width+9); NV = NN(1:height,1:width); % -----------------------------------------------I = double(I); % -----------------------------------------------% Wavelet transform % -----------------------------------------------[CA,CHD,CVD,CDD] = swt2(I, 2, 'haar'); % -----------------------------------------------% For experiments there were choosen some of the planes % and then watermark is added to the plane % -----------------------------------------------%for m = 1:4 % %

% three transform matrices used sequently

switch m case 1

%

M = CA(:,:,1);

%

M = M + NH;

%

CA(:,:,1) = M;

%

case 2 M = CVD(:,:,1); M = M + NV;

117

CVD(:,:,1) = M; %

otherwise

%

M = CDD(:,:,1);

%

M = M + ND;

%

CDD(:,:,1) = M;

%

end

%end % -----------------------------------------------% inverse transform % -----------------------------------------------II = iswt2(CA,CHD,CVD,CDD,'haar'); IN = uint8(II); % -----------------------------------------------% displaying the result % -----------------------------------------------subplot(121); imshow(uint8(I)); subplot(122); imshow(IN); % -----------------------------------------------% the new picture file will be written in a file with the % 'em' added % for example: the original file - 001.tif % the picture with embedded text - 001em.tif % -----------------------------------------------writefile = [fi_name, 'em', fi_extn]; imwrite(IN, writefile); sprintf('The file with the embedded symbol is ... saved as: %s', writefile) % -----------------------------------------------title9 = 'CEMB'; wr = [title9, fi_extn]; imwrite(NV, wr); % ------------------------------------------------

118

Appendix B.4 Wavelet Domain Watermark Extracting Procedure: WEX.M % -----------------------------------------function f = wex(name) % -----------------------------------------%

this function extracts the watermark

%

embedded by wem.m

% %

wex('image_filename')

%

examples:

%

if the extentions of the files are

%

not given therefore as default there will

%

be given the '.bmp' extentions

wex('7em.bmp')

% -----------------------------------------if nargin > 2 error('too many inputs'); end % -----------------------------------------% Opening file procedure % -----------------------------------------openemfileproc; % -----------------------------------------subplot(122); imshow(I); title('The Watermarked Image', 'FontSize',10); subplot(121); imshow(IO); title('The Original Image', 'FontSize',10); I = double(I);

% supposedly watermarked image

IO = double(IO); % the original image % ------------------------------------------% the wavelet transform of the images % ------------------------------------------[CAD, CHD, CVD, CDD]

= swt2(I,

2, 'haar');

119

[CADO,CHDO,CVDO,CDDO] = swt2(IO, 2, 'haar'); % ------------------------------------------ORIGINAL = imread('CEMB.bmp'); [h w] = size(ORIGINAL); ORIGINALLINE = []; for hh = 1:h for ww = 1:w ORIGINALLINE = [ORIGINALLINE,ORIGINAL(hh,ww)]; end end OR = ORIGINALLINE(5:(length(ORIGINALLINE)-5)); lo = length(OR); figure; COEF = []; for k = 1:8 EMBEDLINE = []; CO = []; switch k case 1 A = CHD(:,:,1) - CHDO(:,:,1); subplot(241) T = 'CHD1'; case 2 A = CHD(:,:,2) - CHDO(:,:,2); subplot(245) T = 'CHD2'; case 3 A = CVD(:,:,1) - CVDO(:,:,1); subplot(242) T = 'CVD1'; case 4 A = CVD(:,:,2) - CVDO(:,:,2); subplot(246) T = 'CVD2'; case 5 A = CDD(:,:,1) - CDDO(:,:,1);

120

subplot(243) T = 'CDD1'; case 6 A = CDD(:,:,2) - CDDO(:,:,2); subplot(247) T = 'CDD2'; case 7 A = CAD(:,:,1) - CADO(:,:,1); subplot(244) T = 'CAD1'; otherwise A = CAD(:,:,2) - CADO(:,:,2); subplot(248) T = 'CAD2'; end for hh = 1:h for ww = 1:w EMBEDLINE = [EMBEDLINE,A(hh,ww)]; end end le = length(EMBEDLINE); dif = le - lo; for i = 1:dif EM = EMBEDLINE(i:(le-dif-1+i)); CO = [CO, corr2(EM, OR)]; end plot(CO); title(T,'FontSize',10); ylim([-0.44 0.44]) COEF = [COEF; CO]; end % ------------------------------------------

121

Appendix C. Supplementary Procedures Appendix C.1 Supplementary Procedure: Opening File: OPENFILEPROC.M

% ------------------------------------------------------% standard procedure OPENFILEEPROC % ------------------------------------------------------%

preparation of the file name, defining the name and extension

% ------------------------------------------------------len=length(name); dot = strfind(name, '.'); if length(dot) == 0 fi_extn = '.bmp'; fi_name = name; openfile = [name, '.bmp']; else fi_name = name(1:dot-1); fi_extn = name(dot:len); openfile = name; end % -----------------------------------------------------sprintf('The picture file opened: %s', openfile) % -----------------------------------------------------I = imread(openfile); [height width dim] = size(I); % ------------------------------------------------------

122

Appendix C.2 Supplementary Procedure: Opening Bitmap Image: OPENSYMPROC.M % -------------------------------------------------% OPENSYMPROC procedure % -------------------------------------------------%

preparation of the file name, defining the name and extention

% -------------------------------------------------lens=length(sym); dot = strfind(sym, '.'); if length(dot) == 0 opensym = [sym, '.bmp']; else opensym = sym; end % -------------------------------------------------sprintf('The picture file opened: %s', opensym) % -------------------------------------------------N = imread(opensym); [heightn widthn] = size(N); % --------------------------------------------------

123

Appendix C.3 Supplementary Procedure: Opening Watermarked File: OPENEMFILEPROC.M % -------------------------------------------------% procedure OPENEMFILEPROC % -------------------------------------------------%

preparation of the file name, defining the name and extension

% -------------------------------------------------len=length(name); dot = strfind(name, '.');

em = strfind(name, 'em');

if length(em) == 0 error('the file has not embedded information'); else name1 = name(1:em-1); end if length(dot) == 0 extn = '.bmp';

fi_name = name;

openfile = [name, '.bmp']; openfileoriginal = [name1, '.bmp']; else fi_name = name(1:dot-1); openfile = name;

fi_extn = name(dot:len);

openfileoriginal = [name1, fi_extn];

end % -------------------------------------------------sprintf('The picture file opened: %s', openfile) sprintf('The original picture file opened: %s', openfileoriginal) % -------------------------------------------------I = imread(openfile); IO = imread(openfileoriginal); [height width dim] = size(I); % --------------------------------------------------

124

Appendix C.4 Supplementary Text to Binary Transform Procedure: TEXTTOBINARY.M % -------------------------------------------------% procedure TEXTTOBINARY % -------------------------------------------------% text to binary number chain transformation % -------------------------------------------------sprintf('The text for embedding: %s', text) textsize = length(text); bina = []; for j = 1:textsize letter = text(j); n = double(letter); % defining the ascii code of the letter m = dec2bin(n);

% defining the binary code of the letter

while length(m) < 7 zero = '0';

% forming of the 7-symbol binary code

m = [zero,m]; end bina = [bina, m]; end bina = [bina '0000000']; len = length(bina); for i = 1:len num(i) = bin2dec(bina(i)); end

125

REFERENCES

[1]. Katzenbeisser, S., Petitcolas, F. A. P., editors. Information Hiding Techniques for Steganography and Digital Watermarking, Artech House Books, January 2000. p.97. [2]. Cox, I., Miller, M. L., Bloom, J. A., Digital Watermarking. The Morgan Kaufmann Series in Multimedia and Information Systems. San Diego, 2002. p.7 [3]. Hembroke, E. F., “Identification of Sound and Like Signals”, United Stares Patent 3, 004, 104, 1961. [4]. Cox, I., Miller, M. L., Bloom, J. A., Digital Watermarking. The Morgan Kaufmann Series in Multimedia and Information Systems. San Diego, 2002. p.5 [5]. Szepanski, W. “A Signal Theoretic Method for Creating Forgery-Proof Documents for Automatic Verification,” in Jackson, J. S., editor, 1979 Carnahan Conference on Crime Countermeasures, 1979, pp. 101-109. [6]. Holt, L., Maufe, B. G., and Wiener, A., “Encoded Marking of a Recording Signal,” U.K. Patent GB 2196167A, 1988. [7]. Komatsu, N., and Tominaga, H. Authentication System Using Concealed Images in Telematics. Memoirs of the School of Science and Engineering., Waseda University, 52:45-60, 1988. [8]. “Document prepared by the International Bureau, WIPO/INT/SIN/98/9” 1998, Presented at the WIPO Seminar for Asia and the Pacific Region on the Internet and the Protection of Intellectual Property Rights, Singapore. 5ih

126

[9]. Lai, S., The Impact of the Recent WIPO Copyright Treat and Other Initiatives on Software Copyright in the United Kingdom, Intellectual Property Quarterly, 1998, pp.35. 6ih [10]. “WIPO Copyright Treaty,” 1996. 4ih [11]. Anderson, A., editor. Information Hiding. Volume 1174 of Lecture Notes in Computer Science. Berlin; New York: Springer-Verlag, 1996. [12] Wong, P. W., and Delp, E. J., editors. Security and Watermarking of Multimedia Contents, Proceeding of the Society of Photo-optical Instrumentation Engineers, volume 3657, 1999. [13]. Wong, P. W., and Delp, E. J., editors. Security and Watermarking of Multimedia Contents II, Proceeding of the Society of Photo-optical Instrumentation Engineers, volume 3971, 2000. [14]. Bell, A. E., The Dynamic Digital Disk, IEEE Spectrum, 36(10): 28-35, 1999. [15]. SDMI Portable Device Specification, Part 1, Version 1.0, Document number pdwg99070802, July 1999. [16]. Depovere, G., Kalker, T., Haitsma, J, The VIVA Project: Digital Watermarking for Broadcast Monitoring. IEEE, International Conference on Image Processing. 2:202-205, 1999. [17]. Hartung, F., Kutter, M., Multimedia Watermarking Techniques. Proceedings of the IEEE, 87(7):1079-1107, 1999. [18]. Bruyndonckx, O., Quisquater, J-J., and Macq, B., Spatial method for copyright labeling of digital images. In IEEE Workshop on Nonlinear Signal and Image Processing '95, Thessaloniki, Greece, pages 456 - 459, 1995.

127

[19]. Cox, I., Kilian, J., Leighton, T., and Shamoon, T.G., Secure spread spectrum watermarking for multimedia. In Proceedings of the IEEE International Conference on Image Processing, ICIP '97, volume 6, pages 1673 - 1687, Santa Barbara, California, USA, 1997. [20]. Dugad, R., Ratakonda, K., and Ahuja, N., A new wavelet-based scheme for watermarking images. In Proceedings of the IEEE International Conference on Image Processing, ICIP '98, Chicago, IL, USA, October 1998. [21]. Rhoads, G. B., Image steganography system featuring perceptually adaptive and globally scalable signal embedding, United States Patent 5,748,763,1998, [22]. Rhoads, G. B., Steganography System, United States Patent 5,850,481, 1998 [23]. Barnett R., Digital Watermarking: applications, techniques and challenges. ECEJ, pages 173 - 183. August 1999. [24]. R. B. Wolfgang and E. J. Delp, "Overview of Image Security Techniques with Applications in Multimedia Systems," Proceedings of the SPIE Conference on Multimedia Networks: Security, Displays, Terminals, and Gatweys, Vol. 3228, November 2-5, 1997, Dallas, Texas, pp. 297-308. [25]. Katzenbeisser S., Fabien, Petitcolas A.P., Information Hiding Techniques for Steganography and Digital Watermarking. Artech House Inc. 2000 [26]. Cox I., Miller M., Bloom J., Digital Watermarking: Principles & Practice. The Morgan Kaufmann Publishers, 2001. [27]. Wayner P., Disappearing Cryptography, Second Edition. Information Hiding: Steganography and Watermarking. The Morgan Kaufmann Publisher. 2002.

128

[28]. Johnson, N.F., Duric, Z., Jajodia, S., Information Hiding: Steganography and Watermarking. Attacks and Countermeasures. Advances in Information Security, Volume 1. 2000 [29]. Lu, C.-S., Huang, S.-K., Sze, C.-J., and Li, H.-Y. M. A New Watermarking technique for Multimedia Protection. Imstitute of Information Science, Academia Sinica, Taipei, Taiwan. [30]. http://www.ece.purdue.edu/~ace/water2/digwmk.html Digital Watermarking and Data Hiding. Multimedia Security Research at Purdue University. [31]. http://www.ece.purdue.edu/~ace/water2/digwmk.html Multimedia Security Research at Purdue University. Different Types of Watermarks [32]. http://www.watermarkingworld.org/faq.html Watermarking World. Digital Watermarking Frequently Asked Questions [33]. Podilchuk, C. I., and Zeng, W., Image Adaptive Watermarking Using Visual Models, IEEE Journal on Selected Areas in Communications, Vol. 16, pp.525-539., 1998. [34] Petitcolas, F.A.P., “Watermarking Schemes Evaluation” ”, in IEEE Signal Processing Magazine, Vol. 17, pp 58-64, September 2000 [35] Kutter, M., Hartung, F. “Introduction to Watermarking Techniques” in Information

Techniques

for

Steganography

and

Digital

Watermarking,

S.C.

Katzenbeisser et al., Eds. Northwood, MA: Artec House, Dec. 1999, pp 97-119. [36] Lin, E. T., and Delp, E., A Review of Data Hiding in Digital Images. Video and Image Processing Laboratory (VIPER) School of Electrical and Computer Engineering, Purdue University, West Lafayette, Indana.

129

[37]. Marvel, L., Image Steganography for Hidden Communication. Ph. D. Dissertation, University of Delaware, Dept. of EE, 1999. P. 10 http://citeseer.ist.psu.edu/marvel99image [38. 901] Cox, I. J., Kilian, F. T., Leighton, F. T., and Shamoon, T., Secure Spread Spectrum Watermarking of Images, Audio, and Video, Proc. IEEE International Conf. of Image Processing, ICIP-96, Vol.3, pp. 243-246. [39. 900] G. Langelaar, I. Setyawan, R.L. Lagendijk, “Watermarking Digital Image and Video Data”, in IEEE Signal Processing Magazine, Vol. 17, pp 20-43, September 2000. [40. 99]. Bender, W., Gruhl, D., and Morimoto, N., “Techniques for data hiding”, in Proceeding of the SPIE 2412, Storage and Retrieval for Image and Video Databases III, 1995, pp. 164-173. [41. 903]. Muharemagic, E., and Furht, B., Survey of Watermarking Techniques and Applications. Dept. of Computer Science and Engineering, Florida Atlantic University. [42. 114]. Cox, I. J., Kilian, F. T., Leighton, F. T., and Shamoon, T., Secure Spread Spectrum Watermarking for Multimedia. IEEE, Trans. Image Processing, Vol., 6, pp. 1673-1687, 1997. [43]. Gonzalez, R., Woods, R., Eddins, S., Digital Image Processing Using MATLAB. Prentice Hall, 2004. [44]. MATLAB Image Processing Help Box. Fourier Transform.

130

[45]. Ruanaidh, J. J., Dowling, W. J., Boland, F. M., Phase watermarking of digital images. Proceedings of International Conference on Image Processing, Volume 3., Sept. 1996, p.p. 239 – 242. [46]. Ruanaidh, J. J., and Pun, T., Rotation, Translation and Scale Invariant Digital Image watermarking, in Proceedings of the international Conference on Image Processing, vol. 1, Santa Barbara, California, Oct. 1997, pp. 536 – 539. [47]. Hubbard. B. B., The World According to Wavelets: The Story of a Mathematical Technique in the Making. 1996. [48]. Wang, H.-J., and Kuo, C.-C. J., “Image Protection via Watermarking on Perceptually Significant Wavelet Coefficients,” in Proceedings of the IEEE Multimedia Signal Processing Workshop, Redondo Beach, California, Dec., 1998, pp. 279-284. [49]. Kundur, D., and Hatzinakos, D., “A Robust Digital Image Watermarking Method Using Wavelet-Based Fusion” in Proceedings of the International Conference on Image Processing, vol. 1, Santa Barbara, California, Oct., 1997, pp. 544-547. [50]. Wilson, T. A., Rogers, S. K., and Myers, L. R., “Perceptual Based Hyperspectral Image Fusion Using Multyresolution Analysis,” Optical Engineering, vol. 34, 1995, pp. 3154-3164. [51]. Xia, X.-G., Boncelet, C. G., and Arce, G. R., “Wavelet Transform Based Watermark for Digital Images”, Optics Express, vol. 3, no. 12, 1998, pp. 497-511. [52]. Zhu, W., Xiong, Z., Zhang, Y., Multiresolution watermarking for images and video: a unified approach. Proceeding of 1998 International Conference on Image Processing, Vol. 1, Oct. 1998, Pages: 465-468.

131

Suggest Documents