Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Background Subraction Tutorial

Hi i'm implementing the opencv background subtraction MOG and MOG2 technique.The problem i'm facing is this that the moving objects are detected along with some black and white portion of the background.In general or in tutorial the background is black and only moving objects should be detected. What have i missed?? I mean should i set some threshold as well??

click to hide/show revision 2
retagged

updated 2014-04-30 01:53:53 -0600

berak gravatar image

Background Subraction Tutorial

Hi i'm implementing the opencv background subtraction MOG and MOG2 technique.The problem i'm facing is this that the moving objects are detected along with some black and white portion of the background.In general or in tutorial the background is black and only moving objects should be detected. What have i missed?? I mean should i set some threshold as well??

click to hide/show revision 3
No.3 Revision

Background Subraction Tutorial

Hi i'm implementing the opencv background subtraction MOG and MOG2 technique.The problem i'm facing is this that the moving objects are detected along with some black and white portion of the background.In general or in tutorial the background is black and only moving objects should be detected. What have i missed?? I mean should i set some threshold as well??

Mat frame; //current frame 
Mat fgMaskMOG; //fg mask generated by MOG method
Ptr<BackgroundSubtractor> pMOG; //MOG Background subtractor 
namedWindow("Frame"); 
namedWindow("FG Mask MOG"); 
pMOG = createBackgroundSubtractorMOG(); 
VideoCapture capture(videoFilename); 
pMOG->apply(frame, fgMaskMOG); imshow("Frame", frame); 
imshow("FG Mask MOG", fgMaskMOG);
click to hide/show revision 4
No.4 Revision

Background Subraction Tutorial

Hi i'm implementing the opencv background subtraction MOG and MOG2 technique.The problem i'm facing is this that the moving objects are detected along with some black and white portion of the background.In general or in tutorial the background is black and only moving objects should be detected. What have i missed?? I mean should i set some threshold as well??

Mat frame; //current frame 
Mat fgMaskMOG; //fg mask generated by MOG method
Ptr<BackgroundSubtractor> pMOG; //MOG Background subtractor 
namedWindow("Frame"); 
namedWindow("FG Mask MOG"); 
pMOG = createBackgroundSubtractorMOG(); 
VideoCapture capture(videoFilename); 
pMOG->apply(frame, fgMaskMOG);  imshow("Frame", frame); 
imshow("FG Mask MOG", fgMaskMOG);