1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| #ifndef WARPING_H
#define WARPING_H
#define LARGEUR_ECRAN cimg_library::CImgDisplay::screen_dimx()
#define HAUTEUR_ECRAN cimg_library::CImgDisplay::screen_dimy()
#include "CImg.h"
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include "PDC.h"
//class PDC;
class Warping
{
public:
Warping(const int n_choc, std::string nom_cfp, cimg_library::CImg <unsigned short>, cimg_library::CImg <unsigned short>);
Warping(std::string nom_fichier, cimg_library::CImg <unsigned short>, cimg_library::CImg <unsigned short>);
~Warping();
void lancerWarping();
cimg_library::CImg<float> moyenne(const cimg_library::CImg<unsigned short>& src, int valeur);
cimg_library::CImg<unsigned short> getImageWarped() const;
void setNombrePointsInterpol(int);
void ajusterVisibleEtIR();
void ajouterPDCDepart(int a, int b);
void ajouterPDCArrivee(int a, int b);
void supprimerPDCDepart(int x, int y);
void supprimerPDCArrivee(int x, int y);
void affichageDepart();
void affichageArrivee();
cimg_library::CImg <unsigned short> warp(const cimg_library::CImg <unsigned short>& , const cimg_library::CImg <> &);
private:
PDC pdc;
float coeff_mul;
cimg_library::CImg <unsigned short> image_visible;
cimg_library::CImg <unsigned short> image_IR;
cimg_library::CImg <> champ_deformation;
cimg_library::CImg <unsigned short> image_IR_warped;
int nbpoints_interpol; // nombre de points pour l'interpolation
std::vector< std::pair <int, int> > pointschoisis; //points gardés pour l'interpolation
void nProchePoints(const std::pair <int, int>& H, const std::vector< std::pair <int, int> > &depart, int n);
std::pair<float, float> pointInterpolation(const std::pair <int, int>& H, const std::vector <std::pair <int, int> > &depart);
bool test(const std::vector < std::pair <int, int> > &depart, const std::pair <int, int>& point);
void interpolationLin();
float dist(const std::pair <int, int>& H, const std::pair <int, int>& point);
void inverseWarp();
cimg_library::CImgDisplay depart_disp;
cimg_library::CImgDisplay arrivee_disp;
};
#endif |
Partager