Giter VIP home page Giter VIP logo

optical-flow-filter's Introduction

IMPORTANT:

Please consider using https://github.com/jadarve/lluvia instead of this repo. Lluvia includes an implementation of this algorithm running using the Vulkan API instead of CUDA. Checkout this demo: https://www.youtube.com/watch?v=mRZ6YdWb8fE.

Optical-flow-filter

A real time optical flow algorithm implemented on GPU.

@Article{2016_Adarve_RAL,
  Title = {A Filter Formulation for Computing Real Time Optical Flow},
  Author = {{Juan David} Adarve and Robert Mahony},
  Journal = {Robotics and Automation Letters},
  Year = {2016}
}

300 Hz Real Time Optical Flow

Build and Installation

Dependencies

  • CMake 2.8.11 or higher.
  • Cuda 7.5 or higher.
  • GCC 4.8.
  • Visual Studio 2013 (Windows only).

Build (Linux)

git clone https://github.com/jadarve/optical-flow-filter.git
cd optical-flow-filter
mkdir build
cd build
cmake ..
make
sudo make install 

The library and header files will be installed at /usr/local/lib and /usr/local/include respectively.

Build (Windows)

For x86_64

mkdir build64 & cd build64
cmake -G "Visual Studio 12 2013 Win64" ..
cmake --build . --config Release

For x86

mkdir build & cd build
cmake -G "Visual Studio 12 2013"
cmake --build . --config Release

Python Wrappers

A python package with wrappers to the C++ library is available at optical-flow-filter/python/ folder. The wrappers have been developed and build using Cython 0.23.4.

cd optical-flow-filter/python/
python setup.py build
sudo python setup.py install

See notebooks/ folder for usage examples.

Demo Applications

flowWebCam

This demo computes optical flow from a webcam. It uses OpenCV to access the camera video stream and to display the computed flow. The instructions to build the demo are the following:

cd optical-flow-filter/demos/flowWebCam
mkdir build
cd build
cmake ..
make
./flowWebCam

highSpeedDemo

This demo interfaces a Basler camera, in our case an acA2000-165um, with the GPU optical flow algorithm, and displays the color encoded flow.

cd optical-flow-filter/demos/highSpeedDemo
mkdir build
cd build
cmake ..
make

To run the application, it is necessary to specify the camera properties file, as follows

./highSpeedDemo -c ../acA2000-165um_binSkip.pfs

Other optional arguments are:

./highSpeedDemo -h

-h, --help             Displays this help.
-v, --version          Displays version information.
-c, --config <file>    Camera configuration file.
-l, --levels <int>     Flow filter pyramid levels (default 2).
-r, --rate <int>       Camera frame rate (default 300).
-m, --maxflow <float>  Maximum optical flow (default 4.0).

optical-flow-filter's People

Contributors

jadarve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

optical-flow-filter's Issues

How to calculate the backward flow?

Hi,
Really appreciate your sharing. I am now implementing this algorithm to calculate both the forward optical flow ((t-1)->t) and the backward optical flow (t->(t-1)). However, the code
"###filter.loadImage(hostImageGray);
###filter.compute();
###filter.downloadFlow(flowHostWrapper);"
I use can only calculate the forward optical flow ((t-1)->t). May I wonder how to calculate the backward optical flow based on your shared code?

Best,
Jiangtian

Optical flow always equals zero?

Hi Juan,

Thanks for sharing your code. I'm trying to incorporate your optical flow calculations in my project and have followed your webcam demo to calculate flow using OpenCV. I'm acquiring camera image frames from a pre-recorded video for my processing and always get a flow vector of zero magnitude. I also get the following message on my console:

DeltaFlowFilter::compute(): fisrt load
FlowFilter::compute(): fisrt load
DeltaFlowFilter::compute(): fisrt load
DeltaFlowFilter::compute(): fisrt load
FlowFilter::compute(): fisrt load

This message repeats itself throughout video processing. Do you have any advice? I get the feeling that only a single optical flow is being calculated for the initial frame and state propagation isn't taking place. Thanks for your help!

A problem during installation in python modules.

I was trying install the python module, but after I input "python setup.py install" I got an error: Unable to find vcvarsall.bat(seen in the picture). So how can I fix it. Any help will be appreciate.

1

error: libflowfilter_gpu.so

when I run ./flowWebCam, errors occured.
./flowWebCam: error while loading shared libraries: libflowfilter_gpu.so: cannot open shared object file: No such file or directory
Any help?
Best,
Joy Yang

Question about paper's equation (17).

Hi Juan,

Sorry, can I ask some question about the paper here?
Why Equation (17) uses ^h\Delta\Phi rather than ^h\Phi ?
I have not traced your code yet but this has already perplexed me for a long time.

Your paper is great, and code work fine to me! Thanks for your help!

Error occuring in setup.py ,due to which ipython notebook is notworking

1.The error which is occurring again and again in the command sudo python setup.py install is
Traceback (most recent call last):

File "setup.py", line 17, in <module>
   from Cython.Build import cythonize
ImportError: No module named Cython.Build

2.Also the python setup.py build command is not installing or building actually. The command just gets executed within 2-3 seconds. So i guess it's not doing anything in actual. When the command was executed for the first time two warnings were printed several times ,

 warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \

and after executing that command again
It is printing following lines

running build
running build_py
running build_ext

The cuda version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

and the os is

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.4 LTS
Release:	16.04
Codename:	xenial

So how to fix this ?
And is there any other method to achieve the same results for optical-flow-filter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.