24 class CMatchedFeatureList;
81 bool isPointFeature()
const;
96 std::vector<uint8_t>
ORB;
104 return (multiSIFTDescriptors.size() > 0 && multiSIFTDescriptors[0].size() > 0);
119 float patchCorrelationTo(
const CFeature &oFeature)
const;
128 float descriptorSIFTDistanceTo(
const CFeature &oFeature,
bool normalize_distances =
true )
const;
131 float descriptorSURFDistanceTo(
const CFeature &oFeature,
bool normalize_distances =
true )
const;
134 float descriptorSpinImgDistanceTo(
const CFeature &oFeature,
bool normalize_distances =
true )
const;
141 float descriptorPolarImgDistanceTo(
144 bool normalize_distances =
true )
const;
151 float descriptorLogPolarImgDistanceTo(
154 bool normalize_distances =
true )
const;
181 void dumpToConsole()
const;
195 static float internal_distanceBetweenPolarImages(
199 bool normalize_distances,
200 bool dont_shift_angle );
235 CFeaturePtr getByID(
const TFeatureID &ID )
const;
236 CFeaturePtr getByID(
const TFeatureID &ID,
int &out_idx )
const;
239 void getByMultiIDs(
const std::vector<TFeatureID> &IDs, std::vector<CFeaturePtr> &out, std::vector<int> &outIndex )
const;
248 CFeaturePtr nearest(
const float x,
const float y,
double &max_dist )
const;
279 inline bool empty()
const {
return m_feats.empty(); }
280 inline size_t size()
const {
return m_feats.size(); }
282 inline void clear() { m_feats.clear(); mark_kdtree_as_outdated(); }
283 inline void resize(
size_t N) { m_feats.resize(N); mark_kdtree_as_outdated(); }
285 inline void push_back(
const CFeaturePtr &f) { mark_kdtree_as_outdated(); m_feats.push_back(f); }
302 if (dim==0)
return m_feats[idx]->x;
303 else return m_feats[idx]->y;
312 const float d0 = p1[0] - m_feats[idx_p2]->x;
313 const float d1 = p1[1] - m_feats[idx_p2]->y;
320 template <
typename BBOX>
331 inline float getFeatureX(
size_t i)
const {
return m_feats[i]->x; }
332 inline float getFeatureY(
size_t i)
const {
return m_feats[i]->y; }
335 inline bool isPointFeature(
size_t i)
const {
return m_feats[i]->isPointFeature(); }
336 inline float getScale(
size_t i)
const {
return m_feats[i]->scale; }
346 inline void setScale(
size_t i,
float s) { m_feats[i]->scale=
s; }
381 void updateMaxID(
const TListIdx &idx );
388 setLeftMaxID(leftID);
389 setRightMaxID(rightID);
TInternalFeatList::const_reverse_iterator const_reverse_iterator
Non-defined feature (also used for Occupancy features)
TFeatureID ID
ID of the feature.
EIGEN_STRONG_INLINE bool empty() const
const_reverse_iterator rend() const
unsigned __int16 uint16_t
uint16_t nTimesSeen
Number of frames it has been seen in a sequence of images.
float scale
Feature scale into the scale space.
Used in some methods to mean "any of the present descriptors".
The virtual base class which provides a unified interface for all persistent objects in MRPT...
A class for storing images as grayscale or RGB bitmaps.
bool hasDescriptorLogPolarImg() const
Whether this feature has this kind of descriptor.
void setRightMaxID(const TFeatureID &rightID)
TFeatureTrackStatus track_status
Status of the feature tracking process (old name: KLT_status)
void setFeatureX(size_t i, float x)
bool hasDescriptorSpinImg() const
TFeatureID getFeatureID(size_t i) const
float getFeatureY(size_t i) const
float getScale(size_t i) const
uint16_t nTimesLastSeen
Number of frames since it was seen for the last time.
void setFeatureResponse(size_t i, float r)
EIGEN_STRONG_INLINE iterator begin()
void setMaxIDs(const TFeatureID &leftID, const TFeatureID &rightID)
bool hasDescriptorSIFT() const
bool isPointFeature(size_t i) const
std::vector< float > SURF
SURF feature descriptor.
std::deque< double > multiScales
A set of scales where the multi-resolution descriptor has been computed.
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...
TInternalFeatList::const_iterator const_iterator
const_iterator begin() const
const Scalar * const_iterator
TFeatureType get_type() const
Get the type of the feature.
mrpt::math::CMatrix LogPolarImg
A log-polar image centered at the interest point.
float y
Coordinates in the image.
void setTrackStatus(size_t i, TFeatureTrackStatus s)
bool hasDescriptorMultiSIFT() const
Whether this feature has this kind of descriptor.
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 ...
const_reverse_iterator rbegin() const
TInternalFeatList m_feats
The actual container with the list of features.
void setFeatureY(size_t i, float y)
reverse_iterator rbegin()
const_iterator end() const
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
bool polarImgsNoRotation
If set to true (manually, default=false) the call to "descriptorDistanceTo" will not consider all the...
TFeatureType type
Type of the feature: featNotDefined, featSIFT, featKLT, featHarris, featSURF, featBeacon.
double depth
The estimated depth in 3D of this feature wrt the camera in the current frame.
#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...
uint16_t nTimesNotSeen
Number of frames it has not been seen in a sequence of images.
virtual ~CFeature()
Virtual destructor.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
std::vector< CFeaturePtr > TInternalFeatList
std::deque< std::vector< std::vector< int32_t > > > multiHashCoeffs
A set of vectors containing the coefficients for a HASH table of descriptors.
std::vector< uint8_t > SIFT
SIFT feature descriptor.
VALUE & operator[](const KEY &key)
Write/read via [i] operator, that creates an element if it didn't exist already.
std::deque< std::vector< double > > multiOrientations
A vector of main orientations (there is a vector of orientations for each scale)
All the possible descriptors this feature may have.
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...
A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...
void push_back(const CFeaturePtr &f)
iterator erase(const iterator &it)
uint64_t TFeatureID
Definition of a feature ID.
bool hasDescriptorORB() const
Whether this feature has this kind of descriptor.
GLsizei const GLchar ** string
A list of visual features, to be used as output by detectors, as input/output by trackers, etc.
uint8_t user_flags
A field for any other flags needed by the user (this has not a predefined meaning) ...
float kdtree_get_pt(const size_t idx, int dim) const
Returns the dim'th component of the idx'th point in the class:
TDescriptorType
The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...
void mark_as_outdated() const
mrpt::math::TPoint3D p3D
The estimated 3D point of this feature wrt its camera.
TInternalFeatList::reverse_iterator reverse_iterator
#define MRPT_DECLARE_TTYPENAME_PTR_NAMESPACE(_TYPE, __NS)
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.
float getFeatureResponse(size_t i) const
float response
A measure of the "goodness" of the feature (old name: KLT_val)
void loadFromTextFile(const std::string &file)
Load matrix from a text file, compatible with MATLAB text format.
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.
GLdouble GLdouble GLdouble r
void setFeatureID(size_t i, TFeatureID id)
std::vector< float > SpinImg
The 2D histogram as a single row.
bool kdtree_get_bbox(BBOX &bb) const
void setLeftMaxID(const TFeatureID &leftID)
Explicitly set the max IDs values to certain values.
A matrix of dynamic size.
TInternalFeatList::iterator iterator
void setFeatureYf(size_t i, float y)
void setFeatureXf(size_t i, float x)
void setScale(size_t i, float s)
mrpt::utils::CImage patch
A patch of the image surrounding the feature.
bool hasDescriptorPolarImg() const
Whether this feature has this kind of descriptor.
float orientation
Main orientation of the feature.
TFeatureType get_type() const
The type of the first feature in the list.
This class is a "CSerializable" wrapper for "CMatrixFloat".
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
uint16_t patchSize
Size of the patch (patchSize x patchSize) (it must be an odd number)
void mark_kdtree_as_outdated() const
Call this when the list of features has been modified so the KD-tree is marked as outdated...
GLuint GLuint GLsizei GLenum type
std::deque< std::vector< std::vector< int32_t > > > multiSIFTDescriptors
A set of SIFT-like descriptors for each orientation and scale of the multiResolution feature (there i...
double initialDepth
The estimated depth in 3D of this feature wrt the camera that took its image.
float getFeatureX(size_t i) const
mrpt::math::CMatrix PolarImg
A polar image centered at the interest point.
TFeatureTrackStatus getTrackStatus(size_t i)
TFeatureType get_type() const
The type of the first feature in the list.
bool hasDescriptorSURF() const
Whether this feature has this kind of descriptor.
size_t kdtree_get_point_count() const
Must return the number of data points.
std::vector< uint8_t > ORB
ORB feature descriptor.