Permalink
Browse files

Small fix

Return the background model from Temporal Median and Adaptive Median
1 parent 469a9d3 commit 08d6dd18ef220deadb7d926593b4e114b30c0c6e @andrewssobral committed Jul 16, 2015
View
@@ -1,6 +1,3 @@
-*.rc eol=crlf
-*.rc2 eol=crlf
*.vcproj eol=crlf
*.bat eol=crlf
*.sln eol=crlf
-*.ico -text
View
@@ -9,4 +9,6 @@ qt_gui/
fet/etc/
*.exe
*.pdb
-vs2010mfc/src/bgslibrary_vs2010_mfc.aps
+vs2010mfc/src/bgslibrary_vs2010_mfc.aps
+*.suo
+vs2010mfc/src/bgslibrary_vs2010_mfc.v12.suo
@@ -61,18 +61,27 @@ void DPAdaptiveMedianBGS::process(const cv::Mat &img_input, cv::Mat &img_output,
bgs.Initalize(params);
bgs.InitModel(frame_data);
+
+ std::cout << "threshold: " << threshold << std::endl;
+ std::cout << "samplingRate: " << samplingRate << std::endl;
+ std::cout << "learningFrames: " << learningFrames << std::endl;
+ std::cout << "showOutput: " << showOutput << std::endl;
}
bgs.Subtract(frameNumber, frame_data, lowThresholdMask, highThresholdMask);
lowThresholdMask.Clear();
bgs.Update(frameNumber, frame_data, lowThresholdMask);
cv::Mat foreground(highThresholdMask.Ptr());
+ cv::Mat background(bgs.Background()->Ptr());
- if(showOutput)
- cv::imshow("Adaptive Median (McFarlane&Schofield)", foreground);
+ if(showOutput){
+ cv::imshow("Adaptive Median FG (McFarlane&Schofield)", foreground);
+ cv::imshow("Adaptive Median BG (McFarlane&Schofield)", background);
+ }
foreground.copyTo(img_output);
+ background.copyTo(img_bgmodel);
delete frame;
firstTime = false;
@@ -69,11 +69,15 @@ void DPPratiMediodBGS::process(const cv::Mat &img_input, cv::Mat &img_output, cv
bgs.Update(frameNumber, frame_data, lowThresholdMask);
cv::Mat foreground(highThresholdMask.Ptr());
+ cv::Mat background(bgs.Background()->Ptr());
- if(showOutput)
- cv::imshow("Temporal Median (Cucchiara&Calderara)", foreground);
+ if(showOutput){
+ cv::imshow("Temporal Median FG (Cucchiara&Calderara)", foreground);
+ cv::imshow("Temporal Median BG (Cucchiara&Calderara)", background);
+ }
foreground.copyTo(img_output);
+ background.copyTo(img_bgmodel);
delete frame;
firstTime = false;
Binary file not shown.
Binary file not shown.

0 comments on commit 08d6dd1

Please sign in to comment.