Skip to content

coherence_enhancing_diffCoherenceEnhancingDiffCoherenceEnhancingDiffcoherence_enhancing_diffcoherence_enhancing_diffπŸ”—

Short descriptionπŸ”—

coherence_enhancing_diffCoherenceEnhancingDiffCoherenceEnhancingDiffcoherence_enhancing_diffcoherence_enhancing_diff β€” Perform a coherence enhancing diffusion of an image.

SignatureπŸ”—

coherence_enhancing_diff( image Image, out image ImageCED, real Sigma, real Rho, real Theta, integer Iterations )void CoherenceEnhancingDiff( const HObject& Image, HObject* ImageCED, const HTuple& Sigma, const HTuple& Rho, const HTuple& Theta, const HTuple& Iterations )static void HOperatorSet.CoherenceEnhancingDiff( HObject image, out HObject imageCED, HTuple sigma, HTuple rho, HTuple theta, HTuple iterations )def coherence_enhancing_diff( image: HObject, sigma: float, rho: float, theta: float, iterations: int ) -> HObject

Herror coherence_enhancing_diff( const Hobject Image, Hobject* ImageCED, double Sigma, double Rho, double Theta, const Hlong Iterations )

Herror T_coherence_enhancing_diff( const Hobject Image, Hobject* ImageCED, const Htuple Sigma, const Htuple Rho, const Htuple Theta, const Htuple Iterations )

HImage HImage::CoherenceEnhancingDiff( double Sigma, double Rho, double Theta, Hlong Iterations ) const

HImage HImage.CoherenceEnhancingDiff( double sigma, double rho, double theta, int iterations )

DescriptionπŸ”—

The operator coherence_enhancing_diffCoherenceEnhancingDiff performs an anisotropic diffusion process on the input image Imageimageimage to increase the coherence of the image structures contained in Imageimageimage. In particular, noncontinuous image edges are connected by diffusion, without being smoothed perpendicular to their dominating direction. For this, coherence_enhancing_diffCoherenceEnhancingDiff uses the anisotropic diffusion equation

\[\begin{eqnarray*} u_{t} = div(G(u) \nabla u) \end{eqnarray*}\]

formulated by Weickert. With a 2x2 coefficient matrix \(G\) that depends on the gray values in Imageimageimage, this is an enhancement of the mean curvature flow or intrinsic heat equation

\[\begin{eqnarray*} u_{t} = div(\frac{\nabla u}{|\nabla u|}) |\nabla u| = curv(u) |\nabla u| \end{eqnarray*}\]

on the gray value function \(u\) defined by the input image Imageimageimage at a time \(t_{0} = 0\). The smoothing operator mean_curvature_flowMeanCurvatureFlow is a direct application of the mean curvature flow equation. The discrete diffusion equation is solved in Iterationsiterationsiterations time steps of length Thetathetatheta, so that the output image ImageCEDimageCEDimage_ced contains the gray value function at the time \(\textrm{Iterations} \cdot \textrm{Theta}\).

To detect the edge 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 Sigmasigmasigma determines the magnitude of the smoothing by means of the standard deviation of a corresponding Gaussian convolution kernel, as used in the operator isotropic_diffusionIsotropicDiffusion for isotropic image smoothing.

While the matrix \(G\) is given by

\[\begin{eqnarray*} G_{MCF}(u) = I - \frac{1}{|\nabla u|^2} \nabla u (\nabla u)^T, \end{eqnarray*}\]

in the case of the operator mean_curvature_flowMeanCurvatureFlow, where \(I\) denotes the unit matrix, \(G_{MCF}\) is again smoothed componentwise by a Gaussian filter of standard deviation Rhorhorho for coherence_enhancing_diffCoherenceEnhancingDiff. Then, the final coefficient matrix

\[\begin{eqnarray*} G_{CED} = g_{1}\left((\lambda_{1}-\lambda_{2})^2\right) w_{1} (w_{1})^T + g_{2}\left((\lambda_{1}-\lambda_{2})^2\right) w_{2} (w_{2})^T \end{eqnarray*}\]

is constructed from the eigenvalues \(\lambda_{1},\lambda_{2}\) and eigenvectors \(w_{1},w_{2}\) of the resulting intermediate matrix, where the functions

\[\begin{eqnarray*} \begin{array}{rcl} g_{1}(p) &=& 0.001\\ g_{2}(p) &=& 0.001 + 0.999 \, \exp\left(\displaystyle\frac{-1}{p}\right) \end{array} \end{eqnarray*}\]

were determined empirically and taken from the publication of Weickert.

Hence, the diffusion direction in mean_curvature_flowMeanCurvatureFlow is only determined by the local direction of the gray value gradient, while \(G_{CED}\) considers the macroscopic structure of the image objects on the scale Rhorhorho and the magnitude of the diffusion in coherence_enhancing_diffCoherenceEnhancingDiff depends on how well this structure is defined.

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πŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

  • Automatically parallelized on channel level.

ParametersπŸ”—

Imageimageimage (input_object) (multichannel-)image(-array) β†’ object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject (byte / uint2 / real)

Input image.

ImageCEDimageCEDimage_ced (output_object) image(-array) β†’ object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject * (byte / uint2 / real)

Output image.

Sigmasigmasigma (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Smoothing for derivative operator.

Default: 0.50.5
Suggested values: 0.0, 0.1, 0.5, 1.00.0, 0.1, 0.5, 1.0
Restriction: Sigma >= 0

Rhorhorho (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Smoothing for diffusion coefficients.

Default: 3.03.0
Suggested values: 0.0, 1.0, 3.0, 5.0, 10.0, 30.00.0, 1.0, 3.0, 5.0, 10.0, 30.0
Restriction: Rho >= 0

Thetathetatheta (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Time step.

Default: 0.50.5
Suggested values: 0.1, 0.2, 0.3, 0.4, 0.50.1, 0.2, 0.3, 0.4, 0.5
Restriction: 0 < Theta <= 0.5

Iterationsiterationsiterations (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of iterations.

Default: 1010
Suggested values: 1, 5, 10, 20, 50, 100, 5001, 5, 10, 20, 50, 100, 500
Restriction: Iterations >= 1

ReferencesπŸ”—

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.

ModuleπŸ”—

Foundation