# Robust Template-Based Watermarking for DIBR 3D Images
## 3 Proposed Method
### Proposed Watermark Embedding Method
#### 3.2.3 Message Watermark Embedding  
The message is inserted into the 1D-DCT domain using the spread spectrum method [44]. If a watermark having the same information in the horizontal direction is inserted into the 1D-DCT, invariance can be obtained against DIBR due to the first property in Section 2.2. The 1D-DCT watermark insertion equation is as follows,  
\[\mathbf{DCT}(I^{\prime}_{i:})=\mathbf{DCT}(I_{i:})+\mathbf{w}, \tag{7}\]  
where \(i=1,2,...,m\), \(\mathbf{w}=[w_{1},w_{2},...w_{n}]^{T}\) is the watermark signal and \(m,n\) are the horizontal and vertical sizes of the block, respectively. \(I_{i:}\) denotes the \(i\)-th column of the original block; \(I^{\prime}_{i:}\) denotes the \(i\)-th column of the watermarked block; and \(\mathbf{DCT}\) denotes the 1D-DCT. The DIBR attack is applied in the spatial domain, not in the transformed domain. Therefore, the inverse DCT (IDCT) is performed to check the change of the inserted watermark in the spatial domain. Using the IDCT, Equation (7) can be rewritten according to the linearity of the DCT as follows,  
\[ \begin{split} I^{\prime}_{i:}=&\mathbf{IDCT}( \mathbf{DCT}(I^{\prime}_{i:}))\\ =&\mathbf{IDCT}(\mathbf{DCT}(I_{i:})+\mathbf{w})=I _{i:}+\mathbf{IDCT}(\mathbf{w})\\ =& I_{i:}+\mathbf{v},\end{split}  \tag{8}\]  
where \(\mathbf{v}=[v_{1},v_{2},...,v_{n}]^{T}\) denotes the inverse transformed watermark. Figure 7: Insert four peak points into one template block. The points are inserted at the third division point so that the intervals are the same. The signal \(\mathbf{v}\) is inserted as the same information in all columns of the spatial domain. This means that the embedded patterns from the \(j\)-th row have the same \(v_{j}\) signal. Therefore, embedded watermark \(\mathbf{v}\) has the following DIBR invariance,  
\[\mathbf{D}([\mathbf{v},\mathbf{v},...,\mathbf{v}])=\left[ \begin{array}{ cccc}v_{1}&v_{1}&\dots&v_{1}\\ v_{2}&v_{2}&\dots&v_{2}\\ \vdots&\vdots&\ddots&\vdots\\ v_{n}&v_{n}&\dots&v_{n}\end{array} \right]=[\mathbf{v},\mathbf{v},...,\mathbf{ v}] \tag{9}\]  
where \(\mathbf{D}(\cdot)\) is the DIBR process described in Section 2.1. Since DIBR only translates pixels in the horizontal direction, \(\mathbf{v}\) is not deformed. Therefore, the watermark can be extracted in the frequency domain as follows,  
\[ \begin{split}\mathbf{DCT}(\mathbf{D}(I_{i:}^{\prime}))&= \mathbf{DCT}(\mathbf{D}(I_{i:}+\mathbf{v}))\\ &=\mathbf{DCT}(\mathbf{D}(I_{i:})+\mathbf{D}(\mathbf{v}))\\ &=\mathbf{DCT}(\mathbf{D}(I_{i:})+\mathbf{v})\\ &=\mathbf{DCT}(\mathbf{D}(I_{i:}))+\mathbf{DCT}(\mathbf{v})\\ &=\mathbf{DCT}(\mathbf{D}(I_{i:}))+\mathbf{w}.\end{split}  \tag{10}\]  
Hence, \(w\) can be extracted in the frequency domain without being damaged by DIBR in the extraction process. To compensate for the capacity decrease caused by template insertion, a data coding technique can be utilized to insert more than 1 bit per block [37]. The message watermark embedding process is divided into four steps as follows. 1. Column-by-column 1D-DCT: Each column of the message block is transformed by 1D-DCT. 2. Data encoding: A pseudo random watermark pattern set (i.e., a set of watermark patterns) is generated. The length of the set is determined by the user, and the capacity of the block is determined according to the length. For example, to represent four bits of information per block, 16 (i.e., 24) unique watermark patterns are generated [45]. 3. Watermark embedding: The proposed method embeds the watermark based on the spread-spectrum [45]. The generated watermark pattern set \(\mathbf{w}_{b}=\{w_{b1},w_{b2},\dots,w_{bL}\}\) is embedded into the middle frequency of the DCT signal \(\mathbf{s}=\{s_{1},s_{2},\dots,s_{L}\}\) compromising both robustness and invisibility.