Mobile camera as a webcam in MATLAB

lego car

Recently I bought this car and assembled it and I wanted to install wireless camera on top of that but I didn’t have wireless camera. I read in lifehacker that IP Webcam turns your Android phone into a wireless camera. So, the general solution would need two parts, one to broadcast the data from the device and another part to read this data into Matlab.

  • Install IP Webcam app from your mobile play store.
  • Open the app, tweak the settings (login/pass, resolution, image quality), set the desired resolution (will impact the speed!)
  • Scroll to the bottom and tap on ‘Start Server’
  • In the camera preview window, you can see the url at the bottom of the screen.
  • Open MATLAB and use below code to obtain a live preview window. Note that this uses JPG files for discrete frames, which is probably not the fastest way. The app can stream the video and/or audio in multiple ways.

mobile camera image

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