To detect a moving object in a video feed with constantly changing background

4 views (last 30 days)
My intention is to capture real time video sequence from a camera fixed atop a moving car, and scan continuously for any intrusion (object) on the road. On detecting the object,there are some inputs to be provided to a micro controller for further action.
My question is, Since the background of the image is constantly changing (ie the road) , how does my camera know that the object entering the frame is the intrusion and not my changing landscape?
how do I start exactly? Please help. Any pointers would be appreciated.

Accepted Answer

Image Analyst
Image Analyst on 16 Aug 2012
Did you search the forum and mathworks.com for "tracking"? There are numerous discussions and examples.
  4 Comments
Image Analyst
Image Analyst on 17 Aug 2012
Well you might just have to spend some time learning about it. One simple way to find background is to take the mode gray level over a long time. But I think most sophisticated methods use Gaussian Mixture Models, though it's not my filed so I'm not really sure of the advantages and disadvantages of the various ways. Once you have the background, you can cast both the image and your background image to single (so subtracting won't clip at zero), and then subtract the images and look for pixels above some threshold value. Then clean it up some using bwareaopen() to get rid of small noise specks or tiny objects you don't care about. Then call regionprops() to measure things about the objects that are left. I'm sure you'll learn more and make that general algorithm better once you get into it.
pooja
pooja on 22 Nov 2012
This sort of helps! Thresholding , subtracting and cleaning it up. Will try it out on a smaller video .

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!