Main MRPT website > C++ reference for MRPT 1.9.9
CFeatureExtraction_common.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+
9  */
10 
11 #include "vision-precomp.h" // Precompiled headers
12 
14 #include <mrpt/system/CTicTac.h>
16 
17 using namespace mrpt;
18 using namespace mrpt::img;
19 using namespace mrpt::vision;
20 using namespace mrpt::img;
21 using namespace mrpt::system;
22 using namespace std;
23 
24 CFeatureExtraction::~CFeatureExtraction() {}
25 struct sort_pred
26 {
27  bool operator()(
28  const std::vector<unsigned int>& left,
29  const std::vector<unsigned int>& right)
30  {
31  return left[1] < right[1];
32  }
33 };
34 
35 /************************************************************************************************
36 * extractFeatures *
37 ************************************************************************************************/
38 void CFeatureExtraction::detectFeatures(
39  const CImage& img, CFeatureList& feats, const unsigned int init_ID,
40  const unsigned int nDesiredFeatures, const TImageROI& ROI) const
41 {
42  switch (options.featsType)
43  {
44  case featHarris:
45  MRPT_TODO(
46  "Refactor: check if OpenCV's tile method can be directly "
47  "called to save space here?")
48  if (options.harrisOptions.tile_image)
49  {
50  mrpt::system::CTicTac tictac;
51 
52  if (!(ROI.xMax == 0 && ROI.xMin == 0 && ROI.yMax == 0 &&
53  ROI.yMin == 0)) // ROI must be not active for this option
54  std::cout << "Warning: Image ROI is not taken into "
55  "account, as harrisOptions.tile is set to YES"
56  << std::endl;
57 
58  TImageROI newROI;
59 
60  unsigned int wd = img.getWidth();
61  unsigned int hg = img.getHeight();
62 
63  unsigned int tt =
64  0; // Total number of features detected in the whole image
65  std::vector<std::vector<unsigned int>> tam(8);
66  std::vector<CFeatureList> aux_feats(
67  8); // 2x4 tiles into the image -> 8 sets of features
68 
69  for (unsigned int k = 0; k < 4;
70  k++) // Search over the 2x4 tiled image
71  {
72  // Resize the inner vector
73  tam[k].resize(2);
74  tam[k + 4].resize(2);
75 
76  // First row
77  newROI.xMin = k * wd / 4.f;
78  newROI.yMin = 0;
79  newROI.xMax = wd / 4.f + k * wd / 4.f - 1;
80  newROI.yMax = hg / 2.f - 1;
81 
82  tictac.Tic();
83  extractFeaturesKLT(
84  img, aux_feats[k], init_ID, nDesiredFeatures, newROI);
85  cout << "Tiempo en extraer una tile: "
86  << tictac.Tac() * 1000.0f << endl;
87 
88  tam[k][0] = k;
89  tam[k][1] = aux_feats[k].size();
90 
91  // Second row
92  newROI.xMin = k * wd / 4;
93  newROI.yMin = hg / 2;
94  newROI.xMax = wd / 4 + k * wd / 4 - 1;
95  newROI.yMax = hg - 1;
96 
97  tictac.Tic();
98  extractFeaturesKLT(
99  img, aux_feats[k + 4], init_ID, nDesiredFeatures,
100  newROI);
101  cout << "Tiempo en extraer una tile: "
102  << tictac.Tac() * 1000.0f << endl;
103 
104  tam[k + 4][0] = k + 4;
105  tam[k + 4][1] = aux_feats[k + 4].size();
106 
107  tt += aux_feats[k].size() + aux_feats[k + 4].size();
108  }
109 
110  // Merge all the features
111  unsigned int new_nDesiredFeatures =
112  nDesiredFeatures <= 0 ? 300 : nDesiredFeatures;
113  unsigned int o_n_per_tile = floor(new_nDesiredFeatures / 8.0f);
114  feats.clear();
115  if (tt > new_nDesiredFeatures) // We have found too many
116  // features, we have to select
117  // them
118  {
119  // Order the size vector
120  std::sort(tam.begin(), tam.end(), sort_pred());
121 
122  if (tam[0][1] > o_n_per_tile) // The smallest subset
123  {
124  // Everything goes right -> Get o_n_per_tile features
125  // from each tile.
126  for (unsigned int m = 0; m < 8; m++)
127  for (unsigned int k = 0; k < o_n_per_tile; k++)
128  feats.push_back(aux_feats[m][k]);
129  }
130  else
131  {
132  std::vector<std::vector<unsigned int>>::iterator
133  itVector;
134  unsigned int n_per_tile = o_n_per_tile;
135 
136  for (itVector = tam.begin(); itVector != tam.end();
137  itVector++)
138  {
139  if ((*itVector)[1] <
140  n_per_tile) // Size of the subset
141  {
142  // We have to distribute the features among the
143  // tiles
144  for (unsigned int k = 0; k < (*itVector)[1];
145  k++)
146  {
147  feats.push_back(
148  aux_feats[(*itVector)[0]][k]);
149  n_per_tile += (n_per_tile - (*itVector)[1]);
150  } // end for
151  } // end if
152  else
153  {
154  for (unsigned int k = 0; k < n_per_tile; k++)
155  {
156  feats.push_back(
157  aux_feats[(*itVector)[0]][k]);
158  n_per_tile = o_n_per_tile;
159  } // end for
160  } // end else
161  } // end for 'itVector'
162  } // end else
163  } // end if tt > nDesiredFeatures
164  else // We have found less features than the desired
165  {
166  CFeatureList::iterator itList;
167  for (unsigned int m = 0; m < 8; m++)
168  for (itList = aux_feats[m].begin();
169  itList != aux_feats[m].end(); itList++)
170  feats.push_back(*itList);
171  ;
172  }
173 
174  } // end if
175 
176  else
177  extractFeaturesKLT(img, feats, init_ID, nDesiredFeatures, ROI);
178  break;
179 
180  case featKLT:
181  extractFeaturesKLT(img, feats, init_ID, nDesiredFeatures, ROI);
182  break;
183 
184  case featSIFT:
185  extractFeaturesSIFT(img, feats, init_ID, nDesiredFeatures, ROI);
186  break;
187 
188  case featBCD:
189  extractFeaturesBCD(img, feats, init_ID, nDesiredFeatures, ROI);
190  break;
191 
192  case featSURF:
193  extractFeaturesSURF(img, feats, init_ID, nDesiredFeatures, ROI);
194  break;
195 
196  case featFAST:
197  extractFeaturesFAST(img, feats, init_ID, nDesiredFeatures, ROI);
198  break;
199 
200  case featFASTER9:
201  extractFeaturesFASTER_N(
202  9, img, feats, init_ID, nDesiredFeatures, ROI);
203  break;
204  case featFASTER10:
205  extractFeaturesFASTER_N(
206  10, img, feats, init_ID, nDesiredFeatures, ROI);
207  break;
208  case featFASTER12:
209  extractFeaturesFASTER_N(
210  12, img, feats, init_ID, nDesiredFeatures, ROI);
211  break;
212 
213  case featORB:
214  extractFeaturesORB(img, feats, init_ID, nDesiredFeatures, ROI);
215  break;
216 
217  // # added by Raghavender Sahdev
218  case featAKAZE:
219  extractFeaturesAKAZE(img, feats, init_ID, nDesiredFeatures, ROI);
220  break;
221  case featLSD:
222  extractFeaturesLSD(img, feats, init_ID, nDesiredFeatures, ROI);
223  break;
224 
225  default:
226  THROW_EXCEPTION("options.method has an invalid value!");
227  break;
228  }
229 }
230 
231 /************************************************************************************************
232  computeDescriptors
233 ************************************************************************************************/
234 void CFeatureExtraction::computeDescriptors(
235  const CImage& in_img, CFeatureList& inout_features,
236  TDescriptorType in_descriptor_list) const
237 {
238  MRPT_START
239 
240  int nDescComputed = 0;
241 
242  if ((in_descriptor_list & descSIFT) != 0)
243  {
244  this->internal_computeSiftDescriptors(in_img, inout_features);
245  ++nDescComputed;
246  }
247  if ((in_descriptor_list & descSURF) != 0)
248  {
249  this->internal_computeSurfDescriptors(in_img, inout_features);
250  ++nDescComputed;
251  }
252  if ((in_descriptor_list & descSpinImages) != 0)
253  {
254  this->internal_computeSpinImageDescriptors(in_img, inout_features);
255  ++nDescComputed;
256  }
257  if ((in_descriptor_list & descPolarImages) != 0)
258  {
259  this->internal_computePolarImageDescriptors(in_img, inout_features);
260  ++nDescComputed;
261  }
262  if ((in_descriptor_list & descLogPolarImages) != 0)
263  {
264  this->internal_computeLogPolarImageDescriptors(in_img, inout_features);
265  ++nDescComputed;
266  }
267  if ((in_descriptor_list & descORB) != 0)
268  {
269  this->internal_computeORBDescriptors(in_img, inout_features);
270  ++nDescComputed;
271  }
272  // # added by Raghavender Sahdev
273  if ((in_descriptor_list & descBLD) != 0)
274  {
275  this->internal_computeBLDLineDescriptors(in_img, inout_features);
276  ++nDescComputed;
277  }
278  if ((in_descriptor_list & descLATCH) != 0)
279  {
280  this->internal_computeLATCHDescriptors(in_img, inout_features);
281  ++nDescComputed;
282  }
283  if (!nDescComputed)
285  "No known descriptor value found in in_descriptor_list=%u",
286  (unsigned)in_descriptor_list)
287 
288  MRPT_END
289 }
290 
291 /************************************************************************************************
292 * extractFeaturesBCD *
293 ************************************************************************************************/
294 void CFeatureExtraction::extractFeaturesBCD(
295  const CImage& img, CFeatureList& feats, unsigned int init_ID,
296  unsigned int nDesiredFeatures, const TImageROI& ROI) const
297 {
299  MRPT_UNUSED_PARAM(feats);
300  MRPT_UNUSED_PARAM(init_ID);
301  MRPT_UNUSED_PARAM(nDesiredFeatures);
302  MRPT_UNUSED_PARAM(ROI);
303 
304  THROW_EXCEPTION("Not implemented yet!");
305 } // end extractFeaturesBCD
306 
307 /*------------------------------------------------------------
308  TOptions()
309 -------------------------------------------------------------*/
310 CFeatureExtraction::TOptions::TOptions(const TFeatureType _featsType)
311  : featsType(_featsType) // Default Method: Kanade-Lucas-Tomasi
312 {
313  // General options
314  patchSize = 21; // Patch size
315  FIND_SUBPIXEL = true; // Find subpixel
316  useMask = false; // Use mask for finding features
317  addNewFeatures = false; // Add to existing feature list
318 
319  // Harris Options
320  harrisOptions.k = 0.04f;
321  harrisOptions.radius = 3; // 15;
323  0.005f; // 0.01f; The lower this is, more features will be found
324  harrisOptions.sigma = 3.0f;
325  harrisOptions.min_distance = 5; // 10;
326  harrisOptions.tile_image = false;
327 
328  // KLT Options
329  KLTOptions.min_distance = 5; // 10;
330  KLTOptions.threshold = 0.1f; // 0.005 ; 0.01f;
331  KLTOptions.radius = 15; // 3;
332  KLTOptions.tile_image = false;
333 
334  // SIFT Options
335  SIFTOptions.implementation = Hess; // Default implementation: Hess
336 
337  // SURF Options
338 
339  // BCD Options
340 
341  // FAST:
342  FASTOptions.threshold = 20;
346 
347  // ORB:
348  ORBOptions.extract_patch = false;
350  ORBOptions.n_levels = 8;
351  ORBOptions.scale_factor = 1.2f;
352 
353  // SpinImages Options:
359 
360  // TPolarImagesOptions
364 
365  // LogPolarImagesOptions
368  16; // Log-Polar image patch will have dimensions WxH, with:
369  // W=num_angles, H= rho_scale * log(radius)
371 
372  // added by Raghavender Sahdev
373  // AKAZEOptions
374  AKAZEOptions.diffusivity = 1; // KAZE::DIFF_PM_G2 maps to 1;
375  // http://docs.opencv.org/trunk/d3/d61/classcv_1_1KAZE.html
378  AKAZEOptions.threshold = 0.001f;
382  5; // AKAZE::DESCRIPTOR_MLDB maps to 5 in open cv;
383  // http://docs.opencv.org/trunk/d8/d30/classcv_1_1AKAZE.html
384 
385  // LSD Options
386  LSDOptions.scale = 2;
387  LSDOptions.nOctaves = 1;
388 
389  // BLD Options
390  // BLDOptions.ksize_ = 11;
394 
395  LATCHOptions.bytes = 32;
398 }
399 
400 /*---------------------------------------------------------------
401  dumpToTextStream
402  ---------------------------------------------------------------*/
404 {
405  out << mrpt::format(
406  "\n----------- [CFeatureExtraction::TOptions] ------------ \n\n");
407 
408  LOADABLEOPTS_DUMP_VAR(featsType, int)
409  LOADABLEOPTS_DUMP_VAR(patchSize, int)
410  LOADABLEOPTS_DUMP_VAR(FIND_SUBPIXEL, bool)
411  LOADABLEOPTS_DUMP_VAR(useMask, bool)
412  LOADABLEOPTS_DUMP_VAR(addNewFeatures, bool)
413 
414  LOADABLEOPTS_DUMP_VAR(harrisOptions.k, double)
415  LOADABLEOPTS_DUMP_VAR(harrisOptions.radius, int)
416  LOADABLEOPTS_DUMP_VAR(harrisOptions.threshold, float)
417  LOADABLEOPTS_DUMP_VAR(harrisOptions.sigma, float)
418  LOADABLEOPTS_DUMP_VAR(harrisOptions.min_distance, float)
419 
420  LOADABLEOPTS_DUMP_VAR(KLTOptions.min_distance, float)
421  LOADABLEOPTS_DUMP_VAR(KLTOptions.threshold, float)
422  LOADABLEOPTS_DUMP_VAR(KLTOptions.radius, int)
423 
424  LOADABLEOPTS_DUMP_VAR(SIFTOptions.implementation, int)
425 
426  LOADABLEOPTS_DUMP_VAR(SURFOptions.rotation_invariant, bool)
427  LOADABLEOPTS_DUMP_VAR(SURFOptions.hessianThreshold, int)
428  LOADABLEOPTS_DUMP_VAR(SURFOptions.nOctaves, int)
429  LOADABLEOPTS_DUMP_VAR(SURFOptions.nLayersPerOctave, int)
430 
431  LOADABLEOPTS_DUMP_VAR(FASTOptions.threshold, int)
432  LOADABLEOPTS_DUMP_VAR(FASTOptions.nonmax_suppression, bool)
433  LOADABLEOPTS_DUMP_VAR(FASTOptions.min_distance, float)
434  LOADABLEOPTS_DUMP_VAR(FASTOptions.use_KLT_response, bool)
435 
436  LOADABLEOPTS_DUMP_VAR(ORBOptions.scale_factor, float)
437  LOADABLEOPTS_DUMP_VAR(ORBOptions.min_distance, int)
438  LOADABLEOPTS_DUMP_VAR(ORBOptions.n_levels, int)
439  LOADABLEOPTS_DUMP_VAR(ORBOptions.extract_patch, bool)
440 
441  LOADABLEOPTS_DUMP_VAR(SpinImagesOptions.hist_size_distance, int)
442  LOADABLEOPTS_DUMP_VAR(SpinImagesOptions.hist_size_intensity, int)
443  LOADABLEOPTS_DUMP_VAR(SpinImagesOptions.radius, int)
444  LOADABLEOPTS_DUMP_VAR(SpinImagesOptions.std_dist, float)
445  LOADABLEOPTS_DUMP_VAR(SpinImagesOptions.std_intensity, float)
446 
447  LOADABLEOPTS_DUMP_VAR(PolarImagesOptions.bins_angle, int)
448  LOADABLEOPTS_DUMP_VAR(PolarImagesOptions.bins_distance, int)
449  LOADABLEOPTS_DUMP_VAR(PolarImagesOptions.radius, int)
450 
451  LOADABLEOPTS_DUMP_VAR(LogPolarImagesOptions.radius, int)
452  LOADABLEOPTS_DUMP_VAR(LogPolarImagesOptions.num_angles, int)
453  LOADABLEOPTS_DUMP_VAR(LogPolarImagesOptions.rho_scale, double)
454 
455  // # added by Raghavender Sahdev
456  LOADABLEOPTS_DUMP_VAR(AKAZEOptions.descriptor_type, int)
457  LOADABLEOPTS_DUMP_VAR(AKAZEOptions.descriptor_size, int)
458  LOADABLEOPTS_DUMP_VAR(AKAZEOptions.descriptor_channels, int)
459  LOADABLEOPTS_DUMP_VAR(AKAZEOptions.threshold, float)
460  LOADABLEOPTS_DUMP_VAR(AKAZEOptions.nOctaves, int)
461  LOADABLEOPTS_DUMP_VAR(AKAZEOptions.nOctaveLayers, int)
462  LOADABLEOPTS_DUMP_VAR(AKAZEOptions.diffusivity, int)
463 
464  LOADABLEOPTS_DUMP_VAR(LSDOptions.nOctaves, int)
465  LOADABLEOPTS_DUMP_VAR(LSDOptions.scale, int)
466 
467  LOADABLEOPTS_DUMP_VAR(BLDOptions.numOfOctave, int)
468  LOADABLEOPTS_DUMP_VAR(BLDOptions.reductionRatio, int)
469  LOADABLEOPTS_DUMP_VAR(BLDOptions.widthOfBand, int)
470 
471  LOADABLEOPTS_DUMP_VAR(LATCHOptions.bytes, int)
472  LOADABLEOPTS_DUMP_VAR(LATCHOptions.half_ssd_size, int)
473  LOADABLEOPTS_DUMP_VAR(LATCHOptions.rotationInvariance, bool)
474 
475  out << mrpt::format("\n");
476 }
477 
478 /*---------------------------------------------------------------
479  loadFromConfigFile
480  ---------------------------------------------------------------*/
482  const mrpt::config::CConfigFileBase& iniFile, const std::string& section)
483 {
484  featsType = iniFile.read_enum(section, "featsType", featsType);
485 
486  MRPT_LOAD_CONFIG_VAR(patchSize, int, iniFile, section)
487  MRPT_LOAD_CONFIG_VAR(FIND_SUBPIXEL, bool, iniFile, section)
488  MRPT_LOAD_CONFIG_VAR(useMask, bool, iniFile, section)
489  MRPT_LOAD_CONFIG_VAR(addNewFeatures, bool, iniFile, section)
490 
491  // string sect = section;
492  MRPT_LOAD_CONFIG_VAR(harrisOptions.k, double, iniFile, section)
493  MRPT_LOAD_CONFIG_VAR(harrisOptions.radius, int, iniFile, section)
494  MRPT_LOAD_CONFIG_VAR(harrisOptions.threshold, float, iniFile, section)
495  MRPT_LOAD_CONFIG_VAR(harrisOptions.sigma, float, iniFile, section)
496  MRPT_LOAD_CONFIG_VAR(harrisOptions.min_distance, float, iniFile, section)
497 
498  MRPT_LOAD_CONFIG_VAR(KLTOptions.min_distance, float, iniFile, section)
499  MRPT_LOAD_CONFIG_VAR(KLTOptions.threshold, float, iniFile, section)
500  MRPT_LOAD_CONFIG_VAR(KLTOptions.radius, int, iniFile, section)
501 
503  SIFTOptions.implementation, int, TSIFTImplementation, iniFile, section)
504  MRPT_LOAD_CONFIG_VAR(SIFTOptions.threshold, double, iniFile, section)
505  MRPT_LOAD_CONFIG_VAR(SIFTOptions.edgeThreshold, double, iniFile, section)
506 
507  MRPT_LOAD_CONFIG_VAR(SURFOptions.rotation_invariant, bool, iniFile, section)
508  MRPT_LOAD_CONFIG_VAR(SURFOptions.hessianThreshold, int, iniFile, section)
509  MRPT_LOAD_CONFIG_VAR(SURFOptions.nOctaves, int, iniFile, section)
510  MRPT_LOAD_CONFIG_VAR(SURFOptions.nLayersPerOctave, int, iniFile, section)
511 
512  MRPT_LOAD_CONFIG_VAR(FASTOptions.threshold, int, iniFile, section)
513  MRPT_LOAD_CONFIG_VAR(FASTOptions.nonmax_suppression, bool, iniFile, section)
514  MRPT_LOAD_CONFIG_VAR(FASTOptions.min_distance, float, iniFile, section)
515  MRPT_LOAD_CONFIG_VAR(FASTOptions.use_KLT_response, bool, iniFile, section)
516 
517  MRPT_LOAD_CONFIG_VAR(ORBOptions.extract_patch, bool, iniFile, section)
518  MRPT_LOAD_CONFIG_VAR(ORBOptions.min_distance, int, iniFile, section)
519  MRPT_LOAD_CONFIG_VAR(ORBOptions.n_levels, int, iniFile, section)
520  MRPT_LOAD_CONFIG_VAR(ORBOptions.scale_factor, float, iniFile, section)
521 
523  SpinImagesOptions.hist_size_distance, int, iniFile, section)
525  SpinImagesOptions.hist_size_intensity, int, iniFile, section)
526  MRPT_LOAD_CONFIG_VAR(SpinImagesOptions.radius, int, iniFile, section)
527  MRPT_LOAD_CONFIG_VAR(SpinImagesOptions.std_dist, float, iniFile, section)
529  SpinImagesOptions.std_intensity, float, iniFile, section)
530 
531  MRPT_LOAD_CONFIG_VAR(PolarImagesOptions.bins_angle, int, iniFile, section)
533  PolarImagesOptions.bins_distance, int, iniFile, section)
534  MRPT_LOAD_CONFIG_VAR(PolarImagesOptions.radius, int, iniFile, section)
535 
536  MRPT_LOAD_CONFIG_VAR(LogPolarImagesOptions.radius, int, iniFile, section)
538  LogPolarImagesOptions.num_angles, int, iniFile, section)
540  LogPolarImagesOptions.rho_scale, double, iniFile, section)
541 
542  // #added by Raghavender Sahdev
543  MRPT_LOAD_CONFIG_VAR(AKAZEOptions.descriptor_type, int, iniFile, section)
544  MRPT_LOAD_CONFIG_VAR(AKAZEOptions.descriptor_size, int, iniFile, section)
546  AKAZEOptions.descriptor_channels, int, iniFile, section)
547  MRPT_LOAD_CONFIG_VAR(AKAZEOptions.threshold, float, iniFile, section)
548  MRPT_LOAD_CONFIG_VAR(AKAZEOptions.nOctaves, int, iniFile, section)
549  MRPT_LOAD_CONFIG_VAR(AKAZEOptions.nOctaveLayers, int, iniFile, section)
550  MRPT_LOAD_CONFIG_VAR(AKAZEOptions.diffusivity, int, iniFile, section)
551 
552  MRPT_LOAD_CONFIG_VAR(LSDOptions.nOctaves, int, iniFile, section)
553  MRPT_LOAD_CONFIG_VAR(LSDOptions.scale, int, iniFile, section)
554 
555  MRPT_LOAD_CONFIG_VAR(BLDOptions.numOfOctave, int, iniFile, section)
556  MRPT_LOAD_CONFIG_VAR(BLDOptions.widthOfBand, int, iniFile, section)
557  MRPT_LOAD_CONFIG_VAR(BLDOptions.reductionRatio, int, iniFile, section)
558 
559  MRPT_LOAD_CONFIG_VAR(LATCHOptions.bytes, int, iniFile, section)
560  MRPT_LOAD_CONFIG_VAR(LATCHOptions.half_ssd_size, int, iniFile, section)
562  LATCHOptions.rotationInvariance, bool, iniFile, section)
563 }
mrpt::vision::descORB
@ descORB
Bit-based feature descriptor.
Definition: vision/include/mrpt/vision/types.h:110
mrpt::vision::CFeatureExtraction::TOptions::KLTOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TKLTOptions KLTOptions
mrpt::vision::CFeatureExtraction::TOptions::TSpinImagesOptions::hist_size_distance
unsigned int hist_size_distance
"intensity" axis of the 2D histogram (default=10).
Definition: CFeatureExtraction.h:232
mrpt::vision::CFeatureExtraction::TOptions::TFASTOptions::min_distance
float min_distance
(default=5) minimum distance between
Definition: CFeatureExtraction.h:166
mrpt::vision::descBLD
@ descBLD
BLD Line descriptor.
Definition: vision/include/mrpt/vision/types.h:111
begin
EIGEN_STRONG_INLINE iterator begin()
Definition: eigen_plugins.h:29
mrpt::vision::featFASTER10
@ featFASTER10
FASTER-9 detector, Edward Rosten's libcvd implementation optimized for SSE2.
Definition: vision/include/mrpt/vision/types.h:76
mrpt::vision::featFAST
@ featFAST
FAST feature detector, OpenCV's implementation ("Faster and better: A machine learning approac...
Definition: vision/include/mrpt/vision/types.h:70
mrpt::vision::descPolarImages
@ descPolarImages
Polar image descriptor.
Definition: vision/include/mrpt/vision/types.h:106
mrpt::vision::CFeatureExtraction::TOptions::TPolarImagesOptions::bins_distance
unsigned int bins_distance
of the polar image (default=8).
Definition: CFeatureExtraction.h:251
mrpt::vision::CFeatureExtraction::TOptions::TLogPolarImagesOptions::num_angles
unsigned int num_angles
log polar image is built, in pixel units (default=30 pixels)
Definition: CFeatureExtraction.h:265
mrpt::vision::TDescriptorType
TDescriptorType
The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...
Definition: vision/include/mrpt/vision/types.h:95
mrpt::vision::CFeatureExtraction::TOptions::TAKAZEOptions::threshold
float threshold
Definition: CFeatureExtraction.h:282
mrpt::vision::CFeatureExtraction::TOptions::TLATCHOptions::bytes
int bytes
Definition: CFeatureExtraction.h:311
mrpt::system::CTicTac
A high-performance stopwatch, with typical resolution of nanoseconds.
Definition: system/CTicTac.h:19
MRPT_LOAD_CONFIG_VAR
#define MRPT_LOAD_CONFIG_VAR( variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
Definition: config/CConfigFileBase.h:282
mrpt::vision::CFeatureExtraction::TOptions::TAKAZEOptions::descriptor_size
int descriptor_size
Definition: CFeatureExtraction.h:280
mrpt::vision::CFeatureExtraction::TOptions::TFASTOptions::nonmax_suppression
bool nonmax_suppression
features (in pixels)
Definition: CFeatureExtraction.h:168
mrpt::vision::CFeatureExtraction::TOptions::ORBOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TORBOptions ORBOptions
mrpt::vision
Classes for computer vision, detectors, features, etc.
Definition: CCamModel.h:20
mrpt::vision::CFeatureExtraction::TOptions::LSDOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TLSDOptions LSDOptions
mrpt::vision::CFeatureExtraction::TOptions::TBLDOptions::reductionRatio
int reductionRatio
Definition: CFeatureExtraction.h:301
mrpt::vision::CFeatureExtraction::TOptions::TBLDOptions::widthOfBand
int widthOfBand
Definition: CFeatureExtraction.h:302
mrpt::vision::CFeatureExtraction::TOptions::TFASTOptions::threshold
int threshold
default= 20
Definition: CFeatureExtraction.h:165
mrpt::vision::featORB
@ featORB
ORB detector and descriptor, OpenCV's implementation ("ORB: an efficient alternative to SIFT o...
Definition: vision/include/mrpt/vision/types.h:83
MRPT_UNUSED_PARAM
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
Definition: common.h:186
mrpt::vision::CFeatureExtraction::TOptions::BLDOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TBLDOptions BLDOptions
mrpt::vision::CFeatureExtraction::TOptions::LATCHOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TLATCHOptions LATCHOptions
mrpt::vision::CFeatureExtraction::TOptions::TSIFTOptions::implementation
TSIFTImplementation implementation
Default: Hess (OpenCV.
Definition: CFeatureExtraction.h:196
mrpt::vision::CFeatureList::iterator
TInternalFeatList::iterator iterator
Definition: CFeature.h:367
mrpt::vision::featFASTER12
@ featFASTER12
FASTER-9 detector, Edward Rosten's libcvd implementation optimized for SSE2.
Definition: vision/include/mrpt/vision/types.h:79
mrpt::vision::CFeatureExtraction::TOptions::TPolarImagesOptions::bins_angle
unsigned int bins_angle
Number of bins in the "angular" axis.
Definition: CFeatureExtraction.h:249
mrpt::vision::CFeatureExtraction::TOptions::TKLTOptions::min_distance
float min_distance
Definition: CFeatureExtraction.h:136
mrpt::vision::CFeatureExtraction::TOptions::THarrisOptions::tile_image
bool tile_image
Definition: CFeatureExtraction.h:152
THROW_EXCEPTION_FMT
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
Definition: exceptions.h:43
mrpt::vision::CFeatureExtraction::TOptions::useMask
bool useMask
Whether to use a mask for determining the regions where not to look for keypoints (default=false).
Definition: CFeatureExtraction.h:118
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::vision::featKLT
@ featKLT
Kanade-Lucas-Tomasi feature [SHI'94].
Definition: vision/include/mrpt/vision/types.h:55
mrpt::vision::CFeatureExtraction::TOptions::TBLDOptions::numOfOctave
int numOfOctave
Definition: CFeatureExtraction.h:303
mrpt::vision::TImageROI::yMax
float yMax
Definition: vision/include/mrpt/vision/types.h:354
mrpt::vision::CFeatureExtraction::TOptions::TAKAZEOptions::diffusivity
int diffusivity
Definition: CFeatureExtraction.h:285
mrpt::vision::descLogPolarImages
@ descLogPolarImages
Log-Polar image descriptor.
Definition: vision/include/mrpt/vision/types.h:108
THROW_EXCEPTION
#define THROW_EXCEPTION(msg)
Definition: exceptions.h:41
mrpt::vision::CFeatureExtraction::TOptions::TKLTOptions::radius
int radius
Definition: CFeatureExtraction.h:133
mrpt::vision::CFeatureExtraction::TOptions::patchSize
unsigned int patchSize
Size of the patch to extract, or 0 if no patch is desired (default=21).
Definition: CFeatureExtraction.h:113
vision-precomp.h
mrpt::vision::CFeatureExtraction::TOptions::TPolarImagesOptions::radius
unsigned int radius
axis of the polar image (default=6).
Definition: CFeatureExtraction.h:253
mrpt::vision::TImageROI::yMin
float yMin
Y coordinate limits [0,imageHeight)
Definition: vision/include/mrpt/vision/types.h:354
mrpt::vision::CFeatureExtraction::TOptions::dumpToTextStream
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
Definition: CFeatureExtraction_common.cpp:403
sort_pred::operator()
bool operator()(const std::vector< unsigned int > &left, const std::vector< unsigned int > &right)
Definition: CFeatureExtraction_common.cpp:27
mrpt::vision::CFeatureExtraction::Hess
@ Hess
Definition: CFeatureExtraction.h:90
mrpt::vision::CFeatureExtraction::TOptions::TORBOptions::n_levels
size_t n_levels
Definition: CFeatureExtraction.h:186
mrpt::system::CTicTac::Tac
double Tac() noexcept
Stops the stopwatch.
Definition: CTicTac.cpp:90
mrpt::vision::CFeatureExtraction::TOptions::TSpinImagesOptions::radius
unsigned int radius
for the "soft histogram" (default=20 units [0,255])
Definition: CFeatureExtraction.h:240
mrpt::vision::CFeatureList
A list of visual features, to be used as output by detectors, as input/output by trackers,...
Definition: CFeature.h:304
mrpt::vision::TImageROI
A structure for defining a ROI within an image.
Definition: vision/include/mrpt/vision/types.h:342
mrpt::vision::TImageROI::xMin
float xMin
X coordinate limits [0,imageWidth)
Definition: vision/include/mrpt/vision/types.h:351
mrpt::vision::CFeatureExtraction::TOptions::TSpinImagesOptions::std_intensity
float std_intensity
"soft histogram" (default=0.4 pixels)
Definition: CFeatureExtraction.h:237
mrpt::vision::descSIFT
@ descSIFT
SIFT descriptors.
Definition: vision/include/mrpt/vision/types.h:100
mrpt::vision::featFASTER9
@ featFASTER9
FASTER-9 detector, Edward Rosten's libcvd implementation optimized for SSE2.
Definition: vision/include/mrpt/vision/types.h:73
MRPT_LOAD_CONFIG_VAR_CAST
#define MRPT_LOAD_CONFIG_VAR_CAST( variableName, variableType, variableTypeCast, configFileObject, sectionNameStr)
Definition: config/CConfigFileBase.h:315
mrpt::img
Definition: CCanvas.h:17
mrpt::vision::CFeatureExtraction::TOptions::TLogPolarImagesOptions::rho_scale
double rho_scale
will have dimensions WxH, with: W=num_angles, H= rho_scale * log(radius)
Definition: CFeatureExtraction.h:269
mrpt::vision::CFeatureExtraction::TOptions::AKAZEOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TAKAZEOptions AKAZEOptions
mrpt::vision::TImageROI::xMax
float xMax
Definition: vision/include/mrpt/vision/types.h:351
mrpt::vision::CFeatureExtraction::TOptions::THarrisOptions::k
float k
Definition: CFeatureExtraction.h:147
mrpt::vision::descSpinImages
@ descSpinImages
Intensity-domain spin image descriptors.
Definition: vision/include/mrpt/vision/types.h:104
mrpt::vision::CFeatureExtraction::TOptions::LogPolarImagesOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TLogPolarImagesOptions LogPolarImagesOptions
MRPT_START
#define MRPT_START
Definition: exceptions.h:262
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::format
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Definition: format.cpp:16
mrpt::vision::CFeatureExtraction::TOptions::TKLTOptions::threshold
float threshold
Definition: CFeatureExtraction.h:134
mrpt::vision::CFeatureExtraction::TOptions::TAKAZEOptions::descriptor_type
int descriptor_type
Definition: CFeatureExtraction.h:279
mrpt::vision::featSIFT
@ featSIFT
Scale Invariant Feature Transform [LOWE'04].
Definition: vision/include/mrpt/vision/types.h:61
mrpt::vision::descLATCH
@ descLATCH
LATCH Line descriptor.
Definition: vision/include/mrpt/vision/types.h:112
iniFile
string iniFile(myDataDir+string("benchmark-options.ini"))
mrpt::vision::descSURF
@ descSURF
SURF descriptors.
Definition: vision/include/mrpt/vision/types.h:102
CFeatureExtraction.h
mrpt::vision::CFeatureExtraction::TOptions::addNewFeatures
bool addNewFeatures
Whether to add the found features to the input feature list or clear it before adding them (default=f...
Definition: CFeatureExtraction.h:123
mrpt::vision::CFeatureExtraction::TOptions::TLogPolarImagesOptions::radius
unsigned int radius
Maximum radius of the area of which the.
Definition: CFeatureExtraction.h:262
mrpt::vision::CFeatureExtraction::TSIFTImplementation
TSIFTImplementation
Definition: CFeatureExtraction.h:85
mrpt::vision::featHarris
@ featHarris
Harris border and corner detector [HARRIS].
Definition: vision/include/mrpt/vision/types.h:57
mrpt::vision::CFeatureExtraction::TOptions::TKLTOptions::tile_image
bool tile_image
Definition: CFeatureExtraction.h:137
mrpt::vision::TFeatureType
TFeatureType
Types of features - This means that the point has been detected with this algorithm,...
Definition: vision/include/mrpt/vision/types.h:50
sort_pred
Definition: CFeatureExtraction_common.cpp:25
mrpt::vision::CFeatureExtraction::TOptions::TORBOptions::extract_patch
bool extract_patch
Definition: CFeatureExtraction.h:189
mrpt::vision::CFeatureList::push_back
void push_back(const CFeature::Ptr &f)
Definition: CFeature.h:400
mrpt::system::CTicTac::Tic
void Tic() noexcept
Starts the stopwatch.
Definition: CTicTac.cpp:79
LOADABLEOPTS_DUMP_VAR
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
Definition: config/CLoadableOptions.h:103
mrpt::vision::CFeatureExtraction::TOptions::FASTOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TFASTOptions FASTOptions
mrpt::vision::CFeatureExtraction::TOptions::harrisOptions
struct mrpt::vision::CFeatureExtraction::TOptions::THarrisOptions harrisOptions
mrpt::img::CImage
A class for storing images as grayscale or RGB bitmaps.
Definition: img/CImage.h:130
mrpt::vision::CFeatureExtraction::TOptions::FIND_SUBPIXEL
bool FIND_SUBPIXEL
Indicates if subpixel accuracy is desired for the extracted points (only applicable to KLT and Harris...
Definition: CFeatureExtraction.h:128
mrpt::vision::featBCD
@ featBCD
Binary corder detector.
Definition: vision/include/mrpt/vision/types.h:59
mrpt::vision::CFeatureExtraction::TOptions::loadFromConfigFile
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
Definition: CFeatureExtraction_common.cpp:481
mrpt::vision::CFeatureExtraction::TOptions::TFASTOptions::use_KLT_response
bool use_KLT_response
(default=false) If true, use
Definition: CFeatureExtraction.h:169
mrpt::vision::CFeatureExtraction::TOptions::TLSDOptions::nOctaves
int nOctaves
Definition: CFeatureExtraction.h:293
mrpt::vision::CFeatureExtraction::TOptions::PolarImagesOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TPolarImagesOptions PolarImagesOptions
mrpt::vision::CFeatureExtraction::TOptions::TAKAZEOptions::descriptor_channels
int descriptor_channels
Definition: CFeatureExtraction.h:281
img
GLint GLvoid * img
Definition: glext.h:3763
CTicTac.h
mrpt::vision::CFeatureExtraction::TOptions::THarrisOptions::min_distance
float min_distance
Definition: CFeatureExtraction.h:151
mrpt::vision::CFeatureExtraction::TOptions::THarrisOptions::threshold
float threshold
Definition: CFeatureExtraction.h:145
mrpt::vision::CFeatureExtraction::TOptions::TAKAZEOptions::nOctaveLayers
int nOctaveLayers
Definition: CFeatureExtraction.h:284
mrpt::vision::featSURF
@ featSURF
Speeded Up Robust Feature [BAY'06].
Definition: vision/include/mrpt/vision/types.h:63
MRPT_END
#define MRPT_END
Definition: exceptions.h:266
MRPT_TODO
#define MRPT_TODO(x)
Definition: common.h:129
mrpt::vision::CFeatureExtraction::TOptions::SpinImagesOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TSpinImagesOptions SpinImagesOptions
mrpt::vision::CFeatureExtraction::TOptions::TORBOptions::min_distance
size_t min_distance
Definition: CFeatureExtraction.h:187
mrpt::vision::CFeatureExtraction::TOptions::TAKAZEOptions::nOctaves
int nOctaves
Definition: CFeatureExtraction.h:283
mrpt::vision::CFeatureExtraction::TOptions::TORBOptions::scale_factor
float scale_factor
Definition: CFeatureExtraction.h:188
mrpt::vision::featAKAZE
@ featAKAZE
AKAZE detector, OpenCV's implementation.
Definition: vision/include/mrpt/vision/types.h:85
mrpt::vision::CFeatureExtraction::TOptions::TLATCHOptions::rotationInvariance
bool rotationInvariance
Definition: CFeatureExtraction.h:312
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::vision::CFeatureExtraction::TOptions::TSpinImagesOptions::std_dist
float std_dist
"distance" axis of the 2D histogram (default=10).
Definition: CFeatureExtraction.h:235
mrpt::vision::CFeatureExtraction::TOptions::TLSDOptions::scale
int scale
Definition: CFeatureExtraction.h:292
mrpt::vision::CFeatureExtraction::TOptions::TSpinImagesOptions::hist_size_intensity
unsigned int hist_size_intensity
SpinImages Options.
Definition: CFeatureExtraction.h:229
iterator
Scalar * iterator
Definition: eigen_plugins.h:26
CArchive.h
mrpt::vision::featLSD
@ featLSD
LSD detector, OpenCV's implementation.
Definition: vision/include/mrpt/vision/types.h:86
mrpt::vision::CFeatureExtraction::TOptions::TLATCHOptions::half_ssd_size
int half_ssd_size
Definition: CFeatureExtraction.h:313
mrpt::vision::CFeatureExtraction::TOptions::THarrisOptions::radius
int radius
Definition: CFeatureExtraction.h:150
mrpt::vision::CFeatureExtraction::TOptions::SIFTOptions
struct mrpt::vision::CFeatureExtraction::TOptions::TSIFTOptions SIFTOptions
mrpt::vision::CFeatureExtraction::TOptions::THarrisOptions::sigma
float sigma
Definition: CFeatureExtraction.h:148
mrpt::vision::CFeatureList::clear
void clear()
Definition: CFeature.h:389
mrpt::system
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Definition: math_frwds.h:25



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST