SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
CVRaulMurOrb.cpp
Go to the documentation of this file.
1 /**
2  * \file CVRaulMurOrb.cpp
3  * \brief Declares the Raul Mur ORB feature detector and descriptor
4  * \details This File is based on the ORB Implementation of ORB_SLAM
5  * https://github.com/raulmur/ORB_SLAM2
6  * \date Spring 2017
7  * \remarks Please use clangformat to format the code. See more code style on
8  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
9  * \authors Pascal Zingg, Timon Tschanz, Michael Goettlicher, Marcus Hudritsch
10  * \copyright http://opensource.org/licenses/GPL-3.0
11 */
12 
13 #include <iterator> // std::back_inserter
14 #include <CVRaulMurExtNode.h>
15 #include <CVRaulMurOrb.h>
16 
17 using namespace cv;
18 using std::pair;
19 
20 const int PATCH_SIZE = 31;
21 const int HALF_PATCH_SIZE = 15;
22 const int EDGE_THRESHOLD = 19;
23 
24 //-----------------------------------------------------------------------------
25 //! Returns the angle of the image patch around a keypoint based on the center of gravity.
26 static float
27 IC_Angle(const CVMat& image,
28  CVPoint2f pt,
29  const vector<int>& u_max)
30 {
31  int m_01 = 0, m_10 = 0;
32 
33  const uchar* center = &image.at<uchar>(cvRound(pt.y), cvRound(pt.x));
34 
35  // Treat the center line differently, v=0
36  for (int u = -HALF_PATCH_SIZE; u <= HALF_PATCH_SIZE; ++u)
37  m_10 += u * center[u];
38 
39  // Go line by line in the circuI853lar patch
40  int step = (int)image.step1();
41  for (int v = 1; v <= HALF_PATCH_SIZE; ++v)
42  {
43  // Proceed over the two lines
44  int v_sum = 0;
45  int d = u_max[(uint)v];
46  for (int u = -d; u <= d; ++u)
47  {
48  int val_plus = center[u + v * step], val_minus = center[u - v * step];
49  v_sum += (val_plus - val_minus);
50  m_10 += u * (val_plus + val_minus);
51  }
52  m_01 += v * v_sum;
53  }
54 
55  return fastAtan2((float)m_01, (float)m_10);
56 }
57 //-----------------------------------------------------------------------------
58 const float factorPI = (float)(CV_PI / 180.f);
59 //-----------------------------------------------------------------------------
60 //! Calculate the Orb descriptor for a keypoint.
61 static void
63  const CVMat& img,
64  const CVPoint* pattern,
65  uchar* desc)
66 {
67 
68  float angle = (float)kpt.angle * factorPI;
69  float a = (float)cos(angle), b = (float)sin(angle);
70 
71  const uchar* center = &img.at<uchar>(cvRound(kpt.pt.y), cvRound(kpt.pt.x));
72  const int step = (int)img.step;
73 // Define a rotation invariant get_value function which gets the correct pixel for the comparison
74 #define GET_VALUE(idx) \
75  center[cvRound(pattern[idx].x * b + pattern[idx].y * a) * step + \
76  cvRound(pattern[idx].x * a - pattern[idx].y * b)]
77 
78  // clang-format off
79  // Do the actual comparisons
80  for (int i = 0; i < 32; ++i, pattern += 16)
81  {
82  int t0, t1, val;
83  t0 = GET_VALUE(0); t1 = GET_VALUE(1); val = t0 < t1;
84  t0 = GET_VALUE(2); t1 = GET_VALUE(3); val |= (t0 < t1) << 1;
85  t0 = GET_VALUE(4); t1 = GET_VALUE(5); val |= (t0 < t1) << 2;
86  t0 = GET_VALUE(6); t1 = GET_VALUE(7); val |= (t0 < t1) << 3;
87  t0 = GET_VALUE(8); t1 = GET_VALUE(9); val |= (t0 < t1) << 4;
88  t0 = GET_VALUE(10); t1 = GET_VALUE(11); val |= (t0 < t1) << 5;
89  t0 = GET_VALUE(12); t1 = GET_VALUE(13); val |= (t0 < t1) << 6;
90  t0 = GET_VALUE(14); t1 = GET_VALUE(15); val |= (t0 < t1) << 7;
91 
92  desc[i] = (uchar)val;
93  }
94  // clang-format on
95 
96 #undef GET_VALUE
97 }
98 //-----------------------------------------------------------------------------
99 /*! This is the hardcoded comparison pattern which the creators of ORB have
100 found to give the best results.
101 */
102 // clang-format off
103 static int bit_pattern_31_[256 * 4] =
104 {
105  8,-3, 9,5/*mean (0), correlation (0)*/,
106  4,2, 7,-12/*mean (1.12461e-05), correlation (0.0437584)*/,
107  -11,9, -8,2/*mean (3.37382e-05), correlation (0.0617409)*/,
108  7,-12, 12,-13/*mean (5.62303e-05), correlation (0.0636977)*/,
109  2,-13, 2,12/*mean (0.000134953), correlation (0.085099)*/,
110  1,-7, 1,6/*mean (0.000528565), correlation (0.0857175)*/,
111  -2,-10, -2,-4/*mean (0.0188821), correlation (0.0985774)*/,
112  -13,-13, -11,-8/*mean (0.0363135), correlation (0.0899616)*/,
113  -13,-3, -12,-9/*mean (0.121806), correlation (0.099849)*/,
114  10,4, 11,9/*mean (0.122065), correlation (0.093285)*/,
115  -13,-8, -8,-9/*mean (0.162787), correlation (0.0942748)*/,
116  -11,7, -9,12/*mean (0.21561), correlation (0.0974438)*/,
117  7,7, 12,6/*mean (0.160583), correlation (0.130064)*/,
118  -4,-5, -3,0/*mean (0.228171), correlation (0.132998)*/,
119  -13,2, -12,-3/*mean (0.00997526), correlation (0.145926)*/,
120  -9,0, -7,5/*mean (0.198234), correlation (0.143636)*/,
121  12,-6, 12,-1/*mean (0.0676226), correlation (0.16689)*/,
122  -3,6, -2,12/*mean (0.166847), correlation (0.171682)*/,
123  -6,-13, -4,-8/*mean (0.101215), correlation (0.179716)*/,
124  11,-13, 12,-8/*mean (0.200641), correlation (0.192279)*/,
125  4,7, 5,1/*mean (0.205106), correlation (0.186848)*/,
126  5,-3, 10,-3/*mean (0.234908), correlation (0.192319)*/,
127  3,-7, 6,12/*mean (0.0709964), correlation (0.210872)*/,
128  -8,-7, -6,-2/*mean (0.0939834), correlation (0.212589)*/,
129  -2,11, -1,-10/*mean (0.127778), correlation (0.20866)*/,
130  -13,12, -8,10/*mean (0.14783), correlation (0.206356)*/,
131  -7,3, -5,-3/*mean (0.182141), correlation (0.198942)*/,
132  -4,2, -3,7/*mean (0.188237), correlation (0.21384)*/,
133  -10,-12, -6,11/*mean (0.14865), correlation (0.23571)*/,
134  5,-12, 6,-7/*mean (0.222312), correlation (0.23324)*/,
135  5,-6, 7,-1/*mean (0.229082), correlation (0.23389)*/,
136  1,0, 4,-5/*mean (0.241577), correlation (0.215286)*/,
137  9,11, 11,-13/*mean (0.00338507), correlation (0.251373)*/,
138  4,7, 4,12/*mean (0.131005), correlation (0.257622)*/,
139  2,-1, 4,4/*mean (0.152755), correlation (0.255205)*/,
140  -4,-12, -2,7/*mean (0.182771), correlation (0.244867)*/,
141  -8,-5, -7,-10/*mean (0.186898), correlation (0.23901)*/,
142  4,11, 9,12/*mean (0.226226), correlation (0.258255)*/,
143  0,-8, 1,-13/*mean (0.0897886), correlation (0.274827)*/,
144  -13,-2, -8,2/*mean (0.148774), correlation (0.28065)*/,
145  -3,-2, -2,3/*mean (0.153048), correlation (0.283063)*/,
146  -6,9, -4,-9/*mean (0.169523), correlation (0.278248)*/,
147  8,12, 10,7/*mean (0.225337), correlation (0.282851)*/,
148  0,9, 1,3/*mean (0.226687), correlation (0.278734)*/,
149  7,-5, 11,-10/*mean (0.00693882), correlation (0.305161)*/,
150  -13,-6, -11,0/*mean (0.0227283), correlation (0.300181)*/,
151  10,7, 12,1/*mean (0.125517), correlation (0.31089)*/,
152  -6,-3, -6,12/*mean (0.131748), correlation (0.312779)*/,
153  10,-9, 12,-4/*mean (0.144827), correlation (0.292797)*/,
154  -13,8, -8,-12/*mean (0.149202), correlation (0.308918)*/,
155  -13,0, -8,-4/*mean (0.160909), correlation (0.310013)*/,
156  3,3, 7,8/*mean (0.177755), correlation (0.309394)*/,
157  5,7, 10,-7/*mean (0.212337), correlation (0.310315)*/,
158  -1,7, 1,-12/*mean (0.214429), correlation (0.311933)*/,
159  3,-10, 5,6/*mean (0.235807), correlation (0.313104)*/,
160  2,-4, 3,-10/*mean (0.00494827), correlation (0.344948)*/,
161  -13,0, -13,5/*mean (0.0549145), correlation (0.344675)*/,
162  -13,-7, -12,12/*mean (0.103385), correlation (0.342715)*/,
163  -13,3, -11,8/*mean (0.134222), correlation (0.322922)*/,
164  -7,12, -4,7/*mean (0.153284), correlation (0.337061)*/,
165  6,-10, 12,8/*mean (0.154881), correlation (0.329257)*/,
166  -9,-1, -7,-6/*mean (0.200967), correlation (0.33312)*/,
167  -2,-5, 0,12/*mean (0.201518), correlation (0.340635)*/,
168  -12,5, -7,5/*mean (0.207805), correlation (0.335631)*/,
169  3,-10, 8,-13/*mean (0.224438), correlation (0.34504)*/,
170  -7,-7, -4,5/*mean (0.239361), correlation (0.338053)*/,
171  -3,-2, -1,-7/*mean (0.240744), correlation (0.344322)*/,
172  2,9, 5,-11/*mean (0.242949), correlation (0.34145)*/,
173  -11,-13, -5,-13/*mean (0.244028), correlation (0.336861)*/,
174  -1,6, 0,-1/*mean (0.247571), correlation (0.343684)*/,
175  5,-3, 5,2/*mean (0.000697256), correlation (0.357265)*/,
176  -4,-13, -4,12/*mean (0.00213675), correlation (0.373827)*/,
177  -9,-6, -9,6/*mean (0.0126856), correlation (0.373938)*/,
178  -12,-10, -8,-4/*mean (0.0152497), correlation (0.364237)*/,
179  10,2, 12,-3/*mean (0.0299933), correlation (0.345292)*/,
180  7,12, 12,12/*mean (0.0307242), correlation (0.366299)*/,
181  -7,-13, -6,5/*mean (0.0534975), correlation (0.368357)*/,
182  -4,9, -3,4/*mean (0.099865), correlation (0.372276)*/,
183  7,-1, 12,2/*mean (0.117083), correlation (0.364529)*/,
184  -7,6, -5,1/*mean (0.126125), correlation (0.369606)*/,
185  -13,11, -12,5/*mean (0.130364), correlation (0.358502)*/,
186  -3,7, -2,-6/*mean (0.131691), correlation (0.375531)*/,
187  7,-8, 12,-7/*mean (0.160166), correlation (0.379508)*/,
188  -13,-7, -11,-12/*mean (0.167848), correlation (0.353343)*/,
189  1,-3, 12,12/*mean (0.183378), correlation (0.371916)*/,
190  2,-6, 3,0/*mean (0.228711), correlation (0.371761)*/,
191  -4,3, -2,-13/*mean (0.247211), correlation (0.364063)*/,
192  -1,-13, 1,9/*mean (0.249325), correlation (0.378139)*/,
193  7,1, 8,-6/*mean (0.000652272), correlation (0.411682)*/,
194  1,-1, 3,12/*mean (0.00248538), correlation (0.392988)*/,
195  9,1, 12,6/*mean (0.0206815), correlation (0.386106)*/,
196  -1,-9, -1,3/*mean (0.0364485), correlation (0.410752)*/,
197  -13,-13, -10,5/*mean (0.0376068), correlation (0.398374)*/,
198  7,7, 10,12/*mean (0.0424202), correlation (0.405663)*/,
199  12,-5, 12,9/*mean (0.0942645), correlation (0.410422)*/,
200  6,3, 7,11/*mean (0.1074), correlation (0.413224)*/,
201  5,-13, 6,10/*mean (0.109256), correlation (0.408646)*/,
202  2,-12, 2,3/*mean (0.131691), correlation (0.416076)*/,
203  3,8, 4,-6/*mean (0.165081), correlation (0.417569)*/,
204  2,6, 12,-13/*mean (0.171874), correlation (0.408471)*/,
205  9,-12, 10,3/*mean (0.175146), correlation (0.41296)*/,
206  -8,4, -7,9/*mean (0.183682), correlation (0.402956)*/,
207  -11,12, -4,-6/*mean (0.184672), correlation (0.416125)*/,
208  1,12, 2,-8/*mean (0.191487), correlation (0.386696)*/,
209  6,-9, 7,-4/*mean (0.192668), correlation (0.394771)*/,
210  2,3, 3,-2/*mean (0.200157), correlation (0.408303)*/,
211  6,3, 11,0/*mean (0.204588), correlation (0.411762)*/,
212  3,-3, 8,-8/*mean (0.205904), correlation (0.416294)*/,
213  7,8, 9,3/*mean (0.213237), correlation (0.409306)*/,
214  -11,-5, -6,-4/*mean (0.243444), correlation (0.395069)*/,
215  -10,11, -5,10/*mean (0.247672), correlation (0.413392)*/,
216  -5,-8, -3,12/*mean (0.24774), correlation (0.411416)*/,
217  -10,5, -9,0/*mean (0.00213675), correlation (0.454003)*/,
218  8,-1, 12,-6/*mean (0.0293635), correlation (0.455368)*/,
219  4,-6, 6,-11/*mean (0.0404971), correlation (0.457393)*/,
220  -10,12, -8,7/*mean (0.0481107), correlation (0.448364)*/,
221  4,-2, 6,7/*mean (0.050641), correlation (0.455019)*/,
222  -2,0, -2,12/*mean (0.0525978), correlation (0.44338)*/,
223  -5,-8, -5,2/*mean (0.0629667), correlation (0.457096)*/,
224  7,-6, 10,12/*mean (0.0653846), correlation (0.445623)*/,
225  -9,-13, -8,-8/*mean (0.0858749), correlation (0.449789)*/,
226  -5,-13, -5,-2/*mean (0.122402), correlation (0.450201)*/,
227  8,-8, 9,-13/*mean (0.125416), correlation (0.453224)*/,
228  -9,-11, -9,0/*mean (0.130128), correlation (0.458724)*/,
229  1,-8, 1,-2/*mean (0.132467), correlation (0.440133)*/,
230  7,-4, 9,1/*mean (0.132692), correlation (0.454)*/,
231  -2,1, -1,-4/*mean (0.135695), correlation (0.455739)*/,
232  11,-6, 12,-11/*mean (0.142904), correlation (0.446114)*/,
233  -12,-9, -6,4/*mean (0.146165), correlation (0.451473)*/,
234  3,7, 7,12/*mean (0.147627), correlation (0.456643)*/,
235  5,5, 10,8/*mean (0.152901), correlation (0.455036)*/,
236  0,-4, 2,8/*mean (0.167083), correlation (0.459315)*/,
237  -9,12, -5,-13/*mean (0.173234), correlation (0.454706)*/,
238  0,7, 2,12/*mean (0.18312), correlation (0.433855)*/,
239  -1,2, 1,7/*mean (0.185504), correlation (0.443838)*/,
240  5,11, 7,-9/*mean (0.185706), correlation (0.451123)*/,
241  3,5, 6,-8/*mean (0.188968), correlation (0.455808)*/,
242  -13,-4, -8,9/*mean (0.191667), correlation (0.459128)*/,
243  -5,9, -3,-3/*mean (0.193196), correlation (0.458364)*/,
244  -4,-7, -3,-12/*mean (0.196536), correlation (0.455782)*/,
245  6,5, 8,0/*mean (0.1972), correlation (0.450481)*/,
246  -7,6, -6,12/*mean (0.199438), correlation (0.458156)*/,
247  -13,6, -5,-2/*mean (0.211224), correlation (0.449548)*/,
248  1,-10, 3,10/*mean (0.211718), correlation (0.440606)*/,
249  4,1, 8,-4/*mean (0.213034), correlation (0.443177)*/,
250  -2,-2, 2,-13/*mean (0.234334), correlation (0.455304)*/,
251  2,-12, 12,12/*mean (0.235684), correlation (0.443436)*/,
252  -2,-13, 0,-6/*mean (0.237674), correlation (0.452525)*/,
253  4,1, 9,3/*mean (0.23962), correlation (0.444824)*/,
254  -6,-10, -3,-5/*mean (0.248459), correlation (0.439621)*/,
255  -3,-13, -1,1/*mean (0.249505), correlation (0.456666)*/,
256  7,5, 12,-11/*mean (0.00119208), correlation (0.495466)*/,
257  4,-2, 5,-7/*mean (0.00372245), correlation (0.484214)*/,
258  -13,9, -9,-5/*mean (0.00741116), correlation (0.499854)*/,
259  7,1, 8,6/*mean (0.0208952), correlation (0.499773)*/,
260  7,-8, 7,6/*mean (0.0220085), correlation (0.501609)*/,
261  -7,-4, -7,1/*mean (0.0233806), correlation (0.496568)*/,
262  -8,11, -7,-8/*mean (0.0236505), correlation (0.489719)*/,
263  -13,6, -12,-8/*mean (0.0268781), correlation (0.503487)*/,
264  2,4, 3,9/*mean (0.0323324), correlation (0.501938)*/,
265  10,-5, 12,3/*mean (0.0399235), correlation (0.494029)*/,
266  -6,-5, -6,7/*mean (0.0420153), correlation (0.486579)*/,
267  8,-3, 9,-8/*mean (0.0548021), correlation (0.484237)*/,
268  2,-12, 2,8/*mean (0.0616622), correlation (0.496642)*/,
269  -11,-2, -10,3/*mean (0.0627755), correlation (0.498563)*/,
270  -12,-13, -7,-9/*mean (0.0829622), correlation (0.495491)*/,
271  -11,0, -10,-5/*mean (0.0843342), correlation (0.487146)*/,
272  5,-3, 11,8/*mean (0.0929937), correlation (0.502315)*/,
273  -2,-13, -1,12/*mean (0.113327), correlation (0.48941)*/,
274  -1,-8, 0,9/*mean (0.132119), correlation (0.467268)*/,
275  -13,-11, -12,-5/*mean (0.136269), correlation (0.498771)*/,
276  -10,-2, -10,11/*mean (0.142173), correlation (0.498714)*/,
277  -3,9, -2,-13/*mean (0.144141), correlation (0.491973)*/,
278  2,-3, 3,2/*mean (0.14892), correlation (0.500782)*/,
279  -9,-13, -4,0/*mean (0.150371), correlation (0.498211)*/,
280  -4,6, -3,-10/*mean (0.152159), correlation (0.495547)*/,
281  -4,12, -2,-7/*mean (0.156152), correlation (0.496925)*/,
282  -6,-11, -4,9/*mean (0.15749), correlation (0.499222)*/,
283  6,-3, 6,11/*mean (0.159211), correlation (0.503821)*/,
284  -13,11, -5,5/*mean (0.162427), correlation (0.501907)*/,
285  11,11, 12,6/*mean (0.16652), correlation (0.497632)*/,
286  7,-5, 12,-2/*mean (0.169141), correlation (0.484474)*/,
287  -1,12, 0,7/*mean (0.169456), correlation (0.495339)*/,
288  -4,-8, -3,-2/*mean (0.171457), correlation (0.487251)*/,
289  -7,1, -6,7/*mean (0.175), correlation (0.500024)*/,
290  -13,-12, -8,-13/*mean (0.175866), correlation (0.497523)*/,
291  -7,-2, -6,-8/*mean (0.178273), correlation (0.501854)*/,
292  -8,5, -6,-9/*mean (0.181107), correlation (0.494888)*/,
293  -5,-1, -4,5/*mean (0.190227), correlation (0.482557)*/,
294  -13,7, -8,10/*mean (0.196739), correlation (0.496503)*/,
295  1,5, 5,-13/*mean (0.19973), correlation (0.499759)*/,
296  1,0, 10,-13/*mean (0.204465), correlation (0.49873)*/,
297  9,12, 10,-1/*mean (0.209334), correlation (0.49063)*/,
298  5,-8, 10,-9/*mean (0.211134), correlation (0.503011)*/,
299  -1,11, 1,-13/*mean (0.212), correlation (0.499414)*/,
300  -9,-3, -6,2/*mean (0.212168), correlation (0.480739)*/,
301  -1,-10, 1,12/*mean (0.212731), correlation (0.502523)*/,
302  -13,1, -8,-10/*mean (0.21327), correlation (0.489786)*/,
303  8,-11, 10,-6/*mean (0.214159), correlation (0.488246)*/,
304  2,-13, 3,-6/*mean (0.216993), correlation (0.50287)*/,
305  7,-13, 12,-9/*mean (0.223639), correlation (0.470502)*/,
306  -10,-10, -5,-7/*mean (0.224089), correlation (0.500852)*/,
307  -10,-8, -8,-13/*mean (0.228666), correlation (0.502629)*/,
308  4,-6, 8,5/*mean (0.22906), correlation (0.498305)*/,
309  3,12, 8,-13/*mean (0.233378), correlation (0.503825)*/,
310  -4,2, -3,-3/*mean (0.234323), correlation (0.476692)*/,
311  5,-13, 10,-12/*mean (0.236392), correlation (0.475462)*/,
312  4,-13, 5,-1/*mean (0.236842), correlation (0.504132)*/,
313  -9,9, -4,3/*mean (0.236977), correlation (0.497739)*/,
314  0,3, 3,-9/*mean (0.24314), correlation (0.499398)*/,
315  -12,1, -6,1/*mean (0.243297), correlation (0.489447)*/,
316  3,2, 4,-8/*mean (0.00155196), correlation (0.553496)*/,
317  -10,-10, -10,9/*mean (0.00239541), correlation (0.54297)*/,
318  8,-13, 12,12/*mean (0.0034413), correlation (0.544361)*/,
319  -8,-12, -6,-5/*mean (0.003565), correlation (0.551225)*/,
320  2,2, 3,7/*mean (0.00835583), correlation (0.55285)*/,
321  10,6, 11,-8/*mean (0.00885065), correlation (0.540913)*/,
322  6,8, 8,-12/*mean (0.0101552), correlation (0.551085)*/,
323  -7,10, -6,5/*mean (0.0102227), correlation (0.533635)*/,
324  -3,-9, -3,9/*mean (0.0110211), correlation (0.543121)*/,
325  -1,-13, -1,5/*mean (0.0113473), correlation (0.550173)*/,
326  -3,-7, -3,4/*mean (0.0140913), correlation (0.554774)*/,
327  -8,-2, -8,3/*mean (0.017049), correlation (0.55461)*/,
328  4,2, 12,12/*mean (0.01778), correlation (0.546921)*/,
329  2,-5, 3,11/*mean (0.0224022), correlation (0.549667)*/,
330  6,-9, 11,-13/*mean (0.029161), correlation (0.546295)*/,
331  3,-1, 7,12/*mean (0.0303081), correlation (0.548599)*/,
332  11,-1, 12,4/*mean (0.0355151), correlation (0.523943)*/,
333  -3,0, -3,6/*mean (0.0417904), correlation (0.543395)*/,
334  4,-11, 4,12/*mean (0.0487292), correlation (0.542818)*/,
335  2,-4, 2,1/*mean (0.0575124), correlation (0.554888)*/,
336  -10,-6, -8,1/*mean (0.0594242), correlation (0.544026)*/,
337  -13,7, -11,1/*mean (0.0597391), correlation (0.550524)*/,
338  -13,12, -11,-13/*mean (0.0608974), correlation (0.55383)*/,
339  6,0, 11,-13/*mean (0.065126), correlation (0.552006)*/,
340  0,-1, 1,4/*mean (0.074224), correlation (0.546372)*/,
341  -13,3, -9,-2/*mean (0.0808592), correlation (0.554875)*/,
342  -9,8, -6,-3/*mean (0.0883378), correlation (0.551178)*/,
343  -13,-6, -8,-2/*mean (0.0901035), correlation (0.548446)*/,
344  5,-9, 8,10/*mean (0.0949843), correlation (0.554694)*/,
345  2,7, 3,-9/*mean (0.0994152), correlation (0.550979)*/,
346  -1,-6, -1,-1/*mean (0.10045), correlation (0.552714)*/,
347  9,5, 11,-2/*mean (0.100686), correlation (0.552594)*/,
348  11,-3, 12,-8/*mean (0.101091), correlation (0.532394)*/,
349  3,0, 3,5/*mean (0.101147), correlation (0.525576)*/,
350  -1,4, 0,10/*mean (0.105263), correlation (0.531498)*/,
351  3,-6, 4,5/*mean (0.110785), correlation (0.540491)*/,
352  -13,0, -10,5/*mean (0.112798), correlation (0.536582)*/,
353  5,8, 12,11/*mean (0.114181), correlation (0.555793)*/,
354  8,9, 9,-6/*mean (0.117431), correlation (0.553763)*/,
355  7,-4, 8,-12/*mean (0.118522), correlation (0.553452)*/,
356  -10,4, -10,9/*mean (0.12094), correlation (0.554785)*/,
357  7,3, 12,4/*mean (0.122582), correlation (0.555825)*/,
358  9,-7, 10,-2/*mean (0.124978), correlation (0.549846)*/,
359  7,0, 12,-2/*mean (0.127002), correlation (0.537452)*/,
360  -1,-6, 0,-11/*mean (0.127148), correlation (0.547401)*/
361 };
362 // clang-format on
363 
364 //-----------------------------------------------------------------------------
366  float _scaleFactor,
367  int _nlevels,
368  int _iniThFAST,
369  int _minThFAST)
370  : nfeatures(_nfeatures),
371  scaleFactor(_scaleFactor),
372  nlevels((uint)_nlevels),
373  iniThFAST(_iniThFAST),
374  minThFAST(_minThFAST)
375 
376 {
377  mvScaleFactor.resize(nlevels);
378  mvLevelSigma2.resize(nlevels);
379  mvScaleFactor[0] = 1.0f;
380  mvLevelSigma2[0] = 1.0f;
381  for (uint i = 1; i < nlevels; i++)
382  {
383  mvScaleFactor[i] = mvScaleFactor[i - 1] * (float)scaleFactor;
385  }
386 
387  mvInvScaleFactor.resize(nlevels);
388  mvInvLevelSigma2.resize(nlevels);
389  for (uint i = 0; i < nlevels; i++)
390  {
391  mvInvScaleFactor[i] = 1.0f / mvScaleFactor[i];
392  mvInvLevelSigma2[i] = 1.0f / mvLevelSigma2[i];
393  }
394 
395  mvImagePyramid.resize(nlevels);
396 
397  mnFeaturesPerLevel.resize(nlevels);
398  float factor = 1.0f / (float)scaleFactor;
399  float nDesiredFeaturesPerScale = nfeatures * (1 - factor) / (1 - (float)pow((double)factor, (double)nlevels));
400 
401  int sumFeatures = 0;
402  for (uint level = 0; level < nlevels - 1; level++)
403  {
404  mnFeaturesPerLevel[level] = cvRound(nDesiredFeaturesPerScale);
405  sumFeatures += mnFeaturesPerLevel[level];
406  nDesiredFeaturesPerScale *= factor;
407  }
408  mnFeaturesPerLevel[nlevels - 1] = std::max(nfeatures - sumFeatures, 0);
409 
410  const int npoints = 512;
411  const CVPoint* pattern0 = (const CVPoint*)bit_pattern_31_;
412  std::copy(pattern0, pattern0 + npoints, std::back_inserter(pattern));
413 
414  // This is for orientation
415  // pre-compute the end of a row in a circular patch
416  umax.resize(HALF_PATCH_SIZE + 1);
417 
418  int v, v0, vmax = cvFloor(HALF_PATCH_SIZE * sqrt(2.f) / 2 + 1);
419  int vmin = cvCeil(HALF_PATCH_SIZE * sqrt(2.f) / 2);
420  const double hp2 = HALF_PATCH_SIZE * HALF_PATCH_SIZE;
421 
422  for (v = 0; v <= vmax; ++v)
423  umax[(uint)v] = cvRound(sqrt(hp2 - v * v));
424 
425  // Make sure we are symmetric
426  for (v = HALF_PATCH_SIZE, v0 = 0; v >= vmin; --v)
427  {
428  while (umax[(uint)v0] == umax[(uint)v0 + 1])
429  ++v0;
430  umax[(uint)v] = v0;
431  ++v0;
432  }
433 }
434 //-----------------------------------------------------------------------------
435 //! Compute the angle for a keypoint and save it.
436 static void computeOrientation(const CVMat& image,
437  CVVKeyPoint& keypoints,
438  const vector<int>& umax)
439 {
440  for (CVVKeyPoint::iterator keypoint = keypoints.begin(),
441  keypointEnd = keypoints.end();
442  keypoint != keypointEnd;
443  ++keypoint)
444  {
445  keypoint->angle = IC_Angle(image, keypoint->pt, umax);
446  }
447 }
448 //-----------------------------------------------------------------------------
449 //! Create The tree and distribute it.
451  const int& minX,
452  const int& maxX,
453  const int& minY,
454  const int& maxY,
455  const int& N,
456  const int& level)
457 {
458  // Compute how many initial nodes
459  const int nIni = (int)round(static_cast<float>(maxX - minX) / (maxY - minY));
460 
461  const float hX = static_cast<float>(maxX - minX) / nIni;
462 
463  list<CVRaulMurExtNode> lNodes;
464 
465  vector<CVRaulMurExtNode*> vpIniNodes;
466  vpIniNodes.resize((uint)nIni);
467 
468  for (int i = 0; i < nIni; i++)
469  {
470  CVRaulMurExtNode ni;
471  // upperleft
472  ni.UL = CVPoint2i((int)(hX * (float)(i)), 0);
473  // upperright
474  ni.UR = CVPoint2i((int)(hX * (float)(i + 1)), 0);
475  // bottomleft
476  ni.BL = CVPoint2i(ni.UL.x, maxY - minY);
477  // bottomright
478  ni.BR = CVPoint2i(ni.UR.x, maxY - minY);
479  ni.vKeys.reserve(vToDistributeKeys.size());
480 
481  lNodes.push_back(ni);
482  vpIniNodes[(uint)i] = &lNodes.back();
483  }
484 
485  // Associate points to childs
486  for (size_t i = 0; i < vToDistributeKeys.size(); i++)
487  {
488  const CVKeyPoint& kp = vToDistributeKeys[i];
489  vpIniNodes[(uint)(kp.pt.x / hX)]->vKeys.push_back(kp);
490  }
491 
492  list<CVRaulMurExtNode>::iterator lit = lNodes.begin();
493  //! Check if the nodes are empty and erase them if not
494  while (lit != lNodes.end())
495  {
496  if (lit->vKeys.size() == 1)
497  {
498  lit->bNoMore = true;
499  lit++;
500  }
501  else if (lit->vKeys.empty())
502  lit = lNodes.erase(lit);
503  else
504  lit++;
505  }
506 
507  bool bFinish = false;
508 
509  int iteration = 0;
510 
511  vector<pair<int, CVRaulMurExtNode*>> vSizeAndPointerToNode;
512  vSizeAndPointerToNode.reserve(lNodes.size() * 4);
513 
514  while (!bFinish)
515  {
516  int prevSize = (int)lNodes.size();
517 
518  lit = lNodes.begin();
519 
520  int nToExpand = 0;
521 
522  vSizeAndPointerToNode.clear();
523 
524  while (lit != lNodes.end())
525  {
526  if (lit->bNoMore)
527  {
528  // If node only contains one point do not subdivide and continue
529  lit++;
530  continue;
531  }
532  else
533  {
534  // If more than one point, subdivide
535  CVRaulMurExtNode n1, n2, n3, n4;
536  lit->DivideNode(n1, n2, n3, n4);
537 
538  // Add children if they contain points
539  if (!n1.vKeys.empty())
540  {
541  lNodes.push_front(n1);
542  if (!n1.vKeys.empty())
543  {
544  nToExpand++;
545  vSizeAndPointerToNode.push_back(std::make_pair(n1.vKeys.size(), &lNodes.front()));
546  lNodes.front().lit = lNodes.begin();
547  }
548  }
549  if (!n2.vKeys.empty())
550  {
551  lNodes.push_front(n2);
552  if (n2.vKeys.size() > 1)
553  {
554  nToExpand++;
555  vSizeAndPointerToNode.push_back(std::make_pair(n2.vKeys.size(), &lNodes.front()));
556  lNodes.front().lit = lNodes.begin();
557  }
558  }
559  if (!n3.vKeys.empty())
560  {
561  lNodes.push_front(n3);
562  if (n3.vKeys.size() > 1)
563  {
564  nToExpand++;
565  vSizeAndPointerToNode.push_back(std::make_pair(n3.vKeys.size(), &lNodes.front()));
566  lNodes.front().lit = lNodes.begin();
567  }
568  }
569  if (!n4.vKeys.empty())
570  {
571  lNodes.push_front(n4);
572  if (n4.vKeys.size() > 1)
573  {
574  nToExpand++;
575  vSizeAndPointerToNode.push_back(std::make_pair(n4.vKeys.size(), &lNodes.front()));
576  lNodes.front().lit = lNodes.begin();
577  }
578  }
579 
580  lit = lNodes.erase(lit);
581  continue;
582  }
583  }
584 
585  // Finish if there are more nodes than required features
586  // or all nodes contain just one point
587 
588  if ((int)lNodes.size() >= N || (int)lNodes.size() == prevSize)
589  {
590  bFinish = true;
591  }
592  else if (((int)lNodes.size() + nToExpand * 3) > N)
593  {
594  while (!bFinish)
595  {
596  prevSize = (int)lNodes.size();
597 
598  vector<pair<int, CVRaulMurExtNode*>> vPrevSizeAndPointerToNode = vSizeAndPointerToNode;
599  vSizeAndPointerToNode.clear();
600 
601  sort(vPrevSizeAndPointerToNode.begin(), vPrevSizeAndPointerToNode.end());
602  for (int j = (int)vPrevSizeAndPointerToNode.size() - 1; j >= 0; j--)
603  {
604  CVRaulMurExtNode n1, n2, n3, n4;
605  vPrevSizeAndPointerToNode[(uint)j].second->DivideNode(n1, n2, n3, n4);
606 
607  // Add childs if they contain points
608  if (!n1.vKeys.empty())
609  {
610  lNodes.push_front(n1);
611  if (n1.vKeys.size() > 1)
612  {
613  vSizeAndPointerToNode.push_back(std::make_pair(n1.vKeys.size(), &lNodes.front()));
614  lNodes.front().lit = lNodes.begin();
615  }
616  }
617  if (!n2.vKeys.empty())
618  {
619  lNodes.push_front(n2);
620  if (n2.vKeys.size() > 1)
621  {
622  vSizeAndPointerToNode.push_back(std::make_pair(n2.vKeys.size(), &lNodes.front()));
623  lNodes.front().lit = lNodes.begin();
624  }
625  }
626  if (!n3.vKeys.empty())
627  {
628  lNodes.push_front(n3);
629  if (n3.vKeys.size() > 1)
630  {
631  vSizeAndPointerToNode.push_back(std::make_pair(n3.vKeys.size(), &lNodes.front()));
632  lNodes.front().lit = lNodes.begin();
633  }
634  }
635  if (!n4.vKeys.empty())
636  {
637  lNodes.push_front(n4);
638  if (n4.vKeys.size() > 1)
639  {
640  vSizeAndPointerToNode.push_back(std::make_pair(n4.vKeys.size(), &lNodes.front()));
641  lNodes.front().lit = lNodes.begin();
642  }
643  }
644 
645  lNodes.erase(vPrevSizeAndPointerToNode[(uint)j].second->lit);
646 
647  if ((int)lNodes.size() >= N)
648  break;
649  }
650 
651  if ((int)lNodes.size() >= N || (int)lNodes.size() == prevSize)
652  bFinish = true;
653  }
654  }
655  }
656 
657  // Retain the best point in each node
658  CVVKeyPoint vResultKeys;
659  vResultKeys.reserve((uint)nfeatures);
660  for (list<CVRaulMurExtNode>::iterator lit = lNodes.begin(); lit != lNodes.end(); lit++)
661  {
662  CVVKeyPoint& vNodeKeys = lit->vKeys;
663  CVKeyPoint* pKP = &vNodeKeys[0];
664  float maxResponse = pKP->response;
665 
666  for (size_t k = 1; k < vNodeKeys.size(); k++)
667  {
668  if (vNodeKeys[k].response > maxResponse)
669  {
670  pKP = &vNodeKeys[k];
671  maxResponse = vNodeKeys[k].response;
672  }
673  }
674 
675  vResultKeys.push_back(*pKP);
676  }
677 
678  return vResultKeys;
679 }
680 //-----------------------------------------------------------------------------
681 //! Get the Keypoints and distribute them.
683 {
684  const float W = 30;
685 
686  for (uint level = 0; level < nlevels; ++level)
687  {
688  const int minBorderX = EDGE_THRESHOLD - 3;
689  const int minBorderY = minBorderX;
690  const int maxBorderX = mvImagePyramid[level].cols - EDGE_THRESHOLD + 3;
691  const int maxBorderY = mvImagePyramid[level].rows - EDGE_THRESHOLD + 3;
692 
693  CVVKeyPoint vToDistributeKeys;
694  vToDistributeKeys.reserve((uint)nfeatures * 10);
695 
696  const float width = (float)(maxBorderX - minBorderX);
697  const float height = (float)(maxBorderY - minBorderY);
698 
699  // generate the Cells to look for features in
700  const int nCols = (int)(width / W);
701  const int nRows = (int)(height / W);
702  const int wCell = (int)(ceil(width / nCols));
703  const int hCell = (int)(ceil(height / nRows));
704 
705  for (int i = 0; i < nRows; i++)
706  {
707  const float iniY = (float)(minBorderY + i * hCell);
708  float maxY = iniY + hCell + 6;
709 
710  if (iniY >= maxBorderY - 3)
711  continue;
712  if (maxY > maxBorderY)
713  maxY = (float)maxBorderY;
714 
715  for (int j = 0; j < nCols; j++)
716  {
717  const float iniX = (float)(minBorderX + j * wCell);
718  float maxX = iniX + wCell + 6;
719  if (iniX >= maxBorderX - 6)
720  continue;
721  if (maxX > maxBorderX)
722  maxX = (float)maxBorderX;
723 
724  CVVKeyPoint vKeysCell;
725 
726  // Try to get Keypoints with initial Threshold
727 
728  FAST(mvImagePyramid[level]
729  .rowRange((int)iniY, (int)maxY)
730  .colRange((int)iniX, (int)maxX),
731  vKeysCell,
732  iniThFAST,
733  true);
734 
735  // If no Keypoints are found try again with a lower Threshold
736  if (vKeysCell.empty())
737  {
738  FAST(mvImagePyramid[level]
739  .rowRange((int)iniY, (int)maxY)
740  .colRange((int)iniX, (int)maxX),
741  vKeysCell,
742  minThFAST,
743  true);
744  }
745 
746  if (!vKeysCell.empty())
747  {
748  for (CVVKeyPoint::iterator vit = vKeysCell.begin(); vit != vKeysCell.end(); vit++)
749  {
750  (*vit).pt.x += j * wCell;
751  (*vit).pt.y += i * hCell;
752  vToDistributeKeys.push_back(*vit);
753  }
754  }
755  }
756  }
757 
758  CVVKeyPoint& keypoints = allKeypoints[level];
759  keypoints.reserve((uint)nfeatures);
760 
761  keypoints = DistributeOctTree(vToDistributeKeys,
762  minBorderX,
763  maxBorderX,
764  minBorderY,
765  maxBorderY,
766  mnFeaturesPerLevel[level],
767  (int)level);
768 
769  const int scaledPatchSize = (int)(PATCH_SIZE * mvScaleFactor[level]);
770 
771  // Add border to coordinates and scale information
772  const int nkps = (int)keypoints.size();
773  for (uint i = 0; i < (uint)nkps; i++)
774  {
775  keypoints[i].pt.x += minBorderX;
776  keypoints[i].pt.y += minBorderY;
777  keypoints[i].octave = (int)level;
778  keypoints[i].size = (float)scaledPatchSize;
779  }
780  }
781 
782  // compute orientations
783 
784  for (uint level = 0; level < nlevels; ++level)
785  computeOrientation(mvImagePyramid[level], allKeypoints[level], umax);
786 }
787 
788 //-----------------------------------------------------------------------------
789 
790 //! Computes the descriptors for all passed keypoints
791 static void
793  CVVKeyPoint& keypoints,
794  CVMat& descriptors,
795  CVVPoint& pattern)
796 {
797  descriptors = CVMat::zeros((int)keypoints.size(), 32, CV_8UC1);
798 
799  for (size_t i = 0; i < keypoints.size(); i++)
800  computeOrbDescriptor(keypoints[i],
801  image,
802  &pattern[0],
803  descriptors.ptr((int)i));
804 }
805 
806 //-----------------------------------------------------------------------------
807 /*! Main detection function. Can be seperated if predefined keypoints are given
808 or no descriptor array is given.
809 */
811  CVInputArray _mask,
812  CVVKeyPoint& _keypoints,
813  CVOutputArray _descriptors,
814  bool useProvidedKeypoints)
815 {
816  if (_image.empty())
817  return;
818 
819  CVMat image = _image.getMat();
820  assert(image.type() == CV_8UC1);
821 
822  // Pre-compute the scale pyramid
823  ComputePyramid(image);
824  CVMat descriptors;
825  CVVVKeyPoint allKeypoints;
826  allKeypoints.resize(nlevels);
827  int nkeypoints = 0;
828  if (!useProvidedKeypoints)
829  {
830  ComputeKeyPointsOctTree(allKeypoints);
831  // ComputeKeyPointsOld(allKeypoints);
832  for (uint level = 0; level < nlevels; ++level)
833  nkeypoints += (int)allKeypoints[level].size();
834  _keypoints.clear();
835  _keypoints.reserve((uint)nkeypoints);
836  }
837  else
838  {
839  //! Remove Points from image border. Ensures that ORB_SLAM and ORB
840  //! generate the same descriptors from the same keypoints.
841  KeyPointsFilter::runByImageBorder(_keypoints, _image.size(), 31);
842  nkeypoints = (int)_keypoints.size();
843  int last_level = 0;
844  for (uint index = 0; index < _keypoints.size(); index++)
845  {
846  if (_keypoints[index].octave > last_level)
847  last_level = _keypoints[index].octave;
848 
849  _keypoints[index].pt /= mvScaleFactor[(uint)_keypoints[index].octave];
850  allKeypoints[(uint)_keypoints[index].octave].push_back(_keypoints[index]);
851  }
852  }
853  if (nkeypoints == 0)
854  _descriptors.release();
855  else if (_descriptors.needed())
856  {
857  _descriptors.create(nkeypoints, 32, CV_8U);
858  descriptors = _descriptors.getMat();
859  }
860 
861  int offset = 0;
862  for (uint level = 0; level < nlevels; ++level)
863  {
864  CVVKeyPoint& keypoints = allKeypoints[level];
865  int nkeypointsLevel = (int)keypoints.size();
866 
867  if (nkeypointsLevel == 0)
868  continue;
869  if (_descriptors.needed())
870  {
871  // preprocess the resized image
872  CVMat workingMat = mvImagePyramid[level].clone();
873  GaussianBlur(workingMat, workingMat, cv::Size(7, 7), 2, 2, BORDER_REFLECT_101);
874 
875  // Compute the descriptors
876  CVMat desc = descriptors.rowRange(offset, offset + nkeypointsLevel);
877 
878  computeDescriptors(workingMat, keypoints, desc, pattern);
879  }
880  offset += nkeypointsLevel;
881 
882  // Scale keypoint coordinates
883  if (level != 0)
884  {
885  float scale = mvScaleFactor[level]; // getScale(level, firstLevel, scaleFactor);
886  for (CVVKeyPoint::iterator keypoint = keypoints.begin(),
887  keypointEnd = keypoints.end();
888  keypoint != keypointEnd;
889  ++keypoint)
890  keypoint->pt *= scale;
891  }
892  // And add the keypoints to the output
893  if (!useProvidedKeypoints)
894  {
895  _keypoints.insert(_keypoints.end(), keypoints.begin(), keypoints.end());
896  }
897  }
898 }
899 //-----------------------------------------------------------------------------
901 {
902  for (uint level = 0; level < (uint)nlevels; ++level)
903  {
904  float scale = mvInvScaleFactor[level];
905  CVSize sz(cvRound((float)image.cols * scale),
906  cvRound((float)image.rows * scale));
907  CVSize wholeSize(sz.width + EDGE_THRESHOLD * 2,
908  sz.height + EDGE_THRESHOLD * 2);
909  CVMat temp(wholeSize, image.type()), masktemp;
910 
911  mvImagePyramid[level] = temp(CVRect(EDGE_THRESHOLD,
913  sz.width,
914  sz.height));
915 
916  // Compute the resized image
917  if (level != 0)
918  {
919  resize(mvImagePyramid[level - 1],
920  mvImagePyramid[level],
921  sz,
922  0,
923  0,
924  INTER_LINEAR);
925 
926  copyMakeBorder(mvImagePyramid[level],
927  temp,
932  BORDER_REFLECT_101 + BORDER_ISOLATED);
933  }
934  else
935  {
936  copyMakeBorder(image, temp, EDGE_THRESHOLD, EDGE_THRESHOLD, EDGE_THRESHOLD, EDGE_THRESHOLD, BORDER_REFLECT_101);
937  }
938  }
939 
940  // save image pyriamid
941  /*for (int level = 0; level < nlevels; ++level) {
942  string filename = "D:/Development/SLProject/debug_ouput/imagePyriamid" + to_string(level) + ".jpg";
943  cv::imwrite(filename, mvImagePyramid[level]);
944  }*/
945 }
946 //-----------------------------------------------------------------------------
Declares the Raul Mur ORB feature detector and descriptor.
const int EDGE_THRESHOLD
const int HALF_PATCH_SIZE
#define GET_VALUE(idx)
const int PATCH_SIZE
static float IC_Angle(const CVMat &image, CVPoint2f pt, const vector< int > &u_max)
Returns the angle of the image patch around a keypoint based on the center of gravity.
const float factorPI
static void computeDescriptors(const CVMat &image, CVVKeyPoint &keypoints, CVMat &descriptors, CVVPoint &pattern)
Computes the descriptors for all passed keypoints.
static void computeOrientation(const CVMat &image, CVVKeyPoint &keypoints, const vector< int > &umax)
Compute the angle for a keypoint and save it.
static int bit_pattern_31_[256 *4]
static void computeOrbDescriptor(const CVKeyPoint &kpt, const CVMat &img, const CVPoint *pattern, uchar *desc)
Calculate the Orb descriptor for a keypoint.
Declares the Raul Mur ORB feature detector and descriptor.
cv::Point2i CVPoint2i
Definition: CVTypedefs.h:42
vector< vector< cv::KeyPoint > > CVVVKeyPoint
Definition: CVTypedefs.h:102
cv::Point2f CVPoint2f
Definition: CVTypedefs.h:43
cv::InputArray CVInputArray
Definition: CVTypedefs.h:63
cv::OutputArray CVOutputArray
Definition: CVTypedefs.h:64
cv::KeyPoint CVKeyPoint
Definition: CVTypedefs.h:60
cv::Rect CVRect
Definition: CVTypedefs.h:39
cv::Size CVSize
Definition: CVTypedefs.h:55
cv::Mat CVMat
Definition: CVTypedefs.h:38
cv::Point CVPoint
Definition: CVTypedefs.h:41
vector< cv::Point > CVVPoint
Definition: CVTypedefs.h:75
vector< cv::KeyPoint > CVVKeyPoint
Definition: CVTypedefs.h:88
Data structure used to subdivide the Image with key points into segments.
void DivideNode(CVRaulMurExtNode &n1, CVRaulMurExtNode &n2, CVRaulMurExtNode &n3, CVRaulMurExtNode &n4)
CVVKeyPoint DistributeOctTree(const CVVKeyPoint &vToDistributeKeys, const int &minX, const int &maxX, const int &minY, const int &maxY, const int &nFeatures, const int &level)
Create The tree and distribute it.
vector< int > umax
Definition: CVRaulMurOrb.h:70
vector< float > mvInvLevelSigma2
Definition: CVRaulMurOrb.h:74
vector< float > mvInvScaleFactor
Definition: CVRaulMurOrb.h:72
CVVPoint pattern
Definition: CVRaulMurOrb.h:63
vector< int > mnFeaturesPerLevel
Definition: CVRaulMurOrb.h:69
double scaleFactor
Definition: CVRaulMurOrb.h:65
CVRaulMurOrb(int nfeatures, float scaleFactor, int nlevels, int iniThFAST, int minThFAST)
void detectAndCompute(CVInputArray image, CVInputArray mask, CVVKeyPoint &keypoints, CVOutputArray descriptors, bool useProvidedKeypoints)
vector< float > mvLevelSigma2
Definition: CVRaulMurOrb.h:73
vector< float > mvScaleFactor
Definition: CVRaulMurOrb.h:71
CVVMat mvImagePyramid
Definition: CVRaulMurOrb.h:51
void ComputePyramid(CVMat image)
void ComputeKeyPointsOctTree(CVVVKeyPoint &allKeypoints)
Get the Keypoints and distribute them.
T ceil(T a)
Definition: Utils.h:247
T step(T edge, T x)
Definition: Utils.h:251