• AlbumentationsAlbumentations
All TransformsGet LicenseDocumentationNews & Insights
Report IssueJoin Discord...

RingingOvershoot

Targets:
image
Image Types:uint8, float32

Create ringing or overshoot artifacts via 2D sinc convolution. blur_range and cutoff_range control strength. Simulates sharpening or compression artifacts.

This transform simulates the ringing artifacts that can occur in digital image processing, particularly after sharpening or edge enhancement operations. It creates oscillations or overshoots near sharp transitions in the image.

Arguments
blur_range
tuple[int, int]
[7,15]

Inclusive range for the sinc filter kernel size. Both ends must be odd and >= 3. Default: (7, 15).

cutoff_range
tuple[float, float]
[0.7853981633974483,1.5707963267948966]

Range to choose the cutoff frequency in radians. Values should be in the range (0, π). A lower cutoff frequency will result in more pronounced ringing effects. Default: (π/4, π/2).

p
float
0.5

Probability of applying the transform. Default: 0.5.

Examples
>>> import numpy as np
>>> import albumentations as A
>>> image = np.random.randint(0, 256, [100, 100, 3], dtype=np.uint8)

# Apply ringing effect with default parameters
>>> transform = A.RingingOvershoot(p=1.0)
>>> ringing_image = transform(image=image)['image']

# Apply ringing effect with custom parameters
>>> transform = A.RingingOvershoot(
...     blur_range=(9, 17),
...     cutoff_range=(np.pi/6, np.pi/3),
...     p=1.0
... )
>>> ringing_image = transform(image=image)['image']
Notes
  • Ringing artifacts are oscillations of the image intensity function in the neighborhood of sharp transitions, such as edges or object boundaries.
  • This transform uses a 2D sinc filter (also known as a 2D cardinal sine function) to introduce these artifacts.
  • The severity of the ringing effect is controlled by both the kernel size (blur_range) and the cutoff frequency.
  • Larger kernel sizes and lower cutoff frequencies will generally produce more noticeable ringing effects.
  • This transform can be useful for:
    • Simulating imperfections in image processing or transmission systems
    • Testing the robustness of computer vision models to ringing artifacts
    • Creating artistic effects that emphasize edges and transitions in images
References
  • Ringing artifactshttps://en.wikipedia.org/wiki/Ringing_artifacts
  • Sinc filterhttps://en.wikipedia.org/wiki/Sinc_filter
  • Digital Image ProcessingRafael C. Gonzalez and Richard E. Woods, 4th Edition