# Dual Partial Reversible Data Hiding Using Enhanced Hamming Code
## 3 Proposed Scheme  
In this section, we propose an improved HC(7,4)-based dual-image reversible data hiding (RDH) technique. The overall conceptual workflow is illustrated in Figure 1, which briefly outlines the transition from the original image through the structurally correlated cover image generation to the subsequent embedding process. Figure 1 provides a high-level overview; in turn, Figure 2 shows the internal architecture, clearly detailing the module interactions, data flow, and role of each component. Unlike conventional dual-image RDH techniques that simply replicate the original image into two identical cover images \(\mathbf{I}_{1}\) and \(\mathbf{I}_{2}\), our method performs a controlled bit-level transformation using an enhanced HC(7,4) Hamming code. This transformation introduces fine-grained structural modifications in the bit-plane, enabling error correction while preserving visual fidelity. Initially, \(\mathbf{I}_{1}\) and \(\mathbf{I}_{2}\) are generated by duplicating the original image. Then, for each pair of corresponding pixels from \(\mathbf{I}_{1}\) and \(\mathbf{I}_{2}\), a virtual 7-bit vector \(y\) is constructed by selecting specific bits from both pixels. If the virtual vector \(y\) fails to satisfy the Hamming code condition \(yH^{T}=0\), a precomputed lookup table (LUT) is used to identify the closest codeword in the zero-syndrome coset. The selected codeword is then split and reassigned to the two pixels in such a way that structural similarity with the original is maintained. This process is applied iteratively across all pixels, resulting in two modified cover images that remain visually close to the original while ensuring compatibility with reversible data embedding in the following stage. Figure 2 presents a more comprehensive block-level system architecture comprising three functional modules: the _cover image generator_, the _data embedder_, and the _data extractor_. These modules respectively correspond to Algorithms 1-3, and are designed for modular independence and engineering clarity. ```
0: Original image \(O\) (grayscale, 8-bit)
0: Cover images \(\mathbf{I}_{1}\) and \(\mathbf{I}_{2}\) satisfying HC(7,4) constraints
1: \(\mathbf{I}_{1}\gets O\); \(\mathbf{I}_{2}\gets O\)
2:for\(j=1\) to \(size(O)\)do
3: Read pixel \(x_{j}\) from \(O\)\(\triangleright\) Original pixel
4: Extract \(x_{j}^{1}\) and \(x_{j}^{2}\) from \(x_{j}\)\(\triangleright\) Bit vectors from pixel
5: Construct virtual pixel \(y\)\(\triangleright\) Selected bits from \(x_{j}^{1}\) and \(x_{j}^{2}\)
6:\(\bar{\alpha}\gets b2d(a_{4}\ a_{3}\ a_{2}\ a_{1})\)\(\triangleright\) Decimal from \(x_{j}^{1}\)
7:\(\bar{\beta}\gets b2d(b_{3}\ b_{2}\ b_{1})\)\(\triangleright\) Decimal from \(x_{j}^{2}\)
8:if\(yH^{T}\
eq 0\)then\(\triangleright\) Coset condition check
9: Initialize \(\varepsilon_{min}\leftarrow\infty\), \(h_{opt}\leftarrow\emptyset\)
10:for each codeword \(h\) in LUT do\(\triangleright\) Candidate codeword
11:\(\alpha\gets b2d(h_{7}\ h_{6}\ h_{5}\ h_{4})\)\(\triangleright\) Decimal upper bits
12:\(\beta\gets b2d(h_{3}\ h_{2}\ h_{1})\)\(\triangleright\) Decimal lower bits
13:\(\varepsilon\leftarrow(\alpha-\bar{\alpha})^{2}+(\beta-\bar{\beta})^{2}\)\(\triangleright\) Similarity measure
14:if\(\varepsilon<\varepsilon_{min}\)then
15:\(\varepsilon_{min}\leftarrow\varepsilon\)
16:\(h_{opt}\gets h\)\(\triangleright\) Update best codeword
17:endif
18:endfor
19: Update \(x_{j}^{1}\) and \(x_{j}^{2}\) with \(h_{opt}\)
20:endif
21: Save \(x_{j}^{1}\) to \(\mathbf{I}_{1}(j)\), \(x_{j}^{2}\) to \(\mathbf{I}_{2}(j)\)
22:endfor
```  
**Algorithm 1** Generation of Cover Images  
Figure 1: High-level schematic diagram of the proposed dual-image RDH system.