Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does KLT work in OpenCV?

I am curious about the logic behind KLT in openCV.

From what I have known so far, the images sent to find optical flow in OpenCV is firstly converted to grayscale.

What I am curious is that, when running the algorithm, we need set of features for computation. What are the features used in finding optical flow method in openCV?

Thank you :)

like image 264
ra bes Avatar asked Sep 18 '13 03:09

ra bes


People also ask

How does KLT work?

The KLT tracks an object in two steps; it locates the trackable features in the initial frame, and then tracks each one of the detected features in the rest of the frames by means of its displacement. The displacement of the specific feature is then defined as the displacement that minimizes the sum of differences.

What does optical flow return?

Optical flow is the pattern of apparent motion of image objects between two consecutive frames caused by the movement of object or camera. It is 2D vector field where each vector is a displacement vector showing the movement of points from first frame to second.

What is optical flow tracking?

Optical flow is one of the efficient approaches to track the movement of objects. Optical flow studies the relative motion of objects across different frame sequences based on the velocity of movement of objects and illumination changes.


1 Answers

There are 2 types of optical flow. Dense and sparse. Dense finds flow for all the pixels while sparse finds flow for the selected points.

The selected points may be user specified, or calculated automatically using any of the feature detectors available in OpenCV. Most common feature detectors include GoodFeaturesToTrack which finds corners using cornerHarris or cornerMinEigenVal

The feature list is then passed to the KLT Tracker calcOpticalFlowPyrLK.

Feature can be any point in the image. Most common features are corners and edges.

like image 55
sgarizvi Avatar answered Sep 29 '22 19:09

sgarizvi