Ask Your Question

***Background separation of video stream by using static background image***

asked 2013-06-12 11:33:16 -0600

Vijay Kakani gravatar image

Hi Everyone,

I'm new to Open CV and present working on my project which needs background separation done with OpenCV.

Two days back I configured Open CV with Visual Studio C++ 2010 and worked on small tutorials from this blog

By I am not sure about how to make the BGS from a video file and background image I am having on my disk...

Can anyone please suggest me with some code that could help me in extracting the background from video (type: quick time movie)by using static background image (jpeg).

Thanks in anticipation

Kindest Regards,

Vijay Kakani

edit retag flag offensive close merge delete


May be I do not fully understand your question, but what does mean "using static background image"? If your already have it, why you need to separate it?

Victor1234 gravatar imageVictor1234 ( 2013-06-12 14:37:24 -0600 )edit

Hi Victor1234, Firstly, thanks for your prompt response. I have a jpeg picture (one static frame of video clip), can I use that static picture to separate the background in the whole video clip (quick time movie {.mov} )??? Sorry for not conveying the question properly

Vijay Kakani gravatar imageVijay Kakani ( 2013-06-21 11:02:31 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-06-12 16:27:17 -0600

If you have a picture of your scene, without any object of interest, you could just do a simple thresholding (absdiff). The results will depend on your scene, and if there is illumination change (almost the case instead you are using a control light).

If you could take more than just an image, look at the background subtraction of OpenCV BackgroundSubtractor or VIBE. You could also look at the sample bgfg_segm.cpp and bgfg_gmg.cpp in OpenCV/samples/cpp.

edit flag offensive delete link more


Thank you very much Mr. Mathieu Barnachon; I am working according to your suggestions I'm new to Open CV. Thanks a million for your valuable information. I have a small question, If possible please suggest me with the solution. I am posting it as a new question

Vijay Kakani gravatar imageVijay Kakani ( 2013-06-21 10:57:05 -0600 )edit

Question Tools


Asked: 2013-06-12 11:33:16 -0600

Seen: 423 times

Last updated: Jun 12 '13