Background subtraction

Background subtraction, also known as Foreground detection, is a technique in the fields of image processing and computer vision wherein an image’s foreground is extracted for further processing (object recognition etc.). Generally an image’s regions of interest are objects (humans, cars, text etc.) in its foreground. Background subtraction is a widely used approach for detecting moving objects in videos from static cameras. The rationale in the approach is that of detecting the moving objects from the difference between the current frame and a reference frame, often called “background image”, or “background model.

The basic method of background subtraction is to compare |frame – background| with
a pre-defined threshold (theta). If the difference of a pixel is larger than theta, then classify it as foreground; otherwise, claim that it is background.

(video dataset)

Continue reading

Face and eyes detection using Haar Cascades

OpenCV algorithm is currently using the following Haar-like features which are the input to the basic classifiers:

Haar-like features

Haar-like features

Cascading is a particular case of ensemble learning based on the concatenation of several classifiers, using all information collected from the output from a given classifier as additional information for the next classifier in the cascade. Unlike voting or stacking ensembles, which are multi-expert systems, cascading is a multistage one.

stages Pictures source

Continue reading

Hand detection (using skin tone)

Hand detection using skin tone is the simplest way to detect hand. Problems of this method are the background should not contain skin colored, really sensitive to light and shape of background!

Continue reading

Object tracking

Tracking of the blue object (and also my glasses which are blue as well ;D)

Tracking of the blue object (and also my glasses which are blue as well ;D)

  1. Take each frame of the video
  2. Convert from BGR to HSV color-space (HSV, it is more easier to represent a color than RGB color-space)
  3. We threshold the HSV image for a range of blue color
  4. Now extract the blue object, we can do whatever on that image we want.

Continue reading

Break Time

Break Time!

I wrote a program that give you break by playing your favourite video(youtube):

import webbrowser
import time

total_breaks=3
break_count=0

print("This program started on" +time.ctime())
while (break_count< total_breaks):
time.sleep(10)
webbrowser.open("http://www.youtube.com/watch?v=-2U0Ivkn2Ds&list=FLapMSp10Zw5H6trxm9ynGAw")
break_count=break_count+1