class mrpt::vision::CFeatureExtraction
Overview
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 implementation may be selected with CFeatureExtraction::TOptions::SIFTOptions::implementation.
SURF: OpenCV’s implementation of SURF detector and descriptor.
The FAST feature detector (OpenCV’s implementation)
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.
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:
#include <mrpt/vision/CFeatureExtraction.h> class CFeatureExtraction { public: // enums enum TSIFTImplementation; // structs struct TOptions; // fields mrpt::system::CTimeLogger profiler {false}; TOptions options; // methods void detectFeatures( const mrpt::img::CImage& img, CFeatureList& feats, const unsigned int init_ID = 0, const unsigned int nDesiredFeatures = 0, const TImageROI& ROI = TImageROI() ); void computeDescriptors(const mrpt::img::CImage& in_img, CFeatureList& inout_features, TDescriptorType in_descriptor_list); };
Fields
mrpt::system::CTimeLogger profiler {false}
Timelogger: disabled by default.
TOptions options
Set all the parameters of the desired method here before calling detectFeatures()
Methods
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.
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:
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.
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 );
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
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. |