HueSaturationValue
PhotometricTransform[TripletParams]HueSaturationValue(hue_shift_limit: float | tuple[float, float] = 20, sat_shift_limit: float | tuple[float, float] = 30, val_shift_limit: float | tuple[float, float] = 20, p: float = 0.5)Random hue / saturation / value shift (Albumentations HueSaturationValue).
Samples each shift uniformly from its limit range, then applies a
single functional.adjust_hsv round-trip — additive in HSV,
hue wraps, saturation and value clip to [0, 1]. Channel-gated
to RGB (PhotometricTransform._require_channels rejects
non-3-channel input).
Parameters
hue_shift_limitfloat or (float, float)= 20[0, 179]. Scalar
v is interpreted as (-v, v).sat_shift_limitfloat or (float, float)= 30[0, 255].val_shift_limitfloat or (float, float)= 20[0, 255].pfloat= 0.5Raises
ValueErrorNotes
Lucid stays in float for the full HSV round-trip; Albumentations
quantises through uint8 + cv2 HSV, so the two match to
~0.02 (G3 parity "ballpark" tier). Lucid's path is the more
precise of the two.
Examples
>>> import lucid
>>> import lucid.utils.transforms as T
>>> tf = T.HueSaturationValue(hue_shift_limit=10, p=1.0)
>>> out = tf(T.Image(lucid.rand(3, 32, 32))).data
>>> tuple(out.shape)
(3, 32, 32)Used by 1
Constructors
1Instance methods
1Sample per-call random parameters for HueSaturationValue.
Parameters
imgTensorReturns
TripletParamsCarries the hue shift (a, OpenCV [0, 179] scale),
saturation shift (b, [0, 255]), and value shift
(c, [0, 255]), each drawn uniformly from its
limit range.