GridDistortion<T>
Models & Types · AiDotNet.Augmentation.Image
Applies grid-based distortion to an image.
Inheritance: AugmentationBase<T, ImageTensor<T>> → ImageAugmenterBase<T> → GridDistortion<T>
For Beginners
Imagine overlaying a flexible grid on your image, then randomly nudging each grid intersection point. The image warps smoothly between the displaced points, creating natural-looking distortions.
How It Works
Grid distortion divides the image into a grid of cells and randomly displaces the grid intersection points, then interpolates the displacement across each cell. This creates smooth, locally varying distortions.
When to use:
- OCR and document recognition
- Medical image augmentation
- Any task requiring smooth local distortions
Constructors
| Constructor | Summary |
|---|---|
GridDistortion(int numSteps, double distortLimit, double fillValue, double probability) |
Creates a new grid distortion augmentation. |
Properties
| Property | Summary |
|---|---|
double DistortLimit { get; } |
Gets the maximum distortion magnitude. |
double FillValue { get; } |
Gets the fill value for out-of-bounds pixels. |
int NumSteps { get; } |
Gets the number of grid steps in each dimension. |
Methods
| Method | Summary |
|---|---|
IDictionary<string, object> GetParameters() |