Keywords

1 Introduction

Visible watermarking is widely used in protecting the ownership of vital images which contain the perceptual copyright information. Determined by whether the original cover image can be fully recovered, the visible watermarking techniques can be classified into two categories: reversible and irreversible. In traditional watermarking techniques, an imperceptible amount of host data is often sacrificed for robustness. However, in some serious scenarios, reversible watermarking is an ideal solution where the availability of original data is essential such as remote sensing, military image processing, medical image sharing, multimedia archive management, etc. [10].

Most reversible data hiding schemes concentrate on the invisible watermarking schemes [2, 3, 5,6,7, 9, 13, 19]. Reversible data hiding technique is proposed to losslessly recover both embedded data and cover medium [1, 14]. The histogram-modification-based method is firstly proposed by Ni et al. [12] in which the peak point of image histogram is utilized for data embedding. In [16], Tian proposes an expansion technique to use a pixel pair to embed one data bit. Afterwards, Thodi and Rodriguez [15] propose a state-of-the-art technique, prediction-error expansion (PEE), where prediction-error is firstly introduced for expansion embedding.

The visible watermark can be directly judged by human eyes and reversible techniques can be applied to allow legitimate users to remove the embedded visible watermark. In past few years, there are many researches focusing on developing efficient reversible visible image watermarking schemes. In [8], Hu and Jeon propose a scheme to replace a bit plane of the watermarking area with the watermark bits. The compressed version of the bit plane is embedded into the non-watermarked area. Liu and Tsai [11] use a deterministic one-to-one compound mappings to embed visible watermarks of arbitrary sizes on cover images. However, the watermark images are required when recovering the original cover image. In [18], Yang et al. propose to embed the visible watermark into the cover image based on the human visual characteristic scaling factors. After that a recovery packet, which is utilized to restore the watermarked area, is reversibly inserted into non-visibly-watermarked region. Chen et al. [4] design a watermarking scheme based on a conventional difference-expansion method. The cover image is partitioned into non-overlapped blocks and each watermark bit is embedded into a block. Despite the merit of [4], there may exist a large number of exceeding numbers in this approach, which affects the visual effect of the visible watermark.

In this paper, inspired by the work [4], we propose an effective reversible visible watermarking scheme based on difference-expansion method. In proposed method, an adaptive block partition strategy is adopted to decrease the exceeding numbers. Besides, an adaptive visual effect factor based on human visual system (HVS) characteristics is used to embed the visible watermark which makes the proposed method more visually satisfactory and less intrusive. In the proposed scheme, the cover image is first segmented into non-overlapped blocks which contain \(k \times k\) pixels. Then the visible watermark is embedded into each block according to an adaptive visual effect factor. After finding an optimal partition of the block with the adaptive block partition strategy, the watermark bit is embedded into each block based on the conventional difference-expansion method.

The rest of the paper is organized as follows. A relevant reversible visible watermarking scheme is reviewed in Sect. 2. Then in Sect. 3, the proposed method is presented in details. The experimental results are given in Sect. 4. The final conclusions are drawn in the last section.

2 Related Work

In this section, a reversible visible image watermarking scheme [4] based on difference-expansion method is introduced. At the end of the section, a discussion of the motivation of proposed method is presented.

In [4], the cover image is partitioned into non-overlapped \(k \times k\) blocks. Each block embeds one watermark bit. The parameter k determines the area of the visible watermark. For each block, the pixels are partitioned into two sets \(S_1\), \(S_2\) and two pixels \(y_1\), \(y_2\). The size of set \(S_1\) is \(\lfloor \frac{k^2 - 1}{2}\rfloor \) and the size of set \(S_2\) is \(\left\lfloor \frac{k^2 - 1}{2} \right\rfloor - 1\). An example of the partition of a block for \(k = 3\) is shown in Table 1. Corresponding to the relation between the block mean \(b_m\) and the threshold \(T_m\) which is calculated according to the local mean of the watermark area, each pixel is shifted as follows,

$$\begin{aligned} x^{'}(i,j) = \left\{ \begin{array}{rl} x(i,j) + w\cdot (B + R(i,j)), \quad &{} if \quad b_m < T_m \\ x(i,j) - w\cdot (B + R(i,j)), \quad &{} if \quad b_m \ge T_m \end{array} \right. \end{aligned}$$
(1)

where w is the watermark bit, x(ij) and \(x^{'}(i,j)\) are the pixels in the original cover image and the watermarked image respectively. B represents the watermark strength and R is a random number generated by a seed within a small range to guarantee the security of this scheme.

Table 1. Examples of partition strategies for k = 3 in Chen et al.’s method [4].

Next, a difference-expansion based method is utilized to embed the watermark bit. The block difference \(d_1\) and \(d_2\) are calculated using the conventional difference-expansion method among the sum of pixel values of \(S_1\), \(S_2\) and the pixel \(y_1\), \(y_2\) respectively.

$$\begin{aligned} {\begin{matrix} &{}d_1 = \sum _{x_1^{'}(i,j) \in S_1} x_1^{'}(i,j) - \sum _{x_2^{'}(i,j) \in S_2} x_2^{'}(i,j) - y_1\\ &{}d_2 = \sum _{x_1^{'}(i,j) \in S_1} x_1^{'}(i,j) - \sum _{x_2^{'}(i,j) \in S_2} x_2^{'}(i,j) - y_2. \end{matrix}} \end{aligned}$$
(2)

Then the watermark bit is embedded into the pixel \(y_1\). A new pixel value \(y_1^{'}\) calculated by the difference \(d_1\) and \(y_1\) replaces the original \(y_1\). If the watermark bit is 1, a sign bit is embedded into the pixel \(y_2\) by using the same way as the watermark bit to record the modification direction of the visible watermark of this block.

In the extraction procedure, the corresponding block difference \(\overline{d_1}\) and \(\overline{d_2}\) are first calculated and the watermark bit w and the sign bit sign can be obtained by

$$\begin{aligned} w = mod(\overline{d_1},2), \quad sign = mod(\overline{d_2},2). \end{aligned}$$
(3)

Then \(y_1\) and \(y_2\) are recovered by the watermark bit and the block difference. Finally, if the watermark bit of this block is 1, the original cover can be recovered by the watermarked pixels, the parameters sign, the watermark strength B and the shift number R.

Fig. 1.
figure 1

The details of the recovered image Lena in the area of the brim of the hat using method in [4] without recording exceeding numbers.

Although this model has achieved promising results, it has two drawbacks: On one hand, the exceeding number which denotes pixels in the watermarked image whose value is larger than 255 or smaller than 0 may occur in this approach. When \(y_1\) or \(y_2\) of a block is an exceeding number, all pixels in this block can not be correctly recovered that will make an unacceptable damage of the visual effect for the recovered image. Notice that in Eq. (2), \(d_1\) is calculated by \(y_1\) and the difference of two subsets \(S_1\), \(S_2\). Since the number of set \(S_2\) is one less than the size of set \(S_1\), \(d_1\) is considered as a small value because of the neighborhood similarity of the natural images. However, the difference can be pretty large in some edge area (i.e., the brim of the hat in Lena as shown in Fig. 1), which causes \(y_1^{'}\) and \(y_2^{'}\) to be exceeding numbers. In [4], Chen et al. propose to record the exceeding numbers, however, these recording pixels in the watermark can not be embedded which may lead to the consecutive loss of the watermark message when the number of the exceeding numbers are large. It causes a misread of the watermark. On the other hand, the watermark strength to be embedded in different areas of the host image is weakly depending on the underlying image content in [4]. This may lead to an obtrusive visible watermarking.

To address these two issues, we improve this model by using the following techniques: Firstly, we utilize an adaptive approach to divide the blocks which can greatly decrease the number of the exceeding numbers. Secondly, in the proposed method, an adaptive visual effect factor depending on the HVS is used to embed the visible watermark. The experimental results show that the watermarked images of proposed method have a better visual effect.

3 Proposed Method

In this section, we will introduce the proposed method in details. The embedding process mainly contains two procedures, visible watermark embedding and watermark bit embedding. We will first introduce the adaptive visual effect factor we use in the visible watermark embedding in Sect. 3.1. Then the embedding procedure will be introduced in Sect. 3.2 and the recovery algorithm will be introduced in Sect. 3.3.

3.1 Visible Watermark Embedding

Inspired by the work [17], we design a visible watermark embedding strategy using an adaptive visual effect factor based on the HVS characteristics. There are two aspects of the HVS characteristics to consider for the proposed visual effect factor.

First, considering that human eyes are more sensitive to changes in smooth areas than textured areas, we give a parameter \(\alpha _i\) to measure the smoothness of block i,

$$\begin{aligned} \alpha _{i} = \frac{|k^{2} - 2c_i| + \tau }{k^{2} + \tau } \end{aligned}$$
(4)

where k is the size of the block and \(\tau \) is a parameter for avoiding \(\alpha _i\) to be zero. Here \(c_i\) represents the number of pixels whose values are greater than the mean pixel value of the \(i \text {-} th\) block,

$$\begin{aligned} l_i = \frac{\sum \limits _{p = 1}^{k}\sum \limits _{q = 1}^{k} I(p,q)}{k^{2}} \end{aligned}$$
(5)

where I(pq) denotes the pixel value of the block. Notice that the parameter \(\alpha \) gets larger as the block gets smoother (more pixels values are greater or smaller than the block mean).

Fig. 2.
figure 2

The neighborhood of current block.

Secondly, the human visual is more sensitive to the changes in middle intensity regions, the luminance factor thus can be considered as

$$\begin{aligned} \beta _i = \frac{|l_i - 255/2|}{255/2} \end{aligned}$$
(6)

\(\beta _i\) becomes larger when the pixel values of this block are in middle luminance. Thus, the visual effect factor can be derived as

$$\begin{aligned} \gamma _i = \frac{\alpha _i}{\beta _i} \end{aligned}$$
(7)

In order to avoid obtrusively embedding the watermark, \(\gamma \) is normalized into a narrow range \([r_1,r_2]\) by

$$\begin{aligned} \widetilde{\gamma _i} = \frac{r_2 - r_1}{max(\gamma ) - min(\gamma )} \times (\gamma _i - min(\gamma )) + r_1. \end{aligned}$$
(8)

where max() and min() are maximum and minimum function respectively. Notice that the greater value of the visual effect factor is, the higher the watermark strength becomes. In order to recover the original cover image without using the watermark image in the recovery procedure, the block mean and the visual effect factor are calculated as,

$$\begin{aligned} \begin{aligned}&l_i^{*} = \frac{1}{|O_1| + |O_2|}\left( \sum \limits _{b_j\in O_1} l_j + \sum \limits _{b_j \in O_2}l_j^{*}\right) \\&\widetilde{\gamma _i}^{*} = \frac{1}{|O_1| + |O_2|}\left( \sum \limits _{b_j\in O_1} \widetilde{\gamma _j} + \sum \limits _{b_j \in O_2}\widetilde{\gamma _j}^{*}\right) \end{aligned} \end{aligned}$$
(9)

where the \(j \text {-} th\) block \(b_j\) belongs to the neighborhood of current block. And \(O_1 = \{Non-watermarked blocks in the neighborhood of current block\}\), \(O_2 = \{Estimated watermarked blocks in the neighborhood of current block\}\), illustrated in Fig. 2. Since the parameters of the watermarked blocks are estimated from the blocks in the original cover image and the blocks that have been estimated, they can be estimated identically in the recovery procedure without using information from the watermarking region.

Then for the \(i\text {-}th\) block, the visible watermark is embedded as follows,

$$\begin{aligned} x_i^{'} = \left\{ \begin{array}{ll} x_i, &{} if \quad w_i = 0\\ (1 - \widetilde{\gamma _i}^{*})x_i + \widetilde{\gamma _i}^{*}W_S - R_i, &{} if \quad w_i = 1, l_i^{*} \ge 127\\ (1 - \widetilde{\gamma _i}^{*})x_i + \widetilde{\gamma _i}^{*}(255 - W_S) + R_i, &{} if \quad w_i = 1, l_i^{*} < 127 \end{array} \right. \end{aligned}$$
(10)

where \(x_i\) and \(x_i^{'}\) are the pixels of the original cover block and the watermarked image block. \(W_S\) is the watermark strength and \(R_i\) is a set of random numbers within the range of [0, ShiftStrength] generated from a seed ShiftSeed.

Fig. 3.
figure 3

Framework of proposed embedding scheme.

figure a

3.2 Embedding Procedure of the Proposed Method

In this section, we will introduce the embedding procedure of the proposed method. The flow of the embedding procedure is illustrated in Fig. 3 and the scheme is shown in Algorithm 1.

First, the cover image is divided into \(k \times k\) sized blocks that each watermark bit will be embedded into one block. Thus, the size k determines the watermark size in image \(\mathbf {W_C}\) while the size of watermark area increases with k. In step 3 and step 4, the visible watermark is embedded into the cover image adaptively based on the visual effect factor. In Eq. (10), the block mean and the visual effect factor are calculated without using any information from the watermark area which ensures the watermark image is not needed to recover the original image. In step 5, the subset \(S_1\) contains one more pixel than the subset \(S_2\), thus the difference between the sum of pixels in \(S_1\) and the sum of pixels in \(S_2\) is nearly one pixel value. Notice that in Eq. (11), we find two subset \(S_1^{*}\) and \(S_2^{*}\) whose pixel difference is closest to the block mean which makes the absolute value of \(d_1\) as small as possible. Thus, the \(y_1^{'}\) in Eq. (13) has little possibility to be the exceeding numbers. Finally, the proposed method uses the difference-expansion method to embed the watermark bit in step 9 and step 10. The other parameters such as \(W_S, k, r_1, r_2, ShiftSeed, M_w, N_w\), the position of the watermarked area and the remaining exceeding numbers’ positions can be embedded into non-watermarked area by the conventional information hiding approaches.

3.3 Extraction of the Watermark and Cover Recovery

The extraction procedure and the recovery algorithm will be given out in this section. The details of the recovery algorithm is illustrated in Algorithm 2.

First, the block size k, the watermark strength \(W_S\) and some other parameters are extracted. In step 2, the watermarked image is partitioned using the same way as the embedding procedure does. Here, as some blocks may still contain exceeding numbers, the position of these blocks are recorded. In step 3, the difference \(\overline{d_1}\) is calculated using \(y_1\) and the estimated value of this block. Then the watermark bit is extracted by the difference \(\overline{d_1}\). The visual effect factor and the block mean are calculated without using the information from the watermarked region. From step 9 to step 11, the subsets used in the embedding procedure are found out to recover the \(y_1^{'}\). Finally, the visible watermark is removed and we obtain the recovered image.

figure b

We now discuss the correctness of the proposed scheme. In the embedding procedure, the pixels in a block are first modified to embed the visible watermark. Both in the embedding and extraction procedure, since the block mean is calculated without using the information of non-estimated watermarked blocks, the same partition and \(S_1^{*}\), \(S_2^{*}\) are used to calculate the block difference. The watermark bit is embedded into the difference among \(S_1\), \(S_2\) and \(y_1\), and then \(y_1\) is replaced by \(y_1^{'}\) in Eq. (13). While in the extraction procedure, the new difference is firstly calculated by \(y_1\) and \(\left\lfloor \frac{\displaystyle \sum \limits _{x_{i}^{'} \in \{S_1 \cup S_2\}} x_{i}^{'}}{2\displaystyle \left\lfloor \frac{k^2 - 1}{2} \right\rfloor - 1} \right\rfloor \) which is the same as the estimated mean of the block in Eq. (13). Then the modified \(y_1\) is recovered in Eq. (17). Finally, all the pixels in the block can be recovered with the visual effect factor if the watermark bit is 1. So far, all the watermark bits have been extracted and the recovered image has also been obtained.

4 Experimental Results

The experimental results are presented in this section. We will introduce the experiments from three aspects. In Sect. 4.1, the parameters used in the proposed scheme will be introduced and the security of the proposed scheme will be basically discussed. The experimental results under different block size k and watermark strength \(W_S\) will be shown in Sect. 4.2. Finally, a discussion of the exceeding numbers and the comparison between the proposed method and the related works will be shown in Sect. 4.3.

4.1 Parameter Selection and Security Discussion

Figure 4(a)–(c) show the gray-scale cover images we used for our experiments, Lena, Boat, Aerial, \(512 \times 512\) in size while Fig. 4(d) is the binary watermark \(128 \times 128\) in size.

Fig. 4.
figure 4

(a)–(c) Three original gray scale \(512 \times 512\) sized cover images. (d) The \(128 \times 128\) sized binary watermark.

We first discuss the parameters utilized in this paper. As we have described in last section, the parameters needed to be considered are listed as follows:

  • The block size k.

  • The watermark strength \(W_S\).

  • The normalize parameter for the visual effect factor \(r_1\) and \(r_2\).

  • The shift number strength ShiftStrength.

Table 2. The selection of the parameters of the proposed method.

The parameters used in the proposed method are described in Table 2. We use \(512 \times 512\) sized cover image and \(128 \times 128\) sized watermark image in our experiments. In the proposed method, each watermark bit is embedded into one block, while some parameters and extra message are embedded into the non-watermarked area. Therefore, k is supposed to be smaller than \(min\left\{ \lfloor \frac{M_c}{M_w}\rfloor , \lfloor \frac{N_c}{N_w}\rfloor \right\} \). For the watermark strength, we choose four different levels of strength which vary the visual effect of the watermark image. And the ShiftStrength is set up to 10 thus the shift number for each pixel is small.

There are two types of strategies to support the security of the proposed scheme. On one hand, the visible watermark is shifted by a random number. An attacker has a probability of \(\frac{1}{(ShiftStrength)^{M_W \times N_W}}\) to correctly recover the original image that the completely recovery is nearly impossible. On the other hand, the wrong selection of the position of \(y_1\) will result in a noisy recovered image. Figure 5 shows an example of the recovered image whose \(y_1\) is wrongly selected. The watermark area of the recovered image is obviously blurred. These two strategies guarantee the security of the proposed scheme.

Fig. 5.
figure 5

Recovered images of Lena whose \(y_1\) is wrongly selected. The watermark strength \(W_S = 60\) and \(k = 3\) (PSNR = 10.2552 dB).

4.2 Experimental Results Under Different Parameters

Figure 6 shows the results of the watermarked images under different block sizes with the same watermark strength \(W_S = 60\). In Fig. 6(a)–(c), the block size \(k = 2\) and in Fig. 6(d)–(f) the block size \(k = 3\). Here the watermark is embedded into the center area of the cover image. The block size determines the size of the watermarked region, and a larger k leads to a larger watermark region. The size of the watermark area of Fig. 6(a)–(c) and (d)–(f) are \(256 \times 256\) and \(384 \times 384\) respectively. Figure 7 shows the watermarked images of different watermark strength with the same block size. Figure 7(a)–(d) show the results of cover image Lena with \(W_S = 20,40,60,80\), Fig. 7(e)–(h) show the results of cover image Boat with \(W_S = 20,40,60,80\), and Fig. 7(i)–(l) show the results of cover image Aerial with \(W_S = 20,40,60,80\), respectively. It can be observed that a larger parameter \(W_S\) leads to a more substantial watermark.

Fig. 6.
figure 6

Experimental results for different block size of the proposed method. (a)–(c) Three watermarked images for \(k=2\), (d)–(f) Three watermarked images for \(k=3\). The watermark strength \(W_S = 60\).

Fig. 7.
figure 7

Experimental results for watermark strength \(W_S = 20,40,60,80\) respectively. The block size \(k = 3\). (a)–(d) The results of cover image Lena for \(W_S = 20,40,60,80\) respectively, (e)–(h) The results of cover image Boat for \(W_S = 20,40,60,80\) respectively, (i)–(l) The results of cover image Aerial for \(W_S = 20,40,60,80\) respectively.

4.3 Discussion on Exceeding Numbers

The number of exceeding numbers of different watermarked images for proposed method and [4] are presented respectively in Fig. 8. An exceeding number denotes a pixel in the watermarked image whose value should have been larger than 255 or smaller than 0. Since the adaptive block partition strategy is used in proposed method, it can be observed that the amount of exceeding numbers of proposed method is far smaller. Otherwise, the amount of exceeding numbers increases as the watermark strength gets larger for Chen et al.’s method, however, it hardly changes for the proposed method. It is because the two methods use different visible watermark embedding strategies. Apparently, the amount of exceeding numbers is less influenced by HVS based embedding strategy.

Fig. 8.
figure 8

Amount of exceeding numbers of different watermarked images and watermark strength.

In Fig. 9, the comparison among two approaches [4, 8] and the proposed method is presented. In Fig. 9(a) and (b), the watermarked images of Hu and Jeon’s approach embedded into the MSB and third MSB plane are presented, respectively. The results of Chen et al. approach and the proposed method are shown in Fig. 9(c) and (d) where the watermark strength is set up to 60 and block size is 3 for both approaches. The visible watermark of Hu and Jeon’s method is either heavy in Fig. 9(a) or light in Fig. 9(b). The watermark in Fig. 9(c) looks more intrusive and noisy, however, the integration of the watermarked image of proposed method is better than Chen et al.’ s scheme and Hu and Jeon’s scheme.

Fig. 9.
figure 9

Watermarked images for different schemes. (a) Hu and Jeon’s scheme (Embed into the MSB plane). (b) Hu and Jeon’s scheme (Embed into the third MSB plane). (c) Chen et al.’s scheme (\(k = 3, B = 60\)). (d) Proposed method (\(k = 3, W_S = 60\)).

5 Conclusion

In this paper, a reversible visible watermarking scheme based on difference-expansion method and an adaptive block partition strategy is proposed. The cover image is first divided into non-overlapped blocks and each watermark bit is embedded into one block. A visual effect factor based on HVS characteristics is calculated to embed the visible watermark and the watermark bit is embedded using the difference-expansion based method for each block. Since the parameters are estimated without the information of the watermarked region, the watermark image is not needed in the extraction procedure. Experimental results have shown that comparing with the related work [4], the exceeding numbers of the proposed method are greatly decreased. The visual effect of the proposed method looks more satisfactory than some other state-of-the-art works [4, 8].