Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Background subtraction that ive done is as follows:

next frame minus previous frame for every frame

This gives me outlines of moving objects. Now how do i tell if these objects have moved past a particular point in the video?

ANy help preferably in python and opencv code will be greatly appreciated
Posted
Comments
Sergey Alexandrovich Kryukov 20-Feb-15 18:24pm    
I don't even see a point in getting outline for this purpose. Blob recognition would be better, at least more certain intersection with a particular point would be pretty obvious.
—SA

1 solution

Epigraph:
The steering mechanism of the tank is used for turning left, right, and other directions.
:-)
Here is what I would advise: don't do background subtraction, and even less try to get the object outline. Do something, in a way, opposite: blob detection:
http://www.learnopencv.com/blob-detection-using-opencv-python-c[^].

For a blob, you can get a convex hull. As it is convex, it makes it trivial to calculate if some point is inside the blob of not. Please see:
http://docs.opencv.org/trunk/doc/tutorials/imgproc/shapedescriptors/hull/hull.html[^].

Now, it's quite unclear what do you mean "objects have moved past a particular point". It depends on how they moved and what are the criteria. But anyway, with convex hull, it's trivial to determine of some point is, say, is left of the object, top of it, left, and so on.

—SA
 
Share this answer
 
Comments
Member 10732110 21-Feb-15 5:29am    
Thanks :-)
Sergey Alexandrovich Kryukov 21-Feb-15 5:42am    
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900