Table of Contents

Class GaussianBlur<T>

Namespace
AiDotNet.Augmentation.Image
Assembly
AiDotNet.dll

Applies Gaussian blur to an image.

public class GaussianBlur<T> : AugmentationBase<T, ImageTensor<T>>, IAugmentation<T, ImageTensor<T>>

Type Parameters

T

The numeric type for calculations.

Inheritance
GaussianBlur<T>
Implements
Inherited Members

Remarks

Gaussian blur smooths the image by convolving it with a Gaussian kernel. This simulates out-of-focus images or motion blur, helping the model become robust to blurry inputs.

For Beginners: Think of this like looking at a photo through frosted glass. The image becomes softer and details are less sharp. This teaches your model to recognize objects even when they're not perfectly in focus.

When to use:

  • When deployed images may be out of focus
  • When training data is too sharp compared to real-world images
  • To reduce high-frequency noise sensitivity

Constructors

GaussianBlur(double, double, int, double)

Creates a new Gaussian blur augmentation.

public GaussianBlur(double minSigma = 0.1, double maxSigma = 2, int kernelSize = 0, double probability = 0.5)

Parameters

minSigma double

The minimum sigma for the Gaussian kernel. Industry standard default is 0.1.

maxSigma double

The maximum sigma for the Gaussian kernel. Industry standard default is 2.0.

kernelSize int

The kernel size for the blur. Use 0 for automatic size based on sigma. Industry standard default is 0 (automatic).

probability double

The probability of applying this augmentation (0.0 to 1.0). Industry standard default is 0.5.

Properties

KernelSize

Gets the kernel size for the Gaussian blur.

public int KernelSize { get; }

Property Value

int

MaxSigma

Gets the maximum sigma (standard deviation) for the Gaussian kernel.

public double MaxSigma { get; }

Property Value

double

MinSigma

Gets the minimum sigma (standard deviation) for the Gaussian kernel.

public double MinSigma { get; }

Property Value

double

Methods

ApplyAugmentation(ImageTensor<T>, AugmentationContext<T>)

Applies Gaussian blur to the image.

protected override ImageTensor<T> ApplyAugmentation(ImageTensor<T> data, AugmentationContext<T> context)

Parameters

data ImageTensor<T>
context AugmentationContext<T>

Returns

ImageTensor<T>

GetParameters()

Gets the parameters of this augmentation.

public override IDictionary<string, object> GetParameters()

Returns

IDictionary<string, object>

A dictionary of parameter names to values.