Book Image

OpenCV Essentials

Book Image

OpenCV Essentials

Overview of this book

Table of Contents (15 chapters)
OpenCV Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The Lucas-Kanade optical flow


The Lucas-Kanade (LK) algorithm was originally proposed in 1981, and it has become one of the most successful methods available in Computer Vision. Currently, this method is typically applied to a subset of key points in the input image. This method assumes that optical flow is a necessary constant in a local neighborhood of the pixel that is under consideration and solves the basic Optical Flow technique equations you can see equation (1), for each pixel (x, y) on that neighborhood. The method also assumes that displacements between two consecutive frames are small and are approximately a way to get an over-constrained system of the considered points:

I(x, y, t) = I(x + ∆x, y + ∆y, t + ∆t)            (1)

We will now focus on the Pyramidal Lucas-Kanade method, which estimates the optical flow in a pyramid using the calcOpticalFlowPyrLK() function. This method first estimates the optical flow at the top of the pyramid, thus avoiding the problems caused by violations...