computer vision - how to track object in scene from far to near in opencv -
i need track cars on road, possible monitor object change gmm, cars on road change size far near, algorithm suggested track object far near or near far?
gaussian mixture models (gmm) isn't bad choice modelling cars objects not sure how model background since can more heterogeneous , require large mixture. learning gmm em (expectation maximization) can processing intensive. advice start using simple histograms model object collection of bins counts instead of collection of gaussian distributions. below describe 2 such methods implemented in opencv.
the simplest way start tracking using opencv using meanshift function. related method, camshift modified version of meanshift corrects size , orientation of initial bounding box when object change size or orientation. can find corresponding demo in camshiftdemo.c of opencv package.
the input both meanshift , camshift probability map each pixel indicates (approximately) chance belongs object (and possibly background). 1 way create such map calculate histogram of object want track , backproject image, if, example, histogram has 2 bins count 90 i=255 , count 10 i=100 each pixel intensity 255 gets 90% probability , each pixel intensity 100 gets 10% (see more detailed explanation histogram backprojection).
note these methods based on histograms of features such intensity, color, or virtually else. can try add more feature histograms , correct probability map relating object histogram histogram of background. can update histograms @ each frame compensate object , background changes.
now, in short, how works. meanshift, name suggests, moves initial window according position of probability mean (calculated within window) , mean typically biased (shifted) away window center , towards highest probability cluster (hopefully object). process repeats iteratively until convergence.
of course, if initial guess far away real probability maximum window can stuck in local maximum has nothing object. high frame rate important since guarantee object doesn't move between frames , can use previous location reasonable guess window position initialization.
Comments
Post a Comment