4. 1. Problem Definition
• Optical Flow: Optical flow is the motion of objects between consecutive
frames of sequence, caused by the relative movement between the object
and camera.
• Problem: Given two consecutive image frames, estimate the motion of each
pixel.
4
7. 2. Types of Optical Flow
• Sparse Optical Flow: Sparse optical flow gives the flow vectors of some
"interesting features" (say few pixels depicting the edges or corners of an
object) within the frame.
7
8. 2. Types of Optical Flow
• Dense Optical Flow: Dense optical flow attempts to compute the optical flow
vector for every pixel of each frame.
• While such computation may be slower, it gives a more accurate result and a
denser result suitable for applications such as learning structure from
motion and video segmentation.
8
10. 3. Sparse Optical Flow – Lucas-Kanade Algorithm
• Lucas and Kanade proposed an effective technique to estimate the motion of
interesting features by comparing two consecutive frames.
• The Lucas-Kanade method works under the brightness constancy assumption
and small motion assumption.
10
11. 3. Sparse Optical Flow – Lucas-Kanade Algorithm
• Shi-Tomashi Corner Detection: For the implementation of sparse optical flow,
we only track the motion of a feature set of pixels. Features in images are
points of interest which present rich image content information.
11
15. 3. Sparse Optical Flow – Lucas-Kanade Algorithm
• Brightness constancy assumption: Brightness of the point will remain the
same.
I(x(t), y(t), t) = C - constant
15
22. 3. Sparse Optical Flow – Lucas-Kanade Algorithm
• Smoothness constancy assumption: A frame portrays a “natural” scene with
textured objects exhibiting shades of gray that change smoothly.
22
27. 4. Dense Optical Flow – Horn-Schunck Algorithm
• The Horn–Schunck method of estimating optical flow is a global method
which introduces a global constraint of smoothness to solve the aperture
problem.
27
33. 5. Lucas Kanade with Pyramid
33
In regular optical flow method, we assume the following:
• Brightness constancy
• Small motion
• Spatial conherence
If the object were to move a larger distance
→The traditional optical flow method would work bad
34. 5. Lucas Kanade with Pyramid
34
• Pyramid is built by using multiple copies
of the same image.
• Each level in the pyramid is 1/4th of the
size of the previous level
• The lowest level is of the highest
resolution
• The highest level is of the lowest
resolution
35. 5. Lucas Kanade with Pyramid
35
• Pyramid is built by using multiple copies of the same image.
• Each level in the pyramid is 1/4th of the size of the previous level
• The lowest level is of the highest resolution
• The highest level is of the lowest resolution
• To Downsample: Using Gausian pyramid
• To Upsamgple: Using Laplacian pyramid
36. 5. Lucas Kanade with Pyramid
36
Lucas-Kanade with Pyramid Algorithm:
• Compute ‘simple’ LK optical flow at hightest level
• At level i
• Take flow ui-1, vi-1 from level i-1
• Bilinear interpolate it to create ui
*, vi
* matrices of twice resolution for level I
• Multiply ui
*, vi
* by 2
• Warp level I Gaussian version of I2 according to predicted flow to create I2’
• Apply LK between I2’ and Gaussian version of I1 to get ui’(x, y), vi’(x, y)
• Add corrections ui’ vi’ i.e. ui = ui
* + vi
*