## 4 Proposed Watermarking Scheme
### Watermark embedding  
The steps of the embedding algorithm can be described as follows:  
1. Split the host image \(I_{o}\) of size \(N\times N\) into \(n^{2}\) non-overlapping blocks, \(B_{b}\), of size \(M\times M\), where \(M=N/n\) and \(1\leq b\leq n^{2}\). 2. Generate the watermark \(W\), i.e., a pseudo-random Gaussian sequence of size \(n^{2}\), by means of the secret key \(K\). 3. Apply the SVD transform to each block:  
Figure 1: Three-dimensional visual representation of the vectors involved in the watermark embedding. \[SYD(B_{b})=\left[U_{b}S_{b}V_{b}\right]\] (4) The computation of the SVD transform is based on the QR method [55], to which we add the sign flip correction function [56] (see Section 5 for details). 4. From the secret key \(K\), extract the indices \(i\) and \(j\) that choose the \(v_{i}\) and \(v_{j}\) vectors belonging to the matrix \(V_{b}\). From \(K\), also extract the indices \(k\) and \(l\) which define the components on \(v_{i}\) and \(v_{j}\), used to compute the secret plane P(\(k\), \(l\)). For simplicity, we refer to such components as \(x=v_{k},y=v_{ls},z=v_{kj}\) and \(w=v_{j}\). 5. Compute the angle \(\theta_{b}\), derived by the projection of vector \(v_{i}\) with the positive axis \(k\), i.e., \(\angle\left(k,proj_{P(k,l)}v_{i}\right)\) defined by the components \(x\) and \(y\), using the four quadrant arctangent function (see Appendix A): \[\theta_{b}=\frac{\arctan(y,x)}{\delta}\] (5) \(\theta_{b}\) is then inserted in the feature set \(F\). The scaling factor \(\delta\) is used to obtain a feature angle that is not close to the point of discontinuity in \(-\pi\) and \(\pi\). In this way, all angles are \"compressed\" around the origin, so the modification made by the watermark insertion should not allow the angle to bypass the discontinuity point. This can be obtained by carefully choosing the scaling factor and the watermark strength, taking also into account that the angle obtained after the watermark insertion should, in theory, span all the range _[-\(\pi\).\(\pi\)]_. Nonetheless, it is possible (in a few cases, if the multiplicative constants are not carefully chosen) that for large values of the feature angle and of the watermark, the discontinuity will be traversed. 6. Compute the angle \(\alpha_{b}\), by adding the angle extracted from the watermark sequence \(W_{b}\) to the angle \(\theta_{b}\): \[\alpha_{b}=\theta_{b}+\beta\cdot W_{b}\] (6) where \(\beta\) is the strength factor of the embedded watermark. 7. Determine the rotation angle \(\varphi_{b}\), which is needed to rotate the \(v_{i}\) and \(v_{j}\) vectors in the plane P(\(v_{i}\), \(v_{j}\)) so that \(\alpha_{b}=\angle\left(k,proj_{P(k,l)}v_{i}^{\cdot}\right)\). To obtain this result, we apply the following relation (for its derivation see Appendix B): \[\varphi_{b}= \begin{cases}\chi,&\text{if}\quad\begin{cases}y\cdot\cos\varphi_{b }-w\cdot\sin\varphi_{b}<0\;\;\text{and}\;\;\alpha_{b}>0\;\;\;\text{or}\\ y\cdot\cos\varphi_{b}-w\cdot\sin\varphi_{b}>0\;\;\text{and}\;\;\alpha_{b}<0\\ \tau,&\text{otherwise}\end{cases}\end{cases} \] (7) \[\chi=\arctan(x\cdot\sin\alpha_{b}-y\cdot\cos\alpha_{b},\,z\cdot \sin\alpha_{b}-w\cdot\cos\alpha_{b})+\pi\] \[\tau=\arctan(x\cdot\sin\alpha_{b}-y\cdot\cos\alpha_{b},\,z\cdot \sin\alpha_{b}-w\cdot\cos\alpha_{b})\]8. Construct the unitary transformation matrix \(G_{b}\) which rotates clockwise a single pair of right singular vectors, i.e., \(v_{i}\) and \(v_{j}\), in the plane P(\(v_{i}\), \(v_{j}\)), by an angle \(\varphi_{b}\): \[G_{b}= \begin{bmatrix}1&\dots&0&\dots&0&\dots&0\\ 0&\ddots&&&&&&\vdots\\ &&\cos\varphi_{b}&0\cdots&\dots&0&-\sin\varphi_{b}&&0\\ \vdots&&&&1\ddots&&&&\vdots\\ 0&\cdots&\sin\varphi_{b}&0\cdots&\dots&0&\cos\varphi&&\\ 0&&&&0&&&&1\ddots\\ i&&&&j&&\ddots\\ \end{bmatrix} .\] (8)
9. Apply the transformation matrix to \(V_{b}\): \[V_{b}^{\prime}=V_{b}\cdot G_{b}^{T}\] (9) where \(V_{b}\) is the modified matrix of the right singular vectors. 10.