def inpaint(self, win_size=3, rescale_factor=1.0):
        """ Fills in the zero pixels in the image.

        Parameters
        ----------
        win_size : int
            size of window to use for inpainting
        rescale_factor : float
            amount to rescale the image for inpainting, smaller numbers increase speed

        Returns
        -------
        :obj:`ColorImage`
            color image with zero pixels filled in
        """
        # get original shape
        orig_shape = (self.height, self.width)
        
        # resize the image
        resized_data = self.resize(rescale_factor, interp='nearest').data

        # inpaint smaller image
        mask = 1 * (np.sum(resized_data, axis=2) == 0)
        inpainted_data = cv2.inpaint(resized_data, mask.astype(np.uint8),
                                     win_size, cv2.INPAINT_TELEA)
        inpainted_im = ColorImage(inpainted_data, frame=self.frame)

        # fill in zero pixels with inpainted and resized image
        filled_data = inpainted_im.resize(
            orig_shape, interp='bilinear').data
        new_data = self.data
        new_data[self.data == 0] = filled_data[self.data == 0]
        return ColorImage(new_data, frame=self.frame)
def inpaint ( self , win_size = 3 , rescale_factor = 1.0 ) : orig_shape = ( self . height , self . width ) resized_data = self . resize ( rescale_factor , interp = 'nearest' ) . data mask = 1 * ( np . sum ( resized_data , axis = 2 ) == 0 ) inpainted_data = cv2 . inpaint ( resized_data , mask . astype ( np . uint8 ) , win_size , cv2 . INPAINT_TELEA ) inpainted_im = ColorImage ( inpainted_data , frame = self . frame ) filled_data = inpainted_im . resize ( orig_shape , interp = 'bilinear' ) . data new_data = self . data new_data [ self . data == 0 ] = filled_data [ self . data == 0 ] return ColorImage ( new_data , frame = self . frame )
Fills in the zero pixels in the image.

        Parameters
        ----------
        win_size : int
            size of window to use for inpainting
        rescale_factor : float
            amount to rescale the image for inpainting, smaller numbers increase speed

        Returns
        -------
        :obj:`ColorImage`
            color image with zero pixels filled in