`inpainting_ced`

— Perform an inpainting by coherence enhancing diffusion.

**inpainting_ced**(*Image*, *Region* : *InpaintedImage* : *Sigma*, *Rho*, *Theta*, *Iterations* : )

The operator `inpainting_ced`

performs an anisotropic
diffusion process on the region * Region* of the input image

`Image`

`Image`

`coherence_enhancing_diff`

, which
is based on a discretization of the anisotropic diffusion equation
formulated by Weickert. With a 2x2 coefficient
matrix G that depends on the gray values in `Image`

`Image`

`mean_curvature_flow`

is a direct application of the
mean curvature flow equation. With the operator
`inpainting_mcf`

, it can also be used for image
inpainting. The discrete diffusion equation is solved in
`Iterations`

`Theta`

`InpaintedImage`

`Iterations`

`Theta`

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
* Sigma* determines the magnitude of the smoothing by means of
the standard deviation of a corresponding Gaussian convolution
kernel, as used in the operator

`isotropic_diffusion`

for
isotropic image smoothing.
Similar to the operator `inpainting_mcf`

, the structure of the
image data in * Region* is simplified by smoothing the level
lines of

`Image`

While the matrix G is given by
in the case of the operator `inpainting_mcf`

, where I
denotes the unit matrix, is again smoothed
componentwise by a Gaussian filter of standard deviation
* Rho* for

`coherence_enhancing_diff`

. Then, the final
coefficient matrix
is constructed from the eigenvalues
and eigenvectors
of the resulting intermediate matrix,
where the functions
were determined empirically and taken from the publication of
Weickert.
Hence, the diffusion direction in `mean_curvature_flow`

is
only determined by the local direction of the gray value gradient,
while considers the macroscopic structure of
the image objects on the scale * Rho* and the magnitude of the
diffusion in

`coherence_enhancing_diff`

depends on how well
this structure is defined.
To achieve the highest possible consistency of the newly created
edges with the image data from the neighbourhood, the gray values
are not mirrored at the border of * Region* to compute the
convolution with the smoothing filter mask of scale

`Rho`

`Region`

`Region`

`Image`

`Image`

`Region`

`Region`

To decrease the number of iterations required for attaining a
satisfactory result, it may be useful to initialize the gray value
matrix in * Region* with the harmonic interpolant, a
continuous function of minimal curvature, by applying the operator

`harmonic_interpolation`

to `Image`

`inpainting_ced`

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

- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.

`Image`

`→`

object (byte / uint2 / real)
Input image.

`Region`

`→`

object
Inpainting region.

`InpaintedImage`

`→`

object (byte / uint2 / real)
Output image.

`Sigma`

`→`

(real)
Smoothing for derivative operator.

Default value: 0.5

Suggested values: 0.0, 0.1, 0.5, 1.0

Restriction: `Sigma >= 0`

`Rho`

`→`

(real)
Smoothing for diffusion coefficients.

Default value: 3.0

Suggested values: 0.0, 1.0, 3.0, 5.0, 10.0, 30.0

Restriction: `Rho >= 0`

`Theta`

`→`

(real)
Time step.

Default value: 0.5

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

Restriction: `0 < Theta <= 0.5`

`Iterations`

`→`

(integer)
Number of iterations.

Default value: 10

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

Restriction: `Iterations >= 1`

read_image (Image, 'fabrik') gen_rectangle1 (Rectangle, 270, 180, 320, 230) harmonic_interpolation (Image, Rectangle, InpaintedImage, 0.01) inpainting_ced (InpaintedImage, Rectangle, InpaintedImage2, \ 0.5, 3.0, 0.5, 1000) dev_display(InpaintedImage2)

`harmonic_interpolation`

,
`inpainting_ct`

,
`inpainting_aniso`

,
`inpainting_mcf`

,
`inpainting_texture`

J. Weickert, V. Hlavac, R. Sara; “Multiscale texture
enhancement”; Computer analysis of images and patterns, Lecture
Notes in Computer Science, Vol. 970, pp. 230-237; Springer,
Berlin; 1995.

J. Weickert, B. ter Haar Romeny, L. Florack, J. Koenderink,
M. Viergever; “A review of nonlinear diffusion filtering”;
Scale-Space Theory in Computer Vision, Lecture Notes in
Comp. Science, Vol. 1252, pp. 3-28; Springer, Berlin; 1997.

Foundation