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 __FASTHESSIAN_H |
---|
30 | #define __FASTHESSIAN_H |
---|
31 | |
---|
32 | #include <vector> |
---|
33 | |
---|
34 | namespace surf { |
---|
35 | |
---|
36 | class Ipoint; |
---|
37 | class Image; |
---|
38 | |
---|
39 | class FastHessian { |
---|
40 | public: |
---|
41 | //! Destructor |
---|
42 | ~FastHessian(); |
---|
43 | |
---|
44 | //! Constructor with parameters |
---|
45 | FastHessian(Image *im, std::vector< Ipoint >& ip, double thres = 0.2, bool doub = false, |
---|
46 | short int initMasksize = 9, short int samplingStep = 2, |
---|
47 | short int octaves = 4); |
---|
48 | |
---|
49 | //! Pass the integral image |
---|
50 | void setIimage( Image *iim ); |
---|
51 | |
---|
52 | //! Detect the interest Points, write into ipts |
---|
53 | void getInterestPoints(); |
---|
54 | |
---|
55 | //! Create a new ipoint at location (x, y), at a certain scale |
---|
56 | //! and corner response strength |
---|
57 | void makeIpoint(double x, double y, double scale, double strength=0); |
---|
58 | |
---|
59 | protected: |
---|
60 | //! Allocate scale layers for one octave |
---|
61 | void allocateOctave(); |
---|
62 | |
---|
63 | //! Fast non-maximum-suppression |
---|
64 | void findMaximum(int *borders, int o, int octave); |
---|
65 | void interpFeature(int s, int row, int col, Image *map, |
---|
66 | int o, int octave, int movesRemain, |
---|
67 | int *borders); |
---|
68 | int fitQuadrat(int s, int r, int c, double &res); |
---|
69 | |
---|
70 | private: |
---|
71 | //! Integral image |
---|
72 | Image *_Iimage; |
---|
73 | |
---|
74 | //! Octaves |
---|
75 | Image **_scaleLevel; |
---|
76 | |
---|
77 | //! Vector of variables |
---|
78 | int _vas[9]; |
---|
79 | |
---|
80 | //! Threshold for interest point detection |
---|
81 | double _threshold; |
---|
82 | |
---|
83 | //! Indicates whether the image size was doubled or not |
---|
84 | //! default is false |
---|
85 | bool _doubled; |
---|
86 | |
---|
87 | //! Reference to vector of interest points passed from outside |
---|
88 | std::vector< Ipoint >& _ipts; |
---|
89 | |
---|
90 | //! Initial lobe size for the second derivative in one direction |
---|
91 | //! default is 3 |
---|
92 | short int _initLobe; |
---|
93 | |
---|
94 | //! Number scales |
---|
95 | short int _maxScales; |
---|
96 | |
---|
97 | //! Number octaves |
---|
98 | short int _maxOctaves; |
---|
99 | |
---|
100 | //! The sampling step |
---|
101 | short int _sampling; |
---|
102 | |
---|
103 | //! Integral image dimensions |
---|
104 | int _width; |
---|
105 | int _height; |
---|
106 | |
---|
107 | //! Result of fitting quadratic |
---|
108 | double _offset[3]; |
---|
109 | }; |
---|
110 | |
---|
111 | } |
---|
112 | |
---|
113 | #endif // FASTHESSIAN_H |
---|