A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or more descriptors (see descriptors), in addition to an image patch.
The (Euclidean) distance between descriptors in a pair of features can be computed with descriptorDistanceTo, while the similarity of the patches is given by patchCorrelationTo.
Definition at line 53 of file CFeature.h.
#include <mrpt/vision/CFeature.h>
Classes | |
struct | TDescriptors |
All the possible descriptors this feature may have. More... | |
Public Member Functions | |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *ptr) noexcept |
void | operator delete[] (void *ptr) noexcept |
void | operator delete (void *memory, void *ptr) noexcept |
void * | operator new (size_t size, const std::nothrow_t &) noexcept |
void | operator delete (void *ptr, const std::nothrow_t &) noexcept |
bool | isPointFeature () const |
a HASH table of descriptors More... | |
bool | getFirstDescriptorAsMatrix (mrpt::math::CMatrixFloat &desc) const |
Return the first found descriptor, as a matrix. More... | |
float | patchCorrelationTo (const CFeature &oFeature) const |
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). More... | |
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. More... | |
float | descriptorSIFTDistanceTo (const CFeature &oFeature, bool normalize_distances=true) const |
Computes the Euclidean Distance between "this" and the "other" descriptors. More... | |
float | descriptorSURFDistanceTo (const CFeature &oFeature, bool normalize_distances=true) const |
Computes the Euclidean Distance between "this" and the "other" descriptors. More... | |
float | descriptorSpinImgDistanceTo (const CFeature &oFeature, bool normalize_distances=true) const |
Computes the Euclidean Distance between "this" and the "other" descriptors. More... | |
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, for the best shift in orientation. More... | |
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, for the best shift in orientation. More... | |
uint8_t | descriptorORBDistanceTo (const CFeature &oFeature) const |
Computes the Hamming distance "this" and the "other" descriptor ORB descriptor. More... | |
float | descriptorBLDDistanceTo (const CFeature &oFeature, bool normalize_distances=true) const |
Computes the Euclidean Distance between "this" and the "other" descriptors. More... | |
float | descriptorLATCHDistanceTo (const CFeature &oFeature, bool normalize_distances=true) const |
Computes the Euclidean Distance between "this" and the "other" descriptors. More... | |
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. More... | |
TFeatureType | get_type () const |
Get the type of the feature. More... | |
void | dumpToTextStream (mrpt::utils::CStream &out) const |
Dump feature information into a text stream. More... | |
void | dumpToConsole () const |
CFeature () | |
Constructor. More... | |
virtual | ~CFeature () |
Virtual destructor. More... | |
virtual mxArray * | writeToMatlab () const |
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More... | |
RTTI classes and functions | |
mrpt::utils::CObject::Ptr | duplicateGetSmartPtr () const |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More... | |
Static Public Member Functions | |
static void * | operator new (size_t size, void *ptr) |
Public Attributes | |
float | x |
float | y |
Coordinates in the image. More... | |
TFeatureID | ID |
ID of the feature. More... | |
mrpt::utils::CImage | patch |
A patch of the image surrounding the feature. More... | |
uint16_t | patchSize |
Size of the patch (patchSize x patchSize) (it must. More... | |
TFeatureType | type |
be an odd number) More... | |
TFeatureTrackStatus | track_status |
featKLT, featHarris, featSURF, featBeacon More... | |
float | response |
process (old name: KLT_status) More... | |
float | orientation |
KLT_val) More... | |
float | scale |
Feature scale into the scale space. More... | |
uint8_t | user_flags |
A field for any other flags needed by the user. More... | |
uint16_t | nTimesSeen |
(this has not a predefined meaning) More... | |
uint16_t | nTimesNotSeen |
of images. More... | |
uint16_t | nTimesLastSeen |
sequence of images. More... | |
float | x2 [2] |
last time. More... | |
float | y2 [2] |
Coordinates for a LSD Detector to represent a line. More... | |
double | depth |
The estimated depth in 3D of this feature wrt the camera. More... | |
double | initialDepth |
in the current frame More... | |
mrpt::math::TPoint3D | p3D |
camera that took its image More... | |
std::deque< double > | multiScales |
A set of scales where the. More... | |
std::deque< std::vector< double > > | multiOrientations |
multi-resolution descriptor has been computed More... | |
std::deque< std::vector< std::vector< int32_t > > > | multiHashCoeffs |
orientations (there is a vector of orientations for each scale) More... | |
struct mrpt::vision::CFeature::TDescriptors | descriptors |
Protected Member Functions | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const override |
Introduces a pure virtual method responsible for writing to a CStream. More... | |
void | readFromStream (mrpt::utils::CStream &in, int version) override |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More... | |
Static Protected Member Functions | |
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". More... | |
Friends | |
class | CFeatureList |
class | CMatchedFeatureList |
RTTI stuff | |
using | Ptr = std::shared_ptr< CFeature > |
using | ConstPtr = std::shared_ptr< const CFeature > |
static mrpt::utils::CLASSINIT | _init_CFeature |
static const mrpt::utils::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "CFeature" |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
static const mrpt::utils::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static mrpt::utils::CObject * | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::utils::CObject * | clone () const override |
Returns a deep copy (clone) of the object, indepently of its class. More... | |
using mrpt::vision::CFeature::ConstPtr = std::shared_ptr<const CFeature > |
Definition at line 58 of file CFeature.h.
using mrpt::vision::CFeature::Ptr = std::shared_ptr< CFeature > |
A typedef for the associated smart pointer
Definition at line 58 of file CFeature.h.
CFeature::CFeature | ( | ) |
Constructor.
Definition at line 447 of file CFeature.cpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 288 of file CFeature.h.
|
staticprotected |
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlinestatic |
Definition at line 58 of file CFeature.h.
|
static |
float CFeature::descriptorBLDDistanceTo | ( | const CFeature & | oFeature, |
bool | normalize_distances = true |
||
) | const |
Computes the Euclidean Distance between "this" and the "other" descriptors.
Definition at line 871 of file CFeature.cpp.
References ASSERT_, mrpt::vision::CFeature::TDescriptors::BLD, descriptors, mrpt::vision::CFeature::TDescriptors::hasDescriptorBLD(), and mrpt::math::square().
Referenced by descriptorDistanceTo().
float CFeature::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.
Definition at line 515 of file CFeature.cpp.
References mrpt::vision::descAny, mrpt::vision::descBLD, mrpt::vision::descLATCH, mrpt::vision::descLogPolarImages, mrpt::vision::descORB, mrpt::vision::descPolarImages, descriptorBLDDistanceTo(), descriptorLATCHDistanceTo(), descriptorLogPolarImgDistanceTo(), descriptorORBDistanceTo(), descriptorPolarImgDistanceTo(), descriptors, descriptorSIFTDistanceTo(), descriptorSpinImgDistanceTo(), descriptorSURFDistanceTo(), mrpt::vision::descSIFT, mrpt::vision::descSpinImages, mrpt::vision::descSURF, mrpt::vision::CFeature::TDescriptors::hasDescriptorBLD(), mrpt::vision::CFeature::TDescriptors::hasDescriptorLATCH(), mrpt::vision::CFeature::TDescriptors::hasDescriptorLogPolarImg(), mrpt::vision::CFeature::TDescriptors::hasDescriptorORB(), mrpt::vision::CFeature::TDescriptors::hasDescriptorPolarImg(), mrpt::vision::CFeature::TDescriptors::hasDescriptorSIFT(), mrpt::vision::CFeature::TDescriptors::hasDescriptorSpinImg(), mrpt::vision::CFeature::TDescriptors::hasDescriptorSURF(), MRPT_END, MRPT_START, THROW_EXCEPTION, and THROW_EXCEPTION_FMT.
float CFeature::descriptorLATCHDistanceTo | ( | const CFeature & | oFeature, |
bool | normalize_distances = true |
||
) | const |
Computes the Euclidean Distance between "this" and the "other" descriptors.
Definition at line 896 of file CFeature.cpp.
References ASSERT_, descriptors, mrpt::vision::CFeature::TDescriptors::hasDescriptorLATCH(), mrpt::vision::CFeature::TDescriptors::LATCH, and mrpt::math::square().
Referenced by descriptorDistanceTo().
float CFeature::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, for the best shift in orientation.
oFeature | The other feature to compare with. |
minDistAngle | The placeholder for the angle at which the smallest distance is found. |
Definition at line 811 of file CFeature.cpp.
References ASSERT_, descriptors, mrpt::vision::CFeature::TDescriptors::hasDescriptorLogPolarImg(), internal_distanceBetweenPolarImages(), mrpt::vision::CFeature::TDescriptors::LogPolarImg, MRPT_END, MRPT_START, and mrpt::vision::CFeature::TDescriptors::polarImgsNoRotation.
Referenced by descriptorDistanceTo().
Computes the Hamming distance "this" and the "other" descriptor ORB descriptor.
Definition at line 841 of file CFeature.cpp.
References ASSERT_, descriptors, mrpt::math::distance(), for(), mrpt::vision::CFeature::TDescriptors::hasDescriptorORB(), and mrpt::vision::CFeature::TDescriptors::ORB.
Referenced by descriptorDistanceTo().
float CFeature::descriptorPolarImgDistanceTo | ( | const CFeature & | oFeature, |
float & | minDistAngle, | ||
bool | normalize_distances = true |
||
) | const |
Returns the minimum Euclidean Distance between "this" and the "other" polar image descriptor, for the best shift in orientation.
oFeature | The other feature to compare with. |
minDistAngle | The placeholder for the angle at which the smallest distance is found. |
Definition at line 784 of file CFeature.cpp.
References ASSERT_, descriptors, mrpt::vision::CFeature::TDescriptors::hasDescriptorPolarImg(), internal_distanceBetweenPolarImages(), MRPT_END, MRPT_START, mrpt::vision::CFeature::TDescriptors::PolarImg, and mrpt::vision::CFeature::TDescriptors::polarImgsNoRotation.
Referenced by descriptorDistanceTo().
float CFeature::descriptorSIFTDistanceTo | ( | const CFeature & | oFeature, |
bool | normalize_distances = true |
||
) | const |
Computes the Euclidean Distance between "this" and the "other" descriptors.
Definition at line 585 of file CFeature.cpp.
References ASSERT_, descriptors, mrpt::vision::CFeature::TDescriptors::hasDescriptorSIFT(), mrpt::vision::CFeature::TDescriptors::SIFT, and mrpt::math::square().
Referenced by descriptorDistanceTo().
float CFeature::descriptorSpinImgDistanceTo | ( | const CFeature & | oFeature, |
bool | normalize_distances = true |
||
) | const |
Computes the Euclidean Distance between "this" and the "other" descriptors.
Definition at line 637 of file CFeature.cpp.
References ASSERT_, descriptors, mrpt::vision::CFeature::TDescriptors::hasDescriptorSpinImg(), mrpt::vision::CFeature::TDescriptors::SpinImg, and mrpt::math::square().
Referenced by descriptorDistanceTo().
float CFeature::descriptorSURFDistanceTo | ( | const CFeature & | oFeature, |
bool | normalize_distances = true |
||
) | const |
Computes the Euclidean Distance between "this" and the "other" descriptors.
Definition at line 610 of file CFeature.cpp.
References ASSERT_, descriptors, mrpt::vision::CFeature::TDescriptors::hasDescriptorSURF(), mrpt::math::square(), and mrpt::vision::CFeature::TDescriptors::SURF.
Referenced by descriptorDistanceTo().
void CFeature::dumpToConsole | ( | ) | const |
Definition at line 381 of file CFeature.cpp.
void CFeature::dumpToTextStream | ( | mrpt::utils::CStream & | out | ) | const |
Dump feature information into a text stream.
Definition at line 247 of file CFeature.cpp.
References mrpt::utils::CStream::printf().
|
inline |
Get the type of the feature.
Definition at line 277 of file CFeature.h.
References type.
Referenced by saveToTextFile().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019 |