# An Adaptive Visible Watermark Embedding Method based on Region Selection

Authors: Wenfa Qi; Yuxin Liu; Sirui Guo; Xiang Wang; Zongming Guo
Journal: Security and Communication Networks
 (2021)

---

## Abstract

Aiming at the problem that the robustness, visibility, and transparency of the existing visible watermarking technologies are difficult to achieve a balance, this paper proposes an adaptive embedding method for visible watermarking. Firstly, the salient region of the host image is detected based on superpixel detection. Secondly, the flat region with relatively low complexity is selected as the embedding region in the nonsalient region of the host image. Then, the watermarking strength is adaptively calculated by considering the gray distribution and image texture complexity of the embedding region. Finally, the visible watermark image is adaptively embedded into the host image with slight adjustment by just noticeable difference (JND) coefficient. The experimental results show that our proposed method improves the robustness of visible watermarking technology and greatly reduces the risk of malicious removal of visible watermark image. Meanwhile, a good balance between the visibility and transparency of the visible watermark image is achieved, which has the advantages of high security and ideal visual effect.


---

## Body

## 1. Introduction

Visible watermarking technology has important applications in many fields, such as content protection [1, 2], copyright identification [3], document security [4, 5], and advertising [6]. In the past two decades, there have been a large number of algorithms with different features in visible watermarking technology. These technologies can be divided into three categories [7]: permanent [8–11], removable [12–14], and reversible visible watermarks [15–20]. In the permanent visible watermarking, the embedded watermark image is permanently retained in the watermarked image, and even the owner cannot completely erase it. However, in removable and reversible visible watermarking techniques, the embedded visible watermark image can be removed by the authorized person using the correct secret key. In addition, the reversible technology can completely remove the visible watermark image and recover the original host image data without loss. Regardless of the type, the visible watermarking technology must meet three requirements [21]: robustness, visibility, and transparency. Robustness means that it is difficult for the unauthorized person to remove the visible watermark image maliciously or unintentionally through conventional image processing methods, thus having the ability to resist various destructive attacks. Additionally, the visible watermark image has certain visibility after embedding into the host image, which allows easy and clear identification of the ownership of the host image. Finally, the visible watermark image has the least obtrusiveness or maximum transparency, which allows the observer to easily identify the details of the host image. In the existing algorithms, these three requirements are contradictory; however, it is necessary to achieve a balance between them.Nowadays, many scholars have done many researches on how to effectively remove the visible watermark image from the watermarked image [22–30]. Some visible watermark removal algorithms need to know the accurate position of the visible watermark image in advance, and the corresponding removal strategy is designed by combining the features of the visible watermark image itself [22, 23]. Another method to remove the watermark image is based on the traditional image inpainting method [24–26], and it mainly uses the surrounding information to fill the areas corresponding to the black pixels in the watermarked image. Therefore, only by knowing the specific location of the missing pixels in the image can the visible watermark image be successfully removed from the watermarked image. Pei and Zeng [27] propose to separate the host image from the watermarked image by using independent component analysis (ICA). However, such a method requires users to mark the watermark area manually, which is time-consuming. Clearly, it cannot process large watermarked areas and automatically remove visible watermark images in batches. To achieve batch removal of visible watermark images, Dekel et al. [28] propose a method to automatically estimate the watermark images and restore the host image with high precision. However, this method has a basic premise; that is, when all visible watermark images are embedded in many different host images in the same way, an effective model of visible watermarking image removal can be established. When the visible watermarking images are added to different positions on different images from different angles, the existing algorithms cannot work well.Therefore, to improve the robustness of the visible watermarking scheme against batch processing attacks, it is necessary to study the adaptive selection strategy of embedding region for visible watermarking. In addition, the visibility and transparency of the visible watermark image also should be comprehensively considered to obtain a more natural image fusion effect.The rest of the paper is organized as follows. The related works are introduced inSection 2. Section 3 presents the embedding scheme of the visible watermark images in detail. Section 4 shows the experimental results as well as the comparisons with prior works. Finally, Section 5 concludes this paper.


## 2. Related Works

When the embedding position of the visible watermark image changes adaptively with the content of the host image, the existing batch processing methods of visible watermarking cannot accurately locate the watermarked area and cannot effectively erase the visible watermark image. For this purpose, Qi et al. [29] propose an improved visible watermark embedding scheme based on the human visual system (HVS) and the region of interest (ROI) selection. This method often finds the relatively smooth region according to the complexity of the host image in the high-tone or low-tone image areas, and these regions usually contain the key objects in the host image. Therefore, the visible watermark image frequently occupies the salient area and occludes the important objects of the host image, which usually produces undesirable visual effects.In terms of the visibility and transparency of visible watermark images, some scholars have proposed many adaptive embedding methods of visible watermark images [30–33]. In [30], the brightness and texture features of host image in DCT frequency domain are extracted to realize the dynamic embedding of the visible watermark. In [31], the visible watermark is dynamically embedded according to JND coefficients in DCT frequency domain. However, the neighbourhood features of the visible watermarked area are not considered in the process of watermark embedding. The watermark strength of visible watermarking also needs to be adaptively changed according to different image features. In [32], the authors point out that it is necessary to dynamically adjust the embedding strength according to the brightness, contrast, texture complexity, and other related features of the host image. In [33], the visual salience matrix of the host image is calculated first, and the embedding strength is proportional to the intensity of the salience of the visible watermarked region. However, the computational complexity of this method is relatively high.


## 3. Proposed Method

In most of the visual scenes, the human visual system can see any region in the image, but the important regions of interest only account for a small part, which is called the salient area [34]. Therefore, the visible watermark image should not obscure the salient objects in the host image; otherwise, it will affect the value of the host image itself. In this paper, the salient areas are detected firstly. Then, it selects the most suitable region in the nonsalient areas for visible watermark embedding. At last, the watermark strength is adaptively calculated for the visible watermarking.


### 3.1. Salient Region Detection

Firstly, an image is segmented into a series of superpixels. Then, all corner points of the image are extracted, and the image is divided into inner and outer parts according to the corner point distribution. Next, the average score of all pixels in each superpixel is calculated and regarded as the score of the superpixel. Finally, all superpixel scores are normalized to the range of0,255, and a complete visual saliency map is formed. The specific process is as follows.


#### 3.1.1. Superpixel Segmentation

Since there is a lot of redundant information in an image, thek-means clustering method is used to segment all pixels with close distances and similar colours into many superpixel regions. The average colour value of all pixels in the CIELAB space of each superpixel is recorded as the colour of the superpixel, which is marked as Ci:(1)Ci=L,a,b=1m∑t=1mLt,∑t=1mat,∑t=1mbt.Suppose that an image is segmented inton superpixels as R1,R2,…,Rn. For any two given superpixelsRi and Rj, usually there will be more than one path connecting them. The length of each path is the sum of the distances of every two adjacent superpixels. It calculates the shortest path from Ri to Rj; for example, path=Ri,Rl+1,Rl+2,…,Rl+k,Rj, and its length is recorded as LMij:(2)LMij=Ci−Cl+1+∑t=1k−1Cl+t−Cl+t+1+Cl+k−Cj.


#### 3.1.2. Image Region Segmentation

Since there are a lot of contour lines in the image, the different distribution of contour lines forms inflection points, intersection points, and other feature points, which are uniformly called corner points. After all corner points are recognized, a minimum polygonS containing them can be constructed. Superpixels located inside the polygon S are given larger weights, while those outside the polygon S are given smaller weights.


#### 3.1.3. Calculation of the Saliency Score of Each Superpixel

For a given superpixelRi in the image, the saliency score is calculated as follows.Step 1. Calculate the scaling factor Ni of Ri as shown in the following equation:(3)Ni=∑j=1ne−0.05×LMij,whereLMij is the length of the shortest path from superpixel Ri to Rj.Step 2. The initial score of superpixel Ri is calculated as(4)sci=fi×di,where(5)fi=1,ifRilocates inS,0,otherwise,anddi represents the sum of the squares of the distances between Ri and all other superpixels; namely,(6)di=∑j=1nCi−Cj2.Step 3. The final visual saliency score of superpixel is calculated as shown in the following equation:(7)sfi=sciNi∑j=1ne−0.05×Lij.The saliency scores of all superpixels are obtained by equation (7), and then the scores of all pixels also can be obtained. All scores are normalized to the range of [0, 255] to obtain the salient area of the original image. For example, for the host image as shown in Figure 1(a), the corresponding salient areas are extracted as shown in Figure 1(b). It is further binarized to get the final salient areas as shown in Figure 1(c), in which white regions are the visually salient areas, and the black regions are the visually nonsalient areas.Figure 1
Experimental images. (a) The original host image with size of1400×930 pixels; (b) preliminary detection result of the salient region; (c) the final extracted salient areas.
(a)(b)(c)


### 3.2. Adaptive Selection of Embedding Region

Next, the nonsalient regions of the host image are evenly segmented into subblocksB1,B2,…,Bn according to the size of the visible watermark image. Based on the texture complexity and the gray distribution features of each image block, the relatively smooth image block is selected as the watermark embedding region.


#### 3.2.1. Calculation of Image Texture Complexity

It can be concluded that the edge density of the image is an important factor affecting the texture complexity of the image. Therefore, it determines the texture complexity by calculating the density of the image boundary. The specific calculation steps are as follows:Step 1: obtain the gradient feature map of the host image.To eliminate the interference of noise,HG is obtained by Gaussian filtering for the host image H; then the gradient feature graph G is obtained by Laplace transform:(8)G=LaplacianHG.Step 2: obtain image boundary features.Use the Otsu method to binarizeG to obtain an image GB with only two gray levels of 0 and 255, and then perform a morphological closing operation on GB to obtain M:(9)M=CGB.Here,C⋅ is to perform morphological closing operations on the image. At this time, a large number of boundary features of the host image are saved in M.Step 3: calculate texture complexity.The boundary density of the subblockBi in the host image H, that is, the texture complexity ρi, is calculated as follows:(10)ρi=LiSi+τ,where Li is the number of pixels located on the boundary extracted from Bi in M, Si is the size of Bi, and 0<τ<1. In practical applications, it sets τ=0.01.


#### 3.2.2. The Distribution Features of Image Gray Value

The visible watermark embedding can be performed by modifying the pixel value of the host image in spatial domain. Generally speaking, in dark tone areas with a gray value interval of [0, 127], the pixel value should be appropriately increased. In the bright tone area with a gray value interval of128,255, the pixel value needs to be appropriately reduced. The visibility of the visible watermark image can be ensured when the magnitude of the modification is large. To ensure the overall visual effect of the visible watermark, our proposed method tries to select the pixel values of the middle tone interval range 127−σ,128+σ, where σ can be set to 64. Next, we will discuss the calculation of the gray value distribution feature of the subblock Ri.The average gray levelαi of all pixels in the subblock Ri is calculated as follows:(11)αi=∑jj∈RiPjsi,where Pj is the pixel value of the host image at point j and the gray value distribution feature γi of the subblock Ri is calculated as follows:(12)γi=1.5−αi−127+σσ,αi≤127,1.5−αi−127−σσ,αi>127.


#### 3.2.3. Smooth Area Selection

After obtaining the boundary densityρi and the gray value distribution feature γi of each subblock Ri using equations (10) and (12), the feature value μi of Ri can be obtained by the following equation:(13)μi=ρiγi.The feature valueμi of each subblock Ri is sequentially calculated, and all feature values μi are sorted in ascending order. The image area Rj corresponding to the smallest feature value μi is the final visible watermark embedding area. In this paper, it reduces ρi and increases γi to achieve the purpose of reducing μi. Among them, when the ρi value is smaller, the visible watermark can successfully avoid the areas with high image texture complexity. When the γi value is larger, the selected visible watermark embedding area will be far away from the high-tone and low-tone areas in the host image, thus making the watermarked image achieve a relatively ideal visual effect.


### 3.3. Adaptively Visible Watermark Embedding

In this paper, the visible watermark image is embedded in the host image as follows:(14)IWx,y=1−γ×Ix,y+γ×127,where Ix,y is the pixel value of the host image, IWx,y is the watermarked pixel value, and γ is the adaptive watermark strength. To adaptively calculate the watermark strength γ from the image features of the neighbourhood area around the watermarked pixel, each pixel in the visible watermark image is embedded into the corresponding image block B size of 2×2 pixels in the host image; that is, each pixel in B is adjusted according to the same watermark intensity γ in equation (14). To ensure the visibility of the visible watermark image, JND model is used to adjust the gray value of each pixel after watermark embedding. The general watermark embedding diagram is shown in Figure 2.Figure 2
The diagram of visible watermark embedding process.


#### 3.3.1. Adaptive Calculation of Watermark Strength

The embedding strength of the visible watermarking adaptively changes with the image complexity of the embedding region. As for the pixelWp in the visible watermark image W, the corresponding watermark embedding area Bp in the host image consists of four pixels P1,P2,P3,P4. Then the specific calculation process of watermark strength is as follows.Step 1. Calculate image texture complexity.Bp and 8 embedding regions in its neighborhood constitute a region SP with the size of 6×6 pixels. Through equation (10), the boundary density S in ρs of Sp can be obtained; then the texture complexity αp of region Sp can be expressed by ρs; that is,(15)αp=ρs.Step 2. Calculate the change amplitude of the pixel value in the embedding region.The intensity change of pixel value in the embedding area of the visible watermark image isβp, which can be measured by the gradient of pixel values in the region. In the embedding region Bp, the four pixels are sorted in ascending order according to the gray value, and the average gray value al of two smaller pixels and the average gray value a2 of two larger pixels are calculated, respectively. The calculation of βp is as follows:(16)βp=π/4tan−1a2/a1+τ,where,τ>0. As shown in equation (16), in the region where the pixel value changes smoothly, the value of a1 is close to a2, and tan−1ab/a1 is approximately equal to π/4, which corresponds to a larger βp. Similarly, when the pixel value in the region changes sharply, the difference between a1 and a2 is large, and the denominator of equation (16) will increase accordingly, so βp will decrease accordingly.Step 3. Calculate the final watermark embedding strength.The embedding strength of visible watermarking is calculated as(17)γp=αpβp.It can be seen from equation (17) that, in the flat area of the host image, if αp is small and βp is large, the watermark embedding strength γ is relatively small. On the contrary, in the region of the host image with complex texture, αp is large and βp is small, and the watermark embedding strength γ is relatively large. All γ values in the embedding areas are calculated normalized to the interval of n1,n2.


#### 3.3.2. Visual Watermark Image Embedding

For the host imageI with RGB colour space, the specific steps of visible watermark image embedding are as follows:Step 1. Firstly, the host image is transformed from RGB colour space to YUV colour space, and the visible watermark is embedded in the luminance component Y.Step 2. For the Y component, the JND masking matrix J is calculated.Step 3. For each pixel Wp in W, the embedding process in the region Bp of the host image is as follows:(1)
WhenWp=0, all pixel values of Bpremain unchanged.(2)
WhenWp=1, the watermarked pixels IPiW′, i=1,2,3,4, are calculated by equation (14).Step 4. Adjust the watermarked pixel value.For anyPi in Bp, the change range Di of the pixel values before and after watermark embedding is calculated:(18)Di=IPi−IPiW′.(1)
IfDi<ω×JPi, where ω≥1, is a fixed constant and JPi is the value of the masking matrix J at the point Pi, it is shown that the variable of the watermarked pixel value obtained by equation (14) is too small, and the pixel value after the watermark embedding is recalculated in the following way:(19)IPiW=IPiW′+ω×JPi,mp≤127,IPiW′−ω×JPi,mp>127.(2)
IfDi≥ω×JPi, then IPiW=IPiW′.So far, the embedding process of visible watermarking is finished.For example, the Logo image in Figure3(a) is embedded into host image in Figure 1(a) to get the watermarked image shown in Figure 3(b), where n1=0.3,n2=0.7,w=3.Figure 3
The watermarked image. (a) A binary visible watermark image with the size of 100∗100 pixels; (b) the watermarked image with (a) embedded into the host image (Figure 1(a)).
(a)(b)


## 3.1. Salient Region Detection

Firstly, an image is segmented into a series of superpixels. Then, all corner points of the image are extracted, and the image is divided into inner and outer parts according to the corner point distribution. Next, the average score of all pixels in each superpixel is calculated and regarded as the score of the superpixel. Finally, all superpixel scores are normalized to the range of0,255, and a complete visual saliency map is formed. The specific process is as follows.


### 3.1.1. Superpixel Segmentation

Since there is a lot of redundant information in an image, thek-means clustering method is used to segment all pixels with close distances and similar colours into many superpixel regions. The average colour value of all pixels in the CIELAB space of each superpixel is recorded as the colour of the superpixel, which is marked as Ci:(1)Ci=L,a,b=1m∑t=1mLt,∑t=1mat,∑t=1mbt.Suppose that an image is segmented inton superpixels as R1,R2,…,Rn. For any two given superpixelsRi and Rj, usually there will be more than one path connecting them. The length of each path is the sum of the distances of every two adjacent superpixels. It calculates the shortest path from Ri to Rj; for example, path=Ri,Rl+1,Rl+2,…,Rl+k,Rj, and its length is recorded as LMij:(2)LMij=Ci−Cl+1+∑t=1k−1Cl+t−Cl+t+1+Cl+k−Cj.


### 3.1.2. Image Region Segmentation

Since there are a lot of contour lines in the image, the different distribution of contour lines forms inflection points, intersection points, and other feature points, which are uniformly called corner points. After all corner points are recognized, a minimum polygonS containing them can be constructed. Superpixels located inside the polygon S are given larger weights, while those outside the polygon S are given smaller weights.


### 3.1.3. Calculation of the Saliency Score of Each Superpixel

For a given superpixelRi in the image, the saliency score is calculated as follows.Step 1. Calculate the scaling factor Ni of Ri as shown in the following equation:(3)Ni=∑j=1ne−0.05×LMij,whereLMij is the length of the shortest path from superpixel Ri to Rj.Step 2. The initial score of superpixel Ri is calculated as(4)sci=fi×di,where(5)fi=1,ifRilocates inS,0,otherwise,anddi represents the sum of the squares of the distances between Ri and all other superpixels; namely,(6)di=∑j=1nCi−Cj2.Step 3. The final visual saliency score of superpixel is calculated as shown in the following equation:(7)sfi=sciNi∑j=1ne−0.05×Lij.The saliency scores of all superpixels are obtained by equation (7), and then the scores of all pixels also can be obtained. All scores are normalized to the range of [0, 255] to obtain the salient area of the original image. For example, for the host image as shown in Figure 1(a), the corresponding salient areas are extracted as shown in Figure 1(b). It is further binarized to get the final salient areas as shown in Figure 1(c), in which white regions are the visually salient areas, and the black regions are the visually nonsalient areas.Figure 1
Experimental images. (a) The original host image with size of1400×930 pixels; (b) preliminary detection result of the salient region; (c) the final extracted salient areas.
(a)(b)(c)


## 3.1.1. Superpixel Segmentation

Since there is a lot of redundant information in an image, thek-means clustering method is used to segment all pixels with close distances and similar colours into many superpixel regions. The average colour value of all pixels in the CIELAB space of each superpixel is recorded as the colour of the superpixel, which is marked as Ci:(1)Ci=L,a,b=1m∑t=1mLt,∑t=1mat,∑t=1mbt.Suppose that an image is segmented inton superpixels as R1,R2,…,Rn. For any two given superpixelsRi and Rj, usually there will be more than one path connecting them. The length of each path is the sum of the distances of every two adjacent superpixels. It calculates the shortest path from Ri to Rj; for example, path=Ri,Rl+1,Rl+2,…,Rl+k,Rj, and its length is recorded as LMij:(2)LMij=Ci−Cl+1+∑t=1k−1Cl+t−Cl+t+1+Cl+k−Cj.


## 3.1.2. Image Region Segmentation

Since there are a lot of contour lines in the image, the different distribution of contour lines forms inflection points, intersection points, and other feature points, which are uniformly called corner points. After all corner points are recognized, a minimum polygonS containing them can be constructed. Superpixels located inside the polygon S are given larger weights, while those outside the polygon S are given smaller weights.


## 3.1.3. Calculation of the Saliency Score of Each Superpixel

For a given superpixelRi in the image, the saliency score is calculated as follows.Step 1. Calculate the scaling factor Ni of Ri as shown in the following equation:(3)Ni=∑j=1ne−0.05×LMij,whereLMij is the length of the shortest path from superpixel Ri to Rj.Step 2. The initial score of superpixel Ri is calculated as(4)sci=fi×di,where(5)fi=1,ifRilocates inS,0,otherwise,anddi represents the sum of the squares of the distances between Ri and all other superpixels; namely,(6)di=∑j=1nCi−Cj2.Step 3. The final visual saliency score of superpixel is calculated as shown in the following equation:(7)sfi=sciNi∑j=1ne−0.05×Lij.The saliency scores of all superpixels are obtained by equation (7), and then the scores of all pixels also can be obtained. All scores are normalized to the range of [0, 255] to obtain the salient area of the original image. For example, for the host image as shown in Figure 1(a), the corresponding salient areas are extracted as shown in Figure 1(b). It is further binarized to get the final salient areas as shown in Figure 1(c), in which white regions are the visually salient areas, and the black regions are the visually nonsalient areas.Figure 1
Experimental images. (a) The original host image with size of1400×930 pixels; (b) preliminary detection result of the salient region; (c) the final extracted salient areas.
(a)(b)(c)


## 3.2. Adaptive Selection of Embedding Region

Next, the nonsalient regions of the host image are evenly segmented into subblocksB1,B2,…,Bn according to the size of the visible watermark image. Based on the texture complexity and the gray distribution features of each image block, the relatively smooth image block is selected as the watermark embedding region.


### 3.2.1. Calculation of Image Texture Complexity

It can be concluded that the edge density of the image is an important factor affecting the texture complexity of the image. Therefore, it determines the texture complexity by calculating the density of the image boundary. The specific calculation steps are as follows:Step 1: obtain the gradient feature map of the host image.To eliminate the interference of noise,HG is obtained by Gaussian filtering for the host image H; then the gradient feature graph G is obtained by Laplace transform:(8)G=LaplacianHG.Step 2: obtain image boundary features.Use the Otsu method to binarizeG to obtain an image GB with only two gray levels of 0 and 255, and then perform a morphological closing operation on GB to obtain M:(9)M=CGB.Here,C⋅ is to perform morphological closing operations on the image. At this time, a large number of boundary features of the host image are saved in M.Step 3: calculate texture complexity.The boundary density of the subblockBi in the host image H, that is, the texture complexity ρi, is calculated as follows:(10)ρi=LiSi+τ,where Li is the number of pixels located on the boundary extracted from Bi in M, Si is the size of Bi, and 0<τ<1. In practical applications, it sets τ=0.01.


### 3.2.2. The Distribution Features of Image Gray Value

The visible watermark embedding can be performed by modifying the pixel value of the host image in spatial domain. Generally speaking, in dark tone areas with a gray value interval of [0, 127], the pixel value should be appropriately increased. In the bright tone area with a gray value interval of128,255, the pixel value needs to be appropriately reduced. The visibility of the visible watermark image can be ensured when the magnitude of the modification is large. To ensure the overall visual effect of the visible watermark, our proposed method tries to select the pixel values of the middle tone interval range 127−σ,128+σ, where σ can be set to 64. Next, we will discuss the calculation of the gray value distribution feature of the subblock Ri.The average gray levelαi of all pixels in the subblock Ri is calculated as follows:(11)αi=∑jj∈RiPjsi,where Pj is the pixel value of the host image at point j and the gray value distribution feature γi of the subblock Ri is calculated as follows:(12)γi=1.5−αi−127+σσ,αi≤127,1.5−αi−127−σσ,αi>127.


### 3.2.3. Smooth Area Selection

After obtaining the boundary densityρi and the gray value distribution feature γi of each subblock Ri using equations (10) and (12), the feature value μi of Ri can be obtained by the following equation:(13)μi=ρiγi.The feature valueμi of each subblock Ri is sequentially calculated, and all feature values μi are sorted in ascending order. The image area Rj corresponding to the smallest feature value μi is the final visible watermark embedding area. In this paper, it reduces ρi and increases γi to achieve the purpose of reducing μi. Among them, when the ρi value is smaller, the visible watermark can successfully avoid the areas with high image texture complexity. When the γi value is larger, the selected visible watermark embedding area will be far away from the high-tone and low-tone areas in the host image, thus making the watermarked image achieve a relatively ideal visual effect.


## 3.2.1. Calculation of Image Texture Complexity

It can be concluded that the edge density of the image is an important factor affecting the texture complexity of the image. Therefore, it determines the texture complexity by calculating the density of the image boundary. The specific calculation steps are as follows:Step 1: obtain the gradient feature map of the host image.To eliminate the interference of noise,HG is obtained by Gaussian filtering for the host image H; then the gradient feature graph G is obtained by Laplace transform:(8)G=LaplacianHG.Step 2: obtain image boundary features.Use the Otsu method to binarizeG to obtain an image GB with only two gray levels of 0 and 255, and then perform a morphological closing operation on GB to obtain M:(9)M=CGB.Here,C⋅ is to perform morphological closing operations on the image. At this time, a large number of boundary features of the host image are saved in M.Step 3: calculate texture complexity.The boundary density of the subblockBi in the host image H, that is, the texture complexity ρi, is calculated as follows:(10)ρi=LiSi+τ,where Li is the number of pixels located on the boundary extracted from Bi in M, Si is the size of Bi, and 0<τ<1. In practical applications, it sets τ=0.01.


## 3.2.2. The Distribution Features of Image Gray Value

The visible watermark embedding can be performed by modifying the pixel value of the host image in spatial domain. Generally speaking, in dark tone areas with a gray value interval of [0, 127], the pixel value should be appropriately increased. In the bright tone area with a gray value interval of128,255, the pixel value needs to be appropriately reduced. The visibility of the visible watermark image can be ensured when the magnitude of the modification is large. To ensure the overall visual effect of the visible watermark, our proposed method tries to select the pixel values of the middle tone interval range 127−σ,128+σ, where σ can be set to 64. Next, we will discuss the calculation of the gray value distribution feature of the subblock Ri.The average gray levelαi of all pixels in the subblock Ri is calculated as follows:(11)αi=∑jj∈RiPjsi,where Pj is the pixel value of the host image at point j and the gray value distribution feature γi of the subblock Ri is calculated as follows:(12)γi=1.5−αi−127+σσ,αi≤127,1.5−αi−127−σσ,αi>127.


## 3.2.3. Smooth Area Selection

After obtaining the boundary densityρi and the gray value distribution feature γi of each subblock Ri using equations (10) and (12), the feature value μi of Ri can be obtained by the following equation:(13)μi=ρiγi.The feature valueμi of each subblock Ri is sequentially calculated, and all feature values μi are sorted in ascending order. The image area Rj corresponding to the smallest feature value μi is the final visible watermark embedding area. In this paper, it reduces ρi and increases γi to achieve the purpose of reducing μi. Among them, when the ρi value is smaller, the visible watermark can successfully avoid the areas with high image texture complexity. When the γi value is larger, the selected visible watermark embedding area will be far away from the high-tone and low-tone areas in the host image, thus making the watermarked image achieve a relatively ideal visual effect.


## 3.3. Adaptively Visible Watermark Embedding

In this paper, the visible watermark image is embedded in the host image as follows:(14)IWx,y=1−γ×Ix,y+γ×127,where Ix,y is the pixel value of the host image, IWx,y is the watermarked pixel value, and γ is the adaptive watermark strength. To adaptively calculate the watermark strength γ from the image features of the neighbourhood area around the watermarked pixel, each pixel in the visible watermark image is embedded into the corresponding image block B size of 2×2 pixels in the host image; that is, each pixel in B is adjusted according to the same watermark intensity γ in equation (14). To ensure the visibility of the visible watermark image, JND model is used to adjust the gray value of each pixel after watermark embedding. The general watermark embedding diagram is shown in Figure 2.Figure 2
The diagram of visible watermark embedding process.


### 3.3.1. Adaptive Calculation of Watermark Strength

The embedding strength of the visible watermarking adaptively changes with the image complexity of the embedding region. As for the pixelWp in the visible watermark image W, the corresponding watermark embedding area Bp in the host image consists of four pixels P1,P2,P3,P4. Then the specific calculation process of watermark strength is as follows.Step 1. Calculate image texture complexity.Bp and 8 embedding regions in its neighborhood constitute a region SP with the size of 6×6 pixels. Through equation (10), the boundary density S in ρs of Sp can be obtained; then the texture complexity αp of region Sp can be expressed by ρs; that is,(15)αp=ρs.Step 2. Calculate the change amplitude of the pixel value in the embedding region.The intensity change of pixel value in the embedding area of the visible watermark image isβp, which can be measured by the gradient of pixel values in the region. In the embedding region Bp, the four pixels are sorted in ascending order according to the gray value, and the average gray value al of two smaller pixels and the average gray value a2 of two larger pixels are calculated, respectively. The calculation of βp is as follows:(16)βp=π/4tan−1a2/a1+τ,where,τ>0. As shown in equation (16), in the region where the pixel value changes smoothly, the value of a1 is close to a2, and tan−1ab/a1 is approximately equal to π/4, which corresponds to a larger βp. Similarly, when the pixel value in the region changes sharply, the difference between a1 and a2 is large, and the denominator of equation (16) will increase accordingly, so βp will decrease accordingly.Step 3. Calculate the final watermark embedding strength.The embedding strength of visible watermarking is calculated as(17)γp=αpβp.It can be seen from equation (17) that, in the flat area of the host image, if αp is small and βp is large, the watermark embedding strength γ is relatively small. On the contrary, in the region of the host image with complex texture, αp is large and βp is small, and the watermark embedding strength γ is relatively large. All γ values in the embedding areas are calculated normalized to the interval of n1,n2.


### 3.3.2. Visual Watermark Image Embedding

For the host imageI with RGB colour space, the specific steps of visible watermark image embedding are as follows:Step 1. Firstly, the host image is transformed from RGB colour space to YUV colour space, and the visible watermark is embedded in the luminance component Y.Step 2. For the Y component, the JND masking matrix J is calculated.Step 3. For each pixel Wp in W, the embedding process in the region Bp of the host image is as follows:(1)
WhenWp=0, all pixel values of Bpremain unchanged.(2)
WhenWp=1, the watermarked pixels IPiW′, i=1,2,3,4, are calculated by equation (14).Step 4. Adjust the watermarked pixel value.For anyPi in Bp, the change range Di of the pixel values before and after watermark embedding is calculated:(18)Di=IPi−IPiW′.(1)
IfDi<ω×JPi, where ω≥1, is a fixed constant and JPi is the value of the masking matrix J at the point Pi, it is shown that the variable of the watermarked pixel value obtained by equation (14) is too small, and the pixel value after the watermark embedding is recalculated in the following way:(19)IPiW=IPiW′+ω×JPi,mp≤127,IPiW′−ω×JPi,mp>127.(2)
IfDi≥ω×JPi, then IPiW=IPiW′.So far, the embedding process of visible watermarking is finished.For example, the Logo image in Figure3(a) is embedded into host image in Figure 1(a) to get the watermarked image shown in Figure 3(b), where n1=0.3,n2=0.7,w=3.Figure 3
The watermarked image. (a) A binary visible watermark image with the size of 100∗100 pixels; (b) the watermarked image with (a) embedded into the host image (Figure 1(a)).
(a)(b)


## 3.3.1. Adaptive Calculation of Watermark Strength

The embedding strength of the visible watermarking adaptively changes with the image complexity of the embedding region. As for the pixelWp in the visible watermark image W, the corresponding watermark embedding area Bp in the host image consists of four pixels P1,P2,P3,P4. Then the specific calculation process of watermark strength is as follows.Step 1. Calculate image texture complexity.Bp and 8 embedding regions in its neighborhood constitute a region SP with the size of 6×6 pixels. Through equation (10), the boundary density S in ρs of Sp can be obtained; then the texture complexity αp of region Sp can be expressed by ρs; that is,(15)αp=ρs.Step 2. Calculate the change amplitude of the pixel value in the embedding region.The intensity change of pixel value in the embedding area of the visible watermark image isβp, which can be measured by the gradient of pixel values in the region. In the embedding region Bp, the four pixels are sorted in ascending order according to the gray value, and the average gray value al of two smaller pixels and the average gray value a2 of two larger pixels are calculated, respectively. The calculation of βp is as follows:(16)βp=π/4tan−1a2/a1+τ,where,τ>0. As shown in equation (16), in the region where the pixel value changes smoothly, the value of a1 is close to a2, and tan−1ab/a1 is approximately equal to π/4, which corresponds to a larger βp. Similarly, when the pixel value in the region changes sharply, the difference between a1 and a2 is large, and the denominator of equation (16) will increase accordingly, so βp will decrease accordingly.Step 3. Calculate the final watermark embedding strength.The embedding strength of visible watermarking is calculated as(17)γp=αpβp.It can be seen from equation (17) that, in the flat area of the host image, if αp is small and βp is large, the watermark embedding strength γ is relatively small. On the contrary, in the region of the host image with complex texture, αp is large and βp is small, and the watermark embedding strength γ is relatively large. All γ values in the embedding areas are calculated normalized to the interval of n1,n2.


## 3.3.2. Visual Watermark Image Embedding

For the host imageI with RGB colour space, the specific steps of visible watermark image embedding are as follows:Step 1. Firstly, the host image is transformed from RGB colour space to YUV colour space, and the visible watermark is embedded in the luminance component Y.Step 2. For the Y component, the JND masking matrix J is calculated.Step 3. For each pixel Wp in W, the embedding process in the region Bp of the host image is as follows:(1)
WhenWp=0, all pixel values of Bpremain unchanged.(2)
WhenWp=1, the watermarked pixels IPiW′, i=1,2,3,4, are calculated by equation (14).Step 4. Adjust the watermarked pixel value.For anyPi in Bp, the change range Di of the pixel values before and after watermark embedding is calculated:(18)Di=IPi−IPiW′.(1)
IfDi<ω×JPi, where ω≥1, is a fixed constant and JPi is the value of the masking matrix J at the point Pi, it is shown that the variable of the watermarked pixel value obtained by equation (14) is too small, and the pixel value after the watermark embedding is recalculated in the following way:(19)IPiW=IPiW′+ω×JPi,mp≤127,IPiW′−ω×JPi,mp>127.(2)
IfDi≥ω×JPi, then IPiW=IPiW′.So far, the embedding process of visible watermarking is finished.For example, the Logo image in Figure3(a) is embedded into host image in Figure 1(a) to get the watermarked image shown in Figure 3(b), where n1=0.3,n2=0.7,w=3.Figure 3
The watermarked image. (a) A binary visible watermark image with the size of 100∗100 pixels; (b) the watermarked image with (a) embedded into the host image (Figure 1(a)).
(a)(b)


## 4. Experimental Results and Discussion

### 4.1. Comparison of the Embedding Region Selection

In [33], the visual saliency matrix of the host image is calculated by using the ITTI visual model, and the region with the lowest visual saliency is selected as the embedding region for visible watermarking. In [29], it calculates the average gray value of each block image and selects the region that meets the following conditions as the embedding area: (1) The average gray value of the image block is greatly different from the middle tone 127. (2) There are as many pixels as possible in the area whose gray values are not equal to the average gray value. In this experiment, there are 24 images selected as the host images from Kodak image set. First of all, the sizes of all host images are scaled to 800∗800 pixels, and the size of the binary visible watermark image is scaled to 120∗120 pixels. Accordingly, the size of watermarked region is set as 240∗240 pixels. The adaptive selection effects of the visible watermark embedding region are given by using the methods in [29, 33] and our proposed method, respectively, just as shown in Figure 4.Figure 4
The effects of adaptive region selection of visible watermark embedding: the images in columns (a), (b), and (c) are obtained by the method in [33], the method in [29], and our proposed method, respectively, and the corresponding host images are kodim14, kodim17, and kodim22, respectively.
(a)(b)(c)In Figure4, as for the image kodim14, both the method in [33] and our proposed method bypass the key objects, such as boat and the people on the boat. However, the method in [29] does not avoid the boat. But the texture complexity of the region in [33] is higher and the gray level is near the middle tone, which disturbs the visual vision inevitably. For the image kodim17, in [33], the regions occupied by statue face and the ball are detected as the salient areas, and the watermarked area overlaps the region occupied by the clothes. The method in [29] and our proposed method bypass the statue, and the location of the region selected by our method is relatively more ideal. As for the image kodim22, the most significant area should be the area occupied by the house. In [29], the watermarked region conflicts with the area of the house, while the method in [33] and our method both avoided the house successfully. In contrast, the selected region by our proposed method is more suitable, in which the background is relatively flat, and the visual effect of the watermarked image is more natural. On the contrary, the method in [33] selects the area occupied by grassland for visible watermarking, and the texture of the background image reflects the visibility of the visible watermark image.In addition, as mentioned before, whether it is based on ICA or traditional image inpainting method, the location information of the embedding region is needed to remove the visible watermark image from watermarked image. In the proposed method, the embedding region of the visible watermarking is adaptively selected, which can resist the watermark removal attack to a certain extent, especially for the batch removal of the visible watermark image. Therefore, the proposed method is robust to the visual watermark removal attack.To sum up, in [33], the ITTI visual model is used to detect the region of interest in the host image, but the gray distribution and texture complexity of the host image are not considered while selecting the watermark embedding region. Therefore, when the texture details of the host image are complex or the significant areas are widely distributed, the accuracy of the region of interest detected by the model is low. In [29], it only uses the features of gray distribution in the host image and does not consider the texture complexity of the host image, in which the selected area usually obscures the important objects. On the basis of salient region detection, combining with the gray distribution and texture complexity of the background image, our proposed method can adaptively select the embedding area for the visible watermarking, which can effectively overcome the defects of the existing methods.


### 4.2. Comparison of Visible Watermark Embedding

In [29], it uses the visual effect factor (VEF) of HVS to adaptively modify the pixel value of the host image to produce a better fusion effect between the visible watermark image and the host image. In [35], the visible watermark is embedded by using the method of dynamic pixel value mapping (DPVM). The visual effect of the visible watermark embedded by our proposed method is compared with the methods in [29, 35]. The subjective effects of visible watermarked images are shown in Figure 5, and the objective visual effect index parameters are as follows.Figure 5
The embedding effects of the watermarked images: the host images from the first row to the third row are kodim02, kodim06, and kodim10, respectively, and the watermarked images from columns (a), (b), and (c) are obtained by the methods in [29, 35] and our proposed method, respectively.
(a)(b)(c)


#### 4.2.1. Peak Signal-to-Noise Ratio (PSNR)

PSNR is used to measure the distortion or noise level of an image. It is often used to objectively evaluate the degradation degree of an image. The greater the PSNR value between two images, the lower the degradation degree of the image, that is, the higher the image quality. Given the original image H with the size of M×N pixels and the watermarked image H′, the peak signal-to-noise ratio is defined as(20)PSNR=10log2552MSE,where MSE is the mean square error between images, which is defined as(21)MSE=1m×n∑i=0m−1∑j=0n−1Hi,j−H′i,j2.


#### 4.2.2. Structural Similarity (SSIM)

SSIM is composed of three contrast modules: brightness, contrast, and structure. For the host image H and the watermarked image H′ to be compared, the comparison results of image brightness are as follows:(22)IH,H′=2μHμH′+c1μH2+μH′2+c1.The comparison results of image contrast are as follows:(23)cH,H′=2σHσH′+c2σH2+σH′2+c2.The comparison results of image structure are as follows:(24)sH,H′=σHH′+c3σHσH′+c3.The definition of structural similarity is as follows:(25)SSIMH,H′=IH,H′αcH,H′βsH,H′γ.In practical applications,α=β=γ=1, c3=0.5×c2, and SSIM can be expressed as(26)SSIMH,H′=2μHμH′+c12σHH′+c2μH2+μH′2+c1σH2+σH′2+c2,where μH is the average gray value of the host imageH, μH′ is the average gray value of the watermark image H′, σH2 is the variance of H, σH′2 is the variance of H′, and σHH′ is the gray level covariance of the two images. The range of structural similarity is from 0 to 1; when the two images are identical, the structure similarity is 1.


#### 4.2.3. Obtrusiveness

In [7], a standard for detecting the visual effect of watermarked images using the abruptness of watermarked images is proposed. For the original image H and the watermarked image H′, the normalized MSPE (mean square perceptual error) value at the point x,y is calculated as follows:(27)MSPEx,y=H′x,y−Hx,y−JNDHx,y2δ2552,where H′x,y is the gray value of point x,y in the watermarked image, Hx,y is the gray value of point x,y in the host image, JNDHx,y is the value of JND matrix of the host image at x,y, and the calculation method of δ is calculated as follows:(28)δ=1,H′x,y−Hx,y≥0,0,otherwise.The abruptness of the entire image is represented by the average of theMSPE values of all pixels. It can be seen from equation (27) that the larger the MSPE value of the watermarked image is, the more obvious the abruptness of the embedded visible watermark image is, and the worse the visual effect of the watermarked image is.The visual quality evaluation effect of the watermarked image shown in Figure5 is given in Table 1.Table 1
Quality evaluation standards with host images in Kodak set.
Image IDPSNRSSIMMSPEIn [29]In [35]OursIn [29]In [35]OursIn [29]In [35]Ourskodim0118.8910.6219.290.18710.14860.21910.00840.07540.0079kodim0216.0812.2323.870.14120.13320.22680.01830.05010.0018kodim0318.1314.2124.100.16050.15700.23270.01220.03270.0024kodim0417.0112.5419.730.17070.14880.20550.01460.04650.0068kodim0516.868.7417.670.19940.14100.20690.01420.11610.0109kodim0615.9012.3424.020.15680.15520.24170.02210.05270.0025kodim0719.2510.6720.830.21020.14640.23070.00870.07660.0053kodim0817.8210.4618.730.19820.15590.23020.00900.07790.0084kodim0918.6314.5326.870.17070.15740.26020.01180.03200.0013kodim1018.8314.2326.340.18450.15820.25920.01110.0340.0015kodim1118.7610.4521.280.20020.14430.23390.00980.08070.0048kodim1218.6314.1626.150.18400.15950.26040.01150.03470.0016kodim1317.6112.6418.750.19720.17020.22720.01210.04460.0085kodim1416.568.7720.870.17680.13000.22480.01570.11860.0046kodim1516.5712.2921.360.16420.14540.21440.01620.04920.0041kodim1620.5415.5627.830.19410.16200.26420.00740.02530.0011kodim1716.898.9719.610.17380.13160.20690.01510.11250.0070kodim1816.5712.2519.400.15970.14380.19190.01620.04950.0073kodim1919.3814.8125.420.18190.16330.24880.00930.02910.0018kodim2013.5210.4920.610.12800.14110.20030.03870.08110.0062kodim2119.7915.0327.390.18830.15840.26350.00900.02870.0012kodim2218.9914.3426.620.18460.15660.25800.01070.03330.0014kodim2316.5412.4819.970.16290.15050.20590.01670.04750.0064kodim2418.4713.5921.780.19920.16430.22710.010670.03740.0042It can be seen from Figure5 and Table 1 that the visibility and transparency of the visible watermark image are contradictory. In [35], it calculates a visible watermarking strength by using the overall features of the watermarked region but ignores the feature information in the local domain. The obtained watermark image has the strongest visibility, as shown in column (b) of Figure 5, but the obtained watermark image has the worst abruptness and the maximum MSPE value. Due to the strong visibility, the watermark image has the lowest similarity with the original host image, and the corresponding SSIM value is the minimum. On the basis of ensuring the visibility of the visible watermark image, to further increase the transparency of the watermarked image, the texture and colour features around each pixel to be modified are considered in both the method in [29] and our proposed method. However, compared with [29], the proposed method is based on the continuous gray gradient of the host image, and the JND value is introduced to ensure the transparency of the watermark image. In addition, compared with the original host image, the watermarked image generated by our proposed method has the least distortion, so it has the highest similarity.


## 4.1. Comparison of the Embedding Region Selection

In [33], the visual saliency matrix of the host image is calculated by using the ITTI visual model, and the region with the lowest visual saliency is selected as the embedding region for visible watermarking. In [29], it calculates the average gray value of each block image and selects the region that meets the following conditions as the embedding area: (1) The average gray value of the image block is greatly different from the middle tone 127. (2) There are as many pixels as possible in the area whose gray values are not equal to the average gray value. In this experiment, there are 24 images selected as the host images from Kodak image set. First of all, the sizes of all host images are scaled to 800∗800 pixels, and the size of the binary visible watermark image is scaled to 120∗120 pixels. Accordingly, the size of watermarked region is set as 240∗240 pixels. The adaptive selection effects of the visible watermark embedding region are given by using the methods in [29, 33] and our proposed method, respectively, just as shown in Figure 4.Figure 4
The effects of adaptive region selection of visible watermark embedding: the images in columns (a), (b), and (c) are obtained by the method in [33], the method in [29], and our proposed method, respectively, and the corresponding host images are kodim14, kodim17, and kodim22, respectively.
(a)(b)(c)In Figure4, as for the image kodim14, both the method in [33] and our proposed method bypass the key objects, such as boat and the people on the boat. However, the method in [29] does not avoid the boat. But the texture complexity of the region in [33] is higher and the gray level is near the middle tone, which disturbs the visual vision inevitably. For the image kodim17, in [33], the regions occupied by statue face and the ball are detected as the salient areas, and the watermarked area overlaps the region occupied by the clothes. The method in [29] and our proposed method bypass the statue, and the location of the region selected by our method is relatively more ideal. As for the image kodim22, the most significant area should be the area occupied by the house. In [29], the watermarked region conflicts with the area of the house, while the method in [33] and our method both avoided the house successfully. In contrast, the selected region by our proposed method is more suitable, in which the background is relatively flat, and the visual effect of the watermarked image is more natural. On the contrary, the method in [33] selects the area occupied by grassland for visible watermarking, and the texture of the background image reflects the visibility of the visible watermark image.In addition, as mentioned before, whether it is based on ICA or traditional image inpainting method, the location information of the embedding region is needed to remove the visible watermark image from watermarked image. In the proposed method, the embedding region of the visible watermarking is adaptively selected, which can resist the watermark removal attack to a certain extent, especially for the batch removal of the visible watermark image. Therefore, the proposed method is robust to the visual watermark removal attack.To sum up, in [33], the ITTI visual model is used to detect the region of interest in the host image, but the gray distribution and texture complexity of the host image are not considered while selecting the watermark embedding region. Therefore, when the texture details of the host image are complex or the significant areas are widely distributed, the accuracy of the region of interest detected by the model is low. In [29], it only uses the features of gray distribution in the host image and does not consider the texture complexity of the host image, in which the selected area usually obscures the important objects. On the basis of salient region detection, combining with the gray distribution and texture complexity of the background image, our proposed method can adaptively select the embedding area for the visible watermarking, which can effectively overcome the defects of the existing methods.


## 4.2. Comparison of Visible Watermark Embedding

In [29], it uses the visual effect factor (VEF) of HVS to adaptively modify the pixel value of the host image to produce a better fusion effect between the visible watermark image and the host image. In [35], the visible watermark is embedded by using the method of dynamic pixel value mapping (DPVM). The visual effect of the visible watermark embedded by our proposed method is compared with the methods in [29, 35]. The subjective effects of visible watermarked images are shown in Figure 5, and the objective visual effect index parameters are as follows.Figure 5
The embedding effects of the watermarked images: the host images from the first row to the third row are kodim02, kodim06, and kodim10, respectively, and the watermarked images from columns (a), (b), and (c) are obtained by the methods in [29, 35] and our proposed method, respectively.
(a)(b)(c)


### 4.2.1. Peak Signal-to-Noise Ratio (PSNR)

PSNR is used to measure the distortion or noise level of an image. It is often used to objectively evaluate the degradation degree of an image. The greater the PSNR value between two images, the lower the degradation degree of the image, that is, the higher the image quality. Given the original image H with the size of M×N pixels and the watermarked image H′, the peak signal-to-noise ratio is defined as(20)PSNR=10log2552MSE,where MSE is the mean square error between images, which is defined as(21)MSE=1m×n∑i=0m−1∑j=0n−1Hi,j−H′i,j2.


### 4.2.2. Structural Similarity (SSIM)

SSIM is composed of three contrast modules: brightness, contrast, and structure. For the host image H and the watermarked image H′ to be compared, the comparison results of image brightness are as follows:(22)IH,H′=2μHμH′+c1μH2+μH′2+c1.The comparison results of image contrast are as follows:(23)cH,H′=2σHσH′+c2σH2+σH′2+c2.The comparison results of image structure are as follows:(24)sH,H′=σHH′+c3σHσH′+c3.The definition of structural similarity is as follows:(25)SSIMH,H′=IH,H′αcH,H′βsH,H′γ.In practical applications,α=β=γ=1, c3=0.5×c2, and SSIM can be expressed as(26)SSIMH,H′=2μHμH′+c12σHH′+c2μH2+μH′2+c1σH2+σH′2+c2,where μH is the average gray value of the host imageH, μH′ is the average gray value of the watermark image H′, σH2 is the variance of H, σH′2 is the variance of H′, and σHH′ is the gray level covariance of the two images. The range of structural similarity is from 0 to 1; when the two images are identical, the structure similarity is 1.


### 4.2.3. Obtrusiveness

In [7], a standard for detecting the visual effect of watermarked images using the abruptness of watermarked images is proposed. For the original image H and the watermarked image H′, the normalized MSPE (mean square perceptual error) value at the point x,y is calculated as follows:(27)MSPEx,y=H′x,y−Hx,y−JNDHx,y2δ2552,where H′x,y is the gray value of point x,y in the watermarked image, Hx,y is the gray value of point x,y in the host image, JNDHx,y is the value of JND matrix of the host image at x,y, and the calculation method of δ is calculated as follows:(28)δ=1,H′x,y−Hx,y≥0,0,otherwise.The abruptness of the entire image is represented by the average of theMSPE values of all pixels. It can be seen from equation (27) that the larger the MSPE value of the watermarked image is, the more obvious the abruptness of the embedded visible watermark image is, and the worse the visual effect of the watermarked image is.The visual quality evaluation effect of the watermarked image shown in Figure5 is given in Table 1.Table 1
Quality evaluation standards with host images in Kodak set.
Image IDPSNRSSIMMSPEIn [29]In [35]OursIn [29]In [35]OursIn [29]In [35]Ourskodim0118.8910.6219.290.18710.14860.21910.00840.07540.0079kodim0216.0812.2323.870.14120.13320.22680.01830.05010.0018kodim0318.1314.2124.100.16050.15700.23270.01220.03270.0024kodim0417.0112.5419.730.17070.14880.20550.01460.04650.0068kodim0516.868.7417.670.19940.14100.20690.01420.11610.0109kodim0615.9012.3424.020.15680.15520.24170.02210.05270.0025kodim0719.2510.6720.830.21020.14640.23070.00870.07660.0053kodim0817.8210.4618.730.19820.15590.23020.00900.07790.0084kodim0918.6314.5326.870.17070.15740.26020.01180.03200.0013kodim1018.8314.2326.340.18450.15820.25920.01110.0340.0015kodim1118.7610.4521.280.20020.14430.23390.00980.08070.0048kodim1218.6314.1626.150.18400.15950.26040.01150.03470.0016kodim1317.6112.6418.750.19720.17020.22720.01210.04460.0085kodim1416.568.7720.870.17680.13000.22480.01570.11860.0046kodim1516.5712.2921.360.16420.14540.21440.01620.04920.0041kodim1620.5415.5627.830.19410.16200.26420.00740.02530.0011kodim1716.898.9719.610.17380.13160.20690.01510.11250.0070kodim1816.5712.2519.400.15970.14380.19190.01620.04950.0073kodim1919.3814.8125.420.18190.16330.24880.00930.02910.0018kodim2013.5210.4920.610.12800.14110.20030.03870.08110.0062kodim2119.7915.0327.390.18830.15840.26350.00900.02870.0012kodim2218.9914.3426.620.18460.15660.25800.01070.03330.0014kodim2316.5412.4819.970.16290.15050.20590.01670.04750.0064kodim2418.4713.5921.780.19920.16430.22710.010670.03740.0042It can be seen from Figure5 and Table 1 that the visibility and transparency of the visible watermark image are contradictory. In [35], it calculates a visible watermarking strength by using the overall features of the watermarked region but ignores the feature information in the local domain. The obtained watermark image has the strongest visibility, as shown in column (b) of Figure 5, but the obtained watermark image has the worst abruptness and the maximum MSPE value. Due to the strong visibility, the watermark image has the lowest similarity with the original host image, and the corresponding SSIM value is the minimum. On the basis of ensuring the visibility of the visible watermark image, to further increase the transparency of the watermarked image, the texture and colour features around each pixel to be modified are considered in both the method in [29] and our proposed method. However, compared with [29], the proposed method is based on the continuous gray gradient of the host image, and the JND value is introduced to ensure the transparency of the watermark image. In addition, compared with the original host image, the watermarked image generated by our proposed method has the least distortion, so it has the highest similarity.


## 4.2.1. Peak Signal-to-Noise Ratio (PSNR)

PSNR is used to measure the distortion or noise level of an image. It is often used to objectively evaluate the degradation degree of an image. The greater the PSNR value between two images, the lower the degradation degree of the image, that is, the higher the image quality. Given the original image H with the size of M×N pixels and the watermarked image H′, the peak signal-to-noise ratio is defined as(20)PSNR=10log2552MSE,where MSE is the mean square error between images, which is defined as(21)MSE=1m×n∑i=0m−1∑j=0n−1Hi,j−H′i,j2.


## 4.2.2. Structural Similarity (SSIM)

SSIM is composed of three contrast modules: brightness, contrast, and structure. For the host image H and the watermarked image H′ to be compared, the comparison results of image brightness are as follows:(22)IH,H′=2μHμH′+c1μH2+μH′2+c1.The comparison results of image contrast are as follows:(23)cH,H′=2σHσH′+c2σH2+σH′2+c2.The comparison results of image structure are as follows:(24)sH,H′=σHH′+c3σHσH′+c3.The definition of structural similarity is as follows:(25)SSIMH,H′=IH,H′αcH,H′βsH,H′γ.In practical applications,α=β=γ=1, c3=0.5×c2, and SSIM can be expressed as(26)SSIMH,H′=2μHμH′+c12σHH′+c2μH2+μH′2+c1σH2+σH′2+c2,where μH is the average gray value of the host imageH, μH′ is the average gray value of the watermark image H′, σH2 is the variance of H, σH′2 is the variance of H′, and σHH′ is the gray level covariance of the two images. The range of structural similarity is from 0 to 1; when the two images are identical, the structure similarity is 1.


## 4.2.3. Obtrusiveness

In [7], a standard for detecting the visual effect of watermarked images using the abruptness of watermarked images is proposed. For the original image H and the watermarked image H′, the normalized MSPE (mean square perceptual error) value at the point x,y is calculated as follows:(27)MSPEx,y=H′x,y−Hx,y−JNDHx,y2δ2552,where H′x,y is the gray value of point x,y in the watermarked image, Hx,y is the gray value of point x,y in the host image, JNDHx,y is the value of JND matrix of the host image at x,y, and the calculation method of δ is calculated as follows:(28)δ=1,H′x,y−Hx,y≥0,0,otherwise.The abruptness of the entire image is represented by the average of theMSPE values of all pixels. It can be seen from equation (27) that the larger the MSPE value of the watermarked image is, the more obvious the abruptness of the embedded visible watermark image is, and the worse the visual effect of the watermarked image is.The visual quality evaluation effect of the watermarked image shown in Figure5 is given in Table 1.Table 1
Quality evaluation standards with host images in Kodak set.
Image IDPSNRSSIMMSPEIn [29]In [35]OursIn [29]In [35]OursIn [29]In [35]Ourskodim0118.8910.6219.290.18710.14860.21910.00840.07540.0079kodim0216.0812.2323.870.14120.13320.22680.01830.05010.0018kodim0318.1314.2124.100.16050.15700.23270.01220.03270.0024kodim0417.0112.5419.730.17070.14880.20550.01460.04650.0068kodim0516.868.7417.670.19940.14100.20690.01420.11610.0109kodim0615.9012.3424.020.15680.15520.24170.02210.05270.0025kodim0719.2510.6720.830.21020.14640.23070.00870.07660.0053kodim0817.8210.4618.730.19820.15590.23020.00900.07790.0084kodim0918.6314.5326.870.17070.15740.26020.01180.03200.0013kodim1018.8314.2326.340.18450.15820.25920.01110.0340.0015kodim1118.7610.4521.280.20020.14430.23390.00980.08070.0048kodim1218.6314.1626.150.18400.15950.26040.01150.03470.0016kodim1317.6112.6418.750.19720.17020.22720.01210.04460.0085kodim1416.568.7720.870.17680.13000.22480.01570.11860.0046kodim1516.5712.2921.360.16420.14540.21440.01620.04920.0041kodim1620.5415.5627.830.19410.16200.26420.00740.02530.0011kodim1716.898.9719.610.17380.13160.20690.01510.11250.0070kodim1816.5712.2519.400.15970.14380.19190.01620.04950.0073kodim1919.3814.8125.420.18190.16330.24880.00930.02910.0018kodim2013.5210.4920.610.12800.14110.20030.03870.08110.0062kodim2119.7915.0327.390.18830.15840.26350.00900.02870.0012kodim2218.9914.3426.620.18460.15660.25800.01070.03330.0014kodim2316.5412.4819.970.16290.15050.20590.01670.04750.0064kodim2418.4713.5921.780.19920.16430.22710.010670.03740.0042It can be seen from Figure5 and Table 1 that the visibility and transparency of the visible watermark image are contradictory. In [35], it calculates a visible watermarking strength by using the overall features of the watermarked region but ignores the feature information in the local domain. The obtained watermark image has the strongest visibility, as shown in column (b) of Figure 5, but the obtained watermark image has the worst abruptness and the maximum MSPE value. Due to the strong visibility, the watermark image has the lowest similarity with the original host image, and the corresponding SSIM value is the minimum. On the basis of ensuring the visibility of the visible watermark image, to further increase the transparency of the watermarked image, the texture and colour features around each pixel to be modified are considered in both the method in [29] and our proposed method. However, compared with [29], the proposed method is based on the continuous gray gradient of the host image, and the JND value is introduced to ensure the transparency of the watermark image. In addition, compared with the original host image, the watermarked image generated by our proposed method has the least distortion, so it has the highest similarity.


## 5. Conclusion

To improve the robustness, visibility, and transparency of visible watermarking technology, this paper proposes an adaptive embedding method for visible watermarking. Firstly, the salient region of the host image is detected based on superpixel detection. On the one hand, the visible watermark image avoids the key objects in the host image and does not damage the value of the host image itself. On the other hand, the embedding region of the visible watermark image will change with content of the host image which increases the difficulty of malicious removal of visible watermark and especially can effectively resist the attack of batch automatic removal. Then, in the nonsalient area of the host image, a relatively low complexity flat area is selected as the embedding region, because the details in the host image with high texture complexity will affect the visibility of the visible watermark image. Finally, considering the JND coefficient, gray distribution, and texture complexity of the embedding region, the watermark embedding strength is calculated adaptively, and the ideal transparency of the visible watermark image is obtained. In a word, the proposed method achieves a good balance in robustness, visibility, and transparency. However, how to further improve the security of visible watermarking algorithm is worthy of further research.



---

*Source: 6693343-2021-03-03.xml*