MRPT  2.0.4
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Private Member Functions
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):

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

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

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 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 77 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 86 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::featHarris, mrpt::vision::featKLT, mrpt::vision::featLSD, mrpt::vision::featORB, mrpt::vision::featSIFT, mrpt::vision::featSURF, and THROW_EXCEPTION.

Referenced by mrpt::vision::CGenericFeatureTracker::internal_trackFeatures(), 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

◆ 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

Extract features from the image based on the SIFT method.

Parameters
imgThe image from where to extract the images.
featsThe list of extracted features.
nDesiredFeaturesNumber of features to be extracted. Default: authomatic.
ROI(op. input) Region of Interest. Default: All the image.

Definition at line 38 of file CFeatureExtraction_SIFT.cpp.

References mrpt::img::CImage::asCvMatRef(), ASSERT_, mrpt::vision::CFeatureList::clear(), mrpt::vision::CFeature::descriptors, mrpt::img::CImage::extract_patch(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::featSIFT, mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::ID, mrpt::vision::CFeature::keypoint, mrpt::system::os::memcpy(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::octave, mrpt::vision::CFeature::orientation, mrpt::vision::CFeature::patch, mrpt::vision::CFeature::patchSize, mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::pt, mrpt::vision::CFeatureList::push_back(), mrpt::vision::CFeatureList::resize(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::response, mrpt::round(), mrpt::vision::CFeature::TDescriptors::SIFT, mrpt::math::size(), mrpt::img::CImage::swap(), THROW_EXCEPTION, mrpt::vision::CFeature::type, mrpt::img::TPixelCoordf::x, mrpt::vision::TImageROI::xMax, mrpt::vision::TImageROI::xMin, mrpt::img::TPixelCoordf::y, mrpt::vision::TImageROI::yMax, and mrpt::vision::TImageROI::yMin.

Here is the call graph for this function:

◆ 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, params, 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::getAsIplImage(), mrpt::img::CImage::getChannelCount(), MRPT_END, MRPT_START, out, mrpt::round(), 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 229 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::img::CImage::getAsIplImage(), mrpt::img::CImage::getChannelCount(), MRPT_END, MRPT_START, out, mrpt::round(), 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::d2f(), mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::img::CImage::isColor(), 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

◆ profiler

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

Timelogger: disabled by default.

Definition at line 75 of file CFeatureExtraction.h.




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020