code: def inpaint(self, rescale_factor=1.0):
          
          # get original shape
          orig_shape = (self.height, self.width)
  
          # form inpaint kernel
          inpaint_kernel = np.array([[1, 1, 1], [1, 0, 1], [1, 1, 1]])
  
          # resize the image
          resized_data = self.resize(rescale_factor, interp='nearest').data
  
          # inpaint the smaller image
          cur_data = resized_data.copy()
          zeros = (cur_data == 0)
          while np.any(zeros):
              neighbors = ssg.convolve2d((cur_data != 0), inpaint_kernel,
                                         mode='same', boundary='symm')
              avg_depth = ssg.convolve2d(cur_data, inpaint_kernel,
                                         mode='same', boundary='symm')
              avg_depth[neighbors > 0] = avg_depth[neighbors > 0] / \
                  neighbors[neighbors > 0]
              avg_depth[neighbors == 0] = 0
              avg_depth[resized_data > 0] = resized_data[resized_data > 0]
              cur_data = avg_depth
              zeros = (cur_data == 0)
  
          # fill in zero pixels with inpainted and resized image
          inpainted_im = DepthImage(cur_data, frame=self.frame)
          filled_data = inpainted_im.resize(
              orig_shape, interp='bilinear').data
          new_data = np.copy(self.data)
          new_data[self.data == 0] = filled_data[self.data == 0]
          return DepthImage(new_data, frame=self.frame)
docs: Fills in the zero pixels in the image.
  
          Parameters
          ----------
          rescale_factor : float
              amount to rescale the image for inpainting, smaller numbers increase speed
  
          Returns
          -------
          :obj:`DepthImage`
              depth image with zero pixels filled in