# CS-512 - Homework 4 (5%)

**Due by: December 3, 2015**

## Assignment
Specifications

In this assignment you need to implement
ONE of several motion analysis algorithms.

- The input image should always be converted to grayscale
before processing it. It should either be read from a file or
captured from a camera.

- The main parameters of each algorithm should be made
available for interactive manipulation through
keyboard/mouse/trackbar interaction.

- You may NOT use the OpenCV function which directly
implements the algorithm you choose. You may, however, use it
for verification purposes. You may use other OpenCV functions
as necessary. Use Python and OpenCV for the implementation.
- Your program must include a help key describing its
functionality.
- You need to evaluate the performance of the algorithm you
choose using test data. The results of your evaluation should
be included in your report. Try to determine the strengths and
weaknesses of the algorithm.
- For submission instructions and the necessary format of the
report please refer to assignment 1.
- The assignment must be submitted by the due date (regardless
of any available late days).

## Optical flow estimation

- In this part you need to estimate the optical flow vectors
in a sequence of images. The input to the program should be
captured from the camera or read from a video file.
- The optical flow vectors should be computed and displayed on
one of the images in the sequence as colored straight line
segments. Pressing āPā should pause/release the current image.
- You may choose to implement are the Lucas-Kanade,
affine-flow, or Horn-Schunk algorithms.
- The spatiotemporal derivatives should be computed by
extending the spatial gradient estimation technique you used
in the previous assignments.
- If implementing the Lucas-Kanade or affine motion, estimate
the reliability of the motion estimation based on the ratio of
smallest eigenvalue the system matrix (AT A), where high value
indicates high reliability. The reliability should be
displayed by modifying the intensity of the drawn optical flow
vectors.
- Test video sequences are available on the cs512 website.