Module 7 of E0 259, Data Analytics, August 2018

Video background separation

Lectures from August 2017

Lecture 1 (until slide 17/38) (Rajesh Sundaresan)
Lecture 2 (Rajesh Sundaresan)

Data set for August 2016 assignment. No assignment on this module for August 2017 and August 2018

A stream of 360 bmp images of a video. Each frame is made of 120x160 pixels. There are 24 bits of colour data for each pixel, with each colour component being uint8 valued. A link to the image frames will be sent to the crediting students.

Assignment

Due: No due date. Discussion is encouraged. But write your own code. Please comply with the ethics policy.

Formatting and notation: Use imread function in Matlab, or other similar function in your programming language, to read the data as 120 x 160 x 3 unint8 elements. In the data set there are 360 such frames. Index them as data[i][j][c][t] where row index i goes from 1 to 120, column index j goes from 1 to 160, colour index c goes from 1 to 3, and frame index t goes from 1 to 360. After you process the files, use imwrite function in Matlab, or other similar function in your programming language, to create output bmp files.

What to submit: Zip file of your code. Your code should be able to read the bmp files from an input/ directory, process them, write the output bmp files as BGnnnnn.bmp and FGnnnnn.bmp files into an output/ directory. The TAs will browse through your code, run it on a different set of 360 bmp frames, and will inspect the FG and BG outputs. Your code should do the following.

1. For each j, convert data[:][j][:][:] into a 360 x 360 array of real numbers. The number of frames has been chosen to make a square matrix. You may assume, for this assignment, that the number of rows times number of colour components equals the number of frames. (Your code should work for all situations that satisfy number of rows times number of colour components equals number frames.) Compute the incoherence parameter for each j. You will use this in the next step.

2. For each j, using the incoherence parameter computed, and using r = 12, execute the ALTPROJ algorithm on slide 14/38 of the lectures. Set the beta parameter as suggested in Theorem on slide 16/38, one value for each j, using your computed incoherence parameters. But set threshold τ = μ σk+1(M - S(t))/n1/2. Also, you may wish to exit the iterations if you have reached a fixed point for the current stage. Take the epsilon parameter of the algorithm to be 0.01. You will then obtain a foreground matrix and a background matrix. Modify the foreground to be the original matrix minus the background matrix.

3. Reformat your background matrix into BG[1:120][1:160][1:3][1:360]. Do the same for the foreground matrix. Then write them out as BGnnnnn.bmp and FGnnnnn.bmp files in the output/ directory.