开发者

Quick motion detection in opencv

开发者 https://www.devze.com 2023-02-17 22:27 出处:网络
I want to detect motion in a quick way before tracking, will absDiff() (or cmpS() ) between 2 frames be sufficient to achieve this or should I consider something more? Pls keep in mind I\'m completely

I want to detect motion in a quick way before tracking, will absDiff() (or cmpS() ) between 2 frames be sufficient to achieve this or should I consider something more? Pls keep in mind I'm completely new to vision processing an开发者_运维知识库d opencv :)

Thanks


If you want to detect the specific object's motion, you would need 'connected components' calculation. Refer to http://www.bukisa.com/articles/263221_connected-components-using-opencv


There is a pretty good explanation in chapter 9 of the book 'Learning OpenCV: Computer Vision with the OpenCV Library'. Depending on your scene (indoors/outdoors, lighting conditions etc) the learning stage of your algorithm consists of accumulating the difference between frames in a buffer, then filtering the result using morphology operations to cancel noise. Or, when basic cvAbsDiff detects spurious motion, you implement a little bit more complicated 'codebook' algorithm instead.

The source code is available on the OReilly's site.


There's no quick and easy way. The method I'm trying is to build a background image over time, subtract the foreground which would be anything not part of the background and put a roi over the foreground object.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号