harmonic_interpolationharmonic_interpolationHarmonicInterpolationHarmonicInterpolationharmonic_interpolation (Operator)

Name

harmonic_interpolationharmonic_interpolationHarmonicInterpolationHarmonicInterpolationharmonic_interpolation — Perform a harmonic interpolation on an image region.

Signature

harmonic_interpolation(Image, Region : InpaintedImage : Precision : )

Herror harmonic_interpolation(const Hobject Image, const Hobject Region, Hobject* InpaintedImage, double Precision)

Herror T_harmonic_interpolation(const Hobject Image, const Hobject Region, Hobject* InpaintedImage, const Htuple Precision)

void HarmonicInterpolation(const HObject& Image, const HObject& Region, HObject* InpaintedImage, const HTuple& Precision)

HImage HImage::HarmonicInterpolation(const HRegion& Region, double Precision) const

static void HOperatorSet.HarmonicInterpolation(HObject image, HObject region, out HObject inpaintedImage, HTuple precision)

HImage HImage.HarmonicInterpolation(HRegion region, double precision)

def harmonic_interpolation(image: HObject, region: HObject, precision: float) -> HObject

Description

The operator harmonic_interpolationharmonic_interpolationHarmonicInterpolationHarmonicInterpolationharmonic_interpolation reconstructs the destroyed image data of ImageImageImageimageimage inside the region RegionRegionRegionregionregion by solving the discrete Laplace equation for the corresponding gray value function u. The unique solution, which exists under Dirichlet boundary conditions given by ImageImageImageimageimage outside of RegionRegionRegionregionregion, is returned in InpaintedImageInpaintedImageInpaintedImageinpaintedImageinpainted_image.

This technique is called harmonic interpolation since in function theory the solutions of the Laplace equation are referred to as harmonic functions.

If RegionRegionRegionregionregion touches the border of the gray value matrix of ImageImageImageimageimage and thus some Dirichlet boundary values do not exist, von Neumann boundary conditions are used instead. This means that the gray values are mirrored at the border of ImageImageImageimageimage. If no Dirichlet boundary values exist at all, a constant image with gray value 0 is returned.

The spatial derivatives are discretized as and . The equation is solved by an iterative conjugate gradient solver, which iteratively improves the computational error until the maximum norm of its update step becomes a smaller fraction than PrecisionPrecisionPrecisionprecisionprecision of the norm of the input data or a maximum of 1000 iterations is reached. PrecisionPrecisionPrecisionprecisionprecision = 0.01 thus means a relative computational accuracy of 1%.

Attention

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution Information

Parameters

ImageImageImageimageimage (input_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject (byte / uint2 / real)

Input image.

RegionRegionRegionregionregion (input_object)  region objectHRegionHObjectHObjectHobject

Inpainting region.

InpaintedImageInpaintedImageInpaintedImageinpaintedImageinpainted_image (output_object)  image(-array) objectHImageHObjectHObjectHobject * (byte / uint2 / real)

Output image.

PrecisionPrecisionPrecisionprecisionprecision (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Computational accuracy.

Default: 0.001

Suggested values: 0.0, 0.0001, 0.001, 0.01

Restriction: Precision >= 0.0

Alternatives

inpainting_ctinpainting_ctInpaintingCtInpaintingCtinpainting_ct, inpainting_anisoinpainting_anisoInpaintingAnisoInpaintingAnisoinpainting_aniso, inpainting_mcfinpainting_mcfInpaintingMcfInpaintingMcfinpainting_mcf, inpainting_textureinpainting_textureInpaintingTextureInpaintingTextureinpainting_texture, inpainting_cedinpainting_cedInpaintingCedInpaintingCedinpainting_ced

References

L.C. Evans; “Partial Differential Equations”; AMS, Providence; 1998.
W. Hackbusch; “Iterative Lösung großer schwachbesetzter Gleichungssysteme”; Teubner, Stuttgart;1991.

Module

Foundation