#ifndef WATCHPOINT_H
#define WATCHPOINT_H
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <iostream>
#include "Box.h"
#include "Image.h"
#include "Timer.h"
using namespace std;
class WatchPoint : public Box
{
public :
WatchPoint(IplImage *_image,CvPoint p1,CvPoint p2);
~WatchPoint();
void flip_image(IplImage *img);
void set_tolerance(float t);
int get_tolerance(){ return tolerance; }
void set_motion_image(IplImage *img);
void improve_quality(bool called_by_movement = false);
void set_fliptime(int time);
int get_fliptime(){ return fliptime; }
bool movement();
protected :
bool motion;
bool improvement_has_been_made;
int improvement_level;
float tolerance;
IplImage *ipl_initial_image;
IplImage *ipl_current_image;
IplImage *on_motion_image;
std::string window_name;
static int total_watch_point;
int current_watch_point;
void draw(IplImage *img1,IplImage *img2,IplImage *img3);
void createRgbImage(RgbImage &initial_image,RgbImage ¤t_image);
static Timer *timer;
int spawn_sec;
int fliptime;
cv::VideoWriter *writer;
int counter;
};
#endif