Source code used in the paper Histograms of Optical Flow Orientation and Magnitude to Detect Anomalous Events in Videos (published on SIBGRAPI 2015). In this paper, we propose the use of magnitude and orientation to describe patterns in crowded scenes. This model describes spatiotemporal regions in the scene to determine if they presents a normal or anomalous pattern. Our descriptor captures spatiotemporal information from cuboids (regions with spatial and temporal support) and encodes both magnitude and orientation of the optical flow separately into histograms, differently from previous works, which are based only on the orientation.
This code obtained the following results in the UCSD Anomaly Detection Dataset. This data set contains two sequences: Peds1 and Peds2. Most of researches present the results using AUC and ERR metrics. An extended list of results on the UCSD and other datasets on anomaly detection can be found here.
If you use the code or parts of it, please cite the following paper.