Leadtools.ImageProcessing.Effects Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.10
GaussianCommand Class
See Also  Members   Example 
Leadtools.ImageProcessing.Effects Namespace : GaussianCommand Class




Smooths or blurs an image by applying a Gaussian filter to the specified image.

Syntax

Visual Basic (Declaration) 
Public Class GaussianCommand 
   Inherits RasterCommand
   Implements IRasterCommand 
Visual Basic (Usage)Copy Code
Dim instance As GaussianCommand
C# 
public class GaussianCommand : RasterCommand, IRasterCommand  
Managed Extensions for C++ 
public __gc class GaussianCommand : public RasterCommand, IRasterCommand  
C++/CLI 
public ref class GaussianCommand : public RasterCommand, IRasterCommand  

Example

Visual BasicCopy Code
ImageProcessing.Effects.GaussianCommand
   Public Sub GaussianCommandExample()
      RasterCodecs.Startup()
      Dim codecs As New RasterCodecs()
      codecs.ThrowExceptionsOnInvalidImages = True

      Dim leadImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg")

      ' Prepare the command
      Dim command As GaussianCommand = New GaussianCommand
      command.Radius = 20
      command.Run(leadImage)
      codecs.Save(leadImage, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24)

      RasterCodecs.Shutdown()
   End Sub
C#Copy Code
ImageProcessing.Effects.GaussianCommand 
      public void GaussianCommandExample() 
      { 
         // Load an image 
         RasterCodecs.Startup(); 
         RasterCodecs codecs = new RasterCodecs(); 
         codecs.ThrowExceptionsOnInvalidImages = true; 
 
         RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg"); 
 
         // Prepare the command 
         GaussianCommand command = new GaussianCommand(); 
         command.Radius = 20; 
         command.Run(image); 
         codecs.Save(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24); 
 
         RasterCodecs.Shutdown(); 
      }

Remarks

  • Each pixel in the image is blurred based on neighborhood pixels. The radius value determines the size of the neighborhood to consider when blurring a pixel. The result is a blurred version of the original image.
  • The amount of blur is controlled by specifying the size of the neighborhood used for blurring or smoothing. The value of the Radius property determines the size and values of the mask.
  • This command 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 only in the Document/Medical toolkits.
  • This command does not support 32-bit grayscale images.
For more information, refer to Removing Noise.

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.Effects.GaussianCommand

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also