67 std::optional<mrpt::img::CImage>
patch;
110 std::optional<std::vector<uint8_t>>
SIFT;
113 std::optional<std::vector<float>>
SURF;
135 std::optional<std::vector<uint8_t>>
ORB;
139 std::optional<std::vector<uint8_t>>
BLD;
141 std::optional<std::vector<uint8_t>>
LATCH;
182 bool normalize_distances =
true)
const;
187 const CFeature& oFeature,
bool normalize_distances =
true)
const;
192 const CFeature& oFeature,
bool normalize_distances =
true)
const;
197 const CFeature& oFeature,
bool normalize_distances =
true)
const;
207 const CFeature& oFeature,
float& minDistAngle,
208 bool normalize_distances =
true)
const;
218 const CFeature& oFeature,
float& minDistAngle,
219 bool normalize_distances =
true)
const;
229 const CFeature& oFeature,
bool normalize_distances =
true)
const;
233 const CFeature& oFeature,
bool normalize_distances =
true)
const;
268 float& minDistAngle,
bool normalize_distances,
bool dont_shift_angle);
318 const float x,
const float y,
double& max_dist)
const;
367 m_feats.emplace_back(std::move(f));
397 return m_feats[idx].keypoint.pt.x;
399 return m_feats[idx].keypoint.pt.y;
405 const float* p1,
const size_t idx_p2,
size_t size)
const 410 const float d0 = p1[0] -
m_feats[idx_p2].keypoint.pt.x;
411 const float d1 = p1[1] -
m_feats[idx_p2].keypoint.pt.y;
412 return d0 * d0 + d1 * d1;
421 template <
typename BBOX>
434 return m_feats[i].keypoint.pt.x;
438 return m_feats[i].keypoint.pt.y;
446 return m_feats[i].keypoint.response;
450 return m_feats[i].isPointFeature();
455 return m_feats[i].keypoint.track_status;
479 m_feats[i].keypoint.track_status =
s;
void updateMaxID(const TListIdx &idx)
Updates the value of the maximum ID of the features in the matched list, i.e.
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, using the given descriptor or the first present one.
const_reverse_iterator rend() const
uint8_t descriptorORBDistanceTo(const CFeature &oFeature) const
Computes the Hamming distance "this" and the "other" descriptor ORB descriptor.
uint64_t TFeatureID
Definition of a feature ID.
unsigned __int16 uint16_t
float descriptorSpinImgDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
bool hasDescriptorBLD() const
CFeatureList()=default
Constructor.
TInternalFeatList::iterator iterator
std::optional< std::vector< uint8_t > > ORB
ORB feature descriptor.
void loadFromTextFile(const std::string &fileName)
Save feature list to a text file.
Non-defined feature (also used for Occupancy features)
std::optional< std::vector< uint8_t > > BLD
BLD feature descriptor.
bool hasDescriptorLogPolarImg() const
void setRightMaxID(const TFeatureID &rightID)
TKeyPointMethod type
Keypoint method used to detect this feature.
TFeatureTrackStatus track_status
Status of the feature tracking process.
void setFeatureX(size_t i, float x)
bool hasDescriptorSpinImg() const
void dumpToConsole() const
float descriptorSIFTDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
TFeatureID getFeatureID(size_t i) const
float getFeatureY(size_t i) const
float descriptorSURFDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
float getScale(size_t i) const
void setFeatureResponse(size_t i, float r)
void setMaxIDs(const TFeatureID &leftID, const TFeatureID &rightID)
bool hasDescriptorSIFT() const
bool isPointFeature(size_t i) const
GLint GLint GLsizei GLsizei GLsizei depth
const_iterator begin() const
TKeyPointMethod get_type() const
The type of the first feature in the list.
CMatchedFeatureList()=default
void setTrackStatus(size_t i, TFeatureTrackStatus s)
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
Used in some methods to mean "any of the present descriptors".
TKeyPointMethod get_type() const
The type of the first feature in the list.
TInternalFeatList m_feats
The actual container with the list of features.
A generic adaptor class for providing Nearest Neighbor (NN) lookup via the nanoflann library...
void setFeatureY(size_t i, float y)
const CFeature & operator[](const unsigned int index) const
reverse_iterator rbegin()
void push_back(const CFeature &f)
const_iterator end() const
void dumpToTextStream(std::ostream &out) const
Dump feature information into a text stream.
TInternalFeatList::reverse_iterator reverse_iterator
bool polarImgsNoRotation
If set to true (default=false) the call to "descriptorDistanceTo" will not consider all the rotations...
void getBothFeatureLists(CFeatureList &list1, CFeatureList &list2)
Returns the matching features as two separate CFeatureLists.
void saveToTextFile(const std::string &filename, bool APPEND=false)
Save the feature to a text file in this format: "%% Dump of mrpt::vision::CFeatureList. Each line format is:\n" "%% ID TYPE X Y ORIENTATION SCALE TRACK_STATUS RESPONSE HAS_SIFT [SIFT] HAS_SURF [SURF] HAS_MULTI [MULTI_i] HAS_ORB [ORB]" "%% |---------------------- feature ------------------| |---------------------- descriptors ------------------------|" "%% with:\n" "%% TYPE : The used detector: 0:KLT, 1: Harris, 2: BCD, 3: SIFT, 4: SURF, 5: Beacon, 6: FAST, 7: ORB\n" "%% HAS_* : 1 if a descriptor of that type is associated to the feature.
Inactive (right after detection, and before being tried to track)
std::optional< mrpt::img::CImage > patch
A patch of the image surrounding the feature.
void getMaxID(const TListIdx &idx, TFeatureID &firstListID, TFeatureID &secondListID)
Returns the maximum ID of the features in the list.
CFeature & operator[](const unsigned int index)
TKeyPointMethod
Types of key point detectors.
TDescriptorType
The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...
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...
TInternalFeatList::const_reverse_iterator const_reverse_iterator
A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...
float descriptorLATCHDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
virtual ~CMatchedFeatureList()=default
static float internal_distanceBetweenPolarImages(const mrpt::math::CMatrixF &desc1, const mrpt::math::CMatrixF &desc2, float &minDistAngle, bool normalize_distances, bool dont_shift_angle)
Internal function used by "descriptorLogPolarImgDistanceTo" and "descriptorPolarImgDistanceTo".
iterator erase(const iterator &it)
bool hasDescriptorORB() const
void saveToTextFile(const std::string &fileName)
Save list of matched features to a text file.
GLsizei const GLchar ** string
const CFeature * getByID(const TFeatureID &ID) const
Get a reference to a Feature from its ID.
A list of visual features, to be used as output by detectors, as input/output by trackers, etc.
const CFeature * 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...
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:
void mark_as_outdated() const
mrpt::math::TPoint3D p3D
camera that took its image
TInternalFeatList::const_iterator const_iterator
#define MRPT_DECLARE_TTYPENAME_PTR_NAMESPACE(_TYPE, __NS)
std::optional< mrpt::math::CMatrixF > PolarImg
A polar image centered at the interest point.
float getFeatureResponse(size_t i) const
bool hasDescriptorLATCH() const
void saveToTextFile(const std::string &fileName, bool APPEND=false)
Save feature list to a text file.
float response
A measure of the "goodness" of the feature.
virtual ~CFeatureList()
Virtual destructor.
bool getFirstDescriptorAsMatrix(mrpt::math::CMatrixFloat &desc) const
Return the first found descriptor, as a matrix.
This class is a "CSerializable" wrapper for "CMatrixFloat".
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...
TKeyPointMethod get_type() const
Get the type of the feature.
const_iterator begin() const
GLdouble GLdouble GLdouble r
void setFeatureID(size_t i, TFeatureID id)
std::optional< std::vector< uint8_t > > SIFT
SIFT feature descriptor.
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
const CFeature * 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...
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::optional< std::vector< float > > SURF
SURF feature descriptor.
void kdtree_mark_as_outdated() const
To be called by child classes when KD tree data changes.
bool kdtree_get_bbox(BBOX &bb) const
void setLeftMaxID(const TFeatureID &leftID)
Explicitly set the max IDs values to certain values.
float patchCorrelationTo(const CFeature &oFeature) const
Computes the normalized cross-correlation between the patches of this and another feature (normalized...
The virtual base class which provides a unified interface for all persistent objects in MRPT...
TFeatureID getMaxID() const
Get the maximum ID into the list.
void setFeatureYf(size_t i, float y)
void setFeatureXf(size_t i, float x)
void setScale(size_t i, float s)
float y2[2]
Coordinates for a LSD Detector to represent a line.
bool hasDescriptorPolarImg() const
float orientation
Main orientation of the feature.
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...
~CFeature() override=default
This template class provides the basic functionality for a general 2D any-size, resizable container o...
float descriptorBLDDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
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
double initialDepth
in the current frame
void emplace_back(CFeature &&f)
float getFeatureX(size_t i) const
std::optional< std::vector< float > > SpinImg
The 2D histogram as a single row.
std::optional< mrpt::math::CMatrixF > LogPolarImg
A log-polar image centered at the interest point.
void copyListFrom(const CFeatureList &otherList)
Copies the content of another CFeatureList inside this one.
TFeatureTrackStatus getTrackStatus(size_t i)
bool isPointFeature() const
Return false only for Blob detectors (SIFT, SURF)
std::vector< CFeature > TInternalFeatList
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
bool hasDescriptorSURF() const
size_t kdtree_get_point_count() const
Must return the number of data points.
std::optional< std::vector< uint8_t > > LATCH
LATCH feature descriptor.