Figure vs. Ground Segmentation

#include <cv.h>
#include "opencv2/video/video.hpp"
#include "opencv2/highgui/highgui.hpp"
 
void background_model_learning_test()
{
	int history = 1000;
	double varThreshold = 100;
	cv::Ptr<cv::BackgroundSubtractorMOG2> myBackgroundForegroundModel
		= cv::createBackgroundSubtractorMOG2( history, varThreshold, false );
 
	cv::VideoCapture c("W:\\data\\humaneva\\orig\\I\\S1\\Image_Data\\Walking_1_(C1).avi");
 
	cv::Mat img,fgmask;
 
	int i = 0;
	while (1)
	{
 
		c >> img;
		if (img.empty())
			break;
 
		myBackgroundForegroundModel->apply( img, fgmask, -1.0 );
 
		cv::imshow( "img", img );
		cv::imshow( "fmask", fgmask );
		cv::waitKey(1);
 
		char fname[500];
		sprintf_s(fname, "W:\\tmp\\%04d.png", i++);
		cv::imwrite(fname, fgmask);
	}
 
 
}
 
 
int main( int argc, const char* argv[])
{
	background_model_learning_test();
}

You need to install a Flash Player to watch this video!

 
public/figure_vs._ground_segmentation.txt · Last modified: 2013/09/12 08:47 (external edit) · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki