%Use these commands to get the required outputs.
imshow(BG1)
%Shows the background image as an average of all the images. Part 1.
imshow(BGstd)
%Shows the standard deviation of the images. Part 2.
for l=1:56
imshow(frgimg(:,:,l));
pause(0.03);
end
%Shows the movie of the difference images. Part 3.
bar(vector_v)
%Shows the bar plot of the difference image. Part 4.
imshow(BG2)
%Shows the image with reduced foreground activity but taking into account
%images with zero values as part of the sample so the average is taken to
%be over 56 samples.
imshow(BG3)
%Shows the image with reduced foreground activity but not taking into
%account images with zero values, so we are talking about a smaller sample.
%That takes care of Part 5.
for m=1:lngthsmpl
imshow(frgimg1(:,:,m));
pause(0.03);
end
%Shows the movie of the new difference images only taking into account the
%images with lower foreground activity than normal. Part 6.
imshow(bkgrnddiff)
imshow(bkgrnddiff1)
%Shows the two differences, with full sample(56) and the reduced
%sample(36). Part 6.