Opencv Motion detection with tracking

maximus picture maximus · Aug 11, 2011 · Viewed 9.9k times · Source

I need a robust motion detection and tracking in web cam's video frames. The background is always the same. The aim is to identify the position of the object, if possible without the shadows, but not so urgent to remove shadows. I've tried the opencv algorithm for background subtraction and thresholding, but this depends on only one image as a background, what if the background changes a little bit in brightness (or camera auto-focus), I need the algorithm to be strong for little changes as brightness or some shadows.

Answer

jmartel picture jmartel · Aug 12, 2011

Robust method for tracking are part of broad research interests that are being developed all around the world... Here are maybe keys to solve your problem that is very interesting but wide and open.

First a lot of them assumes brightness constancy (therefore what you ask is difficult to achieve). For instance:

  • Lucas-Kanade
  • Horn-Schunk
  • Block-matching

is widely used for tracking but assumes brightness constancy.

Then other interesting ones could be meanshift or camshift tracking, but you need a projection to follow... However you can use a back-projection computed accordingly to certain threshold to fit your needs for robustness...

I'll post later about that, Julien,