Reputation: 13523
How can I detect direction and number of objects using Emgu?
Objects are moving in all directions (2D); and a camera is seeing these objects (on a 2D surface). Object may have little differences in shape but are similar enough.
Thanks
Upvotes: 1
Views: 3188
Reputation: 7682
cvAbsDiff
on successive frames (may be on each n
-th and (n - gap)
-th frame) to detect changes and use thresholding in order to get a changes maskcvUpdateMotionHistory
and pass obtained mask as an argumentcvCalcMotionGradient
passing motion history accumulated by previous calls cvSegmentMotion
and for each segment calculate angle using cvCalcGlobalOrientation
Similar steps are coded in motempl.c
example distributed within OpenCV library.
Update
I thought that they've implemented almost complete OpenCV binding and differencies in interface are the result of adding OOP. For instance here is an AbsDiff method. However motion related stuff has different structure. Use MotionInfo
method to get motion angle as in this example (which I found with google search).
Upvotes: 3