Chapter 5 A Watermarking Method for Copyright Protection of Binary Images
5.2 A Watermark Embedding Method
5.3.1 Embedding of Watermarks
To generate watermark signals for a binary image, the image is first divided into non-overlapping 4×4 blocks. Then, each 4×4 block is divided further into four non-overlapping 2×2 blocks. Figure 5.1 shows an example of a 4×4 block and its four 2×2 blocks.
(a) (b) Figure 5.1 An example of 4×4 image blocks. (a) A 4×4 block. (b) Each 2×2 block
in the 4×4 block.
A. Assigning Gray Values to 2×2 Blocks
73
In the modified inverse halftoning technique, we modify the RHG values of an image to assign a gray value to a 2×2 block, which was first proposed by Tsai and Huang [10]. The RHG value is the abbreviation of reduced halftone gray and an RHG function is used to convert grayscale images into binary ones. In Tsai and Huang’s method, the use of the RHG function aims to process a binary image of the size of 9×9 block. However, in the proposed method, the size of a block to process a binary image is taken to be 4×4. It is, therefore, necessary to modify the RHG in a way as described here. That is, each 2×2 binary image block B is assigned a gray value G by the following RHG formula:
G=[(4-N)×255/4] (5.1)
where N is the number of black pixels in B. The RHG value maps the range of gray values [0 255] into 4 discrete gray levels. That is, for an input N, B is assigned a gray value G which is one of the five values 0, 64, 128, 192, 256. For example, if N is 0, the RHG value is 256. If N = 1, then the RHG value is 192. If N is 4, the RHG value is 0. We use these RHG values to represent the gray values of each block, and then choose the candidates from the four blocks to embed watermark signals.
B. Choice of Rearrangeable Block
In order to control the quality of a binary image, we should carefully select a proper 2×2 block from a 4×4 block to embed watermark signals. Each block selected for this purpose is called a rearrangeable block in this study. For each 2×2 block, if their RHG value is 0 or 256 which means black or white entirely, we remove these blocks from the candidate block list. The reason is obvious, because if we make any change in an entirely black or white block, it will be easily noticed.
74
The way to select a proper block for embedding watermark signals is described next. One good choice of the block is that with its RHG value Gs being the smallest but not 0, and another choice is that with its RHG value Gl being the largest but not 255. A large RHG value means that there are fewer black pixels in the block, and a smaller RHG value means fewer white pixels. If we choose these blocks as a candidate to hide data, less distortion will be produced according to a human vision model. Take the smallest RHG value but not 0 as an example. It means that there are fewer white pixels in the block, so it will cause less distortion to rearrange the positions of these white pixels than to rearrange those of the black ones. Let ws be the number of white pixels in the block Ds whose RHG value is Gs and bl be the number of black pixels in the block Dl whose RHG value is Gl. If ws is not larger than bl, then according to the previous discussion, Ds is taken as the rearrangeable block in the proposed method; otherwise, Dl is taken as the rearrangeable block.
C. Rearrangement of Pixels by Reference Table
In this step, we have to set up a reference table T. The reference table is assumed to be held by the sender and the receiver, and the content of T contains the positions of the black pixels and the watermark bit stream. The value Nb in T means the number of black pixels obtained from the 2×2 rearrangeable block b. By table lookup, we will rearrange the positions of black pixels in b. Table 5.1 shows an example of the reference table.
In each 4×4 block BBi, we embed most three bits into the rearrangeable block b.
The way we use to hide data is to apply combinatorial operator. The watermark bit stream with is a combinatorial number, which means the number of ways to pick N
(4, b)
w C= N C(4,Nb)
b unordered outcomes from 4 possibilities. In this study, Nb
75
means the number of black pixels in b. For example, if Nb is equal to 2, we have four positions, {p1, p2, p3, p4}, from which two positions are picked to embed watermark signals, and g = C(4,2)=6, which means we have 6 codes w={r1, r2, r3, r4, r5, r6} for use as watermarks, where r1={p1, p2}, r2={p1, p3}, r3={p1, p4}, r4={p2, p3}, r5={p2, p4}, and r6={p3, p4}. In this case, because four possibilities of combination can be used for representing two bits and we haveC(4, 2)= possibilities of combination to 6 represent two bits, the other two remaining possibilities can be used to represent one more data.
After choosing the rearrangeable block bi, we rearrange the positions of the black pixels according to the number of black pixels by the reference table to embed the watermark bit wi of bit stream s.
Table 5.1 An example of reference table.
Case Number(s) of black pixels (Nb)
10
Case A and Case E mean that the block is entirely black or white. If we change the pixels in these blocks, it is easily noticed. As a result, no data can be embedded.
b. Case B and Case D:
Case B means that there is only one black pixel in the rearrangeable block, and Case D means that there is only one white pixel in the rearrangeable block. When this is the case, because the probability of combination is equal to 4 (that is,
or ), only two bits can be embedded.
B and its bit representation after embedding two bits.
77
(a) (b) (c)
(d) (e) (f)
Figure 5.2 An example of Case B. (a) A 4×4 block. (b) The rearrangeable 2×2 block (in the red block) of the 4×4 block. (c) The 4×4 block after embedding “00” the bit stream of watermark. (d) The 4×4 block after embedding “01” the bit stream of watermark. (e) The 4×4 block after embedding “10” the bit stream of watermark. (f) The 4×4 block after embedding “11” the bit stream of watermark.
c. Case C:
In Case C, there are two black pixels and two white pixels, and the probability of combination is equal to 6 (that is,C(4,2)=6). To embed two bits, only 4 possibilities of combination are needed. In addition to embedding two bits, it has more free space to hide one more bit. We use the remaining 2 free spaces to embed one more bit by the reference table. When this is the case, the rearrangeable block can at most hide three bits. Figure 5.3 shows an example of Case C to illustrate how to embed at most three bits.
78
(a) (b) (c)
(d) (e) (f)
(g) (h) Figure 5.3 An example of Case C. (a) A 4×4 block. (b) The rearrangeable 2×2 block
(in the red block) of the 4×4 block. (c) The 4×4 block after embedding
“00” the bit stream of watermark. (d) The 4×4 block after embedding
“01” the bit stream of watermark. (e) The 4×4 block after embedding
“10” the bit stream of watermark. (f) The 4×4 block after embedding
“11” the bit stream of watermark. (g) The 4×4 block after embedding
“000” the bit stream of watermark. (h) The 4×4 block after embedding
“111” the bit stream of watermark.
5.3.2 Detailed Algorithm
The input to the proposed watermark embedding process includes a binary image I , a watermark W, and a reference table T. The output is a stego-image S. The
processis described as follows. Figure 5.4 illustrates a flowchart of the proposed watermark embedding process.
Algorithm 1: Watermark embedding.
79
Input: A given binary image I and a watermark W.
Output: A stego-image S.
Steps:
1 Create the reference table T.
2 Convert W into a binary form w1w2w3…wL.
3 Divide I into non-overlapping 4×4 blocks, and divide each 4×4 block BBi
further into four non-overlapping 2×2 blocks.
4 For each 2×2 image block Di, count the number N of the black pixels in it and assign it an RHG value G by the reduced halftone gray function described in 5.1.
5 For each 2×2 image block Di, perform the following operations.
5.1. Find the rearrangeable block Di of all the four blocks in BBi, following the step of choosing the rearrangeable block -.
5.2. Calculate the black pixels in Di, and arrange pixels to embed the watermark binary stream wi.
5.3. Rearrange all the pixels of Di to embed watermark signals according to the reference table T.
6 Take the final result as the desired stego-image S.
80
Figure 5.4 Flowchart of proposed method for watermark embedding process.
5.4 Watermark Extraction Process
In the proposed watermark extraction process, a watermark can be extracted to verify the copyright. The concept of the extraction method and the detailed extraction algorithm will be described in this section.
81
5.4.1 Extraction of Watermarks
In the proposed watermark extraction method, the receiver also needs the reference table T, as described in the watermark embedding method to extract the bit stream of the watermark. The extraction process is similar to the proposed embedding process but in a reverse order. A stego-image is first divided into non-overlapping 4×4 blocks. Each 4×4 block BBi is further divided into four 2×2 blocks denoted as bi with i
= 1, 2, 3, 4. In each 2×2 block, we assign the RHG value according to Equation (5.1) and choose the rearrangeable block b. After selecting the rearrangeable block b, we count the number of black pixels and verify the arrangement of black pixels to extract the value of the bit stream by T. That means, by table lookup, the embedded data bits in bi can be determined. After extracting the embedded watermark bit streams, we convert them to obtain watermark signals. shows a flowchart of the proposed extraction process.
Figure 5.5
5.4.2 Detailed Algorithm
Algorithm 2: Watermark extraction.
Input: A given stego-image S.
Output: A watermark W.
Steps:
1. Divide S into non-overlapping 4×4 blocks, and divide each 4×4 block BBi
further into four non-overlapping 2×2 blocks.
2. For each 2×2 image block bi, count the number N of the black pixels in it and assign it an RHG value G by the reduced halftone gray function described by Equation (5.1).
82
3. For each 2×2 image block bi, perform the following operations.
3.1. Find the rearrangeable block b of all the four blocks in BBi, following the step of choosing a rearrangeable block.
3.2. Check the positions of pixels in the rearrangeable block and by table lookup, extract the sub-stream Si from b.
4. Reconstruct the watermark data from several sub-streams.
Figure 5.5 Flowchart of proposed extraction process.
5.5 Experimental Results
Several experimental results of applying the proposed method are shown here.
83
Figure 5.6(a) and (b) illustrate two binary images of the size 256×256. The results after embedding watermark signals are shown in Figure 5.6(c) and (d), respectively.
Figure 5.6(e) and (f) show the differences in black pixels after embedding the watermark bit stream.
(a) (b)
(c) (d) Figure 5.6 Input binary images, output stego-images with watermark signals, the
differences, and the watermark image. (a) A binary image of “Lena”.
(b) A binary image of “Monkey”. (c) and (d) The stego-images after embedding watermark signals. (e) and (f) The difference between the original binary image and the stego-image.
84
(e) (f) Figure 5.6 Input binary images, output stego-images with watermark signals, the
differences, and the watermark image. (a) A binary image of “Lena”. (b) A binary image of “Monkey”. (c) and (d) The stego-images after embedding watermark signals. (e) and (f) The difference between the original binary image and the stego-image (continued).
Figure 5.7 shows some other examples of the results of our experiments. Figure 5.7(a) and (b) are the binary document images both of the size 512×512, and Figure 5.7(c) and (d) show the stego-image after embedding the watermark signals. Figure 5.7(e) and (f) illustrate the difference between the original image and the stego-image. Table 5.2 shows the statistics about the embedded bits and the different pixels for the stego-images after embedding the watermark signals. From these experiments, we can observe that even though the stego-image is embedded with a watermark, we can still see the words clearly. The amount of embedded bits per block ranges from 2.3 to 2.5 bits.
85
(a) (b)
(c) (d) Figure 5.7 Input binary document images, output stego-images with watermark
signals, and the differences. (a) A Chinese binary document image. (b) An English binary document image. (c) and (d) The stego-images after embedding the watermark signals. (e) and (f) The difference between the original binary image and the stego-image, respectively.
86
(e) (f) Figure 5.7 Input binary document images, output stego-images with watermark
signals, and the differences. (a) A Chinese binary document image. (b) An English binary document image. (c) and (d) The stego-images after embedding the watermark signals. (e) and (f) The difference between the original binary image and the stego-image, respectively (continued).
Table 5.2 The statistics about the embedded bits and the difference pixels for the stego-images after embedding watermark signals.
Lena Monkey Chinese English
Used blocks 3154 10299 6417 3359
Embedded bits 7287 23753 15753 8377
Different pixels 4976 16934 10624 5620
5.6 Discussions and Summary
In this chapter, we have presented a novel watermark embedding method for copyright protection in binary images. We use the RHG value to select the proper position to hide data which is called the rearrangeable block. We change the positions of black pixels in the rearrangeable blocks to obtain and embed watermark signals.
87
With the help of the reference table, we can embed 3 bits in a 4×4 block. So during the extraction process, we can extract the embedded watermark signal by table lookup.
Experimental results demonstrate that the words in the stego-image after embedding watermark signals can still be seen clearly. As a result, our algorithm can be applied to not only binary images but also binary document images.
However, the proposed watermark embedding method does not belong to robust watermarking. This means that the embedded watermark signals are easily tampered with. In future works, efforts can be made on solving this problem.
88
Chapter 6
Hiding Digital Information and Authentication Signals behind Binary Images with Reduced Distortion and Enhanced Security
6.1
In this chapter, we propose a method to combine both watermark and authentication signals for binary document images. The method is based on Tzeng and Tsai [1-2]. By integrating the proposed method of [1] and [2], a watermark and an authentication signal can co-exist in a binary document image. The integrity of binary document images can be verified by extracting the authentication signals and the watermark signals can be detected for copyright protection at the same time.
The remainder of this chapter is organized as follows. In Section 6.1, an introduction is given first. In Section 6.2, the idea of the integration method is described. In Section 6.3, the watermark and authentication signal embedding processes are given. In Section 6.4, the watermark extraction process and the image authentication process are described. In Section 6.5, some experimental results are given to show the feasibility of the proposed integration method. Finally, in Section 6.6, some discussions and summary are made.
Introduction
Due to the rapid growth of digital processing, digital images are easy to be copied or even tampered with. It is necessary to devise a scheme both to protect the copyright of images and to authenticate the fidelity and integrity of them. The techniques of
89
embedding watermark and authentication signals together can be utilized to achieve these goals. Many researches about these techniques are proposed individually.
However, few researches are about combining them in a single image.
In the proposed integration method, we focus on binary images to embed watermark and authentication signals. In a binary image, there are only two types of pixels, black and white, with values 0 and 255, respectively, and if the pixel values are changed arbitrarily, visible artifacts in the image will be created. It is the reason why there are few researches about watermarking for binary images according to our survey. In this chapter, we embed not only watermark signals for copyright protection but also authentication signals for verifying the integrity of a binary image. And it is hoped that after embedding watermark and authentication signals, the quality of the stego-image is still good.
6.1.1 Problem Definitions
Owing to the aforementioned purposes, watermark and authentication signals will be embedded simultaneously in a binary image. But this is quite difficult. A reason is that usable properties of a binary image for data embedding are limited. So, the main issue is to utilize the limited properties efficiently to embed the information properly.
The embedding process should create no conflict in embedding the information of watermark and authentication signals. Furthermore, it is needed to extract all embedded information accurately from the stego-image. In this study, we propose an integration method to find usable properties and utilize them to embed watermark and authentication signals together.
90
6.1.2 Review of Employed Techniques
In this section, techniques employed in our methods are reviewed. These techniques are based on Tzeng and Tsai[1-2]. In Tzeng and Tsai [1], the main topic is embedding authentication signals into binary images. And in Tzeng and Tsai [2], the main topic is embedding watermark signals for copyright protection into binary images. These two techniques are introduced briefly as follows.
(A). Embedding authentication signals
In Tzeng and Tsai [1], two keys and two random number generators are used to create the authentication codes and the positions for embedding authentication signals.
The size of a block used to process an image is 3×3. The first key K1 with the first number generator f1 generate a sequence of random numbers as the authentication codes. The function of the second key K2 with the second number generator f2 is to select randomly code holders to hold the authentication codes. Then, by finding the optimal code holder gopt with the minimum number of different bit values of the authentication codes and replacing the different bit values, if necessary, the authentication codes could be held by the gopt.
As an example, let the pixels in a given 3×3 image block BB1 in a raster scanning order be denoted as P1 through P9 whose contents, when concatenated, are 011110010, as shown in Figure 6.1(a). Authentication codes f1(K1) are 10,11,01,10 and code holders f2(K2) are 15, 29, 82. A 2-bit authentication code c1=10 generated by f1 is to be embedded in B1B shown in Figure 6.1(g). In Figure 6.1, the code holders created by f2
with K2 are H1=(P1, P5), H2=(P2, P9) and H3=(P8, P2). We will select a candidate from the three cold holders with the minimum number of different bit values with the authentication code. As a result, In Figure 6.1 (a), we want to embed c1 into BB1, and find that the code holder H2=(P2,P9)=10 is the same as c1. So in B1B there is no need to
91
modify the pixel value. However, in Figure 6.1(b), we want to embed c2 into BB2, and Figure 6.1 An example of embedding authentication codes. (a) and (b) A 3×3 block.
(c) and (d) Select a code holder to embed an authentication code for (a) and (b). (e) and (f) The result after embedding the authentication code. (g) and (h) The 3×3 block corresponding to (e) and (f).
(B). Embedding watermark signals
In [2], a method to embed watermark signals into a binary image is described. The
92
concept of surrounding edge count (SEC) was proposed to represent data embeddability for binary images. The definition of SEC is defined as follows:
8
where v means the pixel value of centralized viewpoint of p and vi means the pixel value of its eight neighbors. As a result, SECp define as the number of existing edges between p and its eight neighbors in a 3×3 block. Some examples are shown in Figure 6.2(a), (b) and (c). SECp is a measure of the structural randomness in a block from the centralized viewpoint of p. A characteristic of SEC is that the embeddability property can guarantee the embeddability at the embeddable bits can be preserved so that the embedded data at these bits can be extracted correctly. The definition of △SECp is shown below:
p p
SEC SEC SEC '
Δ = − p (6.2)
where SECp'
denote the SEC value after the complementation operation. △SECp is the amount of the resulting change of the numbers of edges in a 3×3 block. Figure 6.2(d) and (e) show the result of SECp and SECp'
, and △SECp is equal to 8. A measure of a pixel p in a 3×3 block B to be data embeddable needs to satisfy the two conditions: (a)
△SECp ≦ threshold=Td; and (b) p and its eight neighbors in B have not been visited yet. The condition (a) above restricts the distortion introduced by the complementation of p’s value to be sufficiently small, so that the resulting image quality will not be affected too much. And condition (b) requires that embeddable pixels be disconnected from one another, so that pixel value changes due to secret embedding will not be clustered or propagated to cause obvious larger-size visual artifacts. The advantage of Tzeng and Tsai[2] is that pixel embeddability can be preserved after the secret hiding process.
In our proposed integration method, we will combine both (A) and (B) methods
93
into a binary image. Because the size of a block used in both methods is 3×3, if we directly apply Method (A) and then apply Method (B) into a binary image, it will cause some conflicts and vice versa.
into a binary image. Because the size of a block used in both methods is 3×3, if we directly apply Method (A) and then apply Method (B) into a binary image, it will cause some conflicts and vice versa.