-
Notifications
You must be signed in to change notification settings - Fork 3
/
descsift.h
58 lines (44 loc) · 1.79 KB
/
descsift.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
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef DESCSIFT_H
#define DESCSIFT_H
#include <vector>
#include "abstractdescriptor.h"
#include "keypoint.h"
#include "image.h"
using namespace std;
/**********************************************************************
*@author Wanlei Zhao
*@version 1.0
*All rights reserved by Wanlei Zhao and the patent holder
*
*Anyone receive this code should not redistribute it to other people
*without permission of the author
*
*This code should only be used for non-commercial purpose
************************************************************************/
class DescSIFT :public AbstractDescriptor
{
private:
vector<vector<float> > gMat;
///for descriptor
static const int NumOrient;
static const int GRID;
static const int DSize;
static const int PatchSize;
static const int PSIFTLen;
static const int PatchMag;
public:
DescSIFT(DESC desc);
int buildDescriptor(const int kpnum, vector<KeyPoint*> &kps, const char *descfn, const float resize_rate);
int buildPatchView(const int kpnum, vector<KeyPoint*> &kps, const char *descfn, const float resize_rate);
int getSIFTDescriptor(const float *myWin, const float sigma);
int getSIFTDescriptor(Image *win,const float sizeratio);
int getNormDescPatch(KeyPoint *keyp, float *myWin, const int Size);
static void test();
static vector<vector<float> > GaussianWeight2D(const float sigma, const int radius);
static vector<vector<float> > GaussianWeight2D(const int winSize);
static void getPatch(const char*srcimg, const char *srcfn, const char *dstpatch);
static bool getPixGradient(const int x,const int y,Image *win,const float sizeratio,float &mag,float &theta);
static bool getPixGradient(const int x,const int y,const float *pixels,const int size,float &mag,float &theta);
~DescSIFT();
};
#endif