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
TThe numeric type for calculations.
- Inheritance
-
AugmentationBase<T, ImageTensor<T>[]>VideoColorJitter<T>
- Implements
-
IAugmentation<T, ImageTensor<T>[]>
- 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
brightnessRangedoubleBrightness adjustment range (default: 0.2).
contrastRangedoubleContrast adjustment range (default: 0.2).
saturationRangedoubleSaturation adjustment range (default: 0.2).
probabilitydoubleProbability of applying this augmentation (default: 0.5).
frameRatedoubleFrame rate of the video (default: 30).
Properties
BrightnessRange
Gets the maximum brightness adjustment.
public double BrightnessRange { get; }
Property Value
Remarks
Default: 0.2 (±20%)
ContrastRange
Gets the maximum contrast adjustment.
public double ContrastRange { get; }
Property Value
Remarks
Default: 0.2 (±20%)
SaturationRange
Gets the maximum saturation adjustment.
public double SaturationRange { get; }
Property Value
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
dataImageTensor<T>[]The input data.
contextAugmentationContext<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.