************************************************** */
#include "stdafx.h"
#include "opencv2/core/core.hpp"
#include "opencv2/video/background_segm.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/legacy/legacy.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
using namespace std;
using namespace cv;
//VARIABLES for CODEBOOK METHOD:
CvBGCodeBookModel* model = 0;
const int NCHANNELS = 3;
bool ch[NCHANNELS]={true,true,true}; // This sets what channels should be adjusted for background bounds
const char *keys = //input information
{
"{nf|nframes |10 |frames number}"
"{c |camera |false |use the camera or not}"
"{mf|movie_file|tree.avi |used movie video file}"
};
int main(int argc, const char** argv)
{
IplImage* rawImage = 0, *yuvImage = 0; //yuvImage is for codebook method
IplImage *ImaskCodeBook = 0,*ImaskCodeBookCC = 0;
//camera information
CvCapture* capture = 0;
double BrightValue=0.0f;
double GaintVa
#include "stdafx.h"
#include "opencv2/core/core.hpp"
#include "opencv2/video/background_segm.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/legacy/legacy.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
using namespace std;
using namespace cv;
//VARIABLES for CODEBOOK METHOD:
CvBGCodeBookModel* model = 0;
const int NCHANNELS = 3;
bool ch[NCHANNELS]={true,true,true}; // This sets what channels should be adjusted for background bounds
const char *keys = //input information
{
"{nf|nframes |10 |frames number}"
"{c |camera |false |use the camera or not}"
"{mf|movie_file|tree.avi |used movie video file}"
};
int main(int argc, const char** argv)
{
IplImage* rawImage = 0, *yuvImage = 0; //yuvImage is for codebook method
IplImage *ImaskCodeBook = 0,*ImaskCodeBookCC = 0;
//camera information
CvCapture* capture = 0;
double BrightValue=0.0f;
double GaintVa