0

I'd like to be able to detect if a camera's line of sight has been changed, thus seeing a sudden change in the background. Surely there's a clever way to do this?

When it comes to tracking changes in a video stream, it seems most of the work is related to separating the background from the foreground so that objects moving around in the image(s) can be identified using background subtraction or the like.

I'm using EmguCV (OpenCV) as my tool of choice...in case there's any particular suggestions around available algorithms in this tool set. I've looked experimented with the background/foreground subtractors available in Emgu. They're not bad for detecting foreground changes, but I don't see how to use them to watch for this type of event. Surely I'm overlooking something obvious.

Thanks.

Bryan Greenway
  • 703
  • 11
  • 30

1 Answers1

1

I have used BackGround subtraction method before and it worked really very well. So, just as a rough idea i can suggest you something.

Ok, you want to check the change in the image so, we can assume that most of the time the scene will be constant. If the scene remain constant then your background image will be constant. But if there is any change in the scene then the background image will try to change.

Strategy: You can try to calculate the correlation between the current BG frame and a previous BG frame (may be 5 frame before or something like that). If the Correlation value is high i.e. ~ 0.99999 then there is not change in the scene otherwise something has changed.

Just an idea !!

skm
  • 5,015
  • 8
  • 43
  • 104
  • thanks for the response. I think your idea has a lot of promise. I'm currently using EmguCV's (the C# wrapper of OpenCV) FGDetector. It uses one of a couple of statistical models to build the background...however, I don't see a way to actually get the background image that it builds...just the foregroundMask and backgroundMask...neither of which look like background image. I would need to somehow get that image. It's not obvious to me how to do that. More investigation, and maybe another Stackoverflow question. Thanks again! – Bryan Greenway Feb 26 '14 at 22:03
  • The program automatically generates the BG image based upon GMM statistics. Or you can say that it learns BG image. And whatever things are not a part of BG image, it consider those things as FG image. – skm Feb 27 '14 at 00:29
  • Agreed. However, it seems that with the OpenCV implementation, the background image is accessible for the MOG and MOG2 algorithms, but is not (as far as I can tell) for the GMG algorithm. Too bad, because the GMG algorithm appears to be more robust. – Bryan Greenway Feb 27 '14 at 04:17
  • Have a check here I've provided an example of forming the background image http://www.emgu.com/wiki/index.php?title=Background_Image Cheers – Chris Feb 27 '14 at 08:39
  • @Chris - Thanks for the advice! I will definitely give that a try. – Bryan Greenway Mar 04 '14 at 18:42