milkcat0904 / dense_flow

Tools to extract dense optical flow from videos, based on OpenCV

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extracting dense flow field given a video.

Depencies:

  • LibZip: to install on ubuntu apt-get install libzip-dev on mac brew install libzip

For OpenCV 3 Users

Please see the opencv-3.1 branch. Many thanks to @victorhcm for the contributions!

A.下载 Download

$ git clone --recursive http://github.com/yjxiong/dense_flow

B.安装 Install

1.在下载包的目录下执行cmd:

    $ mkdir build 

    $ cd build
    
    $ cmake .. 

2.修改build文件夹中的CMakeCache.txt文件,将参数置为OFF

(当执行make -j出现Error:cannot find -lopencv dep_cudart时)

image

    $ make -j

C.使用

$ ./extract_gpu -f test.avi -x tmp/flow_x -y tmp/flow_y -i tmp/image -b 20 -t 1 -d 0 -s 1 -o dir

- `test.avi`: input video
- `tmp`: folder containing RGB images and optical flow images
- `dir`: output generated images to folder. if set to `zip`, will write images to zip files instead.

D.Warp Flow

The warp optical flow is used in the tsn model


To extract warp flow, use the command

$ ./extract_warp_gpu -f test.avi -x tmp/flow_x -y tmp/flow_y -i tmp/image -b 20 -t 1 -d 0 -s 1 -o dir

About

Tools to extract dense optical flow from videos, based on OpenCV


Languages

Language:C++ 77.7%Language:MATLAB 8.7%Language:Python 7.0%Language:CMake 6.7%