Giter VIP home page Giter VIP logo

video-stabilization-using-opencv's Introduction

Video-Stabilization

Video Stabilization Using Point Feature Matching in OpenCV.

This mainly involves reducing the effect of motion due to translation or rotation or any movement in camera. In this, Euclidean Motion Model is used instead of Affine or Homographic transformation, because it is adequate for motion stabilization.

Steps for video stabilization

  1. Capture two consequent frames of a video.
  2. Find motion between those two frames.
  3. Correct the motion.

Finding motions between frames

  1. Find good features in the current frame and previous frame (goodGeaturesToTrack) and (calcOpticalFlowPyrLK).
  2. We use two set of points to find rigid transform that maps previous frame to the current frame(estimateRigidTranform).
  3. Once the motion is estimated, we store the rotated, translated values.
  4. We soothe the values, found in step 3 (moving average filter).
  5. Calculate smooth motion between frames (trajectory).
  6. Apply smoothed camera motion to frames.

Important functions used:-

  1. calcOpticalFlowPyrLK()
    a) nextPts - output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image.
    b) status – output status vector (of unsigned chars); each element of the vector is set to 1 if the flow for the corresponding features has been found, otherwise, it is set to 0.
    c) err - outputs vector of errors, if the flow wasn’t found then the error is not defined.

  2. estimateRigidTransform()
    a) Computes an optimal affine transformation between two 2D point sets.

Version Requirements

  1. Python 2.7 or Python 3.x
  2. OpenCV version 3.x.x

Usage

python video_stabilization.py

video-stabilization-using-opencv's People

Contributors

krutikabapat avatar

Watchers

James Cloos avatar

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.