|
Algorithm 2 Pseudocode for Procedural Rainfall Augmentation |
Input:
Original image
Image directory D (for batch processing)
Number of rain layers
Number of rain lines per layer
Rain line length range
Rain line angle mean and std
Rain line thickness range
Rain line brightness range
Motion blur kernel size
Transparency (per-layer alpha) range
Output path
Output:
Step 1: Generate and Overlay Rain Layers
-
1.
Initialize
-
2.
For to :
Create empty mask with same size as
For to :
-
–
Randomly sample start point
-
–
Randomly sample length
-
–
Randomly sample angle
-
–
Compute end point by and
-
–
Randomly sample thickness
-
–
Randomly sample brightness
-
–
Draw line from to with width , brightness on
Apply motion blur with kernel size along to
Randomly sample transparency
-
Blend onto :
Step 2: Batch Processing and Output
|