## 2 Materials and Methods
### Generation of Layered Depth Image  
As the prerequisite for LDI representation, the acquisition of high-quality depth images can be used for multilayer representation. The LDI contains a different number of depth pixels in each pixel position, and each pixel can be connected with 0 or 1 neighborhood pixel in four basic directions. This feature can be used to solve the occlusion problem caused by different perspectives in the scene. There are different kinds of objects in different scenes, which have different depths due to their position relationship. According to the discontinuity relationship of depth, image information can be divided into foreground information and background information. The aim of this study is to expand the invisible background information occluded in different perspectives, that is, to generate new pixel information in the parallax area. Depth image preprocessing: When filling the occluded area through RGB-D images, the primary task is to effectively utilize the depth discontinuity between geometric objects; this is because the depth values usually change continuously inside the object, while the edge of the object will show very obvious discontinuity characteristics. However, due to the regularization characteristic of existing depth estimation algorithms based on neural networks, the discontinuity between edge pixels is blurred, which makes the depth image obtained too smooth. In order to make use of the discontinuity area of the depth edge effectively, a weighted pattern filter is used to sharpen the depth image. A histogram is used to count the number of pixels with the same intensity in the depth image, and then a weighted pattern filter is used on this basis. First, the local histogram \(H_{local}(u,d)\) is defined as  
\[H_{local}(u,d)=\sum_{v\in E(u)}G_{z}(d-F(v))G_{k}(u-v) \tag{1}\]  
where \(u\) is the reference pixel, \(d\) is the depth of the reference pixel and \(v\) is the pixel of its neighborhood. \(E(u)\) is the set of neighborhood pixels in the specified size window centered on point \(u\). \(G_{z}\) and \(G_{k}\) are Gaussian kernel functions, and their standard deviations are \(\delta_{z}\) and \(\delta_{k}\), respectively. \(z\) represents the value range, and \(k\) represents the spatial domain. By calculating the depth value of the reference pixel by specifying the neighborhood pixel within the window, the maximum value is set as the final solution \(F(u)\) of the weighted mode filter:  
\[F(u)=\underset{d}{\text{argmax}}H_{local}(u,d) \tag{2}\]  
In order to ensure that the edge information in the image after weighted summing processing is clear, and the quality of the depth image is improved, the similarity of the inter-pixel in the depth image and its corresponding color image \(C(u)\) is used to carry out global pixel similarity exploration in \(H_{local}(u,d)\). The global histogram is expressed as \(H_{global}(u,d)\):  
\[H_{global}(u,d)=\sum_{v\in E(u)}G_{z^{\prime}}(C(u)-C(v))G_{z}(d-F(v))G_{k}(u-v) \tag{3}\]  
where \(z^{\prime}\) is the value range of the color image. In the color image, the closer the brightness between two pixels is, the larger the \(G_{z^{\prime}}\) is. Therefore, the global final solution \(F_{global}(u)\) of the weighted mode filter can be obtained as follows:  
\[F_{global}(u)=\underset{d}{\text{argmax}}H_{global}(u,d) \tag{4}\]  
The smoothness of the filter is affected by the values of standard deviation \(\delta_{z}\), \(\delta_{k}\) and \(\delta_{z^{\prime}}\), where \(\delta_{z}=3.0\), \(\delta_{k}=8.0\) and \(\delta_{z^{\prime}}=6.0\) are selected by experiment, and the window size is 7 pixels \(\times\) 7 pixels. The input RGB image is shown in Figure 2(a). The filtered results are shown in Figure 2(b). In order to clearly compare the contents before and after weighted filtering, the area in the red box is locally enlarged, as shown in Figure 2(d). The content corresponding to Figure 2(d) without weighted filtering is shown in Figure 2(c).