←Select platform

GaussianCommand Class

Summary
Smooths or blurs an image by applying a Gaussian filter to the specified image.
Syntax
C#
VB
Objective-C
C++
Java
public class GaussianCommand : RasterCommand 
Public Class GaussianCommand  
   Inherits RasterCommand 
@interface LTGaussianCommand : LTRasterCommand 
public class GaussianCommand extends RasterCommand 
public ref class GaussianCommand : public RasterCommand   
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.
  • This command supports signed/unsigned data images.

For more information, refer to Removing Noise.

Example

Run the GaussianCommand on an image and applies the Gaussian filter.

C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Effects; 
 
public void GaussianCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1.CMP")); 
 
   // Prepare the command 
   GaussianCommand command = new GaussianCommand(); 
   command.Radius = 20; 
   command.Run(image); 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images"; 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.ImageProcessing.Effects 
 
Public Sub GaussianCommandExample() 
   Dim codecs As New RasterCodecs() 
   codecs.ThrowExceptionsOnInvalidImages = True 
 
   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1.CMP")) 
 
   ' Prepare the command 
   Dim command As GaussianCommand = New GaussianCommand 
   command.Radius = 20 
   command.Run(leadImage) 
   codecs.Save(leadImage, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24) 
 
End Sub 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images" 
End Class 
Requirements

Target Platforms

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

Leadtools.ImageProcessing.Effects Assembly

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