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_interpolationHarmonicInterpolationHarmonicInterpolationHarmonicInterpolationharmonic_interpolation reconstructs the destroyed image data of ImageImageImageImageimageimage inside the region RegionRegionRegionRegionregionregion by solving the discrete Laplace equation for the corresponding gray value function u. The unique solution, which exists under Dirichlet boundary conditions given by ImageImageImageImageimageimage outside of RegionRegionRegionRegionregionregion, is returned in InpaintedImageInpaintedImageInpaintedImageInpaintedImageinpaintedImageinpainted_image.

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

If RegionRegionRegionRegionregionregion touches the border of the gray value matrix of ImageImageImageImageimageimage 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 ImageImageImageImageimageimage. 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 PrecisionPrecisionPrecisionPrecisionprecisionprecision of the norm of the input data or a maximum of 1000 iterations is reached. PrecisionPrecisionPrecisionPrecisionprecisionprecision = 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

ImageImageImageImageimageimage (input_object)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / uint2 / real)

Input image.

RegionRegionRegionRegionregionregion (input_object)  region objectHRegionHObjectHRegionHobject

Inpainting region.

InpaintedImageInpaintedImageInpaintedImageInpaintedImageinpaintedImageinpainted_image (output_object)  image(-array) objectHImageHObjectHImageHobject * (byte / uint2 / real)

Output image.

PrecisionPrecisionPrecisionPrecisionprecisionprecision (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_ctInpaintingCtInpaintingCtInpaintingCtinpainting_ct, inpainting_anisoinpainting_anisoInpaintingAnisoInpaintingAnisoInpaintingAnisoinpainting_aniso, inpainting_mcfinpainting_mcfInpaintingMcfInpaintingMcfInpaintingMcfinpainting_mcf, inpainting_textureinpainting_textureInpaintingTextureInpaintingTextureInpaintingTextureinpainting_texture, inpainting_cedinpainting_cedInpaintingCedInpaintingCedInpaintingCedinpainting_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