c++ - Opencv Object tracking and count objects which passes ROI in video frame -
i working on opencv application need count object motion can detected camera. camera still , did object tracking opencv , cvblob referring many tutorials.
i found similar question: object counting
and found similar http://labs.globant.com/uncategorized/peopletracker-people-and-object-tracking/
i new opencv , i've gone through opencv documentation couldn't find related count moving objects in video.
can 1 please give me idea how specially counting part. read in article above, count people crosses virtual line.is there special algorithm detect object crossing line?
your question might broad when asking general technique count moving objects in video sequences. give hints might you:
- as usual in computer vision, there not exist 1 specific way solve problem. try do research people detection, background extraction , motion detection have wider point of view
- state more user requirements of system, namely how many people can occur in image frame? things complicated when track more 1 person. furthermore, can other moving objects appear on image (e.g. animals)? if no , 1 person supposed track, answer problem pretty easy, see explanation below. if yes, have more research.
- usually cannot find in opencv api direct solution computer vision problem, namely there not such method solve directly problem of people counting. sure there exists paper, reference (usually scientific stuff) can adopted solve problem. there no method "count people crossing vertical line". have solve problem merging algorithms together.
in link have provided 1 can see use algorithm background extraction determined non-moving background , moving foreground (in our case, walking person). not sure if use more (or sophisticated), information background extraction sufficient start problem solving.
and here contribution solution. assuming 1 person walks in front of stable placed camera , no other objects motion can observed, following:
- save frame when no person moving in front of camera, used later reference background
- in loop, apply background detector extract parts in image representing motion (mog or can calculate difference between background , current frame, followed binary threshold , blob counting, see answer here)
- from assumption, 1 blob should detected (if not, use metrics chooses "the best one". example choose 1 maximum area). blob person track. knowing position on image, compare position of "vertical line". objects moving left right exiting , right left entering.
remember solution work in case of assumption stated.
Comments
Post a Comment