Optical Flow
Fast optical flow computation using OF_DIS.
By Laurent Ittiitti@usc.eduhttp://jevois.orgGPL v3
 Language:   C++            Supports mappings with USB output:   Yes            Supports mappings with NO USB output:   No
 Video Mapping:   GREY 176 288 100 YUYV 176 144 100 JeVois OpticalFlow

Module Documentation

Computes horizontal and vertical optical flow into two separate optical flow maps. This module is intended for use as a pre-processor, that is, the images sent out may be further processed by the host computer.

The optical flow image output is twice taller than the camera input image:

  • On top is the horizontal motion map
    • darker shades of gray for things moving rightward from the viewpoint of the camera,
    • lighter shades for things that move leftward,
    • mid-grey level for no motion
  • below it is the vertical motion map
    • dark for things moving downward,
    • bright for upward,
    • mid-grey for no vertical motion.

You should be able to run this algorithm at 100 frames/s with 176x144 video camera resolution.

This module has parameters to tune the algorithm. Interested users are referred to the original paper and implementation for how to set these:

"Fast Optical Flow using Dense Inverse Search" by Till Kroeger, Radu Timofte, Dengxin Dai and Luc Van Gool, Proc ECCV, 2016.

Also see here: http://www.vision.ee.ethz.ch/~kroegert/OFlow/

Trying it out

Have JeVois point towards an otherwise static scene, and swipe one finger in front of it, either moving from left to right of the field of view, from top to bottom, etc to confirm the different greyscale values as described above.

ParameterTypeDescriptionDefaultValid Values
(FastOpticalFlow) opointintAlgorithm operating point1jevois::Range<int>(1, 4)
(FastOpticalFlow) factorfloatFactor to use when converting float velocities to byte25.0F-
(FastOpticalFlow) thetasfintFinest scale in the pyramid, or -1 for auto-1-
(FastOpticalFlow) thetaitintNumber of gradient descent iterations, or -1 for auto5-
(FastOpticalFlow) thetapsintPatch size in pixels, or -1 for auto-1-
(FastOpticalFlow) thetaovfloatPatch overlap on each scale, or -1 for auto0.1F-
(FastOpticalFlow) usevrefboolUse variational refinement when truefalse-
Detailed docs:OpticalFlow
Copyright:Copyright (C) 2016 by Laurent Itti, iLab and the University of Southern California
License:GPL v3
Distribution:Unrestricted
Restrictions:None
Support URL:http://jevois.org/doc
Other URL:http://iLab.usc.edu
Address:University of Southern California, HNB-07A, 3641 Watt Way, Los Angeles, CA 90089-2520, USA