# A Novel Adaptive Image Data Hiding and Encryption Scheme Using Constructive Image Abstraction
## 2 Our Proposed Methods
### Adaptive Data Embedding  
Adaptive data embedding strategies consider local image properties such as texture or luminance. To take advantage of the fact that the human eye is less sensitive to variations in darker pixels, we propose an adaptive message embedding algorithm based on the luminance of pixels for both RGBE and LDR images. The input of this process is the intermediate abstracted image, \(I_{A}\), and the output is the abstracted stego image \(I_{S}\), with concealed messages. Our adaptive data embedding algorithm first determines the adjustable embedding bases. The larger the embedding base, the more messages that can be concealed. We propose a six-level adaptive base approach for HDR images encoded by the RGBE format. For an RGBE pixel \(\mathbf{P}=(P_{R},P_{G},P_{B},P_{E})\), we apply Equation (1) to determine the corresponding embedding base. During the image abstraction process, contour edges are detected and produced, resulting in a small exponent value close to \(P_{E}=0\) and a scene-referred color channel of approximately \(2^{-128}\). Regardless of their \(P_{R}\), \(P_{G}\), and \(P_{B}\) values, these pixels are indistinguishable to the human eyes. We leverage this fact and assign the maximum base \((b_{R},b_{G},b_{B})=(255,255,255)\) to these pixels with \(P_{E}=0\). The remaining pixels are divided into \(T\) groups based on their \(P_{E}\) values, where \(E_{min}\) and \(E_{max}\) represent the minimum and maximum non-zero \(P_{E}\) values, respectively. The group with the smallest \(P_{E}\) is assigned the embedding base \(HD_{1}\), while the group with the highest \(P_{E}\) values is assigned embedding base \(HD_{T}\). In this study, we adopt the parameters of embedding base in descending order associated to their \(P_{E}\) values, where we set \(T=5\) and \((HD_{1},HD_{2},HD_{3},HD_{4},HD_{5})=(11,9,7,5,3)\). \[ \begin{array}{l}(b_{R},b_{G},b_{B})=\left\{\begin{array}{ll}(255,255,255),& \text{if }P_{E}=0\\ (HD_{i},HD_{i},HD_{i}),&\text{if }E_{L,i}\leq P_{E}\leq E_{R,i},\text{ where }1\leq i\leq T \\ E_{L,i}=E_{min}+\frac{(i-1)}{T}(E_{max}-E_{min})\text{ and }E_{R,i}=E_{ min}+\frac{i}{T}(E_{max}-E_{min})\end{array}\right.\end{array}  \tag{1}\]  
For LDR images, we utilize a two-level base approach to segment pixels. Firstly, we calculate the mean values for each channel of the image and denote them as \((\mu_{R},\mu_{G},\mu_{B})\). These values are used as a boundary to conceal different secret messages. They also serve as part of a secret key when extracting the secret message; thus, they are delivering to the receiver from a secure channel. Next, for the \(i\)-th pixel, \(\mathbf{P}=(P_{R},P_{G},P_{B})\), we apply Equation (2) to determine the embedding base \((b_{R},b_{G},b_{B})\) for each channel of the pixel. If the absence of the index \(i\) does not result in any ambiguity in the expression, we will not include it. In this study, we adopt the parameters \((LD_{1},LD_{2},LD_{3},LD_{4})=(5,7,9,11)\). Nevertheless, end user can change these parameters, depending on the request of the embedding capacity. The larger the parameters, the higher the embedding capacity our scheme can offer:  
\[b_{R}= \begin{cases}LD_{1},&\text{for }P_{R}>\mu_{R}\\ LD_{2},&\text{for }P_{R}\leq\mu_{R}\end{cases} ,\quad b_{G}=\left\{ \begin{array}{ll}LD_{2},& \text{for }P_{G}>\mu_{G}\\ LD_{3},&\text{for }P_{G}\leq\mu_{G}\end{array} ,\quad b_{B}= \begin{cases}LD_{3},& \text{for }P_{B}>\mu_{B}\\ LD_{4},&\text{for }P_{B}\leq\mu_{B}\end{cases} \right. \tag{2}\]  
Using the determined embedding bases, we decompose the embedding digits from the message stream and inject them into the corresponding channels of the pixels. In the HDR image, a stego pixel is represented as \(\mathbf{P^{\prime}}=(P_{R^{\prime}},P_{G^{\prime}},P_{B^{\prime}},P_{E})\), where the E channel does not carry any secret message due to its sensitivity to a minor change; while in the LDR image, a stego pixel is represented as \(\mathbf{P^{\prime}}=(P_{R^{\prime}},P_{G^{\prime}},P_{B^{\prime}})\).