Table of Contents

Class VideoColorJitter<T>

Namespace
AiDotNet.Augmentation.Video
Assembly
AiDotNet.dll

Applies color jitter (brightness, contrast, saturation) to video frames.

public class VideoColorJitter<T> : SpatialVideoAugmenterBase<T>, IAugmentation<T, ImageTensor<T>[]>

Type Parameters

T

The numeric type for calculations.

Inheritance
VideoColorJitter<T>
Implements
Inherited Members

Remarks

For Beginners: Color jitter randomly adjusts brightness, contrast, and saturation of video frames. This helps models become robust to different lighting conditions and camera settings.

When to use:

  • Videos captured with different cameras or lighting
  • Outdoor videos with varying light conditions
  • Reducing overfitting to specific color characteristics

Constructors

VideoColorJitter(double, double, double, double, double)

Creates a new video color jitter augmentation.

public VideoColorJitter(double brightnessRange = 0.2, double contrastRange = 0.2, double saturationRange = 0.2, double probability = 0.5, double frameRate = 30)

Parameters

brightnessRange double

Brightness adjustment range (default: 0.2).

contrastRange double

Contrast adjustment range (default: 0.2).

saturationRange double

Saturation adjustment range (default: 0.2).

probability double

Probability of applying this augmentation (default: 0.5).

frameRate double

Frame rate of the video (default: 30).

Properties

BrightnessRange

Gets the maximum brightness adjustment.

public double BrightnessRange { get; }

Property Value

double

Remarks

Default: 0.2 (±20%)

ContrastRange

Gets the maximum contrast adjustment.

public double ContrastRange { get; }

Property Value

double

Remarks

Default: 0.2 (±20%)

SaturationRange

Gets the maximum saturation adjustment.

public double SaturationRange { get; }

Property Value

double

Remarks

Default: 0.2 (±20%)

Methods

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

Implement this method to perform the actual augmentation.

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

Parameters

data ImageTensor<T>[]

The input data.

context AugmentationContext<T>

The augmentation context.

Returns

ImageTensor<T>[]

The augmented data.

GetParameters()

Gets the parameters of this augmentation.

public override IDictionary<string, object> GetParameters()

Returns

IDictionary<string, object>

A dictionary of parameter names to values.