Contrast<T>

Models & Types · AiDotNet.Augmentation.Image

Adjusts the contrast of an image by scaling pixel values around the mean.

Inheritance: AugmentationBase<T, ImageTensor<T>> → Contrast<T>

For Beginners

Think of contrast like the difference between a sunny day (high contrast with bright lights and dark shadows) and a foggy day (low contrast where everything looks similar in brightness). This teaches your model to recognize objects in both crisp and hazy conditions.

How It Works

Contrast adjustment changes the difference between light and dark areas of an image. Higher contrast makes light areas lighter and dark areas darker, while lower contrast makes the image appear more “washed out” or flat.

When to use:

  • Images from cameras with different quality or settings
  • Scenes with varying lighting conditions
  • Data from different sources with different post-processing

When NOT to use:

  • Tasks where pixel intensity relationships are critical
  • Medical imaging where contrast carries diagnostic information
  • Already preprocessed images with standardized contrast

Constructors

Constructor Summary
Contrast(double minFactor, double maxFactor, double probability) Creates a new contrast augmentation.

Properties

Property Summary
double MaxFactor { get; } Gets the maximum contrast adjustment factor.
double MinFactor { get; } Gets the minimum contrast adjustment factor.

Methods

Method Summary
IDictionary<string, object> GetParameters()