← Back to all transforms

RandomRain

Description

Adds rain effects to an image.

    Args:
        slant_range (tuple[int, int]): tuple of type (slant_lower, slant_upper) representing the range for
            rain slant angle.
        drop_length (int): Length of the raindrops.
        drop_width (int): Width of the raindrops.
        drop_color (tuple[int, int, int]): Color of the rain drops in RGB format.
        blur_value (int): Blur value for simulating rain effect. Rainy views are blurry.
        brightness_coefficient (float): Coefficient to adjust the brightness of the image.
            Rainy days are usually shady. Should be in the range (0, 1].
        rain_type (Optional[str]): Type of rain to simulate. One of [None, "drizzle", "heavy", "torrential"].


    Targets:
        image

    Image types:
        uint8, float32

    Reference:
        https://github.com/UjjwalSaxena/Automold--Road-Augmentation-Library

    

Parameters

  • p: float (default: 0.5)
  • slant_range: tuple[float, float] (default: (-10, 10))
  • drop_length: int (default: 20)
  • drop_width: int (default: 1)
  • drop_color: tuple[int, int, int] (default: (200, 200, 200))
  • blur_value: int (default: 7)
  • brightness_coefficient: float (default: 0.7)
  • rain_type: Literal['drizzle', 'heavy', 'torrential'] | None (default: null)

Targets

  • Image

Try it out

Original Image (width = 484, height = 733):

Original

Transformed Image:

Transform not yet applied