Optical-flow-based Waterway Velocity Detection Algorithm Under Complex Illumination Conditions
Real-time and accurate River Surface Velocity(RSV)data in rivers serve as crucial foundations for modern waterway dispatching and flood prevention.However,most traditional velocity measurement methods require manual field participation,which pose high risks and cannot satisfy the demands for large-scale system deployment.By contrast,image-based velocity measurement methods,which do not require direct contact with rivers,can provide near-real-time velocity information based on continuous frames captured by cameras.Nevertheless,optical flow estimation,as a mainstream image-based velocity measurement method,is designed for rigid object motion and lacks robustness in scenes with high similarity,such as river surfaces.To enhance the estimation accuracy of the water flow velocity algorithm based on the Recurrent All-Pairs Field Transformer(RAFT)model for optical flow estimation,a Convolutional Block Attention Module(CBAM)attention module is introduced in the feature extraction section.This module effectively improves the ability of the RAFT model to recognize river surface ripples and the movement of tracer particles.The loss functions in the optical flow iteration section are optimized by incorporating the angular error loss and divergence gradient smoothness loss,which reflect fluid motion characteristics.In addition,a weight factor that exponentially increases with the number of iterations is introduced to match the loss functions,emphasizing the significant effects that high-order iterations have on the overall results.Performance evaluations are conducted using river datasets from different scenarios to validate the effectiveness of the improved method.The results show that the proposed method yields an average relative error of 11.37%in complex optical noise scenarios,thus demonstrating good robustness and enabling the generation of more accurate spatial distribution maps of surface velocity.
River Surface Velocity(RSV)optical flow estimationRecurrent All-Pairs Field Transformers(RAFT)illumination conditionsConvolutional Block Attention Module(CBAM)compound loss function