# A Robust Image Watermarking Scheme Based on SVD in the Spatial Domain
## 4 The Proposed Scheme
### Watermark Embedding  
In the proposed method, a binary watermark is embedded into the largest singular values of some image blocks. Figure 3 illustrates the watermark embedding process, and the concrete steps are described as follows.  
Step 1. The host image with a size of \(M\,\times\,M\) is firstly divided into a series of non-overlapping blocks with a size of \(m\,\times\,m\).  
Step 2. The largest singular value \(\lambda_{\text{max}}\) in each image block serves as the embedding position to embed the watermark information. Instead of calculating the largest singular value using SVD in SVD-based watermarking [14], the largest singular value is obtained by the 2-norm of a matrix in the spatial domain, which is given by Equation (11). Then, we get a series of singular values \(\lambda_{\text{max}}^{i}\)\(\{i=1,2,\cdots,(M\,\times\,M)/(m\,\times\,m))\}\).  
\[\lambda_{\text{max}}=\|\mathbf{A}\|_{2}. \tag{11}\]  
Figure 2: Frequency distribution histogram of the values in \(\mathbf{u}_{1}\mathbf{v}_{1}^{\text{T}}\) for block sizes 4 \(\times\) 4 and 8 \(\times\) 8: **(a)** Image Lena with block size 4 \(\times\) 4; **(b)** Image [PERSON] with block size 4 \(\times\) 4; **(c)** Image Lena with block size 8 \(\times\) 8; **(d)** Image Barbara with block size 8 \(\times\) 8.  
Step 3. It is generally known that the larger the singular value used for watermark embedding is, the smaller the effect of a watermark on the host image will be. To further enhance the watermark imperceptibility, these singular values obtained above are rearranged in descending order, and the larger singular values are selected to embed the watermarking message according to the watermark capacity. In other words, the number of the selected singular values is the same as the number of pixels in the watermark image. In addition, the block indexes of these selected blocks are stored as a key matrix, which will be used for watermark extraction on the receiving end. Therefore, the proposed method is a semi-blind watermarking scheme.  
Step 4. To reinforce the safety of the watermark, the binary watermark is encrypted by the Arnold transform with a secret key \(k\).  
Step 5. The encrypted watermarking bits are orderly embedded into the largest singular values of the selected blocks by modulating its amplitudes. The embedding rules in [23] are used in this step, which are given as follows.  
Let \(\Delta\) be the quantization step to control the modifying magnitudes \(T_{1}\) and \(T_{2}\). The relationship between the watermarking bit \(w\) and the modifying magnitudes can be expressed as:  
\[\left\{\begin{array}{l}T_{1}=0.5\Delta,\ T_{2}=-1.5\Delta,\ w=1,\\ T_{1}=-0.5\Delta,\ T_{2}=1.5\Delta,\ \text{otherwise}.\end{array}\right. \tag{12}\]  
Then, we get the modified singular value \({\lambda^{\prime}}_{\text{max}}\) by Equation (13):  
\[\begin{array}{l}k_{1}=\text{floor}(\text{ceil}(\lambda_{\text{max}}/\Delta )/2),\\ c_{1}=2k_{1}\Delta+T_{1},\ c_{2}=2k_{1}\Delta+T_{2},\\ {\lambda^{\prime}}_{\text{max}}=\left\{\begin{array}{l}c_{2},\ |\lambda_{\text{max}}-c_{2}|<|\lambda_{\text{max}}-c_{1}|,\\ c_{1},\ \text{otherwise}.\end{array}\right.\end{array} \tag{13}\]  
Step 6. To achieve spatial domain watermarking, the difference \(\Delta\lambda\) between \(\lambda_{\text{max}}\) and \({\lambda^{\prime}}_{\text{max}}\) is computed by \({\lambda^{\prime}}_{\text{max}}-\lambda_{\text{max}}\). According to Equation (8), we can get the difference matrix \(\Delta A\) between the original image block \(A\) and its watermarked version \(A_{w}\) using \(\Delta\lambda\mathbf{u}_{1}\mathbf{v}_{1}^{\text{T}}\). The watermark embedding process is completed by directly modifying the pixel values using \(\Delta A\) in each block, as shown in Equation (7).  
Step 7. After image reconstruction, the watermarked image can be obtained.