Main MRPT website > C++ reference
MRPT logo
Classes | Public Member Functions | Public Attributes | Static Protected Member Functions | Friends

mrpt::vision::CFeature Class Reference


Detailed Description

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 121 of file CFeature.h.

#include <mrpt/vision/CFeature.h>

Inheritance diagram for mrpt::vision::CFeature:
Inheritance graph
[legend]

List of all members.

Classes

struct  TDescriptors
 All the possible descriptors this feature may have. More...

Public Member Functions

bool isPointFeature () const
 Return false only for Blob detectors (SIFT, SURF)
bool getFirstDescriptorAsMatrix (mrpt::math::CMatrixFloat &desc) const
 Return the first found descriptor, as a matrix.
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).
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.
float descriptorSIFTDistanceTo (const CFeature &oFeature, bool normalize_distances=true) const
 Computes the Euclidean Distance between "this" and the "other" descriptors.
float descriptorSURFDistanceTo (const CFeature &oFeature, bool normalize_distances=true) const
 Computes the Euclidean Distance between "this" and the "other" descriptors.
float descriptorSpinImgDistanceTo (const CFeature &oFeature, bool normalize_distances=true) const
 Computes the Euclidean Distance between "this" and the "other" descriptors.
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.
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.
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" "%% |---------------------- feature ------------------| |---------------------- descriptors ------------------------|" "%% with:\n" "%% TYPE : The used detector: 0:KLT, 1: Harris, 2: BCD, 3: SIFT, 4: SURF, 5: Beacon, 6: FAST\n" "%% HAS_* : 1 if a descriptor of that type is associated to the feature." "%% SIFT : Present if HAS_SIFT=1: N DESC_0 ... DESC_N-1" "%% SURF : Present if HAS_SURF=1: N DESC_0 ... DESC_N-1" "%% MULTI : Present if HAS_MULTI=1: SCALE ORI N DESC_0 ... DESC_N-1" "%%-------------------------------------------------------------------------------------------\n");.
TFeatureType get_type () const
 Get the type of the feature.
void dumpToTextStream (mrpt::utils::CStream &out) const
 Dump feature information into a text stream.
void dumpToConsole () const
 CFeature ()
 Constructor.
virtual ~CFeature ()
 Virtual destructor.

Public Attributes

float x
float y
 Coordinates in the image.
TFeatureID ID
 ID of the feature.
CImage patch
 A patch of the image surrounding the feature.
uint16_t patchSize
 Size of the patch (patchSize x patchSize) (it must be an odd number)
TFeatureType type
 Type of the feature: featNotDefined, featSIFT, featKLT, featHarris, featSURF, featBeacon.
TFeatureTrackStatus track_status
 Status of the feature tracking process (old name: KLT_status)
float response
 A measure of the "goodness" of the feature (old name: KLT_val)
float orientation
 Main orientation of the feature.
float scale
 Feature scale into the scale space.
uint8_t IDSourceImage
 ID of the image from which the feature was extracted (JL says: ?????)
uint16_t nTimesSeen
 Number of frames it has been seen in a sequence of images.
uint16_t nTimesNotSeen
 Number of frames it has not been seen in a sequence of images.
uint16_t nTimesLastSeen
 Number of frames since it was seen for the last time.
double depth
 The estimated depth in 3D of this feature wrt the camera in the current frame.
double initialDepth
 The estimated depth in 3D of this feature wrt the camera that took its image.
TPoint3D p3D
 The estimated 3D point of this feature wrt its camera.
deque< double > multiScales
 A set of scales where the multi-resolution descriptor has been computed.
deque< vector< double > > multiOrientations
 A vector of main orientations (there is a vector of orientations for each scale)
deque< vector< vector< int32_t > > > multiHashCoeffs
 A set of vectors containing the coefficients for a HASH table of descriptors.
struct VISION_IMPEXP
mrpt::vision::CFeature::TDescriptors 
descriptors

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".

Friends

class CFeatureList
class CMatchedFeatureList

RTTI stuff

typedef CFeaturePtr SmartPtr
static mrpt::utils::CLASSINIT _init_CFeature
static mrpt::utils::TRuntimeClassId classCFeature
static const
mrpt::utils::TRuntimeClassId
classinfo
static const
mrpt::utils::TRuntimeClassId
_GetBaseClass ()
virtual const
mrpt::utils::TRuntimeClassId
GetRuntimeClass () const
 Returns information about the class of an object in runtime.
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CFeaturePtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 126 of file CFeature.h.


Constructor & Destructor Documentation

mrpt::vision::CFeature::CFeature (  )

Constructor.

virtual mrpt::vision::CFeature::~CFeature (  ) [inline, virtual]

Virtual destructor.

Definition at line 250 of file CFeature.h.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::vision::CFeature::_GetBaseClass (  ) [static, protected]

Reimplemented from mrpt::utils::CSerializable.

static CFeaturePtr mrpt::vision::CFeature::Create (  ) [static]
static mrpt::utils::CObject* mrpt::vision::CFeature::CreateObject (  ) [static]
float mrpt::vision::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.

Note:
If descriptorToUse is not descAny and that descriptor is not present in one of the features, an exception will be raised.
See also:
patchCorrelationTo
float mrpt::vision::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.

Parameters:
oFeatureThe other feature to compare with.
minDistAngleThe placeholder for the angle at which the smallest distance is found.
Returns:
The distance for the best orientation (minimum distance).
float mrpt::vision::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.

Parameters:
oFeatureThe other feature to compare with.
minDistAngleThe placeholder for the angle at which the smallest distance is found.
Returns:
The distance for the best orientation (minimum distance).
float mrpt::vision::CFeature::descriptorSIFTDistanceTo ( const CFeature oFeature,
bool  normalize_distances = true 
) const

Computes the Euclidean Distance between "this" and the "other" descriptors.

float mrpt::vision::CFeature::descriptorSpinImgDistanceTo ( const CFeature oFeature,
bool  normalize_distances = true 
) const

Computes the Euclidean Distance between "this" and the "other" descriptors.

float mrpt::vision::CFeature::descriptorSURFDistanceTo ( const CFeature oFeature,
bool  normalize_distances = true 
) const

Computes the Euclidean Distance between "this" and the "other" descriptors.

void mrpt::vision::CFeature::dumpToConsole (  ) const
void mrpt::vision::CFeature::dumpToTextStream ( mrpt::utils::CStream out ) const

Dump feature information into a text stream.

virtual mrpt::utils::CObject* mrpt::vision::CFeature::duplicate (  ) const [virtual]

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

TFeatureType mrpt::vision::CFeature::get_type (  ) const [inline]

Get the type of the feature.

Definition at line 238 of file CFeature.h.

bool mrpt::vision::CFeature::getFirstDescriptorAsMatrix ( mrpt::math::CMatrixFloat desc ) const

Return the first found descriptor, as a matrix.

Returns:
false on error, i.e. there is no valid descriptor.
virtual const mrpt::utils::TRuntimeClassId* mrpt::vision::CFeature::GetRuntimeClass (  ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

static float mrpt::vision::CFeature::internal_distanceBetweenPolarImages ( const mrpt::math::CMatrix desc1,
const mrpt::math::CMatrix desc2,
float &  minDistAngle,
bool  normalize_distances,
bool  dont_shift_angle 
) [static, protected]

Internal function used by "descriptorLogPolarImgDistanceTo" and "descriptorPolarImgDistanceTo".

bool mrpt::vision::CFeature::isPointFeature (  ) const

Return false only for Blob detectors (SIFT, SURF)

float mrpt::vision::CFeature::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).

Note:
If this or the other features does not have patches or they are of different sizes, an exception will be raised.
See also:
descriptorDistanceTo
void mrpt::vision::CFeature::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" "%% |---------------------- feature ------------------| |---------------------- descriptors ------------------------|" "%% with:\n" "%% TYPE : The used detector: 0:KLT, 1: Harris, 2: BCD, 3: SIFT, 4: SURF, 5: Beacon, 6: FAST\n" "%% HAS_* : 1 if a descriptor of that type is associated to the feature." "%% SIFT : Present if HAS_SIFT=1: N DESC_0 ... DESC_N-1" "%% SURF : Present if HAS_SURF=1: N DESC_0 ... DESC_N-1" "%% MULTI : Present if HAS_MULTI=1: SCALE ORI N DESC_0 ... DESC_N-1" "%%-------------------------------------------------------------------------------------------\n");.


Friends And Related Function Documentation

friend class CFeatureList [friend]

Definition at line 123 of file CFeature.h.

friend class CMatchedFeatureList [friend]

Definition at line 124 of file CFeature.h.


Member Data Documentation

Definition at line 126 of file CFeature.h.

Definition at line 126 of file CFeature.h.

Definition at line 126 of file CFeature.h.

The estimated depth in 3D of this feature wrt the camera in the current frame.

Definition at line 143 of file CFeature.h.

ID of the feature.

Definition at line 130 of file CFeature.h.

ID of the image from which the feature was extracted (JL says: ?????)

Definition at line 138 of file CFeature.h.

The estimated depth in 3D of this feature wrt the camera that took its image.

Definition at line 144 of file CFeature.h.

deque<vector<vector<int32_t> > > mrpt::vision::CFeature::multiHashCoeffs

A set of vectors containing the coefficients for a HASH table of descriptors.

Definition at line 148 of file CFeature.h.

A vector of main orientations (there is a vector of orientations for each scale)

Definition at line 147 of file CFeature.h.

A set of scales where the multi-resolution descriptor has been computed.

Definition at line 146 of file CFeature.h.

Number of frames since it was seen for the last time.

Definition at line 141 of file CFeature.h.

Number of frames it has not been seen in a sequence of images.

Definition at line 140 of file CFeature.h.

Number of frames it has been seen in a sequence of images.

Definition at line 139 of file CFeature.h.

Main orientation of the feature.

Definition at line 136 of file CFeature.h.

The estimated 3D point of this feature wrt its camera.

Definition at line 145 of file CFeature.h.

A patch of the image surrounding the feature.

Definition at line 131 of file CFeature.h.

Size of the patch (patchSize x patchSize) (it must be an odd number)

Definition at line 132 of file CFeature.h.

A measure of the "goodness" of the feature (old name: KLT_val)

Definition at line 135 of file CFeature.h.

Feature scale into the scale space.

Definition at line 137 of file CFeature.h.

Status of the feature tracking process (old name: KLT_status)

Definition at line 134 of file CFeature.h.

Type of the feature: featNotDefined, featSIFT, featKLT, featHarris, featSURF, featBeacon.

Definition at line 133 of file CFeature.h.

Definition at line 129 of file CFeature.h.

Coordinates in the image.

Definition at line 129 of file CFeature.h.




Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011