himrep
SiftGPU_Extractor.h
1 
2 #ifndef __SIFT_GPU_EXTRACTOR_H__
3 #define __SIFT_GPU_EXTRACTOR_H__
4 
5 #include <opencv2/opencv.hpp>
6 
7 #if defined(__APPLE__)
8  #include <OpenGL/gl.h>
9  #include <OpenGL/glu.h>
10 #else
11  #include "GL/gl.h"
12 #endif
13 
14 #if !defined(SIFTGPU_STATIC) && !defined(SIFTGPU_DLL_RUNTIME)
15 // SIFTGPU_STATIC comes from compiler
16 #define SIFTGPU_DLL_RUNTIME
17 // Load at runtime if the above macro defined
18 // comment the macro above to use static linking
19 #endif
20 
21 
22 #ifdef SIFTGPU_DLL_RUNTIME
23  #include <dlfcn.h>
24  #define FREE_MYLIB dlclose
25  #define GET_MYPROC dlsym
26 #endif
27 
28 #include "SiftGPU.h"
29 
30 #include <vector>
31 using namespace std;
32 
33 class SiftGPU_Extractor
34 {
35 private:
36  ComboSiftGPU *combo;
37  SiftMatchGPU *matcher;
38  SiftGPU *sift;
39 
40  vector<SiftGPU::SiftKeypoint> keypoints_grid;
41 
42 public:
43  SiftGPU_Extractor();
44 
45  int getFeatureNum();
46 
47  bool setDenseGrid(int width, int height, int step, int scale);
48  bool setDenseGrid(IplImage *img, int step, int scale);
49 
50  bool extractSift(IplImage *img, vector<SiftGPU::SiftKeypoint> *keypoints=NULL, vector<float> *descriptors=NULL, int feature_size=128);
51  bool extractDenseSift(IplImage *img, vector<SiftGPU::SiftKeypoint> *keypoints=NULL, vector<float> *descriptors=NULL, int feature_size=128);
52 
53  bool getFeatureVector(vector<SiftGPU::SiftKeypoint> *keypoints, vector<float> *descriptors, int feature_size=128);
54 };
55 
56 
57 
58 #endif
59 
60 
61