## 2 The Proposed RDHEI Method
### Room Reservation and Image Encryption  
#### 2.1.1 Pixel Prediction  
Predictors are utilized in various image processing applications to exploit the spatial correlation among neighboring pixels. They make use of the values of adjacent pixels to estimate the value of a pixel. In image compression, predictors are used to reduce redundancy in the data by encoding the difference between the predicted value and the  
Figure 2: Overview of the Proposed RDHEI Methodology, featuring the RRBE approach, pixel prediction integration, quadtree decomposition, bit plane reordering, image encryption, and data hiding. actual value of a pixel [22; 23; 24]. This difference is typically smaller than the actual value of the pixel, which means that the amount of data that needs to be stored or transmitted can be significantly reduced while maintaining the original image quality. There are several types of predictors, and the choice of a specific predictor depends on the requirements of the target application and the characteristics of the images being used. The prediction causal template used by the studied predictors is depicted in Figure 3, where \(x\) denotes the current sample, and A to G are the neighboring samples in the relative positions. 1. _The MED predictor_ The Median Edge Detector (MED) [22; 25], is a type of image processing technique used to detect edges in an image. It operates by considering neighboring pixel values along edges within a local context. The predictor identifies pixels along edges by analyzing the differences between adjacent pixel values. It then computes a prediction for the current pixel by considering the median of these neighboring differences. 2. _The GAP predictor_ The Gradient Adjusted Prediction (GAP) [26] algorithm is designed to improve the accuracy of prediction by taking into account the local gradient of the image. In the GAP algorithm, the predicted value of a pixel is determined by using a linear combination of neighboring pixels. 3. _First improvement of the MED predictor_ The performance of the MED technique is insufficient when it comes to diagonal edges, resulting in a significant prediction inaccuracy. [PERSON] [27] proposed a method for improving diagonal edge detection. His method evaluates the neighboring pixels' local gradients and estimates the presence of a diagonal edge. If there is a diagonal edge, the prediction is made using a different method and two thresholds. 4. _Second improvement of the MED predictor_ The second improvement detects various sorts of edges based on the set thresholds. In the study by [PERSON] et al. [28], it is demonstrated that the edge detection techniques employed by the MED predictor are constrained to recognizing solely horizontal and vertical edges. As a result, a low-complexity, cost-effective method was introduced to effectively identify diagonal edges. 5. _Time complexity_ The predictors under investigation make estimations of pixel values in a target image by considering neighboring pixels within a local neighborhood, as depicted in Figure 3. The computational efficiency of these predictors primarily relies on two key factors: - The size of the local neighborhood (e.g., 3 pixels for MED and 7 pixels for GAP). - The algorithm used to calculate the predicted value from the neighborhood. Given that the size of the local neighborhood is relatively small (e.g., 3 or 7), the complexity associated with predicting the value of a target pixel can be simplified to  
Figure 3: The causal template used by the studied predictors. \(\mathcal{O}(1)\). Consequently, the overall time complexity for each of the investigated predictors when applied to an image of dimensions \(n\times m\) can be succinctly expressed as \(\mathcal{O}(nm)\). Whatever the prediction technique used, the predicted error pixel is always calculated as \(e(u,v)=x(u,v)-\hat{x}(u,v)\) and the resulting errors range from \(-255\) to \(255\) for 8-bit grayscale images, which requires 9 bits to encode each error value.