←Select platform

AnisotropicDiffusionCommand Class

Summary
Performs a 2-Dimensional Anisotropic Diffusion filter on an image for reduction of varied patterned and non-patterned noise.
Syntax
C#
C++/CLI
Python
public class AnisotropicDiffusionCommand : RasterCommand 
public ref class AnisotropicDiffusionCommand : public RasterCommand   
class AnisotropicDiffusionCommand(RasterCommand): 
Remarks
  • This function is designed to reduce noise in images, more specifically, medical images. This procedure is best suited for images with a great amount of periodic noise in them.
  • The number of iterations controls the number of times the filter will be applied to the image. The lower the number of iterations, the faster the filter will perform. Higher iterations typically mean clearer results, yet ultimately clarity depends on the maximum length of vectors that can be computed from the image.
  • The higher the timestep variable, the larger the range of vectors used for the next iteration. If the timestep parameter is too high, out of range results occur because at some spots the maximum number of vectors allowed is exceeded.
  • The update parameter is very useful when using a large number of iterations on a large image, especially when the results are not known. This variable updates the image after update iterations, thus the progress of the de-noising can be witnessed.
  • If the image has a region, the function will be applied only on the region. This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available in the Document/Medical toolkits.

Anisotropic Diffusion Function - Before

Anisotropic Diffusion Function - Before

Anisotropic Diffusion Function - After

Anisotropic Diffusion Function - After

View additional platform support for this Anisotropic Diffusion function.

Example

Runs the AnisotropicDiffusionCommand on the Image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
 
public void AnisotropicDiffusionCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\NaturalFruits.jpg")); 
 
   // Prepare the command 
   AnisotropicDiffusionCommand command = new AnisotropicDiffusionCommand(); 
   //Apply  
   command.Iterations = 20; 
   command.Smoothing = 1; 
   command.TimeStep = 100.0f; 
   command.MinVariation = 0.5f; 
   command.MaxVariation = 0.8f; 
   command.EdgeHeight = 4.0f; 
   command.Update = 10; 
   command.Run(image); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.3.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Core Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.