2018-07-23 17:30:57 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <vector>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#ifdef _OPENMP
|
|
|
|
#include <omp.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "demo_lib_sift.h"
|
|
|
|
#include "io_png/io_png.h"
|
|
|
|
|
|
|
|
#include "library.h"
|
|
|
|
#include "frot.h"
|
|
|
|
#include "fproj.h"
|
|
|
|
#include "compute_asift_keypoints.h"
|
|
|
|
#include "compute_asift_matches.h"
|
|
|
|
|
|
|
|
# define IM_X 800
|
|
|
|
# define IM_Y 600
|
|
|
|
|
|
|
|
// struct image
|
|
|
|
// {
|
|
|
|
// vector<float> img;
|
|
|
|
// int width;
|
|
|
|
// int height;
|
|
|
|
// } image;
|
|
|
|
|
2018-07-24 14:45:28 +02:00
|
|
|
typedef vector< vector< keypointslist > > asift_keypoints;
|
|
|
|
|
2018-07-23 17:30:57 +02:00
|
|
|
class ASIFT_matcher
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ASIFT_matcher();
|
2018-07-24 14:45:28 +02:00
|
|
|
// virtual ~ASIFT_matcher();
|
2018-07-23 17:30:57 +02:00
|
|
|
|
|
|
|
bool addReference(const char* image, int num_tilts);
|
|
|
|
bool match(const char* image, int num_tilts);
|
2018-07-24 14:45:28 +02:00
|
|
|
void print() const;
|
2018-07-23 17:30:57 +02:00
|
|
|
|
2018-07-24 14:45:28 +02:00
|
|
|
void setResizeImg(bool resize_imgs){ _resize_imgs=resize_imgs;}
|
|
|
|
|
|
|
|
const vector < int >& getNbMatch()const{ return _num_matchings;}
|
|
|
|
const vector< matchingslist >& getMatch()const{ return _matchings;}
|
|
|
|
|
2018-07-23 17:30:57 +02:00
|
|
|
protected:
|
|
|
|
//QUESCEQUESAI
|
2018-07-24 14:45:28 +02:00
|
|
|
int _verb;// = 0;
|
2018-07-23 17:30:57 +02:00
|
|
|
|
|
|
|
//Reference Images
|
|
|
|
// vector< image > _im_refs;
|
2018-07-24 14:45:28 +02:00
|
|
|
unsigned int _nb_refs;// = 0;
|
2018-07-23 17:30:57 +02:00
|
|
|
vector< vector< float > > _im_refs;
|
|
|
|
vector< pair<int,int> > _size_refs; //Width/Height
|
|
|
|
|
|
|
|
//ASIFT Keypoints
|
|
|
|
vector< int > _num_keys;
|
|
|
|
vector< int > _num_tilts; //Speed VS Precision
|
2018-07-24 14:45:28 +02:00
|
|
|
vector< asift_keypoints > _keys;
|
2018-07-23 17:30:57 +02:00
|
|
|
|
|
|
|
//Matchs
|
|
|
|
vector < int > _num_matchings;
|
|
|
|
vector< matchingslist > _matchings;
|
|
|
|
|
|
|
|
siftPar _siftParam;
|
|
|
|
|
|
|
|
//Flags
|
2018-07-24 14:45:28 +02:00
|
|
|
bool _resize_imgs;// = false;
|
2018-07-23 17:30:57 +02:00
|
|
|
};
|