• 沒有找到結果。

Problems and Proposed Solutions for Mosaic Image Creation

Chapter 2 A New Data Hiding Technique via Secret-fragment-visible Mosaic

2.3 Problems and Proposed Solutions for Mosaic Image Creation

Problems encountered in generating mosaic images are discussed in this section with solutions to them proposed.

A. Color Transformations between Blocks

In the first phase of the proposed method, each tile image T in the given secret image is fit into a target block B in a pre-selected target image. Since the color characteristics of T and B are different from each other, how to change their color distributions to make them look alike is the main issue here. Reinhard et al. [43]

proposed a color transfer scheme in this aspect, which converts the color characteristic of an image to be that of another in the l color space. This idea is an answer to the issue and is adopted in this study, except that the RGB color space instead of the l

one is used to reduce the volume of the required information for recovery of the original secret image.

More specifically, let T and B be described as two pixel sets {p1, p2, …, pn} and {p1′, p2′, …, pn′}, respectively. Let the color of each pi be denoted by (ri, gi, bi) and that of each pi′ by (ri′, gi′, bi′). At first, we compute the means and standard deviations of T and B, respectively, in each of the three color channels R, G, and B by the following formulas:

1 1 verified easily that the new color mean and variance of the resulting tile image T′ are equal to those of B, respectively. To compute the original color values (ri, gi, bi) of pi formula are all real numbers, and it is impractical to embed real numbers, each with many digits, in the generated mosaic image. Therefore, we limit the numbers of bits used to represent relevant parameter values in (3) and (4). Specifically, for each color channel we allow each of the means of T and B to have 8 bits with its value in the range of 0 to 255, and the standard deviation quotient qc in (3) to have 7 bits with its value in the range of 0.1 to 12.8. That is, each mean is changed to the closest value in the range of 0 to 255, and each qc is changed to the closest value in the range of 0.1 to 12.8. We do not allow qc to be 0 because otherwise the original pixel value cannot be recovered back by (4) for the reason that 1/qc in (4) is not defined when qc = 0.

B. Choosing Appropriate Target Blocks and Rotating Blocks to Fit Better with Smaller RMSE Value

In transforming the color characteristic of a tile image T to be that of a corresponding target block B as described above, how to choose an appropriate B for each T is an issue. For this, as shown in Figure 2.3, we use the standard deviation of the colors in the block as a measure to select the most similar B for each T. Specially, we sort all the tile images to form a sequence, Stile, and all the target blocks to form another, Starget, according to the average values of the standard deviations of the three color channels. Then, we fit the first in Stile into the first in Starget, fit the second in Stile

into the second in Starget, and so on.

Figure 2.3. Illustration of fitting tile images into target blocks.

Additionally, after a target block B is chosen to fit a tile image T and after the color characteristic of T is transformed, we conduct a further improvement on the color similarity between the resulting tile image T′ and the target block B by rotating T′ into one of the four directions, 0o, 90o, 180o, and 270o, which yields a rotated

version of T′ with the minimum root mean square error (RMSE) value with respect to B among the four directions for final use to fit T into B. Furthermore, the color similariy between the resulting tile image T′ and the target block B is measured in the luminance channel only, instead of in the RGB three color channels, to reduce the execution time of the proposed method. Figure 2.4 shows a result of applying this block rotation scheme to the secret image and the target image shown in Figures 2.4(a) and 2.4(b), respectively, where Figure 2.4(c) is the mosaic image created without applying this scheme and Figure 2.4(d) is the one created instead. It can be seen that Figure 2.4(d) has a better fitting result with a smaller RMSE value than Figure 2.4(c).

(a) (b)

(c) (d)

Figure 2.4. Illustration of effect of rotating tile images before fitting them into target blocks. (a) Secret image. (b) Target image. (c) Mosaic image created from (a) and (b) without block rotations (with RMSE = 23.261). (d) Mosaic image created from (a) and (b) with block rotations (with RMSE = 20.870).

C. Handling Overflows/Underflows in Color Transformation

After the color transformation process is conducted as described previously, some pixel values in the new tile image T′ might have overflows or underflows. To deal with this problem, we convert such values to be non-overflow or non-underflow ones and record the value differences as residuals for use in later recovery.

Specifically, we convert all the transformed pixel values in T′ not smaller than 255 to be 255, and all those not larger than 0 to be 0. Next, we compute the differences between the original pixel values and the converted ones as the residuals and record them as part of the information associated with T′. Accordingly, the pixel values which are just on the bound of 255 or 0, however, cannot be distinguished from those with overflow/underflow values during later recovery since all the pixel values with overflows/underflows are converted to be 255 or 0 now. To remedy this, we define the residuals of those pixel values which are on the bound to be “0” and record them as well.

But as can be seen from (3), the ranges of possible residual values are unknown, and this causes a problem of deciding how many bits should be used to record a residual. To solve this problem, we record the residual values in the un-transformed color space rather than in the transformed one. That is, by using the following two formulas we compute first the smallest possible color value cS (with c = r, g, or b) in T that becomes larger than 255 as well as the largest possible value cL in T that becomes smaller than 0, respectively, after the color transformation process has been residuals of ci will all lie in the range of 0 to 255 as can be verified. Consequently, we can simply record each of them with 8 bits. And finally, because the residual values are centralized around zero, we use further in this study the Huffman encoding scheme to encode the residuals in order to reduce the numbers of required bits to represent them.

D. Embedding Information for Secret Image Recovery

In order to recover the secret image from the mosaic image, we have to embed relevant recovery information into the mosaic image. For this, we adopt a technique proposed by Coltuc and Chassery [44] and apply it to the least significant bits of the pixels in the created mosaic image to conduct data embedding. Unlike the classical LSB replacement methods [6], [45], [46], which substitute LSBs with message bits directly, the reversible contrast mapping method [44] applies simple integer transformations to pairs of pixel values. Specifically, the method conducts forward and backward integer transformations as follows, respectively, where (x, y) are a pair of pixel values and (x', y') are the transformed ones:

2 , 2

The information required to recover a tile image T which is mapped to a target block B includes: 1) the index of B; 2) the optimal rotation angle of T; 3) the truncated means of T and B and the standard deviation quotients, of all color channels; and 4) the overflow/underflow residuals. These data items for recovering a tile image T are integrated as a five-component bit stream of the form

M = t1t2…tmr1r2m1m2…m48q1q2…q21d1d2…dk, represent the rotation angle of T because there are four possible rotation directions; 3) 48 bits are required to represent the means of Tand B because we use eight bits to represent a mean value in each color channel; 4) it needs 21 bits to represent the quotients of T over B in the three color channels with each channel requiring 7 bits;

and 5) the total number k of required bits for representing all the residuals depends on the number of overflows or underflows in T.

Then, the above-defined bit streams of all the tile images are concatenated in order further into a total bit stream Mt for the entire secret image. Moreover, in order to protect Mt from being attacked, we encrypt it with a secret key to obtain an encrypted bit stream Mt′, which is finally embedded into the pixel pairs in the mosaic image using the method of Coltuc and Chassery [44] described above. It may require more than one iteration in the encoding process since the length of Mt′ may be larger than the number of pixel pairs available in an iteration. A plot of the statistics of the numbers of required bits for secret image recovery is shown in Figure 2.10(b).

Moreover, we have to embed as well some related information about the mosaic image generation process into the mosaic image for use in the secret image recovery process. Such information, described as a bit stream I like M mentioned previously, includes the following data items: 1) the number of iterations conducted in the process for embedding the bit stream Mt′; 2) the total number of used pixel pairs in the last iteration for embedding Mt′; and 3) the Huffman table for encoding the residuals.

With the bit stream Mt′ embedded into the mosaic image, we can recover the secret image back as will be described later. It is noted that some loss will be incurred in the recovered secret image, or more specifically, in the color transformation process using (3) where each pixel’s color value ci is multiplied by the standard deviation quotient qc and the resulting real value ci′′ is truncated to be an integer in the range of 0 through 255. However, because each truncated part is smaller than the value of 1, the recovered value of ci using (4) is still precise enough to yield a color nearly identical to its original one. Even when overflows/underflows occur at some pixels in the color transformation process, we record their residual values as described previously and after using (4) to recover the pixel value ci, we add the residual values back to the computed pixel values ci to get the original pixel data, yielding a nearly losslessly-recovered secret image. According to the results of the experiments conducted in this study, each recovered secret image has a very small RMSE value with respect to the original secret image, as will be shown later in Section 2.5.