how to get direction of moving object?

asked 2013-11-22 04:43:50 -0600

rokasma gravatar image

updated 2013-11-22 04:54:03 -0600

Hi,

I am writing a code for moving objects detection, but now i want to count in/out objects. Now i can count olny how many objects cross the line. What is the best way to do that?

For detection I use frames substraction (first frame with current frame).

edit retag flag offensive close merge delete

Comments

Google : opencv + tracking

That is about all you actually need...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-11-22 04:57:07 -0600 )edit

hahhhahaha... I know how to track an object, but i don't know how to determine if object is comming in or out

rokasma gravatar imagerokasma ( 2013-11-22 05:07:34 -0600 )edit

I'm not experienced on the matter, but, if you know an object previous and actual position,isn't it trivial to determine the direction of movement? Maybe you didn't explain the problem very well

Pedro Batista gravatar imagePedro Batista ( 2013-11-22 05:22:44 -0600 )edit

@rokasma, if you actually understand the tracking, then indeed, defining a direction between subsequent points is easy. Just define a function for your border. If the applied coordinates are filled into the equation, you can define where the point lies, even when it is exact on the border.

Doesn't that solve your problem?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-11-22 06:12:55 -0600 )edit