lenspack.image.inpainting module

lenspack.image.inpainting.inpaint(image, mask, niter=100, thresholding='hard')[source]

Fill in gaps in an image using the Discrete Cosine Transform (DCT).

Parameters
  • image (array_like (2D)) – Input image.

  • mask (array_like (2D)) – Boolean or binary mask representing the missing pixels of image. False or zero pixel values are considered to be masked.

  • niter (int, optional) – Number of iterations. Default is 100.

  • thresholding ({'soft', 'hard'}, optional) – Type of thresholding. Default is ‘hard’.

Returns

Inpainted image.

Return type

2D numpy array

References

  • Elad, Starck, Querre, & Donoho, ACHA 19, 340 (2005)

  • Pires, Starck, Amara, et al., MNRAS 395, 1265 (2009)