harmonic_interpolationharmonic_interpolationHarmonicInterpolationHarmonicInterpolation (Operator)


harmonic_interpolationharmonic_interpolationHarmonicInterpolationHarmonicInterpolation — Perform a harmonic interpolation on an image region.


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)


The operator harmonic_interpolationharmonic_interpolationHarmonicInterpolationHarmonicInterpolationHarmonicInterpolation 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 InpaintedImageInpaintedImageInpaintedImageInpaintedImageinpaintedImage.

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%.


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


ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHobject (byte / uint2 / real)

Input image.

RegionRegionRegionRegionregion (input_object)  region objectHRegionHRegionHobject

Inpainting region.

InpaintedImageInpaintedImageInpaintedImageInpaintedImageinpaintedImage (output_object)  image(-array) objectHImageHImageHobject * (byte / uint2 / real)

Output image.

PrecisionPrecisionPrecisionPrecisionprecision (input_control)  real HTupleHTupleHtuple (real) (double) (double) (double)

Computational accuracy.

Default value: 0.001

Suggested values: 0.0, 0.0001, 0.001, 0.01

Restriction: Precision >= 0.0


inpainting_ctinpainting_ctInpaintingCtInpaintingCtInpaintingCt, inpainting_anisoinpainting_anisoInpaintingAnisoInpaintingAnisoInpaintingAniso, inpainting_mcfinpainting_mcfInpaintingMcfInpaintingMcfInpaintingMcf, inpainting_textureinpainting_textureInpaintingTextureInpaintingTextureInpaintingTexture, inpainting_cedinpainting_cedInpaintingCedInpaintingCedInpaintingCed


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