Add lateral chromatic aberration: shift red and blue relative to green. distortion_limit and shift_limit control strength. Simulates lens color fringing.
Chromatic aberration is an optical effect that occurs when a lens fails to focus all colors to the same point. This transform simulates this effect by applying different radial distortions to the red and blue channels of the image, while leaving the green channel unchanged.
primary_distortion_limitRange of the primary radial distortion coefficient. If a single float value is provided, the range will be (-primary_distortion_limit, primary_distortion_limit). This parameter controls the distortion in the center of the image:
secondary_distortion_limitRange of the secondary radial distortion coefficient. If a single float value is provided, the range will be (-secondary_distortion_limit, secondary_distortion_limit). This parameter controls the distortion in the corners of the image:
modeType of color fringing to apply. Options are:
interpolationFlag specifying the interpolation algorithm. Should be one of: cv2.INTER_NEAREST, cv2.INTER_LINEAR, cv2.INTER_CUBIC, cv2.INTER_AREA, cv2.INTER_LANCZOS4. Default: cv2.INTER_LINEAR.
pProbability of applying the transform. Should be in the range [0, 1]. Default: 0.5.
>>> import albumentations as A
>>> import cv2
>>> transform = A.ChromaticAberration(
... primary_distortion_limit=0.05,
... secondary_distortion_limit=0.1,
... mode='green_purple',
... interpolation=cv2.INTER_LINEAR,
... p=1.0
... )
>>> transformed = transform(image=image)
>>> aberrated_image = transformed['image']