Perspective<T>

Models & Types · AiDotNet.Augmentation.Image

Applies a random perspective transformation to an image.

Inheritance: AugmentationBase<T, ImageTensor<T>> → SpatialAugmentationBase<T, ImageTensor<T>> → SpatialImageAugmenterBase<T> → Perspective<T>

For Beginners

Imagine tilting a photo in 3D space — objects closer to you appear larger, and objects farther away appear smaller. This augmentation simulates that effect, teaching your model to recognize objects regardless of viewing angle.

How It Works

Perspective transformation simulates viewing the image from different angles by applying a projective (homography) transform. Each corner of the image is displaced by a random amount, creating a realistic 3D perspective effect.

When to use:

  • Document recognition (photos of documents taken at angles)
  • Street sign/license plate recognition
  • Any task where the camera angle may vary

Constructors

Constructor Summary
Perspective(double distortionScale, InterpolationMode interpolation, double fillValue, double probability) Creates a new perspective transformation.

Properties

Property Summary
InterpolationMode Interpolation { get; } Gets the interpolation mode.
double DistortionScale { get; } Gets the maximum distortion scale (fraction of image size).
double FillValue { get; } Gets the fill value for areas outside the transformed image.

Methods

Method Summary
IDictionary<string, object> GetParameters()