Linas Kondrackis
  • Portfolio

Click on the images to enlarge.

Person Detection in series of images

Computer Vision • OpenCV • Python • Numpy

We were given a set of a over 6000 images, depicting one working day of a man in his office. The task was to track the person and count the number of frames he was performing a certain activity.

For this task, we have devised an image player to play the images as a video and allow playback control. It would also show any contours that we would detect using the methods we develop later.

Initial observations of inter-frame difference showed that some areas produce movement but can easily be masked. E.g. computer screen and the window were masked, as they produced strong changes, irrelevant to our task. After RGB normalization we have then implemented and tested background subtraction methods of inter-frame difference, mean subtraction, Gaussian subtraction, adaptive subtraction.

The resulting motion was morphologically transformed to provide a centroid of the detected person. Lastly, as the camera viewpoint never changed, the activities of the person were mapped to locations, allowing very easy classification.

Report: Google Drive

For code, scroll down to the end of the report or contact me.



  • Category: Projects
  • Date: January 2016 - February 2016
  • Collaborators: Dalius Grazinskis

Detected motion of a person and the centroid. This is how the final result that uses a Gaussian model of the background looked under the hood.

Detected motion of a person and the centroid, also using the Gaussian background model. This time, the detection boundary and centroid are superimposed on the input image.

The distance between two consecutive centroids (or potentially the median difference of more), showing large motions or outliers.

Mask of the room, before being applied to the images. The static mask can be used as the viewpoint of the camera never changes.

Background subtraction, using the Gaussian background model, before applying morphological transformations.

Regions of motion, detected using simple background subtraction, with morphological transformations applied.