RgbToLab<T>
Models & Types · AiDotNet.Augmentation.Image
Converts an image between RGB and CIE Lab* color space.
Inheritance: AugmentationBase<T, ImageTensor<T>> → ImageAugmenterBase<T> → RgbToLab<T>
For Beginners
Lab* is a special color space where the distance between two colors matches how different they look to the human eye. L* is lightness (0=black, 100=white), a* goes from green (negative) to red (positive), and b* goes from blue (negative) to yellow (positive).
How It Works
The CIE Lab* color space is designed to be perceptually uniform, meaning that equal numerical changes correspond to roughly equal perceived color differences. The conversion goes through XYZ color space as an intermediate step.
Channel layout:
- *L (Lightness)**: [0, 100]
- a*: Approximately [-128, 127] (green to red)
- b*: Approximately [-128, 127] (blue to yellow)
When to use:
- Color difference calculations (Delta E)
- Perceptually uniform color augmentation
- Color transfer between images
- Image quality assessment
Constructors
| Constructor | Summary |
|---|---|
RgbToLab(bool normalizeOutput, double probability) |
Creates a new RGB to Lab* conversion. |
Properties
| Property | Summary |
|---|---|
bool NormalizeOutput { get; } |
Gets whether to normalize output to [0, 1] range. |
Methods
| Method | Summary |
|---|---|
IDictionary<string, object> GetParameters() |
|
ValueTuple<double, double, double> LabToRgb(double l, double a, double b) |
Converts Lab* values back to RGB. |