-
Notifications
You must be signed in to change notification settings - Fork 286
/
cudaSift.h
45 lines (40 loc) · 1.36 KB
/
cudaSift.h
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
#ifndef CUDASIFT_H
#define CUDASIFT_H
#include "cudaImage.h"
typedef struct {
float xpos;
float ypos;
float scale;
float sharpness;
float edgeness;
float orientation;
float score;
float ambiguity;
int match;
float match_xpos;
float match_ypos;
float match_error;
float subsampling;
float empty[3];
float data[128];
} SiftPoint;
typedef struct {
int numPts; // Number of available Sift points
int maxPts; // Number of allocated Sift points
#ifdef MANAGEDMEM
SiftPoint *m_data; // Managed data
#else
SiftPoint *h_data; // Host (CPU) data
SiftPoint *d_data; // Device (GPU) data
#endif
} SiftData;
void InitCuda(int devNum = 0);
float *AllocSiftTempMemory(int width, int height, int numOctaves, bool scaleUp = false);
void FreeSiftTempMemory(float *memoryTmp);
void ExtractSift(SiftData &siftData, CudaImage &img, int numOctaves, double initBlur, float thresh, float lowestScale = 0.0f, bool scaleUp = false, float *tempMemory = 0);
void InitSiftData(SiftData &data, int num = 1024, bool host = false, bool dev = true);
void FreeSiftData(SiftData &data);
void PrintSiftData(SiftData &data);
double MatchSiftData(SiftData &data1, SiftData &data2);
double FindHomography(SiftData &data, float *homography, int *numMatches, int numLoops = 1000, float minScore = 0.85f, float maxAmbiguity = 0.95f, float thresh = 5.0f);
#endif