Debian Codegraph @

src/thirdparty/SiftGPU/SiftMatchCU.h

raw
1 ////////////////////////////////////////////////////////////////////////////
2 // File: SiftMatchCU.h
3 // Author: Changchang Wu
4 // Description : interface for the SiftMatchCU
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 [email protected]
19 //
20 ////////////////////////////////////////////////////////////////////////////
21
22
23
24 #ifndef CU_SIFT_MATCH_H
25 #define CU_SIFT_MATCH_H
26 #if defined(SIFTGPU_CUDA_ENABLED)
27
28 class CuTexImage;
29 class SiftMatchCU:public SiftMatchGPU
30 {
31 private:
32 //tex storage
33 CuTexImage _texLoc[2];
34 CuTexImage _texDes[2];
35 CuTexImage _texDot;
36 CuTexImage _texMatch[2];
37 CuTexImage _texCRT;
38
39 //programs
40 //
41 int _num_sift[2];
42 int _id_sift[2];
43 int _have_loc[2];
44 int _loc_ncomp[2];
45
46 //gpu parameter
47 int _initialized;
48 vector<int> sift_buffer;
49 private:
50 int GetBestMatch(int max_match, uint32_t match_buffer[][2], float distmax, float ratiomax, int mbm);
51 public:
52 SiftMatchCU(int max_sift);
53 virtual ~SiftMatchCU(){};
54 void InitSiftMatch();
55 bool Allocate(int max_sift, int mbm) override;
56 void SetMaxSift(int max_sift) override;
57 void SetDescriptors(int index, int num, const unsigned char * descriptor, int id = -1);
58 void SetDescriptors(int index, int num, const float * descriptor, int id = -1);
59 void SetFeatureLocation(int index, const float* locations, int gap, int ncomp);
60 int GetSiftMatch(int max_match, uint32_t match_buffer[][2], float distmax, float ratiomax, int mbm);
61 int GetGuidedSiftMatch(int max_match, uint32_t match_buffer[][2], float* H, float* F,
62 float distmax, float ratiomax, float hdistmax, float fdistmax, int mbm,
63 int use_h, int use_f);
64 //////////////////////////////
65 static int CheckCudaDevice(int device);
66 };
67
68 #endif
69 #endif
70