HALCON Reference Manual 10.0.2
Table of Contents / Filters / Inpainting ClassesClassesClasses | | | Operators

inpainting_mcfinpainting_mcfinpainting_mcfInpaintingMcfInpaintingMcf (Operator)

Name

inpainting_mcfinpainting_mcfinpainting_mcfInpaintingMcfInpaintingMcf — Perform an inpainting by smoothing of level lines.

Signature

inpainting_mcf(Image, Region : InpaintedImage : Sigma, Theta, Iterations : )

Herror inpainting_mcf(const Hobject Image, const Hobject Region, Hobject* InpaintedImage, double Sigma, double Theta, const Hlong Iterations)

Herror T_inpainting_mcf(const Hobject Image, const Hobject Region, Hobject* InpaintedImage, const Htuple Sigma, const Htuple Theta, const Htuple Iterations)

Herror inpainting_mcf(Hobject Image, Hobject Region, Hobject* InpaintedImage, const HTuple& Sigma, const HTuple& Theta, const HTuple& Iterations)

HImage HImage::InpaintingMcf(const HRegion& Region, const HTuple& Sigma, const HTuple& Theta, const HTuple& Iterations) const

HImageArray HImageArray::InpaintingMcf(const HRegion& Region, const HTuple& Sigma, const HTuple& Theta, const HTuple& Iterations) const

void HOperatorSetX.InpaintingMcf(
[in] IHUntypedObjectX* Image, [in] IHUntypedObjectX* Region, [out] IHUntypedObjectX*InpaintedImage, [in] VARIANT Sigma, [in] VARIANT Theta, [in] VARIANT Iterations)

IHImageX* HImageX.InpaintingMcf(
[in] IHRegionX* Region, [in] double Sigma, [in] double Theta, [in] Hlong Iterations)

static void HOperatorSet.InpaintingMcf(HObject image, HObject region, out HObject inpaintedImage, HTuple sigma, HTuple theta, HTuple iterations)

HImage HImage.InpaintingMcf(HRegion region, double sigma, double theta, int iterations)

Description

The operator inpainting_mcfinpainting_mcfinpainting_mcfInpaintingMcfInpaintingMcf extends the image edges that adjoin the region RegionRegionRegionRegionregion of the input image ImageImageImageImageimage into the interior of RegionRegionRegionRegionregion and connects their ends by smoothing the level lines of the gray value function of ImageImageImageImageimage.

This happens through the application of the mean curvature flow or intrinsic heat equation

  u_t = div(grad u/|grad u|) |grad u| = curv(u) |grad u|

on the gray value function u defined in the region RegionRegionRegionRegionregion by the input image ImageImageImageImageimage at a time t_0 = 0. The discretized equation is solved in IterationsIterationsIterationsIterationsiterations time steps of length ThetaThetaThetaThetatheta, so that the output image InpaintedImageInpaintedImageInpaintedImageInpaintedImageinpaintedImage contains the gray value function at the time IterationsIterationsIterationsIterationsiterations * ThetaThetaThetaThetatheta .

A stationary state of the mean curvature flow equation, which is also the basis of the operator mean_curvature_flowmean_curvature_flowmean_curvature_flowMeanCurvatureFlowMeanCurvatureFlow, has the special property that the level lines of u all have the curvature 0. This means that after sufficiently many iterations there are only straight edges left inside the computation area of the output image InpaintedImageInpaintedImageInpaintedImageInpaintedImageinpaintedImage. By this, the structure of objects inside of RegionRegionRegionRegionregion can be simplified, while the remaining edges are continuously connected to those of the surrounding image matrix. This allows for a removal of image errors and unwanted objects in the input image, a so called image inpainting, which is only weakly visible to a human beholder since there remain no obvious artefacts or smudges.

To detect the image direction more robustly, in particular on noisy input data, an additional isotropic smoothing step can precede the computation of the gray value gradients. The parameter SigmaSigmaSigmaSigmasigma determines the magnitude of the smoothing by means of the standard deviation of a corresponding Gaussian convolution kernel, as used in the operator isotropic_diffusionisotropic_diffusionisotropic_diffusionIsotropicDiffusionIsotropicDiffusion for isotropic image smoothing.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  image(-array) objectHImageHImageHImageXHobject (byte / uint2 / real)

Input image.

RegionRegionRegionRegionregion (input_object)  region objectHRegionHRegionHRegionXHobject

Inpainting region.

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

Output image.

SigmaSigmaSigmaSigmasigma (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Smoothing for derivative operator.

Default value: 0.5

Suggested values: 0.0, 0.1, 0.5, 1.0

Restriction: Sigma >= 0

ThetaThetaThetaThetatheta (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Time step.

Default value: 0.5

Suggested values: 0.1, 0.2, 0.3, 0.4, 0.5

Restriction: (0 < Theta) <= 0.5

IterationsIterationsIterationsIterationsiterations (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of iterations.

Default value: 10

Suggested values: 1, 5, 10, 20, 50, 100, 500

Restriction: Iterations >= 1

Alternatives

harmonic_interpolationharmonic_interpolationharmonic_interpolationHarmonicInterpolationHarmonicInterpolation, inpainting_ctinpainting_ctinpainting_ctInpaintingCtInpaintingCt, inpainting_anisoinpainting_anisoinpainting_anisoInpaintingAnisoInpaintingAniso, inpainting_cedinpainting_cedinpainting_cedInpaintingCedInpaintingCed, inpainting_textureinpainting_textureinpainting_textureInpaintingTextureInpaintingTexture

References

M. G. Crandall, P. Lions; “Convergent Difference Schemes for Nonlinear Parabolic Equations and Mean Curvature Motion”; Numer. Math. 75 pp. 17-41; 1996.
G. Aubert, P. Kornprobst; “Mathematical Problems in Image Processing”; Applied Mathematical Sciences 147; Springer, New York; 2002.

Module

Foundation


Table of Contents / Filters / Inpainting ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH