Go to the documentation of this file.00001
00002
00003
00004
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022
00023 #ifndef GPU_SIFT_MATCH_H
00024 #define GPU_SIFT_MATCH_H
00025 class GLTexImage;
00026 class ProgramGPU;
00027
00028 class SiftMatchGL:public SiftMatchGPU
00029 {
00030 typedef GLint ParameterGL;
00031 private:
00032
00033 GLTexImage _texLoc[2];
00034 GLTexImage _texDes[2];
00035 GLTexImage _texDot;
00036 GLTexImage _texMatch[2];
00037
00038
00039 ProgramGPU * s_multiply;
00040 ProgramGPU * s_guided_mult;
00041 ProgramGPU * s_col_max;
00042 ProgramGPU * s_row_max;
00043
00044
00045 ParameterGL _param_multiply_tex1;
00046 ParameterGL _param_multiply_tex2;
00047 ParameterGL _param_multiply_size;
00048 ParameterGL _param_rowmax_param;
00049 ParameterGL _param_colmax_param;
00050
00052 ParameterGL _param_guided_mult_tex1;
00053 ParameterGL _param_guided_mult_tex2;
00054 ParameterGL _param_guided_mult_texl1;
00055 ParameterGL _param_guided_mult_texl2;
00056 ParameterGL _param_guided_mult_h;
00057 ParameterGL _param_guided_mult_f;
00058 ParameterGL _param_guided_mult_param;
00059
00060 int _max_sift;
00061 int _num_sift[2];
00062 int _id_sift[2];
00063 int _have_loc[2];
00064
00065
00066 int _sift_per_stripe;
00067 int _sift_num_stripe;
00068 int _sift_per_row;
00069 int _pixel_per_sift;
00070 int _initialized;
00071
00072 vector<float> sift_buffer;
00073 private:
00074 void AllocateSiftMatch();
00075 void LoadSiftMatchShadersGLSL();
00076 int GetBestMatch(int max_match, int match_buffer[][2], float distmax, float ratiomax, int mbm);
00077 public:
00078 SiftMatchGL(int max_sift, int use_glsl);
00079 virtual ~SiftMatchGL();
00080 public:
00081 void InitSiftMatch();
00082 void SetMaxSift(int max_sift);
00083 void SetDescriptors(int index, int num, const unsigned char * descriptor, int id = -1);
00084 void SetDescriptors(int index, int num, const float * descriptor, int id = -1);
00085 void SetFeautreLocation(int index, const float* locatoins, int gap);
00086 int GetSiftMatch(int max_match, int match_buffer[][2], float distmax, float ratiomax, int mbm);
00087 int GetGuidedSiftMatch(int max_match, int match_buffer[][2], float H[3][3], float F[3][3],
00088 float distmax, float ratiomax, float hdistmax,float fdistmax, int mbm);
00089 };
00090
00091
00092 #endif
00093