• 沒有找到結果。

Chapter 6 A New Data Hiding Technique via Message-rich code Image for

6.3 Generation of Message-rich Code Image

6.3.1 Pattern image creation

Unlike the method in Chapter 5 that transforms a message M into a character message image, the proposed method in this chapter transforms M into a bit stream B of codes, uses binary code patterns to encode the bits of B, and composes the code

patterns, each in the form a pattern block, to form a pattern image similar in appearance to a pre-selected target image. Specifically, each pattern block T consists of several unit blocks Fi, with each Fi representing a bit of the code pattern C which T represents. A main issue here is how to design the code patterns so that the corresponding pattern blocks are suitable for use not only in message embedding but in block luminance modulation (see Stage 1-3 in this chapter above). To solve this issue, two characteristics must be provided in the designed code patterns: 1) the number of bits in each code pattern C must be small enough, so that the pattern block T representative of C can keep the local color characteristic of the corresponding target image area; and 2) the colors of the unit blocks Fi of the pattern block T representative of each code pattern C should not be all the same, since this will cause the original bits represented by the unit blocks of the code patterns undistinguishable during message extraction.

The first characteristic mentioned above is necessary for the resulting message-rich code image to become more similar to the pre-selected target image.

And as an illustration of the necessity of the second characteristic, Figure 6.3 shows an example of undistinguishable binary code patterns, where the unit blocks Fi of the pattern block T representative of a code pattern C with bits “0000” are all of an identical color originally and are modulated to be all of another color, but then in the message extraction stage, the bits represented by the modulated pattern block cannot be extracted since only one color exists in this modulated pattern block and the bits corresponding to this color cannot be uniquely determined (more details discussed later).

Figure 6.3. An example of undistinguishable binary code patterns.

Therefore, in this study each pattern block representative of a code pattern is set to be of the smallest size of 2×2 unit blocks. Also, a novel bit expansion scheme is proposed to expand every three bits of the bit stream B into four ones which are not all

the same in order to satisfy the second required characteristic of the code pattern. In detail, let the bit stream B be denoted as

B = b11b12b13b21b22b23b31b32b33 …bn1bn2bn3;

and for every three consecutive bits bi1bi2bi3 in B, we perform at first a bit expansion operation to get four bits bi1′bi2′bi3′bi4′ by the following rule:

set bi4′ = bi1bi2bi3 and bij′ = bij for j = 1, 2, 3, (28) where  and denote bitwise “OR” and “complement” operations, respectively.

The resulting four bits bi1′bi2′bi3′bi4′ will not be all identical, as can be verified by ORing the four bits bi1′ through bi4′, leading to the following result:

bi1′bi2′bi3′bi4′ = (bi1bi2bi3)bi4′ combinations are taken as the code patterns which we mentioned previously.

Message bits

Figure 6.4. Performing proposed bit expansion scheme on every three message bits to yield eight binary code patterns represented by pattern blocks.

Next, we create a 2×2 pattern block Ti = Fi1Fi2Fi3Fi4 with four unit blocks Fi1

through Fi4 to represent the non-all-identical bits bi1′ through bi4′ of each code pattern Ci, where the color of unit block Fij is set to be black if bij′ = 0 or white if bij′ = 1.

Accordingly, as can be seen from Figure 6.4, the colors of the pattern blocks representative of the eight code patterns are all non-identical as well.

Finally, we create a pattern image IP of the size of the target image IT by arranging all the pattern blocks Ti, say n ones, in a raster-scan order. If the n pattern blocks do not fill up IP, then we repeat to fill them into IP again and again until they do.

For example, with the target image IT as shown in Figure 6.5(a) and the bit stream B =

“110110110100011111010111001...,” the pattern image IP resulting from such filling operations is shown in Figure 6.5(b).

(a) (b) (c)

(d) (e) (f)

Figure 6.5 Message-rich code image generation. (a) Target image. (b) Pattern image IP. (c) Y-channel of (a). (d) Modulated pattern image. (e) Zoom-out of red square region in (d). (f) Resulting message-rich code image.

6.3.2 Block luminance modulation

After the pattern image IP is created, it is “injected” into the target image IT

under the constraint that the resulting image retains the visual appearance of IT. For

this, we utilize a characteristic of the YCbCr color model to embed IP into the Y-channel of IT. A block luminance modulation technique is used as the same way in Section 5.3.2, which modulates the mean of each pattern block Ti to be the same as that of the corresponding target block Bi of IT. The resulting modulated pattern image IP′ so has roughly the visual appearance of the Y-component of the target image IT. For example, Figure 6.5(d) shows a modulated pattern image IP′ so created, which looks like the Y-component of the target image IT shown in Figure 6.5(c); and Figure 6.5(e) shows a zoom-out version of part of Figure 6.5(d) enclosed by the red rectangle.

The details for block luminance modulation is omitted here, where the detailed steps for block luminance modulation is the same as those in Section 5.3.2. After the pattern image IP is modulated, the overall gray appearance of the modulated pattern image IP' and that of the Y-component of IT is roughly the same. Accordingly, we replace the Y-component of IT with IP′ to generate finally the desired message-rich code image IC which has the visual color appearance of IT, as shown by the example seen in Figure 6.5(f).

Later, when conducting message extraction, the message bit stream can be extracted from the Y-component of a captured version of IC by classifying the pixels of each pattern block into two classes according to their Y values: black and white.

However, an issue may occur here as the same one descried in Section 5.3.2: if the two representative values r1 and r2 are too close, it will be difficult to “separate” them in the classification process. Therefore, an adjustment of the representative values r1

and r2 is conducted, resulting in r1' and r2', so that the absolute difference between r1' and r2' becomes not smaller than a pre-defined contrast threshold   0. For example, Figure 6.6 shows a pattern block resulting from modulations with different values of , from which one can see that the two colors in a modulated pattern block will be more easily distinguished when  is larger. The detail of the proposed representative-value adjustment scheme can be found in Section 5.3.2 so it is omitted here.