-
Notifications
You must be signed in to change notification settings - Fork 0
/
surf.h
92 lines (61 loc) · 2.64 KB
/
surf.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/***********************************************************
* --- OpenSURF --- *
* This library is distributed under the GNU GPL. Please *
* use the contact form at http://www.chrisevansdev.com *
* for more information. *
* *
* C. Evans, Research Into Robust Visual Features, *
* MSc University of Bristol, 2008. *
* *
************************************************************/
#ifndef SURF_H
#define SURF_H
#include <opencv2/opencv.hpp>
#include "ipoint.h"
#include "integral.h"
#include <vector>
typedef unsigned long long int ulli;
class Surf {
public:
//! Standard Constructor (img is an integral image)
Surf(vtkImageData *img, std::vector<Ipoint> &ipts);
//! Describe all features in the supplied vector
void getDescriptors( int radius = 5, bool normalize = true );
//! Describe all raw features in the supplied vector
void getRawDescriptors( int radius = 5 );
private:
//---------------- Private Functions -----------------//
static VTK_THREAD_RETURN_TYPE ThreadedDesc (void *arg);
//! Assign the current Ipoint an orientation
//void getOrientation();
//! Get the descriptor. See Agrawal ECCV 08
void getDescriptor(int id, int radius, bool normalize);
//! Get the raw descriptor.
void getRawDescriptor(int id, int radius);
//! Calculate the value of the 2d gaussian at x,y
inline float gaussian(float x, float y, float z, float sig);
//inline float gaussian(float x, float y, float sig);
//! Calculate Haar wavelet responses in x and y directions
inline float haarX(int x, int y, int z, int s);
inline float haarY(int x, int y, int z, int s);
inline float haarZ(int x, int y, int z, int s);
inline float haarXOptim(int x, int y, int z, int s);
inline float haarYOptim(int x, int y, int z, int s);
inline float haarZOptim(int x, int y, int z, int s);
//! Get the angle from the +ve x-axis of the vector given by [X Y]
//float getAngle(float X, float Y);
//---------------- Private Variables -----------------//
//! Integral image where Ipoints have been detected
vtkImageData *img;
//! Ipoints vector
IpVec &ipts;
int* dims;
long long int* incs;
unsigned long long int* pin_tegral;
};
//! Round float to nearest integer
inline int fRound(float flt)
{
return (int) floor(flt+0.5f);
}
#endif