ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
SiftMatchCU.h
Go to the documentation of this file.
1 // File: SiftMatchCU.h
3 // Author: Changchang Wu
4 // Description : interface for the SiftMatchCU
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 //
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 
45  //gpu parameter
46  int _initialized;
47  vector<int> sift_buffer;
48 private:
49  int GetBestMatch(int max_match, uint32_t match_buffer[][2], float distmax, float ratiomax, int mbm);
50 public:
51  SiftMatchCU(int max_sift);
52  virtual ~SiftMatchCU(){};
53  void InitSiftMatch();
54  bool Allocate(int max_sift, int mbm) override;
55  void SetMaxSift(int max_sift) override;
56  void SetDescriptors(int index, int num, const unsigned char * descriptor, int id = -1);
57  void SetDescriptors(int index, int num, const float * descriptor, int id = -1);
58  void SetFeautreLocation(int index, const float* locatoins, int gap);
59  int GetSiftMatch(int max_match, uint32_t match_buffer[][2], float distmax, float ratiomax, int mbm);
60  int GetGuidedSiftMatch(int max_match, uint32_t match_buffer[][2], float* H, float* F,
61  float distmax, float ratiomax, float hdistmax, float fdistmax, int mbm);
63  static int CheckCudaDevice(int device);
64 };
65 
66 #endif
67 #endif
68 
matcher export
Definition: SiftGPU.h:269
virtual void SetMaxSift(int max_sift)
Definition: SiftMatch.cpp:646
virtual bool Allocate(int max_sift, int mbm)
Definition: SiftMatch.cpp:636
virtual int GetGuidedSiftMatch(int max_match, uint32_t match_buffer[][2], float *H, float *F, float distmax=0.7, float ratiomax=0.8, float hdistmax=32, float fdistmax=16, int mutual_best_match=1)
Definition: SiftMatch.cpp:676
virtual void SetDescriptors(int index, int num, const float *descriptors, int id=-1)
Definition: SiftMatch.cpp:666
virtual int GetSiftMatch(int max_match, uint32_t match_buffer[][2], float distmax=0.7, float ratiomax=0.8, int mutual_best_match=1)
Definition: SiftMatch.cpp:691
virtual void SetFeautreLocation(int index, const float *locations, int gap=0)
Definition: SiftMatch.cpp:671