Assignment 3
The program is enclosed with the mail. There are two parts to it. The first part is the actual program which creates all the required results, and the second part (results) contains the commands to see the results. There are certain things that I want to comment on the program.
1. I have used certain steps which are seemingly not required, but I used them just to ensure that I understand clearly as to what I'm doing in the program.
2. The time and space requirements of the program can be easily improved, (for example, by reducing the number of zero matrices that I created during the program, or by reducing the number of variables), but I ended up using a lot of variables that are not really required.
3. I have used two different ways to get the background images where the foreground activity was less than the average. The first one(BG2) uses all the 56 frames as total, while the second one(BG3) uses only 36. One impact is that BG2 is more blurred, since we are using only 36 frames and averaging it over 56! So that process is definitely not advisable. Image BG3 on the other hand uses only 36 frames and the results are evident with a much sharper picutre. The difference between BG1 and BG3 also reflect the same thing.

Vector v: I have used the variable vector_v for v. The bar chart shows increased foreground pixels in the middle frames of the movie. The reason is that as the moving object comes closer to the detection system the foreground activity increases, increasing the number of foreground pixels. This is also seen in the movie of the forground pixels.

The second version of the system is better than the first one since it reduces the impact of the moving object and hence has a better representation of the background image. Even though the number of frames decreased the quality of the image improved on account of using frames with lesser foreground activity. The new background image is much more sharper and clearer in details than the older one.