// MotionDetector.h
// Chris Pocock 2014

#ifndef MOTIONDETECTOR_H_
#define MOTIONDETECTOR_H_

#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <fstream>

using namespace cv;

class MotionDetector {

private:

	// Class variables
	int h;
	int w;

	int detect_count;
	int nodetect_count;

	int safeTopMost;
	int safeLeftMost;
	int safeBotMost;
	int safeRightMost;

	int min_movement;
	int max_min_movement;
	int max_movement;
	int max_max_movement;

	int minArea;
	int maxArea;
	int max_minArea;
	int max_maxArea;

	int topMost;
	int botMost;
	int rightMost;
	int leftMost;

	int xpos;
	int ypos;

	Rect oldRect;

public:

	// Class methods
	MotionDetector(int,int);
	virtual ~MotionDetector();
	void searchForMovement(Mat&, Mat&, std::ofstream*,int);
	void setupUi();
	void reset();
	int getSafeL();
	int getSafeR();
	int getSafeT();
	int getSafeB();
	int getDetectCnt();
	int getNoDetectCnt();

};

#endif
