Ask Your Question

Retrieving Foreground from static background

asked 2013-02-23 05:14:42 -0600

ranger gravatar image

0 down vote favorite

I am working on a video processing project which involves tracking objects which can be stationary or moving. The actual static background is available at the beginning. I have writeen a simple code for getting the foreground :

cv::Mat temp;
threshold(temp, temp, 128, 255, CV_THRESH_BINARY | CV_THRESH_OTSU);

But unfortunately the code doesnt seem to work well in retrieving the foreground objects...I will be glab if someboday provide me with some suggestions and bits of code...

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-02-25 08:29:54 -0600

Try the background subtract methods of OpenCV here and specially the Mixture of Gaussian here, and the associated sample (cpp/segment_object.cpp) for an example.

edit flag offensive delete link more

Question Tools


Asked: 2013-02-23 05:14:42 -0600

Seen: 1,468 times

Last updated: Feb 25 '13