120 likes | 261 Views
Parallelizing OpenCV: Optical Flow Algorithms. Arjun Agarwal Abhishek Gupta Eric Lovett. Optical Flow. Apparent motion of objects, surfaces and edges in a scene caused by the relative motion between scene and observer Use cases: For tracking objects
E N D
Parallelizing OpenCV:Optical Flow Algorithms Arjun Agarwal Abhishek Gupta Eric Lovett
Optical Flow • Apparent motion of objects, surfaces and edges in a scene caused by the relative motion between scene and observer • Use cases: • For tracking objects • determine whether the objects are moving or the observer is moving • Three of the ways to do this in OpenCV that are not yet parallelized: • Horn & Schunck algorithm (Iterative) • Lucas & Kanade algorithm (Iterative) • Block matching method (Data decomposition)
What we have done • Parallelized OpticalFlow BM and LK • Methodology: • Used OpenMP • Changed while loops to for loops (e.g. LK) • Removed inter-loop dependencies • Used data-driven decomposition • Analyze across: • Number of processors • Data granularity • Input size
To Do • Need to finish parallelizing OpticalFlowHS • Explore why the speedups are not much • False Sharing* • Figure out what the sequential overhead is doing (matrix manipulations?) and if we can reduce or parallelize it* • Problem size is too small (we intend to explore the speedup for high definition videos) • We intend to explore wall-clock times for different scheduling (static vs. dynamic)
Evaluation • Evaluation is done on Niagara-2 • It has 64 byte cache line • It has 8 processors and 8 hardware threads per processor
Optical Flow LK • Inter-loop Dependency • Some variables in Iteration i depended on iteration (i-2) • Solution: We calculated those variables in the ith using the data that we have at ith iteration • We