-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chromatic Abberation #1386
Comments
Simply shifting the 2 channels (blue and red) would apply the chromatic aberration effect to the whole image. To simulate lateral chromatic aberration, the shift should be applied to the individual channels separately with respect to the radial distance from the center of the image. This can be done by splitting the image into its RGB channels, applying a slight amount of distortion to the blue and red channels, and then merging the channels back together. If this transform seems useful, I would like to implement it as an |
Great to hear back on this! |
Already implemented this for our augmentation pipeline. The results look like this:
Left: Original, Middle: Subtle chromatic aberration, Right: Strong chromatic aberration
Waiting for feedback from @albumentations-team, then I'll make a PR :) |
@mrsmrynk Looks great. Waiting for a PR :) |
Hi, I'm not sure if any augmentation like this exists in Albumentations. But if not, chromatic abberation would be a great addition. Chromatic abberation occurs when a camera lens fails to focus all the colors at the focal point of the lens due to dispersion. This effect can easily be replicated in python. Below is an example code of the implementation:
where
px_shift
is the number of pixels the color is shifted by and the direction is set by the sign in front of the pixel shift. Both the direction and the pixel shift can be randomized with the pixel shift also being able to be assigned a random range.The text was updated successfully, but these errors were encountered: