-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSiftMatchCU.h
More file actions
68 lines (60 loc) · 2.17 KB
/
SiftMatchCU.h
File metadata and controls
68 lines (60 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
////////////////////////////////////////////////////////////////////////////
// File: SiftMatchCU.h
// Author: Changchang Wu
// Description : interface for the SiftMatchCU
////
// Copyright (c) 2007 University of North Carolina at Chapel Hill
// All Rights Reserved
//
// Permission to use, copy, modify and distribute this software and its
// documentation for educational, research and non-profit purposes, without
// fee, and without a written agreement is hereby granted, provided that the
// above copyright notice and the following paragraph appear in all copies.
//
// The University of North Carolina at Chapel Hill make no representations
// about the suitability of this software for any purpose. It is provided
// 'as is' without express or implied warranty.
//
// Please send BUG REPORTS to [email protected]
//
////////////////////////////////////////////////////////////////////////////
#ifndef CU_SIFT_MATCH_H
#define CU_SIFT_MATCH_H
#if defined(SIFTGPU_CUDA_ENABLED)
class CuTexImage;
class SiftMatchCU:public SiftMatchGPU
{
private:
//tex storage
CuTexImage _texLoc[2];
CuTexImage _texDes[2];
CuTexImage _texDot;
CuTexImage _texMatch[2];
CuTexImage _texCRT;
//programs
//
int _num_sift[2];
int _id_sift[2];
int _have_loc[2];
//gpu parameter
int _initialized;
vector<int> sift_buffer;
private:
int GetBestMatch(int max_match, uint32_t match_buffer[][2], float distmax, float ratiomax, int mbm);
public:
SiftMatchCU(int max_sift);
virtual ~SiftMatchCU(){};
void InitSiftMatch();
bool Allocate(int max_sift, int mbm) override;
void SetMaxSift(int max_sift) override;
void SetDescriptors(int index, int num, const unsigned char * descriptor, int id = -1);
void SetDescriptors(int index, int num, const float * descriptor, int id = -1);
void SetFeatureLocation(int index, const float* locatoins, int gap);
int GetSiftMatch(int max_match, uint32_t match_buffer[][2], float distmax, float ratiomax, int mbm);
int GetGuidedSiftMatch(int max_match, uint32_t match_buffer[][2], float* H, float* F,
float distmax, float ratiomax, float hdistmax, float fdistmax, int mbm);
//////////////////////////////
static int CheckCudaDevice(int device);
};
#endif
#endif