24 class CMatchedFeatureList;
96 std::vector<uint8_t>
ORB;
104 return (multiSIFTDescriptors.size() > 0 && multiSIFTDescriptors[0].size() > 0);
144 bool normalize_distances =
true )
const;
154 bool normalize_distances =
true )
const;
199 bool normalize_distances,
200 bool dont_shift_angle );
239 void getByMultiIDs(
const std::vector<TFeatureID> &IDs, std::vector<CFeaturePtr> &out, std::vector<int> &outIndex )
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(); }
287 inline CFeaturePtr & operator [](
const unsigned int index) {
return m_feats[index]; }
288 inline const CFeaturePtr & operator [](
const unsigned int index)
const {
return m_feats[index]; }
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; }
388 setLeftMaxID(leftID);
389 setRightMaxID(rightID);
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#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...
#define MRPT_DECLARE_TTYPENAME_PTR_NAMESPACE(_TYPE, __NS)
This class is a "CSerializable" wrapper for "CMatrixFloat".
A matrix of dynamic size.
A class for storing images as grayscale or RGB bitmaps.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...
float descriptorLogPolarImgDistanceTo(const CFeature &oFeature, float &minDistAngle, bool normalize_distances=true) const
Returns the minimum Euclidean Distance between "this" and the "other" log-polar image descriptor,...
float descriptorDistanceTo(const CFeature &oFeature, TDescriptorType descriptorToUse=descAny, bool normalize_distances=true) const
Computes the Euclidean Distance between this feature's and other feature's descriptors,...
uint8_t descriptorORBDistanceTo(const CFeature &oFeature) const
Computes the Hamming distance "this" and the "other" descriptor ORB descriptor.
bool getFirstDescriptorAsMatrix(mrpt::math::CMatrixFloat &desc) const
Return the first found descriptor, as a matrix.
TFeatureType type
Type of the feature: featNotDefined, featSIFT, featKLT, featHarris, featSURF, featBeacon.
float descriptorPolarImgDistanceTo(const CFeature &oFeature, float &minDistAngle, bool normalize_distances=true) const
Returns the minimum Euclidean Distance between "this" and the "other" polar image descriptor,...
std::deque< std::vector< double > > multiOrientations
A vector of main orientations (there is a vector of orientations for each scale)
float response
A measure of the "goodness" of the feature (old name: KLT_val)
static float internal_distanceBetweenPolarImages(const mrpt::math::CMatrix &desc1, const mrpt::math::CMatrix &desc2, float &minDistAngle, bool normalize_distances, bool dont_shift_angle)
Internal function used by "descriptorLogPolarImgDistanceTo" and "descriptorPolarImgDistanceTo".
mrpt::math::TPoint3D p3D
The estimated 3D point of this feature wrt its camera.
void dumpToConsole() const
mrpt::utils::CImage patch
A patch of the image surrounding the feature.
std::deque< std::vector< std::vector< int32_t > > > multiHashCoeffs
A set of vectors containing the coefficients for a HASH table of descriptors.
double initialDepth
The estimated depth in 3D of this feature wrt the camera that took its image.
float descriptorSpinImgDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
float scale
Feature scale into the scale space.
void saveToTextFile(const std::string &filename, bool APPEND=false)
Save the feature to a text file in this format: "%% Dump of mrpt::vision::CFeatureList....
float patchCorrelationTo(const CFeature &oFeature) const
Computes the normalized cross-correlation between the patches of this and another feature (normalized...
void dumpToTextStream(mrpt::utils::CStream &out) const
Dump feature information into a text stream.
uint16_t nTimesNotSeen
Number of frames it has not been seen in a sequence of images.
uint16_t nTimesSeen
Number of frames it has been seen in a sequence of images.
uint8_t user_flags
A field for any other flags needed by the user (this has not a predefined meaning)
std::deque< double > multiScales
A set of scales where the multi-resolution descriptor has been computed.
uint16_t nTimesLastSeen
Number of frames since it was seen for the last time.
float descriptorSIFTDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
struct VISION_IMPEXP mrpt::vision::CFeature::TDescriptors descriptors
float descriptorSURFDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
float orientation
Main orientation of the feature.
virtual ~CFeature()
Virtual destructor.
TFeatureID ID
ID of the feature.
bool isPointFeature() const
Return false only for Blob detectors (SIFT, SURF)
TFeatureTrackStatus track_status
Status of the feature tracking process (old name: KLT_status)
uint16_t patchSize
Size of the patch (patchSize x patchSize) (it must be an odd number)
double depth
The estimated depth in 3D of this feature wrt the camera in the current frame.
TFeatureType get_type() const
Get the type of the feature.
A list of visual features, to be used as output by detectors, as input/output by trackers,...
void setFeatureYf(size_t i, float y)
const_reverse_iterator rbegin() const
iterator erase(const iterator &it)
float getFeatureResponse(size_t i) const
TFeatureID getFeatureID(size_t i) const
void setTrackStatus(size_t i, TFeatureTrackStatus s)
void push_back(const CFeaturePtr &f)
void setFeatureResponse(size_t i, float r)
const_reverse_iterator rend() const
void copyListFrom(const CFeatureList &otherList)
Copies the content of another CFeatureList inside this one.
TInternalFeatList::const_reverse_iterator const_reverse_iterator
void setFeatureXf(size_t i, float x)
TFeatureTrackStatus getTrackStatus(size_t i)
void saveToTextFile(const std::string &fileName, bool APPEND=false)
Save feature list to a text file.
reverse_iterator rbegin()
TInternalFeatList::const_iterator const_iterator
size_t kdtree_get_point_count() const
Must return the number of data points.
TInternalFeatList::reverse_iterator reverse_iterator
bool kdtree_get_bbox(BBOX &bb) const
void mark_kdtree_as_outdated() const
Call this when the list of features has been modified so the KD-tree is marked as outdated.
TInternalFeatList::iterator iterator
void setFeatureX(size_t i, float x)
CFeaturePtr getByID(const TFeatureID &ID, int &out_idx) const
void mark_as_outdated() const
float getFeatureY(size_t i) const
CFeaturePtr getByID(const TFeatureID &ID) const
Get a reference to a Feature from its ID.
const_iterator end() const
float kdtree_get_pt(const size_t idx, int dim) const
Returns the dim'th component of the idx'th point in the class:
virtual ~CFeatureList()
Virtual destructor.
void loadFromTextFile(const std::string &fileName)
Save feature list to a text file.
void setFeatureY(size_t i, float y)
TFeatureID getMaxID() const
Get the maximum ID into the list.
void setFeatureID(size_t i, TFeatureID id)
CFeaturePtr nearest(const float x, const float y, double &max_dist) const
Get a reference to the nearest feature to the a given 2D point (version returning distance to closest...
CFeatureList()
Constructor.
TInternalFeatList m_feats
The actual container with the list of features.
void setScale(size_t i, float s)
void getByMultiIDs(const std::vector< TFeatureID > &IDs, std::vector< CFeaturePtr > &out, std::vector< int > &outIndex) const
Get a vector of references to a subset of features from their IDs.
std::vector< CFeaturePtr > TInternalFeatList
float getScale(size_t i) const
TFeatureType get_type() const
The type of the first feature in the list.
float getFeatureX(size_t i) const
const_iterator begin() const
bool isPointFeature(size_t i) const
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 ...
virtual ~CMatchedFeatureList()
Virtual destructor.
void saveToTextFile(const std::string &fileName)
Save list of matched features to a text file.
CMatchedFeatureList()
Constructor.
void setRightMaxID(const TFeatureID &rightID)
TFeatureType get_type() const
The type of the first feature in the list.
void setMaxIDs(const TFeatureID &leftID, const TFeatureID &rightID)
void updateMaxID(const TListIdx &idx)
Updates the value of the maximum ID of the features in the matched list, i.e.
void getBothFeatureLists(CFeatureList &list1, CFeatureList &list2)
Returns the matching features as two separate CFeatureLists.
void getMaxID(const TListIdx &idx, TFeatureID &firstListID, TFeatureID &secondListID)
Returns the maximum ID of the features in the list.
void setLeftMaxID(const TFeatureID &leftID)
Explicitly set the max IDs values to certain values.
CFeaturePtr getByID(const TFeatureID &ID, const TListIdx &idx)
Returns a smart pointer to the feature with the provided ID or a empty one if not found.
EIGEN_STRONG_INLINE bool empty() const
EIGEN_STRONG_INLINE iterator begin()
TDescriptorType
The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...
TFeatureType
Types of features - This means that the point has been detected with this algorithm,...
uint64_t TFeatureID
Definition of a feature ID.
@ descAny
Used in some methods to mean "any of the present descriptors".
@ featNotDefined
Non-defined feature (also used for Occupancy features)
struct VISION_IMPEXP CFeaturePtr
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
Classes for computer vision, detectors, features, etc.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
All the possible descriptors this feature may have.
uint16_t SpinImg_range_rows
The number of rows (corresponding to range bins in the 2D histogram) of the original matrix from whic...
bool hasDescriptorPolarImg() const
Whether this feature has this kind of descriptor.
mrpt::math::CMatrix PolarImg
A polar image centered at the interest point.
bool hasDescriptorSIFT() const
bool hasDescriptorMultiSIFT() const
Whether this feature has this kind of descriptor.
bool hasDescriptorSURF() const
Whether this feature has this kind of descriptor.
bool hasDescriptorORB() const
Whether this feature has this kind of descriptor.
std::vector< float > SpinImg
The 2D histogram as a single row.
std::vector< float > SURF
SURF feature descriptor.
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...
bool polarImgsNoRotation
If set to true (manually, default=false) the call to "descriptorDistanceTo" will not consider all the...
mrpt::math::CMatrix LogPolarImg
A log-polar image centered at the interest point.
std::vector< uint8_t > SIFT
SIFT feature descriptor.
bool hasDescriptorLogPolarImg() const
Whether this feature has this kind of descriptor.
std::vector< uint8_t > ORB
ORB feature descriptor
bool hasDescriptorSpinImg() const