-
Notifications
You must be signed in to change notification settings - Fork 12
/
interestpoint.hpp
66 lines (54 loc) · 1.86 KB
/
interestpoint.hpp
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
#ifndef INTERESTPOINT_HPP
#define INTERESTPOINT_HPP
#include <set>
#include "types.hpp"
#include "point.hpp"
namespace sift {
/**
* A class, which holds all the necessary information about the collected interest points
*/
class InterestPoint {
public:
/**
* the scale of the interestpoint
*/
f32_t scale;
/**
* The octave of the interestpoint, because scale alone doesn't identify clearly
*/
u16_t octave;
/**
* This is needed because of the fact, the corresponding DoG must not be searched
* again. And we get a linear access to the corresponding DoG element.
*/
u16_t index;
/**
* A flag, which shows if the interestpoint was filtered out by sift
*/
bool filtered = false;
/**
* the x and y coordinates of the interest point
*/
Point<u16_t, u16_t> loc;
/**
* The orientations of the interest point
*/
f32_t orientation;
std::vector<f32_t> descriptors;
InterestPoint() = default;
explicit InterestPoint(Point<u16_t, u16_t> loc, f32_t scale, u16_t octave, u16_t index)
: scale(scale), octave(octave), index(index), loc(loc) {
}
/**
* Orders interest points by the fact if they are filtered or not. So the filtered can
* be deleted from the end of a vector
*/
static bool cmpByFilter(const InterestPoint &a, const InterestPoint &b) {
if (!a.filtered && b.filtered) {
return true;
}
return false;
}
};
}
#endif //INTERESTPOINT_HPP