#ifndef _FUNCTIONS_TRACKING_H_
#define _FUNCTIONS_TRACKING_H_
#include "graph.h"
#include "graph.cpp"

#include "maxflow.cpp"

#include "../lib/CImg.h"
using namespace cimg_library;
typedef Graph<double,double,double> GraphType;
void writeIMG(CImg<int> &Y);
void initialisation(CImg<int> &a, CImg<bool> &b);
CImg<double> optflow(const CImg<>& xsrc,const CImg<>& xdest,const double smooth,const double precision,const int pnb_scale, const CImg<bool> &masque);
CImg<double> optmonoflow(const CImg<>& I1,const CImg<>& I2,const CImg<>& u0, const double smooth, const double precision, const CImg<double> &m);
CImg<double>  RGB2gris(CImg<double>  A);

CImg<double> estim_histo(const CImg<double> &histo2,double &nb_histo,  const CImg<bool> &Objet_precedant_visible,const CImg<int> &Im_precedante);
void distance(const CImg<double> &in,  CImg<double> &D, double d);
void distance3(const CImg<double> &in,  CImg<double> &D, double d);
void distance2(CImg<double> &D,const  CImg<bool> &in);
void Interpolation_vitesse(CImg<double> &Carte_vitesse,CImg<bool> & Objet_precedant,CImg<bool> &corner,CImg<double> &vitesse_moyenne);
void harris_detect(int t,CImg<bool>& corner,const char *seq,const char *type,const int format, int bord);

void border(int &lowx, int &lowy, int hc, int wc, double x, double y, int s);
void opflow_atpoints(CImg<double> &Im_courante_gris,CImg<double>& Im_precedante_gris, CImg<bool> &Objet_precedant_visible, CImg<bool> & corner,CImg<double>& flot, double bord_opt, double seuil_max, int nbscale,int sliding);
void construct_pyramid(CImg<double> &Im,  CImgList<double> & pyr, int nbscale) ;
void ComputeXDerivative(CImg<double> & im1, int s, CImg<double> & dI);
void ComputeYDerivative(CImg<double>  &im1, int s, CImg<double> & dI);
void ComputeTimeDerivative(CImg<double> & im1,CImg<double>  &im2,  int s, CImg<double> & Ft);
double trunk(double a);
double Max(double a , double b);
double Min(double a , double b);
double Min(double a , double b,double c);
double Max(double a , double b,double c);
void cree_reg(CImg<int> &Im_label, int l, CImg<double> &edge_poids_courant,CImg<int> &pos_image, GraphType *g, int a, int b, int c);
void cree_reg_obj(CImg<bool> &Objet_precedant, int l, int o, CImg<bool> &Objet_label,CImg<int> &pos_objet, GraphType *g, int a, int b, double r2)  ;
int Max(int a, int b);
int Min(int a , int b);
int absolue(int a);
double absolued(int a);
double absolued(double a);
double absolue(double a);

int nbc,nbl;

double absolu(double a);

#endif

