Main MRPT website > C++ reference
MRPT logo
CFeature.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2014, 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 #ifndef CFeature_H
10 #define CFeature_H
11 
12 #include <mrpt/utils/CImage.h>
13 #include <mrpt/math/CMatrix.h>
15 
16 #include <mrpt/vision/types.h>
18 
19 namespace mrpt
20 {
21  namespace vision
22  {
23  using namespace mrpt::utils;
24  using namespace mrpt::math;
25  using namespace std;
26 
27  class CFeatureList;
28  class CMatchedFeatureList;
29 
30  enum TListIdx
31  {
32  firstList = 0,
35  };
36 
37  /** \defgroup mrptvision_features Feature detection, descriptors and matching
38  * \ingroup mrpt_vision_grp
39  */
40 
41  /** \addtogroup mrptvision_features
42  @{ */
43 
44 
45  /****************************************************
46  Class CFEATURE
47  *****************************************************/
49 
50  /** A generic 2D feature from an image, extracted with \a CFeatureExtraction
51  * Each feature may have one or more descriptors (see \a descriptors), in addition to an image patch.
52  * The (Euclidean) distance between descriptors in a pair of features can be computed with descriptorDistanceTo,
53  * while the similarity of the patches is given by patchCorrelationTo.
54  *
55  * \sa CFeatureList, TSimpleFeature, TSimpleFeatureList
56  */
57  class VISION_IMPEXP CFeature : public mrpt::utils::CSerializable
58  {
59  friend class CFeatureList;
60  friend class CMatchedFeatureList;
61 
63 
64  public:
65  float x,y; //!< Coordinates in the image
66  TFeatureID ID; //!< ID of the feature
67  CImage patch; //!< A patch of the image surrounding the feature
68  uint16_t patchSize; //!< Size of the patch (patchSize x patchSize) (it must be an odd number)
69  TFeatureType type; //!< Type of the feature: featNotDefined, featSIFT, featKLT, featHarris, featSURF, featBeacon
70  TFeatureTrackStatus track_status; //!< Status of the feature tracking process (old name: KLT_status)
71  float response; //!< A measure of the "goodness" of the feature (old name: KLT_val)
72  float orientation; //!< Main orientation of the feature
73  float scale; //!< Feature scale into the scale space
74  uint8_t user_flags; //!< A field for any other flags needed by the user (this has not a predefined meaning)
75  uint16_t nTimesSeen; //!< Number of frames it has been seen in a sequence of images.
76  uint16_t nTimesNotSeen; //!< Number of frames it has not been seen in a sequence of images.
77  uint16_t nTimesLastSeen; //!< Number of frames since it was seen for the last time.
78 
79  double depth; //!< The estimated depth in 3D of this feature wrt the camera in the current frame
80  double initialDepth; //!< The estimated depth in 3D of this feature wrt the camera that took its image
81  TPoint3D p3D; //!< The estimated 3D point of this feature wrt its camera
82  deque<double> multiScales; //!< A set of scales where the multi-resolution descriptor has been computed
83  deque<vector<double> > multiOrientations; //!< A vector of main orientations (there is a vector of orientations for each scale)
84  deque<vector<vector<int32_t> > > multiHashCoeffs; //!< A set of vectors containing the coefficients for a HASH table of descriptors
85  bool isPointFeature() const; //!< Return false only for Blob detectors (SIFT, SURF)
86 
87  /** All the possible descriptors this feature may have */
89  {
90  TDescriptors(); // Initialization
91 
92  std::vector<uint8_t> SIFT; //!< SIFT feature descriptor
93  std::vector<float> SURF; //!< SURF feature descriptor
94  std::vector<float> SpinImg; //!< The 2D histogram as a single row
95  uint16_t SpinImg_range_rows; //!< The number of rows (corresponding to range bins in the 2D histogram) of the original matrix from which SpinImg was extracted as a vector.
96  mrpt::math::CMatrix PolarImg; //!< A polar image centered at the interest point
97  mrpt::math::CMatrix LogPolarImg; //!< A log-polar image centered at the interest point
98  bool polarImgsNoRotation; //!< If set to true (manually, default=false) the call to "descriptorDistanceTo" will not consider all the rotations between polar image descriptors (PolarImg, LogPolarImg)
99  deque<vector<vector<int32_t> > > multiSIFTDescriptors; //!< A set of SIFT-like descriptors for each orientation and scale of the multiResolution feature (there is a vector of descriptors for each scale)
100  std::vector<uint8_t> ORB; //!< ORB feature descriptor
101 
102  bool hasDescriptorSIFT() const { return !SIFT.empty(); }; //!< Whether this feature has this kind of descriptor
103  bool hasDescriptorSURF() const { return !SURF.empty(); } //!< Whether this feature has this kind of descriptor
104  bool hasDescriptorSpinImg() const { return !SpinImg.empty(); }; //!< Whether this feature has this kind of descriptor
105  bool hasDescriptorPolarImg() const { return PolarImg.rows()!=0; } ; //!< Whether this feature has this kind of descriptor
106  bool hasDescriptorLogPolarImg() const { return LogPolarImg.rows()!=0; } ; //!< Whether this feature has this kind of descriptor
107  bool hasDescriptorMultiSIFT() const {
108  return (multiSIFTDescriptors.size() > 0 && multiSIFTDescriptors[0].size() > 0); //!< Whether this feature has this kind of descriptor
109  }
110  bool hasDescriptorORB() const { return !ORB.empty(); } //!< Whether this feature has this kind of descriptor
111  }
112  descriptors;
113 
114  /** Return the first found descriptor, as a matrix.
115  * \return false on error, i.e. there is no valid descriptor.
116  */
117  bool getFirstDescriptorAsMatrix(mrpt::math::CMatrixFloat &desc) const;
118 
119  /** Computes the normalized cross-correlation between the patches of this and another feature (normalized in the range [0,1], such as 0=best, 1=worst).
120  * \note If this or the other features does not have patches or they are of different sizes, an exception will be raised.
121  * \sa descriptorDistanceTo
122  */
123  float patchCorrelationTo( const CFeature &oFeature) const;
124 
125  /** Computes the Euclidean Distance between this feature's and other feature's descriptors, using the given descriptor or the first present one.
126  * \note If descriptorToUse is not descAny and that descriptor is not present in one of the features, an exception will be raised.
127  * \sa patchCorrelationTo
128  */
129  float descriptorDistanceTo( const CFeature &oFeature, TDescriptorType descriptorToUse = descAny, bool normalize_distances = true ) const;
130 
131  /** Computes the Euclidean Distance between "this" and the "other" descriptors */
132  float descriptorSIFTDistanceTo( const CFeature &oFeature, bool normalize_distances = true ) const;
133 
134  /** Computes the Euclidean Distance between "this" and the "other" descriptors */
135  float descriptorSURFDistanceTo( const CFeature &oFeature, bool normalize_distances = true ) const;
136 
137  /** Computes the Euclidean Distance between "this" and the "other" descriptors */
138  float descriptorSpinImgDistanceTo( const CFeature &oFeature, bool normalize_distances = true ) const;
139 
140  /** Returns the minimum Euclidean Distance between "this" and the "other" polar image descriptor, for the best shift in orientation.
141  * \param oFeature The other feature to compare with.
142  * \param minDistAngle The placeholder for the angle at which the smallest distance is found.
143  * \return The distance for the best orientation (minimum distance).
144  */
145  float descriptorPolarImgDistanceTo(
146  const CFeature &oFeature,
147  float &minDistAngle,
148  bool normalize_distances = true ) const;
149 
150  /** Returns the minimum Euclidean Distance between "this" and the "other" log-polar image descriptor, for the best shift in orientation.
151  * \param oFeature The other feature to compare with.
152  * \param minDistAngle The placeholder for the angle at which the smallest distance is found.
153  * \return The distance for the best orientation (minimum distance).
154  */
155  float descriptorLogPolarImgDistanceTo(
156  const CFeature &oFeature,
157  float &minDistAngle,
158  bool normalize_distances = true ) const;
159 
160  /** Computes the Hamming distance "this" and the "other" descriptor ORB descriptor */
161  uint8_t descriptorORBDistanceTo( const CFeature &oFeature ) const;
162 
163  /** Save the feature to a text file in this format:
164  * "%% Dump of mrpt::vision::CFeatureList. Each line format is:\n"
165  * "%% ID TYPE X Y ORIENTATION SCALE TRACK_STATUS RESPONSE HAS_SIFT [SIFT] HAS_SURF [SURF] HAS_MULTI [MULTI_i] HAS_ORB [ORB]"
166  * "%% |---------------------- feature ------------------| |---------------------- descriptors ------------------------|"
167  * "%% with:\n"
168  * "%% TYPE : The used detector: 0:KLT, 1: Harris, 2: BCD, 3: SIFT, 4: SURF, 5: Beacon, 6: FAST, 7: ORB\n"
169  * "%% HAS_* : 1 if a descriptor of that type is associated to the feature."
170  * "%% SIFT : Present if HAS_SIFT=1: N DESC_0 ... DESC_N-1"
171  * "%% SURF : Present if HAS_SURF=1: N DESC_0 ... DESC_N-1"
172  * "%% MULTI : Present if HAS_MULTI=1: SCALE ORI N DESC_0 ... DESC_N-1"
173  * "%% ORB : Present if HAS_ORB=1: DESC_0 ... DESC_31
174  * "%%-----------------------------------------------------------------------------\n");
175  */
176  void saveToTextFile( const std::string &filename, bool APPEND = false );
177 
178  /** Get the type of the feature
179  */
180  TFeatureType get_type() const { return type; }
181 
182  /** Dump feature information into a text stream */
183  void dumpToTextStream( mrpt::utils::CStream &out) const;
184 
185  void dumpToConsole() const;
186 
187  /** Constructor
188  */
189  CFeature();
190 
191  /** Virtual destructor */
192  virtual ~CFeature() {}
193 
194 
195  protected:
196 
197  /** Internal function used by "descriptorLogPolarImgDistanceTo" and "descriptorPolarImgDistanceTo"
198  */
199  static float internal_distanceBetweenPolarImages(
200  const mrpt::math::CMatrix &desc1,
201  const mrpt::math::CMatrix &desc2,
202  float &minDistAngle,
203  bool normalize_distances,
204  bool dont_shift_angle );
205 
206  }; // end of class
208 
209 
210  /****************************************************
211  Class CFEATURELIST
212  *****************************************************/
213  /** A list of visual features, to be used as output by detectors, as input/output by trackers, etc.
214  */
216  {
217  protected:
218  typedef std::vector<CFeaturePtr> TInternalFeatList;
219 
220  TInternalFeatList m_feats; //!< The actual container with the list of features
221 
222  public:
223  /** The type of the first feature in the list */
224  inline TFeatureType get_type() const { return empty() ? featNotDefined : (*begin())->get_type(); }
225 
226  /** Save feature list to a text file */
227  void saveToTextFile( const std::string &fileName, bool APPEND = false );
228 
229  /** Save feature list to a text file */
230  void loadFromTextFile( const std::string &fileName );
231 
232  /** Copies the content of another CFeatureList inside this one. The inner features are also copied. */
233  void copyListFrom( const CFeatureList &otherList );
234 
235  /** Get the maximum ID into the list */
236  TFeatureID getMaxID() const;
237 
238  /** Get a reference to a Feature from its ID */
239  CFeaturePtr getByID( const TFeatureID &ID ) const;
240  CFeaturePtr getByID( const TFeatureID &ID, int &out_idx ) const;
241 
242  /** Get a vector of references to a subset of features from their IDs */
243  void getByMultiIDs( const vector<TFeatureID> &IDs, vector<CFeaturePtr> &out, vector<int> &outIndex ) const;
244 
245  /** Get a reference to the nearest feature to the a given 2D point (version returning distance to closest feature in "max_dist")
246  * \param x [IN] The query point x-coordinate
247  * \param y [IN] The query point y-coordinate
248  * \param max_dist [IN/OUT] At input: The maximum distance to search for. At output: The actual distance to the feature.
249  * \return A reference to the found feature, or a NULL smart pointer if none found.
250  * \note See also all the available KD-tree search methods, listed in mrpt::math::KDTreeCapable
251  */
252  CFeaturePtr nearest( const float x, const float y, double &max_dist ) const;
253 
254  /** Constructor */
255  CFeatureList();
256 
257  /** Virtual destructor */
258  virtual ~CFeatureList();
259 
260  /** Call this when the list of features has been modified so the KD-tree is marked as outdated. */
261  inline void mark_kdtree_as_outdated() const { kdtree_mark_as_outdated(); }
262 
263  /** @name Method and datatypes to emulate a STL container
264  @{ */
267 
268  typedef TInternalFeatList::reverse_iterator reverse_iterator;
269  typedef TInternalFeatList::const_reverse_iterator const_reverse_iterator;
270 
271  inline iterator begin() { return m_feats.begin(); }
272  inline iterator end() { return m_feats.end(); }
273  inline const_iterator begin() const { return m_feats.begin(); }
274  inline const_iterator end() const { return m_feats.end(); }
275 
276  inline reverse_iterator rbegin() { return m_feats.rbegin(); }
277  inline reverse_iterator rend() { return m_feats.rend(); }
278  inline const_reverse_iterator rbegin() const { return m_feats.rbegin(); }
279  inline const_reverse_iterator rend() const { return m_feats.rend(); }
280 
281  inline iterator erase(const iterator it) { mark_kdtree_as_outdated(); return m_feats.erase(it); }
282 
283  inline bool empty() const { return m_feats.empty(); }
284  inline size_t size() const { return m_feats.size(); }
285 
286  inline void clear() { m_feats.clear(); mark_kdtree_as_outdated(); }
287  inline void resize(size_t N) { m_feats.resize(N); mark_kdtree_as_outdated(); }
288 
289  inline void push_back(const CFeaturePtr &f) { mark_kdtree_as_outdated(); m_feats.push_back(f); }
290 
291  inline CFeaturePtr & operator [](const unsigned int index) { return m_feats[index]; }
292  inline const CFeaturePtr & operator [](const unsigned int index) const { return m_feats[index]; }
293 
294  /** @} */
295 
296 
297  /** @name Methods that MUST be implemented by children classes of KDTreeCapable
298  @{ */
299 
300  /// Must return the number of data points
301  inline size_t kdtree_get_point_count() const { return this->size(); }
302 
303  /// Returns the dim'th component of the idx'th point in the class:
304  inline float kdtree_get_pt(const size_t idx, int dim) const {
305  ASSERTDEB_(dim==0 || dim==1)
306  if (dim==0) return m_feats[idx]->x;
307  else return m_feats[idx]->y;
308  }
309 
310  /// Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class:
311  inline float kdtree_distance(const float *p1, const size_t idx_p2,size_t size) const
312  {
313  ASSERTDEB_(size==2)
314  MRPT_UNUSED_PARAM(size); // in release mode
315 
316  const float d0 = p1[0] - m_feats[idx_p2]->x;
317  const float d1 = p1[1] - m_feats[idx_p2]->y;
318  return d0*d0+d1*d1;
319  }
320 
321  // Optional bounding-box computation: return false to default to a standard bbox computation loop.
322  // Return true if the BBOX was already computed by the class and returned in "bb" so it can be avoided to redo it again.
323  // Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 for point clouds)
324  template <typename BBOX>
325  bool kdtree_get_bbox(BBOX &bb) const {
326  MRPT_UNUSED_PARAM(bb);
327  return false;
328  }
329 
330  /** @} */
331 
332 
333  /** @name getFeature*() methods for template-based access to feature list
334  @{ */
335  inline float getFeatureX(size_t i) const { return m_feats[i]->x; }
336  inline float getFeatureY(size_t i) const { return m_feats[i]->y; }
337  inline TFeatureID getFeatureID(size_t i) const { return m_feats[i]->ID; }
338  inline float getFeatureResponse(size_t i) const { return m_feats[i]->response; }
339  inline bool isPointFeature(size_t i) const { return m_feats[i]->isPointFeature(); }
340  inline float getScale(size_t i) const { return m_feats[i]->scale; }
341  inline TFeatureTrackStatus getTrackStatus(size_t i) { return m_feats[i]->track_status; }
342 
343  inline void setFeatureX(size_t i,float x) { m_feats[i]->x=x; }
344  inline void setFeatureXf(size_t i,float x) { m_feats[i]->x=x; }
345  inline void setFeatureY(size_t i,float y) { m_feats[i]->y=y; }
346  inline void setFeatureYf(size_t i,float y) { m_feats[i]->y=y; }
347 
348  inline void setFeatureID(size_t i,TFeatureID id) { m_feats[i]->ID=id; }
349  inline void setFeatureResponse(size_t i,float r) { m_feats[i]->response=r; }
350  inline void setScale(size_t i,float s) { m_feats[i]->scale=s; }
351  inline void setTrackStatus(size_t i,TFeatureTrackStatus s) { m_feats[i]->track_status=s; }
352 
353  inline void mark_as_outdated() const { kdtree_mark_as_outdated(); }
354 
355  /** @} */
356 
357 
358  }; // end of class
359 
360  /****************************************************
361  Class CMATCHEDFEATURELIST
362  *****************************************************/
363  /** A list of features
364  */
365  class VISION_IMPEXP CMatchedFeatureList : public std::deque< std::pair<CFeaturePtr,CFeaturePtr> >
366  {
367  public:
368  /** The type of the first feature in the list */
369  inline TFeatureType get_type() const { return empty() ? featNotDefined : (begin()->first)->get_type(); }
370 
371  /** Save list of matched features to a text file */
372  void saveToTextFile(const std::string &fileName);
373 
374  /** Returns the matching features as two separate CFeatureLists */
375  void getBothFeatureLists( CFeatureList &list1, CFeatureList &list2 );
376 
377  /** Returns a smart pointer to the feature with the provided ID or a empty one if not found */
378  CFeaturePtr getByID( const TFeatureID & ID, const TListIdx &idx );
379 
380  /** Returns the maximum ID of the features in the list. If the max ID has been already set up, this method just returns it.
381  Otherwise, this method finds, stores and returns it.*/
382  void getMaxID( const TListIdx &idx, TFeatureID & firstListID, TFeatureID & secondListID );
383 
384  /** Updates the value of the maximum ID of the features in the matched list, i.e. it explicitly searches for the max ID and updates the member variables. */
385  void updateMaxID( const TListIdx &idx );
386 
387  /** Explicitly set the max IDs values to certain values */
388  inline void setLeftMaxID( const TFeatureID &leftID ){ m_leftMaxID = leftID; }
389  inline void setRightMaxID( const TFeatureID &rightID ){ m_rightMaxID = rightID; }
390  inline void setMaxIDs( const TFeatureID &leftID, const TFeatureID &rightID )
391  {
392  setLeftMaxID(leftID);
393  setRightMaxID(rightID);
394  };
395 
396  /** Constructor */
398 
399  /** Virtual destructor */
400  virtual ~CMatchedFeatureList();
401  protected:
402  TFeatureID m_leftMaxID, m_rightMaxID;
403  }; // end of class
404 
405 
406  /** @} */ // End of add to module: mrptvision_features
407 
408  } // end of namespace
409 
410 
411  namespace utils
412  {
413  using namespace ::mrpt::vision;
414  // Specialization must occur in the same namespace
416  }
417 } // end of namespace
418 
419 #endif
420 
TFeatureType get_type() const
The type of the first feature in the list.
Definition: CFeature.h:224
TInternalFeatList::const_reverse_iterator const_reverse_iterator
Definition: CFeature.h:269
Non-defined feature (also used for Occupancy features)
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
Used in some methods to mean "any of the present descriptors".
float kdtree_get_pt(const size_t idx, int dim) const
Returns the dim'th component of the idx'th point in the class:
Definition: CFeature.h:304
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:35
const_reverse_iterator rend() const
Definition: CFeature.h:279
void saveToTextFile(const std::string &file, mrpt::math::TMatrixTextFileFormat fileFormat=mrpt::math::MATRIX_FORMAT_ENG, bool appendMRPTHeader=false, const std::string &userHeader=std::string()) const
Save matrix to a text file, compatible with MATLAB text format (see also the methods of matrix classe...
A class for storing images as grayscale or RGB bitmaps.
Definition: CImage.h:97
void setRightMaxID(const TFeatureID &rightID)
Definition: CFeature.h:389
const_reverse_iterator rbegin() const
Definition: CFeature.h:278
reverse_iterator rend()
Definition: CFeature.h:277
void setFeatureX(size_t i, float x)
Definition: CFeature.h:343
size_t size() const
Definition: CFeature.h:284
Scalar * iterator
Definition: eigen_plugins.h:23
void mark_kdtree_as_outdated() const
Call this when the list of features has been modified so the KD-tree is marked as outdated...
Definition: CFeature.h:261
float getFeatureResponse(size_t i) const
Definition: CFeature.h:338
void setFeatureResponse(size_t i, float r)
Definition: CFeature.h:349
bool isPointFeature(size_t i) const
Definition: CFeature.h:339
EIGEN_STRONG_INLINE iterator begin()
Definition: eigen_plugins.h:26
void setMaxIDs(const TFeatureID &leftID, const TFeatureID &rightID)
Definition: CFeature.h:390
std::vector< float > SURF
SURF feature descriptor.
Definition: CFeature.h:93
TInternalFeatList::const_iterator const_iterator
Definition: CFeature.h:266
STL namespace.
#define MRPT_DECLARE_TTYPENAME_PTR(_TYPE)
Definition: TTypeName.h:68
const Scalar * const_iterator
Definition: eigen_plugins.h:24
mrpt::math::CMatrix LogPolarImg
A log-polar image centered at the interest point.
Definition: CFeature.h:97
bool hasDescriptorORB() const
Whether this feature has this kind of descriptor.
Definition: CFeature.h:110
void setTrackStatus(size_t i, TFeatureTrackStatus s)
Definition: CFeature.h:351
const_iterator begin() const
Definition: CFeature.h:273
TInternalFeatList m_feats
The actual container with the list of features.
Definition: CFeature.h:220
bool hasDescriptorMultiSIFT() const
Whether this feature has this kind of descriptor.
Definition: CFeature.h:107
TFeatureType get_type() const
The type of the first feature in the list.
Definition: CFeature.h:369
A generic adaptor class for providing Approximate Nearest Neighbors (ANN) (via the nanoflann library)...
Definition: KDTreeCapable.h:67
const_iterator end() const
Definition: CFeature.h:274
void setFeatureY(size_t i, float y)
Definition: CFeature.h:345
reverse_iterator rbegin()
Definition: CFeature.h:276
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
bool polarImgsNoRotation
If set to true (manually, default=false) the call to "descriptorDistanceTo" will not consider all the...
Definition: CFeature.h:98
This base provides a set of functions for maths stuff.
Definition: CArray.h:18
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
void resize(size_t N)
Definition: CFeature.h:287
virtual ~CFeature()
Virtual destructor.
Definition: CFeature.h:192
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
EIGEN_STRONG_INLINE bool empty() const
float getFeatureY(size_t i) const
Definition: CFeature.h:336
bool hasDescriptorLogPolarImg() const
Whether this feature has this kind of descriptor.
Definition: CFeature.h:106
std::vector< CFeaturePtr > TInternalFeatList
Definition: CFeature.h:218
bool hasDescriptorPolarImg() const
Whether this feature has this kind of descriptor.
Definition: CFeature.h:105
std::vector< uint8_t > SIFT
SIFT feature descriptor.
Definition: CFeature.h:92
All the possible descriptors this feature may have.
Definition: CFeature.h:88
TFeatureID getFeatureID(size_t i) const
Definition: CFeature.h:337
Classes for computer vision, detectors, features, etc.
uint16_t SpinImg_range_rows
The number of rows (corresponding to range bins in the 2D histogram) of the original matrix from whic...
Definition: CFeature.h:95
A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...
Definition: CFeature.h:57
void push_back(const CFeaturePtr &f)
Definition: CFeature.h:289
uint64_t TFeatureID
Definition of a feature ID.
A list of visual features, to be used as output by detectors, as input/output by trackers, etc.
Definition: CFeature.h:215
TDescriptorType
The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...
TInternalFeatList::reverse_iterator reverse_iterator
Definition: CFeature.h:268
TFeatureType
Types of features - This means that the point has been detected with this algorithm, which is independent of additional descriptors a feature may also have.
void loadFromTextFile(const std::string &file)
Load matrix from a text file, compatible with MATLAB text format.
TFeatureType get_type() const
Get the type of the feature.
Definition: CFeature.h:180
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
bool hasDescriptorSURF() const
Whether this feature has this kind of descriptor.
Definition: CFeature.h:103
void setFeatureID(size_t i, TFeatureID id)
Definition: CFeature.h:348
bool kdtree_get_bbox(BBOX &bb) const
Definition: CFeature.h:325
std::vector< float > SpinImg
The 2D histogram as a single row.
Definition: CFeature.h:94
size_t size(const MATRIXLIKE &m, int dim)
Definition: bits.h:38
float getScale(size_t i) const
Definition: CFeature.h:340
void setLeftMaxID(const TFeatureID &leftID)
Explicitly set the max IDs values to certain values.
Definition: CFeature.h:388
void mark_as_outdated() const
Definition: CFeature.h:353
size_t kdtree_get_point_count() const
Must return the number of data points.
Definition: CFeature.h:301
TInternalFeatList::iterator iterator
Definition: CFeature.h:265
void setFeatureYf(size_t i, float y)
Definition: CFeature.h:346
void setFeatureXf(size_t i, float x)
Definition: CFeature.h:344
void setScale(size_t i, float s)
Definition: CFeature.h:350
float kdtree_distance(const float *p1, const size_t idx_p2, size_t size) const
Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored ...
Definition: CFeature.h:311
float getFeatureX(size_t i) const
Definition: CFeature.h:335
Lightweight 3D point.
This class is a "CSerializable" wrapper for "CMatrixFloat".
Definition: CMatrix.h:30
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
deque< vector< vector< int32_t > > > multiSIFTDescriptors
A set of SIFT-like descriptors for each orientation and scale of the multiResolution feature (there i...
Definition: CFeature.h:99
iterator erase(const iterator it)
Definition: CFeature.h:281
mrpt::math::CMatrix PolarImg
A polar image centered at the interest point.
Definition: CFeature.h:96
TFeatureTrackStatus getTrackStatus(size_t i)
Definition: CFeature.h:341
A list of features.
Definition: CFeature.h:365
std::vector< uint8_t > ORB
ORB feature descriptor.
Definition: CFeature.h:100



Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014