Amin Rahimi - Schoolwork - Background Subtraction

The class:

ECE 172 is an introduction to machine intelligence and robotics, though the focus is mainly computer vision and image processing. The topics covered include edge detection, segmentation, texture analysis, object detection, and background subtraction.

 

The project:

This project explores background subtraction with image enhancment as a means of object tracking. We are presented with a video of a lady walking down a hallway. Our goal is to isolate the person and to enclose any pixel group we recognize as being the person in a red rectangle.

Here is the original video:

walking.avi

The video is converted to grayscale. The first five frames are averaged to create a background image. This image is then subtracted from all frames in the video:

subtracted.avi

Each pixel intensity is then compared to a certain value between 0 and 255. A video is then created showing all the subtracted pixels that lie above this value as while:

thresholded.avi

Each frame is closed so that pixels near each other are grouped and so that any holes are filled in:

closed.avi

Each frame is opened to eliminate any outliers and to make the contours smooth:

opened.avi

 

The result:

Here is the resulting video after the figure is enclosed in a red rectangle.

output.avi