Affine<T>
Models & Types · AiDotNet.Augmentation.Image
Applies random affine transformations (rotation, scale, shear, translation) to an image.
Inheritance: AugmentationBase<T, ImageTensor<T>> → SpatialAugmentationBase<T, ImageTensor<T>> → Affine<T>
For Beginners
Think of this as combining multiple geometric operations into one. The image can be rotated, stretched, tilted (sheared), and moved around - all at once. This creates more diverse training examples than applying each transformation separately.
How It Works
Affine transformation is a general geometric transformation that preserves lines and parallelism. It combines rotation, scaling, shearing, and translation in a single operation, providing a powerful way to augment images with realistic geometric variations.
When to use:
- General image classification with geometric invariance
- Object detection where objects may be viewed from different angles
- When you need combined geometric variations efficiently
Constructors
| Constructor | Summary |
|---|---|
Affine(ValueTuple<double, double>? rotationRange, ValueTuple<double, double>? scaleRange, ValueTuple<double, double>? shearRange, ValueTuple<double, double>? translationRange, double probability, InterpolationMode interpolation, BorderMode borderMode, T borderValue) |
Creates a new affine transformation augmentation. |
Properties
| Property | Summary |
|---|---|
BorderMode BorderMode { get; } |
Gets the border mode when pixels fall outside the original image bounds. |
InterpolationMode Interpolation { get; } |
Gets the interpolation mode for pixel sampling. |
T BorderValue { get; } |
Gets the constant value used when BorderMode is Constant. |
ValueTuple<double, double> RotationRange { get; } |
Gets the rotation angle range in degrees. |
ValueTuple<double, double> ScaleRange { get; } |
Gets the scale factor range. |
ValueTuple<double, double> ShearRange { get; } |
Gets the shear angle range in degrees. |
ValueTuple<double, double> TranslationRange { get; } |
Gets the translation range as a fraction of image dimensions. |
Methods
| Method | Summary |
|---|---|
IDictionary<string, object> GetParameters() |