## 3 The Proposed Method
### Filtering Operation  
As discussed in Section 2.2, the jagged edges in the restored area are mainly derived from the image blocks and the confused portion, which presents as blurring in the large area attack, stems from the undesirable pixel values introduced by unsuccessful recovery. To eliminate the jagged edges, a pixel-based method is needed instead of a block-based method to preserve the important information and reduce image noise. It is feasible to adjust the confused areas using their neighborhood or background pixels. When an image enhancement method is adopted for the restored image, it restores some obvious details but which method to apply depends primarily subjective judgment. In addition, such an enhancement cannot reduce the confusion. After abundant experiments and a comprehensive literature review, we found that the median filter has a strong effect for edge smoothing and eliminating confusion [5]; however, it causes a contrast reduction in the image and removes some detail in single pixel or small pixel areas. To avoid these defects, some other operations need to be introduced. The method should not only preserve the benefits of the median filter, which is applied to the restored image and the filtered image but increase the contrast by combining low pixel values with high ones using a threshold. The threshold mentioned above is a manually specified pixel value. It is adjustable depending on the image and its restored areas; consequently, it can lead to different recovery results. Based on the above analysis, we introduce a filtering operation to the proposed method. The specific filtering process is illustrated in Figure 4 and explained in the following steps.  
* Step 1. The restored image \(R\) is obtained by performing the inverse embedding process. The binary image \(B\) highlights the tampered area detected by the proposed method. To extract the actual restored area in image \(R\), a minimum operation is performed on image \(R\) and image \(B\), generating image \(R_{\text{e}}\), which has a black background except for the restored area. Then, median filtering is applied to image \(R_{\text{e}}\) and we obtain the filtered image \(R_{\text{ef}}\), which is highly smoothed. However, at the boundaries (i.e., where the black background and the restored areas meet) theoriginal restored pixels are replaced by those with values closer to those of the background, which introduces noise.
* Step 2. The minimum and maximum operations are performed on image \(R_{\text{e}}\) and image \(R_{\text{ef}}\), generating the images \(G_{1}\) and image \(G_{2}\), respectively. Image \(G_{1}\) contains lower pixel values, including the replaced boundary, while image \(G_{2}\) contains higher pixel values. After removing the boundary, image \(G_{1}\) is combined with image \(G_{2}\) to generate image \(G_{3}\) using a manually selected threshold as presented in detail in Section 4.3.
* Step 3. After the previous two steps, image \(G_{3}\) not only smooths the noisy areas but also retains the texture and edge information. The final result, \(R^{\prime}\), is obtained by replacing the restored pixels in image \(R\) with the corresponding pixels in image \(G_{3}\).