skimage2.restoration.inpaint_biharmonic#

skimage2.restoration.inpaint_biharmonic(image, mask, *, split_into_regions=False, channel_axis=None)[source]#

Inpaint masked points in image with biharmonic equations.

Parameters:
image(M[, N[, …, P]][, C]) ndarray

Input image.

mask(M[, N[, …, P]]) ndarray

Array of pixels to be inpainted. Have to be the same shape as one of the ‘image’ channels. Unknown pixels have to be represented with 1, known pixels - with 0.

split_into_regionsbool, optional

If True, inpainting is performed on a region-by-region basis. This is likely to be slower, but will have reduced memory requirements.

channel_axisint or None, optional

If None, the image is assumed to be a grayscale (single channel) image. Otherwise, this parameter indicates which axis of the array corresponds to channels.

Added in version 0.19: channel_axis was added in 0.19.

Returns:
out(M[, N[, …, P]][, C]) ndarray

Input image with masked pixels inpainted.

References

[1]

S.B.Damelin and N.S.Hoang. “On Surface Completion and Image Inpainting by Biharmonic Functions: Numerical Aspects”, International Journal of Mathematics and Mathematical Sciences, Vol. 2018, Article ID 3950312 DOI:10.1155/2018/3950312

[2]

C. K. Chui and H. N. Mhaskar, MRA Contextual-Recovery Extension of Smooth Functions on Manifolds, Appl. and Comp. Harmonic Anal., 28 (2010), 104-113, DOI:10.1016/j.acha.2009.04.004

Examples

>>> img = np.tile(np.square(np.linspace(0, 1, 5)), (5, 1))
>>> mask = np.zeros_like(img)
>>> mask[2, 2:] = 1
>>> mask[1, 3:] = 1
>>> mask[0, 4:] = 1
>>> out = inpaint_biharmonic(img, mask)