• 沒有找到結果。

Chapter 3 Creation of Tetromino-based Mosaic Images

3.5 Discussions and Summary

In this chapter, we reviewed a traditional mosaic image creation process and proposed accordingly an idea of creating a novel type of mosaic image composed by tetrominoes. Then, a creation process of tetromino-based mosaic images is proposed.

In addition, an algorithm has been proposed to generate a tetromino database with different colors and tiling styles. Finally, we also proposed a border enhancement process for improving edge effects in tetromino-based mosaic images. Some experimental results are presented to show the effects of the proposed algorithms.

Colors and tetromino combination are the most important characteristics in tetromino-based mosaic image creation. With these two features, we will propose two data hiding methods in the two following chapters.

Figure 3.5 An original image.

(a)

(b)

Figure 3.6 Some of experimental results of the proposed tetromino-based mosaic creation. (a) A tetromino-based mosaic image without border effects created from Figure 3.5. (b) A partial image of the red region in (a).

(a)

(b)

Figure 3.7 Some of experimental results of the proposed tetromino-based mosaic creation. (a) A tetromino-based mosaic image with dark border effects created from Figure 3.5. (b) A partial image of the red region in (a).

(a)

(b)

Figure 3.8 Some of experimental results of the proposed tetromino-based mosaic creation. (a) A tetromino-based mosaic image with lightening and shading border effects created from Figure 3.5. (b) A partial image of the red region in (a).

(a)

(b)

Figure 3.9 Some of experimental results of the proposed tetromino-based mosaic creation. (a) An image of Eiffel Tower. (b) A tetromino-based mosaic image created from (a)

(a)

(b)

Figure 3.10 Some of experimental results of the proposed tetromino-based mosaic creation. (a) An self-portrait of van Gogh. (b) A tetromino-based mosaic image created from (a).

(a)

(b)

Figure 3.11 Some of experimental results of the proposed tetromino-based mosaic creation. (a) An image of Jolin, a singer. (b) A tetromino-based mosaic image created from (a).

Chapter 4

Data Hiding in Tetromino-based Mosaic Images by Distinct

Combinations of Tetrominoes

4.1 Idea of Proposed Method

As mentioned in Chapter 3, we create a new type of mosaic images in this study, named tetromino-based mosaic images. This type of mosaic image is generated by the use of distinct tetromino combinations. Combinations of tetrominoes can be encoded to hide data. However, using this way to hide data may damage the tetromino-based mosaic images which we create. Therefore, we propose to use edge fitting to maintain visual qualities of tetromino-based mosaic images by sacrificing a portion of capacity of data hiding. In this chapter, we will describe the proposed data hiding method using distinct combinations of tetrominoes and an edge fitting technique based on edge detection.

4.2 Proposed Data Hiding Method by Distinct Combinations of

Tetrominoes

4.2.1 Scheme of Propose Method

The main concept of the proposed method for data hiding using tetromino-based mosaic images is to encode tetromino combinations during tetromino-based mosaic image creation. The creation can be regarded as a two-level hierarchical operation.

The lower level of the operation is to fill four tetrominoes into a block of 4×4 grids for tile image generation. And the upper level is to put all tile images together to create a tetromino-based mosaic image. As a result, we can use the lower level of this two-level hierarchical image creation to hide data. Through the tetromino database construction described in Chapter 3, 117 kinds of tetromino combinations can be found by an enumerating process, as mentioned previously. In theory, we can only embed six bits in a block of 4×4 grids by fundamental binary encoding because the largest power of 2 smaller than 117 is 26. To increase the capacity of our data hiding technique, a transformation process between a binary digit system and a decimal digit one are proposed. At first, the given data are transformed into a binary digit sequence.

Subsequently, we transform the binary number sequence into a decimal digit sequence.

Then, we encode 100 tetromino combinations for every two digits of the decimal digit sequence for data hiding. Because the capacity of the maximum integer data type in C/C++ is 64 binary bits long, which equals 20 decimal digits, we can embed 64×(2/20)=6.4 bits in a block of 4×4 grids by the above-mentioned process. The detail of the process is described as algorithm below.

Algorithm 4.1. Data transformation from binary to decimal.

Input: message data D and a secret key K.

Output: a randomized decimal digit sequence Sr to be used in the data hiding process.

Steps:

Step 1. Transform D into a binary digit sequence S = {S1, S2, ..., Sn}.

Step 2. Create an integer set A of integers in a form of the maximum integer data type.

Step 3. For every 20-bit segment St of S, transform St into a decimal number Ai and store it in A in order.

Step 4. Extract each decimal digit of every Ai in A to form a decimal digit array Sd. Step 5. Use K to randomize Sd to get a randomized decimal digit sequence Sr.

4.2.2 Data Hiding Process

In this section, we combine a tetromino-based mosaic image creation and a data embedding technique to carry out the function of data hiding. Algorithm 4.2 shows the details of our method.

Algorithm 4.2. Data hiding in a tetromino-based mosaic image.

Input: a source image I, a tetromino database DB, a secret message M, and a secret key K.

Output: a stego-tetromino-based mosaic image I′.

Steps:

Step 1. Divide I into a set of 4×4 blocks, B = {B1, B2, .., Bn}.

Step 2. Use the secret key K to transform M into a randomized decimal digit sequence Sr by Algorithm 4.1.

Step 3. Divide Sr into several substrings {S1, S2, .., Sn}, each having a length of two digits.

Step 4. For each Bi in B and each Si in S, perform the following operations.

4.1. Transform Si to a decimal number d.

4.2. Choose a tile image L from DB according to d.

4.3. Perform a border enhancement process (Algorithm 3.6) on L to generate L′.

Step 5. For each block Bi in I, replace it with corresponding L′ generated in the last

step to create a stego-tetromino-based mosaic image I′ as output.

4.2.3 Data Extraction Process

Before a data extraction process, we have to figure out the tetromino combination of each 4×4 block in a stego-tetromino-based mosaic image. Because a stego-image is created by a two-level hierarchical mosaic creation process, we also propose a scheme for recognizing two-level tetromino combinations in stego-tetromino-based mosaic images. In the lower level of recognition, we label each 4×4 grid with an index to identify its edge type at first. Fourteen edge types and their relative indexes are shown in Figure 4.1 for tetromino combination recognition. In the upper level of recognition, we represent indexes of edge types as a 4×4 integer array in each block of 4×4 grids. Each array entry records an index according to the edge type of the corresponding position in a block of 4×4 grids. For instance, Figure 4.2(a) shows a combination of tetrominoes. A corresponding edge type array is show in Figure 4.2(b). The detailed algorithm of tetromino combination recognition is stated in Algorithm 4.3. Using this algorithm, we propose a data extraction process, as described in Algorithm 4.4, for a stego-tetromino-based mosaic images.

Algorithm 4.3. Tetromino combination recognition.

Input: a block B of 4×4 grids, a corresponding table T of edge types and indexes (like Figure 4.1), and a tetromino database DB.

Output: a number m to recognize one of tetromino combinations from DB.

Steps:

Step 1. Create an array A to record the edge types of B.

Step 2. For each grid G in B, perform the following operations.

2.1.Creation a one-dimensional array R.

2.2.For each edge e of G, perform the following steps.

2.2.1. If the pixel value Pe of e is equal to the pixel value Pc of the center of G, record false in R.

2.2.2. If Pe is equal to Pc, record true in R.

2.3.Use R to search the edge type of G from T and obtain an index D.

2.4.Record D in the corresponding position of A.

Step 3. Search A from DB to acquire the corresponding number m for recognizing the combination of tetrominoes.

Figure 4.1 Fourteen edge types in a grid of 4×4 grids

(a) (b)

Figure 4.2 Some illustrations of tetromino combination recognition. (a) A tetromino combination of 4×4 grids. (b) A corresponding edge type array of (a).

12 7 12 7 13 6 10 5 0 10 13 11 11 12 3 10

0 1 2 3

4 5 6 7 8 9

1 1 1 1

Algorithm 4.4. Data extraction from a tetromino-based mosaic image.

Input: a stego-tetromino-based mosaic image I, a tetromino database DB, and a secret key K.

Output: a secret message M.

Steps:

Step 1. Create a decimal digit sequence R = {R1, R2, .., Rn}.

Step 2. Divide I into several blocks of 4×4 grids, B = {B1, B2, .., Bn}.

Step 3. For each block Bi in B, perform the following operations.

3.1.Obtain a number m by recognizing the tetromino combination Bi from DB by Algorithm 4.3.

3.2.Transform m to two decimal digits b.

3.3.Record b in R.

Step 4. Use K to generate a random number sequence r and use r to recover R into a decimal digit sequence R′ in its original order.

Step 5. Transform R′ into a binary digit sequence to form a secret message M as output.

4.2.4 Experimental Results

Figure 3.4 shows some experimental results of applying the proposed data hiding method in a tetromino-based mosaic image. Figure 4.3(a) is a tetromino-based mosaic image with a secret message embedded with the proposed data embedding process - Algorithm 4.2. Figure 4.3(b) is the secret message which is extracted from 3.4(a) by the proposed data extraction process – Algorithm 4.4.

(a)

(b)

Figure 4.3 An experimental result. (a) A stego-tetromino-based mosaic image with embedded data. (b) The message extracted from (a).

4.3 Proposed Edge Fitting Method by Adjusting Combinations of

Tetrominoes Using Information Obtained by Edge Detection

4.3.1 Scheme of Creation Process

Using tetromino combinations as codes of the proposed data hiding method may cause a main disadvantage. Because of utilizing distinct combinations of tetrominoes to hide data, we can not find the best matching tile image for each target image during tetromino-based mosaic image creation. This fact can cause some noise in tetromino-based mosaic images. Figure 4.4 shows a comparison between an image created by a mosaic creation process in Chapter 3 and an image created by our data hiding method in Section 4.2. The blue and green regions show the differences caused by noise. To solve this problem, an edge fitting method by adjusting combinations of tetrominoes using the information obtained by edge detection is proposed in this section. To improve the visual quality of stego-tetromino-based mosaic images, we sacrifice a part of data capacity of our data hiding technique to enhance edge effects.

For each block of 4×4 grids, we perform an edge detection operation which was proposed by Canny [31] to obtain edge values and directions at the beginning.

According this edge information, an edge fitting method is proposed to enhance edge effects. Two detailed algorithms of edge fitting method are described in Section 4.3.2.

4.3.2 Detailed Algorithms of Edge Fitting Method

A modified version of the Canny edge detection operation used in our edge fitting method is described in Algorithm 4.5. Then a combinational algorithm of edge fitting and data hiding is described in Algorithm 4.6.

Algorithm 4.5. Canny edge detection.

Input: a block of 4×4 grids, B.

Output: a set of four average edge values, E={Eh, Ev, Ee, Ew}, of B for the four types of edge directions, respectively.

Steps:

Step 1. .Smooth B to generate a smooth block Bs by a 5×5 Gaussian filter matrix MG which is shown in Figure 3.6 according to the following formula:

B the horizontal and vertical directions of Pi to obtain two edge gradients Gx and Gy, respectively.

2.2. Compute the edge gradient G and the direction θ according to the following formula:

2.3.1. If θ is a west and east direction, denote it by a horizontal direction h.

2.3.2. If θ is a north and south direction, denote it by a vertical direction v.

2.3.3. If θ is a north east and south west direction, denote it by a north-east-and-south-west diagonal direction e.

2.3.4. If θ is a north west and south east direction, denote it also by a north-west-and-south-east diagonal direction w.

Step 3. Add up all edge gradients Gh with direction h, and then divide the sum by the number of Gh to obtain an average value Eh.

Step 4. Add up all edge gradients Gv with direction v, and then divide the sum by the number of Gv to obtain an average value Ev.

Step 5. Add up all each edge gradients Ge with direction v, and then divide the sum by the number of Ge to obtain an average value Ee.

Step 6. Add up all edge gradients Gw with direction v, and then divide the sum by the number of Gw to obtain an average value Ew.

Step 7. Assemble Eh, Ev, Ee,and Ew to form E.

Algorithm 4.6. Combining edge fitting and data hiding.

Input: a source image I, a tetromino database DB, a secret message M, a secret key K, and an edge threshold Te.

Output: a stego-tetromino-based mosaic image I′ with enhanced-edge visual effects.

Steps:

Step 1. Use the secret key K to transform M into a randomized decimal digit sequence Sr by Algorithm 4.1.

Step 2. Divide I into a set of 4×4 blocks, B = {B1, B2, .., Bn}.

Step 3. Divide Sr into several substrings {S1, S2, .., Sn}, each having a length of two digits.

Step 4. For each block Bi in B and each Si in S, perform the following steps.

4.1. Perform the Canny edge detection on Bi by Algorithm 4.5 to obtain four edge values E of the four directions.

4.2. Choose the maximum value of E and denote it by Em. 4.3. Check Em according to the follow steps.

4.3.1. If Em<Te, perform the following data hiding steps on Bi. 4.3.1.1 Transform Si into a decimal number d.

4.3.1.2 Choose a tile image L from DB according to d.

4.3.2. If Em≧Te, perform the following edge fitting steps on Bi. 4.3.2.1 Check the direction of Em and denote it by R.

4.3.2.2 Choose a tile image L from Figure 4.7 according to R.

4.3.3. Replace Bi with L.

4.3.4. Perform a border enhancement process (Algorithm 3.6) on L to generate L′.

Step 5. For each block Bi in I, replace it with corresponding L′ to create a stego-tetromino-based mosaic image I′ as output.

(a)

Figure 4.4 A comparison between two tetromino-based mosaic images. The blue and green regions show the differences caused by noise. (a) An original image. (b) An image created from (a) by a mosaic creation in Chapter 3. (c) An image created from (a) by our data hiding method in Section 4.2.

(b)

Figure 4.4 A comparison between two tetromino-based mosaic images. The blue and green regions show the differences caused by noise. (a) An original image. (b) An image created from (a) by a mosaic creation in Chapter 3. (c) An image created from (a) by our data hiding method in Section 4.2 (continued).

(b)

Figure 4.4 A comparison between two tetromino-based mosaic images. The blue and green regions show the differences caused by noise. (a) An original image. (b) An image created from (a) by a mosaic creation in Chapter 3. (c) An image created from (a) by our data hiding method in Section 4.2 (continued).

2 4 5 4 2

4 9 12 9 4

5 12 15 12 5

4 9 12 9 4

2 4 5 4 2

Figure 4.5 A Gaussian filter matrix.

-1 -2 -1

0 0 0

1 2 1

-1 0 1 -2 0 2 -1 0 1

Figure 4.6 3×3 Sobel masks

(a) (b) (c)

Figure 4.7 Some illustrations of tile images for different edge directions. (a) Vertical direction. (b) Horizontal direction. (c) Two diagonal directions.

4.3.3 Experimental Results

Some experimental results generated by the proposed edge fitting method (Algorithm 4.6) are shown in this section. Figures 4.8(a) and 4.8(b) show a source image and the result of embedding data process created from the source image without applying an edge fitting method. Figure 4.8(c) shows an improved result created by using the edge fitting method.

4.4 Discussions and Summary

In this chapter, we have proposed a data hiding technique by using distinct

combinations of tetrominoes. Then, a process for extracting data from stego-tetromino-based mosaic images is proposed. In addition, an edge fitting method has been proposed to enhance edge effects by adjusting combinations of tetrominoes using the information obtained by edge detection. Some experimental results were presented to show the effects of the proposed algorithms.

(b)

Figure 4.8 Some experimental results. The green regions show the noise improvement achieved by an edge fitting method. (a) A stego-tetromino-based mosaic image created from 4.4(a) with embedded data. (b) A stego-tetromino-based mosaic image created from 4.4(a) with embedded data by the proposed edge fitting method.

(c)

Figure 4.8 Some experimental results. The green regions show the noise improvement achieved by an edge fitting method. (a) A stego-tetromino-based mosaic image created from 4.4(a) with embedded data. (b) A stego-tetromino-based mosaic image created from 4.4(a) with embedded data by the proposed edge fitting method (continued).

Chapter 5

Data Hiding in Tetromino-based Mosaic Images by Small Tetromino Color Shiftings

5.1 Idea of Proposed Method

Color is an important factor in the human visual system. In general, human eyes are perceptive to luminances of colors but insensitive to chrominances of colors.

Figure 5.1 shows a comparison of four colors which are different from one another. It seems to have no difference among the four colors which are mutually shifted slightly in the RGB color model. Therefore, we can utilize this characteristic to hide data in a tetromino-based mosaic image, as done in the proposed method of hiding data in tetromino-based mosaic images. For each tetromino of a tetromino-based mosaic image, we perform a small color shifting to hide data by adjusting the colors of neighboring grids in a tetromino. In addition, the original tetromino-based mosaic image can be losslessly recovered from a stego-image which is created by this data hiding method.

5.2 Proposed Data Hiding by Small

Tetromino Color Shiftings

5.2.1 Scheme of Propose Method

In this section, the proposed data hiding method by small tetromino color shiftings is described. We choose one grid from a tetromino and name it pivot grid at first. An illustration of pivot grids of the nineteen tetromino types is shown is Figure 5.2. A color of the tetromino is stored in the pivot grid for the use in data extraction with a lossless recovery of the original image from the stego-image. Next, the other three grids of the tetromino are used to embed data by changing slightly the colors of these grids. Proven by our experiments, it is possible to increase or decrease each color channel value of a tetromino grid pixel by one or two without incurring perceptual difference. This means that we can encode five color shift values which range from −2 to 2 in each color channel for data hiding. Because full-color images which are used as our inputs have three channels in the RGB color model, totally 53 types of color shiftings can be encoded for each grid of the tetromino. Also, according to the definition of a tetromino, it is composed of four grids which are connected orthogonally. Except the pivot grid, three grids can be used to embed data in a tetromino. And there are four tetrominoes in a block. As a result, 53×3×4 variations can be encoded for hiding data in a block. That is to say, each block can embed at least 83 bits because the largest value of a power of 2 smaller than 53×3×4 is 283. Then, a stego-image generated from a tetromino-based mosaic image is created by the above-mentioned data hiding process. A data extraction process of the proposed data hiding method is also described later in this chapter.

5.2.2 Data Hiding Process

In this section, we describe the proposed data hiding technique using a

tetromino-based mosaic image as an input. Each color channel of a tetromino in this mosaic image is utilized to embed data by increasing or decreasing the values of the color channels slightly. Table 5.1 shows a coding table for encoding secret message bits by color shiftings for use in data hiding. Algorithm 5.1 shows the details of our method.

Figure 5.1 A comparison of four close colors in a block. (1) Color values of RGB channel = (255, 0, 0). (2) Color values of RGB channel = (255, 2, 0). (3) Color values of RGB channel = (253, 0, 2). (4) Color values of RGB channel = (253, 2, 2).

Figure 5.2 An illustration of nineteen tetromino types and their pivot grids. The black spot of each tetromino depicts its pivot grid.

Algorithm 5.1. Data hiding by small tetromino color shifting.

4 2 1

3

Input: a tetromino-based mosaic image I, a secret message M, a tetromino database

Step 3. For each block Bi in B, perform the following steps.

3.1. Obtain a number m by recognizing the tetromino combination Bi from DB

3.3.2.2 Create an array E to store the border information of g.

3.3.2.3 For each border pixel b of g, obtain a color Cb of b and check Cb

A. Acquire a shifting parameter d from Table 5.1 according to Qi.

B. Use c and d to obtain c′ by the following formula to embed Qi: d

c c'= + .

C. For each pixel x in g, replace its color channel value c by c′, except when x is a border pixel and the corresponding value in E is true.

3.4. Perform the above steps to obtain a stego-tetromino-based mosaic image I′.

In Step 3.3.2.4.C of Algorithm 5.1 above, we preserve the color values of the pixels in the region of the border enhancement which have been described in Chapter 3. This is because we hope to maintain the visual effects created by the border enhancement and it does not cause any effect on the proposed data hiding method.

Table 5.1 A coding table between a message digit Qi and a shifting parameter d.

Message digit Qi Shifting parameter d

0 -2

1 -1

2 0

3 1

4 2

5.2.3 Data Extraction Process

The proposed data extraction process is an inverse version of the data hiding process. Besides extracting data, the process also restores the original cover image

from the stego-image in the mean time. We so call it a lossless data recovery process, as mentioned previously, where “data” mean both the message data and the cover image data. In this section, we describe this process, which utilizes a color stored in a pivot grid of each tetromino in a stego-image to achieve its lossless recovery function.

The detail of the process is described as algorithm below.

Algorithm 5.2. Lossless data recovery process.

Input: a stego-tetromino-based mosaic image I, a tetromino database DB, and a secret key K.

Output: a secret message M, and a losslessly recovered cover tetromino-based mosaic image I′.

Steps:

Step 1. Create an empty quinary digit sequence Q initially.

Step 2. Divide I into several blocks of 4×4 grids, B = {B1, B2, ..., Bn}.

3.3.2.2. Create an array E to store the border information of g.

3.3.2.2. Create an array E to store the border information of g.