## 2 Materials and Methods
### Generation of Layered Depth Image
Itcan be clearly seen that the discontinuous edge of the image has been effectively defined after filtering. The improved Canny edge detection algorithm is used to detect the edge of weighted filtered image, and the difference between adjacent pixels in the weighted filtered image is calculated at the same time, so that the depth discontinuous edge is determined. In the implementation process, edge fragments smaller than 15 pixels will be eliminated, and the local connectivity of the LDI will ensure that each discontinuous edge exists independently. The discontinuous depth edges are shown in Figure 3(e). Depth edge inpainting: In this paper, the monocular RGB image is the only input to obtain the virtual view. After depth estimation, the depth image of the input image can be obtained. However, the single depth image is not enough to obtain the virtual view, because it cannot store visual information and geometric content other than the visible object of the input RGB scene. In order to obtain the virtual view, we raised the image to the LDI for representation and created a multilayer representation of the scene based on the discontinuity of pixels between different objects in the scene. At the pixel point continuity, LDI pixels were completely connected with four adjacent pixels. At the pixel point discontinuity, the LDI pixels were not completely connected with four adjacent pixels. After the above operations, the depth discontinuities and discontinuous edge sets in the image were determined, and according to these discontinuous depth edges, the scene was divided into the foreground area and the background area. By expanding the background area, new geometric content was generated in the occluded area, so that the inpainting of the occluded area was realized. The divided areas are shown in Figure 3(b):  
Figure 4: The area division of the input RGB image. (**a**) The input RBG image. (**b**) Generated virtual view image without inpainting. The pink area is the foreground area, the gray area is the occluded area, and the blue area is the background area. Figure 3: Depth image preprocessing. (**a**) The input RGB image. (**b**) Depth image after filtering. (**c**) The enlarged image of the red box area in (**b**); (**d**) The preprocessed image of (**c**). (**e**) The image of lines with discontinuous depth. In Figure 4, the foreground area, the occluded area and background area of the image can be clearly seen. Figure 4a is the input RBG image, and the red box is a selected discontinuous edge line. Figure 4b is the generated virtual view image without inpainting. The pink area is the foreground area, the gray area is the occluded area and the blue area is the background area. For the background area, it was preliminarily expanded according to the edge first, so that the content of the occluded area could be filled. Then, the iterative flood filling algorithm was used to initialize the color and depth of the filled content, and in order to avoid the problem caused by unconstrained extension, it was stipulated that the extended scope would not cross the intersection of the ends of two deep edges during the extended iteration. During pixel filling, forward extension was carried out according to the previously determined edge of the background area, and then 120 times of pixel iterations were carried out in the occluded area according to the LDI pixel using the 4-connectivity method. The pixel information in the filled occluded area will be further processed in Section 2.3. The pixel information in the background area was used to synthesize the information of color and depth of the occluded area. The content of the synthesized occluded area was only limited by the pixel information in the background area and had nothing to do with the content of foreground area and other LDI layers. The edge of the background area was used as input to generate the edge of the occluded area using the edge inpainting network.