1 | /* |
---|
2 | * Speeded-Up Robust Features (SURF) |
---|
3 | * http://people.ee.ethz.ch/~surf |
---|
4 | * |
---|
5 | * Authors: Herbert Bay, Andreas Ess, Geert Willems |
---|
6 | * Windows port by Stefan Saur |
---|
7 | * |
---|
8 | * Copyright (2006): ETH Zurich, Switzerland |
---|
9 | * Katholieke Universiteit Leuven, Belgium |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * For details, see the paper: |
---|
13 | * Herbert Bay, Tinne Tuytelaars, Luc Van Gool, |
---|
14 | * "SURF: Speeded Up Robust Features" |
---|
15 | * Proceedings of the ninth European Conference on Computer Vision, May 2006 |
---|
16 | * |
---|
17 | * Permission to use, copy, modify, and distribute this software and |
---|
18 | * its documentation for educational, research, and non-commercial |
---|
19 | * purposes, without fee and without a signed licensing agreement, is |
---|
20 | * hereby granted, provided that the above copyright notice and this |
---|
21 | * paragraph appear in all copies modifications, and distributions. |
---|
22 | * |
---|
23 | * Any commercial use or any redistribution of this software |
---|
24 | * requires a license from one of the above mentioned establishments. |
---|
25 | * |
---|
26 | * For further details, contact Andreas Ess (aess@vision.ee.ethz.ch). |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef __SURF_H |
---|
30 | #define __SURF_H |
---|
31 | |
---|
32 | namespace surf { |
---|
33 | |
---|
34 | class Image; |
---|
35 | |
---|
36 | class Surf { |
---|
37 | public: |
---|
38 | //! Constructor |
---|
39 | Surf(); |
---|
40 | |
---|
41 | //! Constructor with parameters |
---|
42 | Surf(Image *im, bool dbl=false, bool usurf=false, |
---|
43 | bool ext=false, int insi=4); |
---|
44 | |
---|
45 | //! Destructor |
---|
46 | ~Surf(); |
---|
47 | |
---|
48 | //! Get length of the descriptor vector |
---|
49 | int getVectLength(); |
---|
50 | |
---|
51 | //! set Ipoint for which a descriptor has to be computed |
---|
52 | void setIpoint(Ipoint *ipt); |
---|
53 | |
---|
54 | //! Assign reproducible orienation |
---|
55 | void assignOrientation(); |
---|
56 | |
---|
57 | //! Compute the robust features |
---|
58 | void makeDescriptor(); |
---|
59 | |
---|
60 | protected: |
---|
61 | //! Create the vector |
---|
62 | void createVector(double scale, |
---|
63 | double row, double col); |
---|
64 | |
---|
65 | //! Create the vector |
---|
66 | void createUprightVector(double scale, |
---|
67 | double row, double col); |
---|
68 | |
---|
69 | //! Add sample to the vector |
---|
70 | void AddSample(int r, int c, double rpos, |
---|
71 | double cpos, double rx, double cx, int step); |
---|
72 | |
---|
73 | //! Add upright sample to the vector |
---|
74 | void AddUprightSample(int r, int c, double rpos, |
---|
75 | double cpos, double rx, double cx, int step); |
---|
76 | |
---|
77 | //! Place sample to index in vector |
---|
78 | void PlaceInIndex(double mag1, int ori1, |
---|
79 | double mag2, int ori2, double rx, double cx); |
---|
80 | |
---|
81 | //! Normalise descriptor vector for illumination invariance for |
---|
82 | //! Lambertian surfaces |
---|
83 | void normalise(); |
---|
84 | |
---|
85 | //! Create Lookup tables |
---|
86 | void createLookups(); |
---|
87 | |
---|
88 | private: |
---|
89 | Image *_iimage; |
---|
90 | Ipoint *_current; |
---|
91 | double ***_index; |
---|
92 | bool _doubleImage; |
---|
93 | bool _upright; |
---|
94 | bool _extended; |
---|
95 | int _VecLength; |
---|
96 | int _IndexSize; |
---|
97 | double _MagFactor; |
---|
98 | int _OriSize; |
---|
99 | int _width, _height; |
---|
100 | |
---|
101 | double _sine, _cose; |
---|
102 | double **_Pixels; |
---|
103 | |
---|
104 | double _lookup1[83], _lookup2[40]; |
---|
105 | }; |
---|
106 | |
---|
107 | } |
---|
108 | |
---|
109 | #endif // SURF_H |
---|