Rotation<T>
Models & Types · AiDotNet.Augmentation.Image
Rotates an image by a random angle within a specified range.
Inheritance: AugmentationBase<T, ImageTensor<T>> → SpatialAugmentationBase<T, ImageTensor<T>> → Rotation<T>
For Beginners
Imagine tilting your camera slightly when taking a photo. The same object photographed at a slight angle is still the same object. This augmentation teaches your model to recognize objects even when they’re not perfectly aligned.
How It Works
Rotation randomly rotates the image around its center point by an angle sampled from the specified range. This simulates viewing objects from slightly different angles, which helps the model become robust to orientation variations.
When to use:
- Object classification where objects might appear at different angles
- Document analysis (scanned documents may be slightly tilted)
- Medical imaging where acquisition angle varies
- Satellite imagery where orientation is arbitrary
When NOT to use:
- Facial recognition (faces should be upright)
- Handwriting recognition (letters need consistent orientation)
- Tasks where specific orientation is part of the classification
Constructors
| Constructor | Summary |
|---|---|
Rotation(double minAngle, double maxAngle, double probability, BorderMode borderMode, T borderValue, InterpolationMode interpolation) |
Creates a new rotation augmentation. |
Properties
| Property | Summary |
|---|---|
BorderMode BorderMode { get; } |
Gets the border fill 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. |
double MaxAngle { get; } |
Gets the maximum rotation angle in degrees. |
double MinAngle { get; } |
Gets the minimum rotation angle in degrees (can be negative for counter-clockwise). |
Methods
| Method | Summary |
|---|---|
IDictionary<string, object> GetParameters() |