root / rgbdslam / external / siftgpu / src / SiftGPU / SiftMatch.h @ 9240aaa3
History | View | Annotate | Download (2.77 KB)
1 | 9240aaa3 | Alex | ////////////////////////////////////////////////////////////////////////////
|
---|---|---|---|
2 | // File: SiftMatch.h
|
||
3 | // Author: Changchang Wu
|
||
4 | // Description : interface for the SiftMatchGL
|
||
5 | ////
|
||
6 | // Copyright (c) 2007 University of North Carolina at Chapel Hill
|
||
7 | // All Rights Reserved
|
||
8 | //
|
||
9 | // Permission to use, copy, modify and distribute this software and its
|
||
10 | // documentation for educational, research and non-profit purposes, without
|
||
11 | // fee, and without a written agreement is hereby granted, provided that the
|
||
12 | // above copyright notice and the following paragraph appear in all copies.
|
||
13 | //
|
||
14 | // The University of North Carolina at Chapel Hill make no representations
|
||
15 | // about the suitability of this software for any purpose. It is provided
|
||
16 | // 'as is' without express or implied warranty.
|
||
17 | //
|
||
18 | // Please send BUG REPORTS to ccwu@cs.unc.edu
|
||
19 | //
|
||
20 | ////////////////////////////////////////////////////////////////////////////
|
||
21 | |||
22 | |||
23 | #ifndef GPU_SIFT_MATCH_H
|
||
24 | #define GPU_SIFT_MATCH_H
|
||
25 | class GLTexImage; |
||
26 | class ProgramGPU; |
||
27 | |||
28 | class SiftMatchGL:public SiftMatchGPU |
||
29 | { |
||
30 | typedef GLint ParameterGL;
|
||
31 | private:
|
||
32 | //tex storage
|
||
33 | GLTexImage _texLoc[2];
|
||
34 | GLTexImage _texDes[2];
|
||
35 | GLTexImage _texDot; |
||
36 | GLTexImage _texMatch[2];
|
||
37 | |||
38 | //programs
|
||
39 | ProgramGPU * s_multiply; |
||
40 | ProgramGPU * s_guided_mult; |
||
41 | ProgramGPU * s_col_max; |
||
42 | ProgramGPU * s_row_max; |
||
43 | |||
44 | //matching parameters
|
||
45 | ParameterGL _param_multiply_tex1; |
||
46 | ParameterGL _param_multiply_tex2; |
||
47 | ParameterGL _param_multiply_size; |
||
48 | ParameterGL _param_rowmax_param; |
||
49 | ParameterGL _param_colmax_param; |
||
50 | |||
51 | ///guided matching
|
||
52 | ParameterGL _param_guided_mult_tex1; |
||
53 | ParameterGL _param_guided_mult_tex2; |
||
54 | ParameterGL _param_guided_mult_texl1; |
||
55 | ParameterGL _param_guided_mult_texl2; |
||
56 | ParameterGL _param_guided_mult_h; |
||
57 | ParameterGL _param_guided_mult_f; |
||
58 | ParameterGL _param_guided_mult_param; |
||
59 | //
|
||
60 | int _max_sift;
|
||
61 | int _num_sift[2]; |
||
62 | int _id_sift[2]; |
||
63 | int _have_loc[2]; |
||
64 | |||
65 | //gpu parameter
|
||
66 | int _sift_per_stripe;
|
||
67 | int _sift_num_stripe;
|
||
68 | int _sift_per_row;
|
||
69 | int _pixel_per_sift;
|
||
70 | int _initialized;
|
||
71 | //
|
||
72 | vector<float> sift_buffer;
|
||
73 | private:
|
||
74 | void AllocateSiftMatch();
|
||
75 | void LoadSiftMatchShadersGLSL();
|
||
76 | int GetBestMatch(int max_match, int match_buffer[][2], float distmax, float ratiomax, int mbm); |
||
77 | public:
|
||
78 | SiftMatchGL(int max_sift, int use_glsl); |
||
79 | virtual ~SiftMatchGL(); |
||
80 | public:
|
||
81 | void InitSiftMatch();
|
||
82 | void SetMaxSift(int max_sift); |
||
83 | void SetDescriptors(int index, int num, const unsigned char * descriptor, int id = -1); |
||
84 | void SetDescriptors(int index, int num, const float * descriptor, int id = -1); |
||
85 | void SetFeautreLocation(int index, const float* locatoins, int gap); |
||
86 | int GetSiftMatch(int max_match, int match_buffer[][2], float distmax, float ratiomax, int mbm); |
||
87 | int GetGuidedSiftMatch(int max_match, int match_buffer[][2], float H[3][3], float F[3][3], |
||
88 | float distmax, float ratiomax, float hdistmax,float fdistmax, int mbm); |
||
89 | }; |
||
90 | |||
91 | |||
92 | #endif
|