Skip to content

isotropic_diffusionIsotropicDiffusionIsotropicDiffusionisotropic_diffusionisotropic_diffusion🔗

Short description🔗

isotropic_diffusionIsotropicDiffusionIsotropicDiffusionisotropic_diffusionisotropic_diffusion — Perform an isotropic diffusion of an image.

Signature🔗

isotropic_diffusion( image Image, out image SmoothedImage, real Sigma, integer Iterations )void IsotropicDiffusion( const HObject& Image, HObject* SmoothedImage, const HTuple& Sigma, const HTuple& Iterations )static void HOperatorSet.IsotropicDiffusion( HObject image, out HObject smoothedImage, HTuple sigma, HTuple iterations )def isotropic_diffusion( image: HObject, sigma: float, iterations: int ) -> HObject

Herror isotropic_diffusion( const Hobject Image, Hobject* SmoothedImage, double Sigma, const Hlong Iterations )

Herror T_isotropic_diffusion( const Hobject Image, Hobject* SmoothedImage, const Htuple Sigma, const Htuple Iterations )

HImage HImage::IsotropicDiffusion( double Sigma, Hlong Iterations ) const

HImage HImage.IsotropicDiffusion( double sigma, int iterations )

Description🔗

The operator isotropic_diffusionIsotropicDiffusion performs an isotropic diffusion of the input image Imageimageimage. This corresponds to a convolution of the image matrix with a Gaussian mask of standard deviation Sigmasigmasigma. If the parameter Iterationsiterationsiterations is set to 00, such a convolution is performed explicitly. For input images with a full ROI, isotropic_diffusionIsotropicDiffusion returns the same results as the operator derivate_gaussDerivateGauss when choosing 'none'"none" for its parameter Componentcomponentcomponent. If the gray value matrix is larger than the ROI of Imageimageimage the two operators differ since derivate_gaussDerivateGauss takes the gray values outside of the ROI into account, while isotropic_diffusionIsotropicDiffusion mirrors the values at the boundary of the ROI in any case. The computational complexity increases linearly with the value of Sigmasigmasigma.

If Iterationsiterationsiterations has a positive value the smoothing process is considered as an application of the heat equation

\[\begin{eqnarray*} u_{t} = \Delta u \end{eqnarray*}\]

on the gray value function u with the initial value \(u = u_{0}\) defined by the gray values of Imageimageimage at a time \(t_{0}\). This equation is then solved up to a time \(t_{0} + \frac12 \textrm{Sigma}^2\), which is equivalent to the above convolution, using an iterative procedure for parabolic partial differential equations. The computational complexity is proportional to the value of Iterationsiterationsiterations and independent of Sigmasigmasigma in this case. For small values of Iterationsiterationsiterations, the computational accuracy is very low, however. For this reason, choosing \(\textrm{Iterations} < \textit{3}\) is not recommended.

For smaller values of Sigmasigmasigma, the convolution implementation is typically the faster method. Since the runtime of the partial differential equation solver only depends on the number of iterations and not on the value of Sigmasigmasigma, it is typically faster for large values of Sigmasigmasigma if few iterations are chosen (e.g., \(\textrm{Iterations} = \textit{3}\)).

For an explanation of the concept of smoothing filters see the introduction of chapter Filters / Smoothing.

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.

SmoothedImagesmoothedImagesmoothed_image (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)

Standard deviation of the Gauss distribution.

Default: 1.01.0
Suggested values: 0.1, 0.5, 1.0, 3.0, 10.0, 20.0, 50.00.1, 0.5, 1.0, 3.0, 10.0, 20.0, 50.0
Restriction: Sigma > 0

Iterationsiterationsiterations (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of iterations.

Default: 1010
Suggested values: 0, 3, 10, 100, 5000, 3, 10, 100, 500
Restriction: Iterations >= 0

Module🔗

Foundation