Hydrophysics

Hydrophysics

Automatic Rain Detection from Digital Videos Using the Farneback Optical Flow Algorithm

Document Type : Original Article

Authors
1 Faculty of Civil, Water and Environmental, Shahid Beheshti University, Tehran, Iran.
2 Faculty of Civil, Water and Environmental, Engineering Shahid Beheshti university, Tehran, Iran.
Abstract
Automatic rain detection from digital images, especially in regions lacking traditional equipment, is a low-cost and effective tool for weather monitoring and rapid warning. In this study, the Farneback optical flow algorithm was used to identify motion caused by rain in consecutive video frames. This method analyzes vertical pixel motion and can detect rain, serving as a simple and relatively robust approach in real-world conditions. To evaluate, a set of rainy and non-rainy videos was selected, and results were compared with manual labeling. The algorithm’s average accuracy is 78.72%, indicating a reasonable capability to detect rain, particularly in videos with fixed frame rates and relatively higher brightness. The results suggest that this method can achieve more favorable outcomes when combined with other methods and trained further, and it is cost-effective in terms of implementation. This approach is suitable for real-time and surveillance applications and can serve as a low-cost substitute for traditional equipment. Given the importance of rain detection in natural disaster management and climate change, this area has become a vital focus in recent research, and future improvements could increase efficiency and accuracy.
Keywords

Subjects



Articles in Press, Accepted Manuscript
Available Online from 28 January 2026

  • Receive Date 14 December 2025
  • Revise Date 31 December 2025
  • Accept Date 06 February 2026