# Dual Partial Reversible Data Hiding Using Enhanced Hamming Code
## 3 Proposed Scheme
### Generation of Cover Images  
In this subsection, we present the process for generating two cover images using the improved HC(7,4) scheme. The detailed procedure is summarized in Algorithm 1.  
Initially, two copies of the original image are created, denoted by \(\textbf{I}_{1}\) and \(\textbf{I}_{2}\). For each pixel \(x_{j}\) in the original image \(O\), the same value is assigned to the corresponding pixels in \(\textbf{I}_{1}\) and \(\textbf{I}_{2}\), denoted as \(x_{j}^{1}\) and \(x_{j}^{2}\), respectively. Each of these pixel values is represented in 8-bit binary format as  
\[x_{j}^{1} =(a_{8}\;a_{7}\;a_{6}\;a_{5}\;a_{4}\;a_{3}\;a_{2}\;a_{1}),\] \[x_{j}^{2} =(b_{8}\;b_{7}\;b_{6}\;b_{5}\;b_{4}\;b_{3}\;b_{2}\;b_{1}),\]  
where \(a_{i}\) and \(b_{i}\) represent individual bits of \(x_{j}^{1}\) and \(x_{j}^{2}\).  
A virtual 7-bit pixel \(y\) is then constructed by concatenating selected bits from \(x_{j}^{1}\) and \(x_{j}^{2}\):  
\[y =(a_{4}\;a_{3}\;a_{2}\;a_{1}||b_{3}\;b_{2}\;b_{1}) \tag{4}\]  
where \(||\) denotes bit-wise concatenation. Here, \(a_{4}\) corresponds to the most significant bit (MSB) of \(y\) and \(b_{1}\) to the least significant bit (LSB) of \(y\).  
To ensure that \(y\) satisfies the Hamming code constraint \(yH^{T}=0\), a syndrome check is performed. If the condition is not satisfied, the closest valid codeword is selected from a preconstructed lookup table (LUT) derived from the standard array of HC(7,4) codewords, as shown in Figure 3. This enables efficient correction by identifying the nearest codeword within the corresponding coset. The following algorithm corresponds to the Cover Image Generator module described in Figure 2, and performs syndrome-based modifications to construct cover images \(I_{1}\) and \(I_{2}\).  
Figure 2: Modular architecture of the proposed RDH system: (1) cover image generator, (2) data embedder, and (3) data extractor.  
To formalize this process, the selection of the most suitable codeword \(h\) is defined as a distortion minimization problem over the zero-syndrome coset \(\mathcal{C}_{0}\):  
\[\min_{h\in\mathcal{C}_{0}}\varepsilon(h)=(\alpha-\bar{\alpha})^{2}+(\beta-\bar{ \beta})^{2} \tag{5}\]  
where \(h\) is a candidate codeword from the LUT and \(\bar{\alpha},\bar{\beta}\) are derived from the original bits of \(x_{j}^{1}\) and \(x_{j}^{2}\), respectively. This formulation explicitly expresses the objective of minimizing perceptual distortion while satisfying HC(7,4) compliance.  
Here, \(\varepsilon\) quantifies the difference between the original and candidate virtual pixel representations. The codeword \(h=(h_{7},h_{6},h_{5},h_{4},h_{3},h_{2},h_{1})\) that minimizes \(\varepsilon\) is selected as the best match. Among these bits, the first four \((h_{7},h_{6},h_{5},h_{4})\) are written into the least significant bits of \(x_{j}^{1}\) in \(\mathbf{I}_{1}\) and the last three \((h_{3},h_{2},h_{1})\) are written into the least significant bits of \(x_{j}^{2}\) in \(\mathbf{I}_{2}\).  
This process is repeated for every pixel in the original image. As a result, two structurally correlated cover images \(\mathbf{I}_{1}\) and \(\mathbf{I}_{2}\) are generated, both of which are optimized for low-distortion reversible data embedding.