• 沒有找到結果。

Even distribution of cube colors into groups for image distortion reduction As mentioned previously, we assign the colors in the color cube into groups such

Dynamic Programming Based on A Human Visual Model

Algorithm 4.3 Message data recovery

D. Even distribution of cube colors into groups for image distortion reduction As mentioned previously, we assign the colors in the color cube into groups such

that the colors in each group are distributed evenly. Consequently, a color in the group closest to an image pixel’s color can be selected for color replacement, in order to reduce the resulting image distortion. Here we describe the technique we use for achieving such a goal of even distribution of colors in groups. First, it is not difficult to see that the desired distributions in the groups should be symmetric to each other.

To accomplish this, we adopt the following steps, using the first color cube with base color (0, 0, 0) as an example for explanation of the detail. For other color cubes, the corresponding steps are the same except the base color. Table 2 shows the details of the involved computation results in the steps.

1. Take the 64 color values of the color cube as Euclidean coordinates, and compute its centroid, which is (1.5, 1.5, 1.5).

2. Transform the Euclidean coordinates into new ones through a translation of (1.5, 1.5, 1.5).

3. Transform the new Euclidean coordinates (r, g, b) into 3D spherical coordinates (ρ, θ, φ) by the following formula:

ρ = (rP2P + gP2P + bP2P)P1/2P, φ = tanP-1P(g/b), θ =tanP-1P[b/(rP2P+gP2P)P1/2P]

where ρ is the distance from the origin to a point in the Euclidean space, θ is the zenith angle with respect to the R-axis, φ is the azimuth angle with respect to the B-axis, as shown in Figure 5.3, and the function tanP-1P has values in the range from −90PoP to +90PoP.

4. To facilitate the purpose of even distribution of group colors, modify the range

of tanP−1P such that the computed values of θ lie in the range 0PoP ≤ θ < 360PoP with 0PoP indicating the direction of the R-axis.

5. Use in order the values of ρ, φ, and θ to sort the 64 colors into a list.

6. Assign the 64 colors of the color cube evenly into the 8 groups using the list according to the following criteria to achieve the goal of even distribution of group colors:

(1) each group has an equal number of colors which have a certain value of ρ; (2) the colors of each group have as many angles of θ as possible;

(3) the 8 color groups, when seen as grid points, are symmetric to one another.

7. Regard all the 8 colors in each color group to be identical, and encode each group to represent one of the eight 3-bit segments 000 through 111, as mentioned previously.

In Step 6 above, to satisfy Criteria (2) and (3) we normalize the angle values of θ of all the grid points with respect to each of the angles of “8 selected symmetric points” and listed them for easier selection of appropriate colors into the groups. For the 64-color cubes, these 8 symmetric points may be selected to be the 8 corners of the cube, as done in our experiment. The result of color distribution for the first color cube with base color (0, 0, 0) is shown in Table 2. And an example of the color distribution result for group 3, which includes the corner of (0, 0, 0), is shown in . The assigned 8 colors in the group are (1, 2, 2), (3, 2, 2), (1, 0, 2), (2, 2, 3), (2, 3, 0), (0, 1, 0), (3, 0, 1), (0, 0, 0).

The above process is designed for color cubes with 64 colors. It is not difficult to modify the process to fit more general cases of color cubes with 2Pm+nP colors mentioned before.

Furthermore, as an example of data embedding at image pixels, let P be a pixel

with color c = (r, g, b) = (1, 3, 2) and assume that the 3-bit message segment we want to embed is 010. The color cube used is that described in Table 2 and the group of colors involved is the third shown in Figure 5.4. The color in the group closest to c is c' = (1, 2, 2) with a distance of 1 to c. Therefore, the color c = (1, 3, 2) of P is replaced by c' = (1, 2, 2) in the data embedding process.

As a deeper investigation of the effect of the above even distribution of group colors in a color cube, we tried to compute the value of the peak of the signal-to-noise ratio (PSNR) for the worst case of color replacements, which occurs when the colors of all image pixels are replaced with the most dissimilar colors in color cubes. For this, we have two cases. One is when the colors of each group in a color cube are not evenly distributed. Then, the largest Euclidean color distance resulting from a color replacement obviously will be |(3, 3, 3) − (0, 0, 0)| = (3×3P2P)P1/2P = 27 . The other case

R

G

B

φ

ρ

θ

Figure 5.3 Illustration of a 3D spherical coordinate system for use in even color distribution.

is when the even distribution is done as shown in Table 5.2. Then, according to a computer program written in this study which computes exhaustively the Euclidean color distances between every pair of colors in the color cube based on the groups of Table 3, the largest Euclidean color distance is d = 4.

Accordingly, for the 2PndP case the maximum mean-square error (MSE) for the stego-image may be computed to be MSEBmaxB = dP2P/3 = 4/3, and the corresponding worst PSNR value is PSNRBminB = 10 × log[255P2P/MSEBmaxB] = 10×log[65025/(4/3)] ≈ 46.88 dB which is quite high. In contrast, the former case has PSNRBminB = 10×log[65025/(27/3)] ≈ 38.59 dB which is lower. In short, the 2PndP case, which is what we have implemented in this study, has less image distortion.

Table 5.2 Color encoding table for the (0, 0, 0)-th color cube with base color (0, 0, 0).

r g b ρ φ

(degree)

θ

(degree) group code

R B

G

Figure 5.4 An example of color distribution in a color cube --- the 8 colors in group 3.

2 1 2 0.9 35 315

3 3 2 2.2 13 45 0 2 3 2.2 43 162 2 0 3 2.2 43 288 3 0 3 2.6 35 315

5.2 Detailed Algorithms of Proposed Data Embedding and Extraction

We now describe the detailed algorithms for data embedding and extraction. We assume that the maximum length of given messages to be embedded is B bytes (8B bits) long.