Git Product home page Git Product logo

aia39 / tvl1_optical_flow_framegeneration Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 741 KB

Generating optical flow frame by using TVL1 algorithm in organized way is not so difficult. But for a newbie it is toilsome to find this easier task. TVL1 is most popular way to generate optical flow frame which outperforms most other algorithm but lacks processing speed.

License: MIT License

Python 100.00%
opencv video actionrecognition optical-flow

tvl1_optical_flow_framegeneration's Introduction

TVL1_Optical_Flow_FrameGeneration

Generating optical flow frame by using TVL1 algorithm in organized way is not so difficult. But for a newbie it is toilsome to find this easier task. TVL1 is most popular way to generate optical flow frame which outperforms most other algorithm but lacks processing speed.

Folder Directory Hierarchy

Parent_folder/
    sub_folder1/
        video1.mp4
        video2.mp4

        ...
        
    sub_folder2/
        video1.mp4
        video2.mp4

        ...
        

And all the generated optical flow frame will be saved in a pre-created folder 'Optical Flow Frame' in structured way like input directory which is mentioned in the code(you can change according to your choice)

Demo of the Optical Flow Frame

Some optical flow frame of the video Goal keeper catch football contains in this repo Flow_Frame

Here is the resultant frame of flow.We can get the horizontal component(means u component) and vertical component(means v component) from the given code which is more significant in terms of analytical task.You can see all frames from 'OpticalFlowFrame' folder in the main branch of the repo.

Getting Started

  1. Clone this repository

  2. Install dependencies

  conda install -c anaconda opencv
  or
  pip install opencv-contrib-python 
  1. Run the 'opticalflow.py' from command window
  python opticalflow.py

N.B : By default it will run on TVL1 algortihm.To generate optical flow frame on Farneback algorithm you can clear the comment and run the line of 93 ( flow = cv2.calcOpticalFlowFarneback(prvs,next, None, 0.8, 3, 10, 3, 7, 1.1, 0) ) instead of ( flow = optical_flow.calc(prvs, next, None) )

To know about all other algortihms and parameters of optical flow go through documentation of opencv All Optical Flow Process in Opencv

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.