MRPT  1.9.9
mrpt::vision::CFeatureExtraction Class Reference

Detailed Description

The central class from which images can be analyzed in search of different kinds of interest points and descriptors computed for them.

To extract features from an image, create an instance of CFeatureExtraction, fill out its CFeatureExtraction::options field, including the algorithm to use (see CFeatureExtraction::TOptions::featsType), and call CFeatureExtraction::detectFeatures. This will return a set of features of the class mrpt::vision::CFeature, which include details for each interest point as well as the desired descriptors and/or patches.

By default, a 21x21 patch is extracted for each detected feature. If the patch is not needed, set patchSize to 0 in CFeatureExtraction::options

The implemented detection algorithms are (see CFeatureExtraction::TOptions::featsType):

  • KLT (Kanade-Lucas-Tomasi): A detector (no descriptor vector).
  • Harris: A detector (no descriptor vector).
  • BCD (Binary Corner Detector): A detector (no descriptor vector) (Not implemented yet).
  • SIFT: An implementation of the SIFT detector and descriptor. The implemention may be selected with CFeatureExtraction::TOptions::SIFTOptions::implementation.
  • SURF: OpenCV's implementation of SURF detector and descriptor.
  • The FAST feature detector (OpenCV's implementation)
  • The FASTER (9,10,12) detectors (Edward Rosten's libcvd implementation optimized for SSE2).

Additionally, given a list of interest points onto an image, the following descriptors can be computed for each point by calling CFeatureExtraction::computeDescriptors :

  • SIFT descriptor (Lowe's descriptors).
  • SURF descriptor (OpenCV's implementation - Requires OpenCV 1.1.0 from SVN or later).
  • Intensity-domain spin images (SpinImage): Creates a vector descriptor with the 2D histogram as a single row.
  • A circular patch in polar coordinates (Polar images): The matrix descriptor is a 2D polar image centered at the interest point.
  • A log-polar image patch (Log-polar images): The matrix descriptor is the 2D log-polar image centered at the interest point.

Apart from the normal entry point detectFeatures(), these other low-level static methods are provided for convenience:

Note
The descriptor "Intensity-domain spin images" is described in "A sparse texture representation using affine-invariant regions", S Lazebnik, C Schmid, J Ponce, 2003 IEEE Computer Society Conference on Computer Vision.
See also
mrpt::vision::CFeature

Definition at line 79 of file CFeatureExtraction.h.

#include <mrpt/vision/CFeatureExtraction.h>

Classes

struct  TOptions
 The set of parameters for all the detectors & descriptor algorithms. More...
 

Public Types

enum  TSIFTImplementation {
  LoweBinary = 0, CSBinary, VedaldiBinary, Hess,
  OpenCV
}
 

Public Member Functions

void detectFeatures (const mrpt::img::CImage &img, CFeatureList &feats, const unsigned int init_ID=0, const unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI())
 Extract features from the image based on the method defined in TOptions. More...
 
void computeDescriptors (const mrpt::img::CImage &in_img, CFeatureList &inout_features, TDescriptorType in_descriptor_list)
 Compute one (or more) descriptors for the given set of interest points onto the image, which may have been filled out manually or from detectFeatures. More...
 

Static Public Member Functions

Static methods with low-level detector functionality
static void detectFeatures_SSE2_FASTER9 (const mrpt::img::CImage &img, TKeyPointList &corners, const int threshold=20, bool append_to_list=false, uint8_t octave=0, std::vector< size_t > *out_feats_index_by_row=nullptr)
 A SSE2-optimized implementation of FASTER-9 (requires img to be grayscale). More...
 
static void detectFeatures_SSE2_FASTER10 (const mrpt::img::CImage &img, TKeyPointList &corners, const int threshold=20, bool append_to_list=false, uint8_t octave=0, std::vector< size_t > *out_feats_index_by_row=nullptr)
 Just like detectFeatures_SSE2_FASTER9() for another version of the detector. More...
 
static void detectFeatures_SSE2_FASTER12 (const mrpt::img::CImage &img, TKeyPointList &corners, const int threshold=20, bool append_to_list=false, uint8_t octave=0, std::vector< size_t > *out_feats_index_by_row=nullptr)
 Just like detectFeatures_SSE2_FASTER9() for another version of the detector. More...
 

Public Attributes

mrpt::system::CTimeLogger profiler {false}
 Timelogger: disabled by default. More...
 
TOptions options
 Set all the parameters of the desired method here before calling detectFeatures() More...
 

Private Member Functions

void internal_computeSiftDescriptors (const mrpt::img::CImage &in_img, CFeatureList &in_features)
 Compute the SIFT descriptor of the provided features into the input image. More...
 
void internal_computeSurfDescriptors (const mrpt::img::CImage &in_img, CFeatureList &in_features)
 Compute the SURF descriptor of the provided features into the input image. More...
 
void internal_computeORBDescriptors (const mrpt::img::CImage &in_img, CFeatureList &in_features)
 Compute the ORB descriptor of the provided features into the input image. More...
 
void internal_computeSpinImageDescriptors (const mrpt::img::CImage &in_img, CFeatureList &in_features)
 Compute the intensity-domain spin images descriptor of the provided features into the input image. More...
 
void internal_computePolarImageDescriptors (const mrpt::img::CImage &in_img, CFeatureList &in_features)
 Compute a polar-image descriptor of the provided features into the input image. More...
 
void internal_computeLogPolarImageDescriptors (const mrpt::img::CImage &in_img, CFeatureList &in_features)
 Compute a log-polar image descriptor of the provided features into the input image. More...
 
void internal_computeBLDLineDescriptors (const mrpt::img::CImage &in_img, CFeatureList &in_features)
 Compute a BLD descriptor of the provided features into the input image. More...
 
void internal_computeLATCHDescriptors (const mrpt::img::CImage &in_img, CFeatureList &in_features)
 Compute a LATCH descriptor of the provided features into the input image. More...
 
void extractFeaturesKLT (const mrpt::img::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI())
 Extract features from the image based on the KLT method. More...
 
void extractFeaturesSIFT (const mrpt::img::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI())
 Extract features from the image based on the SIFT method. More...
 
void extractFeaturesORB (const mrpt::img::CImage &img, CFeatureList &feats, const unsigned int init_ID=0, const unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI())
 Extract features from the image based on the ORB method. More...
 
void extractFeaturesSURF (const mrpt::img::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI())
 Extract features from the image based on the SURF method. More...
 
void extractFeaturesFAST (const mrpt::img::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0)
 Extract features from the image based on the FAST method (OpenCV impl.) More...
 
void extractFeaturesFASTER_N (const int N, const mrpt::img::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI())
 Edward's "FASTER & Better" detector, N=9,10,12. More...
 
void extractFeaturesAKAZE (const mrpt::img::CImage &inImg, CFeatureList &feats, unsigned int init_ID, unsigned int nDesiredFeatures, const TImageROI &ROI=TImageROI())
 Extract features from the image based on the AKAZE method. More...
 
void extractFeaturesLSD (const mrpt::img::CImage &inImg, CFeatureList &feats, unsigned int init_ID, unsigned int nDesiredFeatures, const TImageROI &ROI=TImageROI())
 Extract features from the image based on the LSD method. More...
 

Member Enumeration Documentation

◆ TSIFTImplementation

Enumerator
LoweBinary 
CSBinary 
VedaldiBinary 
Hess 
OpenCV 

Definition at line 85 of file CFeatureExtraction.h.

Member Function Documentation

◆ computeDescriptors()

void CFeatureExtraction::computeDescriptors ( const mrpt::img::CImage in_img,
CFeatureList inout_features,
TDescriptorType  in_descriptor_list 
)

Compute one (or more) descriptors for the given set of interest points onto the image, which may have been filled out manually or from detectFeatures.

Parameters
in_img(input) The image from where to compute the descriptors.
inout_features(input/output) The list of features whose descriptors are going to be computed.
in_descriptor_list(input) The bitwise OR of one or several descriptors defined in TDescriptorType.

Each value in "in_descriptor_list" represents one descriptor to be computed, for example:

// This call will compute both, SIFT and Spin-Image descriptors
for a list of feature points lstFeats. fext.computeDescriptors(img,
lstFeats, descSIFT | descSpinImages );
Note
The SIFT descriptors for already located features can only be computed through the Hess and CSBinary implementations which may be specified in CFeatureExtraction::TOptions::SIFTOptions.
This call will also use additional parameters from options

Definition at line 99 of file CFeatureExtraction_common.cpp.

References mrpt::vision::descBLD, mrpt::vision::descLATCH, mrpt::vision::descLogPolarImages, mrpt::vision::descORB, mrpt::vision::descPolarImages, mrpt::vision::descSIFT, mrpt::vision::descSpinImages, mrpt::vision::descSURF, MRPT_END, MRPT_START, and THROW_EXCEPTION_FMT.

Referenced by mrpt::slam::COccupancyGridMapFeatureExtractor::uncached_extractFeatures().

Here is the caller graph for this function:

◆ detectFeatures()

void CFeatureExtraction::detectFeatures ( const mrpt::img::CImage img,
CFeatureList feats,
const unsigned int  init_ID = 0,
const unsigned int  nDesiredFeatures = 0,
const TImageROI ROI = TImageROI() 
)

Extract features from the image based on the method defined in TOptions.

Parameters
img(input) The image from where to extract the images.
feats(output) A complete list of features (containing a patch for each one of them if options.patchsize > 0).
nDesiredFeatures(op. input) Number of features to be extracted. Default: all possible.
See also
computeDescriptors

Definition at line 37 of file CFeatureExtraction_common.cpp.

References mrpt::vision::featAKAZE, mrpt::vision::featFAST, mrpt::vision::featFASTER10, mrpt::vision::featFASTER12, mrpt::vision::featFASTER9, mrpt::vision::featHarris, mrpt::vision::featKLT, mrpt::vision::featLSD, mrpt::vision::featORB, mrpt::vision::featSIFT, mrpt::vision::featSURF, and THROW_EXCEPTION.

Referenced by mrpt::maps::CLandmarksMap::loadSiftFeaturesFromImageObservation(), mrpt::vision::StereoObs2BRObs(), and mrpt::slam::COccupancyGridMapFeatureExtractor::uncached_extractFeatures().

Here is the caller graph for this function:

◆ extractFeaturesAKAZE()

void CFeatureExtraction::extractFeaturesAKAZE ( const mrpt::img::CImage inImg,
CFeatureList feats,
unsigned int  init_ID,
unsigned int  nDesiredFeatures,
const TImageROI ROI = TImageROI() 
)
private

◆ extractFeaturesFAST()

void CFeatureExtraction::extractFeaturesFAST ( const mrpt::img::CImage img,
CFeatureList feats,
unsigned int  init_ID = 0,
unsigned int  nDesiredFeatures = 0 
)
private

◆ extractFeaturesFASTER_N()

void CFeatureExtraction::extractFeaturesFASTER_N ( const int  N,
const mrpt::img::CImage img,
CFeatureList feats,
unsigned int  init_ID = 0,
unsigned int  nDesiredFeatures = 0,
const TImageROI ROI = TImageROI() 
)
private

◆ extractFeaturesKLT()

void CFeatureExtraction::extractFeaturesKLT ( const mrpt::img::CImage img,
CFeatureList feats,
unsigned int  init_ID = 0,
unsigned int  nDesiredFeatures = 0,
const TImageROI ROI = TImageROI() 
)
private

◆ extractFeaturesLSD()

void CFeatureExtraction::extractFeaturesLSD ( const mrpt::img::CImage inImg,
CFeatureList feats,
unsigned int  init_ID,
unsigned int  nDesiredFeatures,
const TImageROI ROI = TImageROI() 
)
private

◆ extractFeaturesORB()

void CFeatureExtraction::extractFeaturesORB ( const mrpt::img::CImage img,
CFeatureList feats,
const unsigned int  init_ID = 0,
const unsigned int  nDesiredFeatures = 0,
const TImageROI ROI = TImageROI() 
)
private

◆ extractFeaturesSIFT()

void CFeatureExtraction::extractFeaturesSIFT ( const mrpt::img::CImage img,
CFeatureList feats,
unsigned int  init_ID = 0,
unsigned int  nDesiredFeatures = 0,
const TImageROI ROI = TImageROI() 
)
private

◆ extractFeaturesSURF()

void CFeatureExtraction::extractFeaturesSURF ( const mrpt::img::CImage img,
CFeatureList feats,
unsigned int  init_ID = 0,
unsigned int  nDesiredFeatures = 0,
const TImageROI ROI = TImageROI() 
)
private

◆ internal_computeBLDLineDescriptors()

void CFeatureExtraction::internal_computeBLDLineDescriptors ( const mrpt::img::CImage in_img,
CFeatureList in_features 
)
private

Compute a BLD descriptor of the provided features into the input image.

Parameters
in_img(input) The image from where to compute the descriptors.
in_features(input/output) The list of features whose descriptors are going to be computed.
Note
Additional parameters from CFeatureExtraction::TOptions::LogPolarImagesOptions are used in this method.

Definition at line 177 of file CFeatureExtraction_LSD_BLD.cpp.

References mrpt::img::CImage::asCvMatRef(), mrpt::vision::CFeatureList::empty(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::CFeatureList::size(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ internal_computeLATCHDescriptors()

void CFeatureExtraction::internal_computeLATCHDescriptors ( const mrpt::img::CImage in_img,
CFeatureList in_features 
)
private

Compute a LATCH descriptor of the provided features into the input image.

Parameters
in_img(input) The image from where to compute the descriptors.
in_features(input/output) The list of features whose descriptors are going to be computed.
Note
Additional parameters from CFeatureExtraction::TOptions::LogPolarImagesOptions are used in this method.

Definition at line 49 of file CFeatureExtraction_LATCH.cpp.

References mrpt::img::CImage::asCvMatRef(), mrpt::vision::CFeatureList::empty(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, MRPT_END, MRPT_START, mrpt::vision::CFeatureList::size(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ internal_computeLogPolarImageDescriptors()

void CFeatureExtraction::internal_computeLogPolarImageDescriptors ( const mrpt::img::CImage in_img,
CFeatureList in_features 
)
private

Compute a log-polar image descriptor of the provided features into the input image.

Parameters
in_img(input) The image from where to compute the descriptors.
in_features(input/output) The list of features whose descriptors are going to be computed.
Note
Additional parameters from CFeatureExtraction::TOptions::LogPolarImagesOptions are used in this method.

Definition at line 23 of file CFeatureExtraction_logPolarImg.cpp.

References mrpt::img::CImage::asCvMatRef(), ASSERT_, mrpt::img::CImage::getChannelCount(), MRPT_END, MRPT_START, and THROW_EXCEPTION.

Here is the call graph for this function:

◆ internal_computeORBDescriptors()

void CFeatureExtraction::internal_computeORBDescriptors ( const mrpt::img::CImage in_img,
CFeatureList in_features 
)
private

Compute the ORB descriptor of the provided features into the input image.

Parameters
in_img(input) The image from where to compute the descriptors.
in_features(input/output) The list of features whose descriptors are going to be computed.

Definition at line 230 of file CFeatureExtraction_ORB.cpp.

References mrpt::img::CImage::asCvMatRef(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::CFeatureList::resize(), and mrpt::vision::CFeatureList::size().

Here is the call graph for this function:

◆ internal_computePolarImageDescriptors()

void CFeatureExtraction::internal_computePolarImageDescriptors ( const mrpt::img::CImage in_img,
CFeatureList in_features 
)
private

Compute a polar-image descriptor of the provided features into the input image.

Parameters
in_img(input) The image from where to compute the descriptors.
in_features(input/output) The list of features whose descriptors are going to be computed.
Note
Additional parameters from CFeatureExtraction::TOptions::PolarImagesOptions are used in this method.

Definition at line 27 of file CFeatureExtraction_polarImg.cpp.

References mrpt::img::CImage::asCvMatRef(), ASSERT_, mrpt::vision::CFeatureList::begin(), mrpt::vision::CFeatureList::end(), mrpt::img::CImage::getChannelCount(), MRPT_END, MRPT_START, and THROW_EXCEPTION.

Here is the call graph for this function:

◆ internal_computeSiftDescriptors()

void CFeatureExtraction::internal_computeSiftDescriptors ( const mrpt::img::CImage in_img,
CFeatureList in_features 
)
private

Compute the SIFT descriptor of the provided features into the input image.

Parameters
in_img(input) The image from where to compute the descriptors.
in_features(input/output) The list of features whose descriptors are going to be computed.
Note
The SIFT descriptors for already located features can only be computed through the Hess and CSBinary implementations which may be specified in CFeatureExtraction::TOptions::SIFTOptions.

Definition at line 202 of file CFeatureExtraction_SIFT.cpp.

References ASSERT_, mrpt::vision::CFeatureList::size(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ internal_computeSpinImageDescriptors()

void CFeatureExtraction::internal_computeSpinImageDescriptors ( const mrpt::img::CImage in_img,
CFeatureList in_features 
)
private

Compute the intensity-domain spin images descriptor of the provided features into the input image.

Parameters
in_img(input) The image from where to compute the descriptors.
in_features(input/output) The list of features whose descriptors are going to be computed.
Note
Additional parameters from CFeatureExtraction::TOptions::SpinImagesOptions are used in this method.

Definition at line 24 of file CFeatureExtraction_spinImg.cpp.

References ASSERT_, mrpt::img::CImage::at(), mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::img::CImage::isColor(), min, MRPT_END, MRPT_START, mrpt::math::normalize(), mrpt::img::CImage::ptr(), R, mrpt::round(), mrpt::math::MatrixVectorBase< Scalar, Derived >::setZero(), and mrpt::square().

Here is the call graph for this function:

◆ internal_computeSurfDescriptors()

void CFeatureExtraction::internal_computeSurfDescriptors ( const mrpt::img::CImage in_img,
CFeatureList in_features 
)
private

Compute the SURF descriptor of the provided features into the input image.

Parameters
in_img(input) The image from where to compute the descriptors.
in_features(input/output) The list of features whose descriptors are going to be computed.

Definition at line 158 of file CFeatureExtraction_SURF.cpp.

References mrpt::img::CImage::asCvMatRef(), mrpt::vision::CFeatureList::empty(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::CFeatureList::size(), and THROW_EXCEPTION.

Here is the call graph for this function:

Member Data Documentation

◆ options

TOptions mrpt::vision::CFeatureExtraction::options

Set all the parameters of the desired method here before calling detectFeatures()

Definition at line 303 of file CFeatureExtraction.h.

Referenced by mrpt::maps::CLandmarksMap::loadSiftFeaturesFromImageObservation(), and mrpt::slam::COccupancyGridMapFeatureExtractor::uncached_extractFeatures().

◆ profiler

mrpt::system::CTimeLogger mrpt::vision::CFeatureExtraction::profiler {false}

Timelogger: disabled by default.

Definition at line 83 of file CFeatureExtraction.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019