0

I'm trying to make some moving object detection (segmentation of foreground moving object from background) with slow illumination changes (= background change). Sometimes osme parts of the object are of the same size of the background, so the blob detection is not robust or accurate.

I think I can get better results combining Background subtraction (color and gradient) and Optical flow. From opencv examples I've tried the code of both and it easy to understand but I don't know how I can combine them.

Any hints or advice are welcome!

nkint
  • 11,513
  • 31
  • 103
  • 174

1 Answers1

-1
  1. call goodfeaturestotrack to get track points.
  2. get the corresponding points in the next frame using optical flow.
  3. get a bounding box of the points in that frame.
  4. select a region (ROI) little larger than the bounding box you get in step 3.
  5. subtract this ROI from the same ROI but with respect to your backfround. So its currentframeROI - backgroundROI = moving object where currentFrameROI = currentFrame(ROI) and backgroundROI = background(ROI).Its good to choose the first frame as the background or the frame where objects are stationary.
  6. this even works for multiple moving objects.
rotating_image
  • 3,046
  • 4
  • 28
  • 46
  • thanks for the answer! but i didn't got it completely.. can you explain the concept behind it? but do you have some reference for this procedure? i mean, papers or related works? – nkint Apr 03 '13 at 20:11
  • I have implemented it in one of my applications...I will try to update my answer with some diagrams... – rotating_image Apr 04 '13 at 02:19
  • ok thank you very much! "subtract this ROI from the same ROI but with respect to your background" is not clear.. i mean, what is the advantage of a normal background subtractor like the opencv buildin? – nkint Apr 04 '13 at 07:53