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 :
Apart from the normal entry point detectFeatures(), these other low-level static methods are provided for convenience:
Definition at line 59 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 | |
CFeatureExtraction () | |
Constructor. | |
virtual | ~CFeatureExtraction () |
Virtual destructor. | |
void | detectFeatures (const mrpt::utils::CImage &img, CFeatureList &feats, const unsigned int init_ID=0, const unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI()) const |
Extract features from the image based on the method defined in TOptions. | |
void | computeDescriptors (const mrpt::utils::CImage &in_img, CFeatureList &inout_features, TDescriptorType in_descriptor_list) const |
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. | |
Static Public Member Functions | |
Static methods with low-level detector functionality | |
static void | detectFeatures_SSE2_FASTER9 (const mrpt::utils::CImage &img, TSimpleFeatureList &corners, const int threshold=20, bool append_to_list=false, uint8_t octave=0, std::vector< size_t > *out_feats_index_by_row=NULL) |
A SSE2-optimized implementation of FASTER-9 (requires img to be grayscale). | |
static void | detectFeatures_SSE2_FASTER10 (const mrpt::utils::CImage &img, TSimpleFeatureList &corners, const int threshold=20, bool append_to_list=false, uint8_t octave=0, std::vector< size_t > *out_feats_index_by_row=NULL) |
Just like detectFeatures_SSE2_FASTER9() for another version of the detector. | |
static void | detectFeatures_SSE2_FASTER12 (const mrpt::utils::CImage &img, TSimpleFeatureList &corners, const int threshold=20, bool append_to_list=false, uint8_t octave=0, std::vector< size_t > *out_feats_index_by_row=NULL) |
Just like detectFeatures_SSE2_FASTER9() for another version of the detector. | |
Public Attributes | |
TOptions | options |
Set all the parameters of the desired method here before calling "detectFeatures". | |
Private Member Functions | |
void | internal_computeSiftDescriptors (const mrpt::utils::CImage &in_img, CFeatureList &in_features) const |
Compute the SIFT descriptor of the provided features into the input image. | |
void | internal_computeSurfDescriptors (const mrpt::utils::CImage &in_img, CFeatureList &in_features) const |
Compute the SURF descriptor of the provided features into the input image. | |
void | internal_computeORBDescriptors (const mrpt::utils::CImage &in_img, CFeatureList &in_features) const |
Compute the ORB descriptor of the provided features into the input image. | |
void | internal_computeSpinImageDescriptors (const mrpt::utils::CImage &in_img, CFeatureList &in_features) const |
Compute the intensity-domain spin images descriptor of the provided features into the input image. | |
void | internal_computePolarImageDescriptors (const mrpt::utils::CImage &in_img, CFeatureList &in_features) const |
Compute a polar-image descriptor of the provided features into the input image. | |
void | internal_computeLogPolarImageDescriptors (const mrpt::utils::CImage &in_img, CFeatureList &in_features) const |
Compute a log-polar image descriptor of the provided features into the input image. | |
void | extractFeaturesKLT (const mrpt::utils::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI()) const |
Extract features from the image based on the KLT method. | |
void | extractFeaturesBCD (const mrpt::utils::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI()) const |
Extract features from the image based on the BCD method. | |
void | extractFeaturesSIFT (const mrpt::utils::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI()) const |
Extract features from the image based on the SIFT method. | |
void | extractFeaturesORB (const mrpt::utils::CImage &img, CFeatureList &feats, const unsigned int init_ID=0, const unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI()) const |
Extract features from the image based on the ORB method. | |
void | extractFeaturesSURF (const mrpt::utils::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI()) const |
Extract features from the image based on the SURF method. | |
void | extractFeaturesFAST (const mrpt::utils::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI(), const mrpt::math::CMatrixBool *mask=NULL) const |
Extract features from the image based on the FAST method. | |
void | extractFeaturesFASTER_N (const int N, const mrpt::utils::CImage &img, CFeatureList &feats, unsigned int init_ID=0, unsigned int nDesiredFeatures=0, const TImageROI &ROI=TImageROI()) const |
Edward's "FASTER & Better" detector, N=9,10,12. | |
void * | my_scale_space_extrema (CFeatureList &featList, void *dog_pyr, int octvs, int intvls, double contr_thr, int curv_thr, void *storage) const |
Computes extrema in the scale space. | |
void | my_adjust_for_img_dbl (void *features) const |
Adjust scale if the image was initially doubled. | |
void | getTimesExtrema (void *dog_pyr, int octvs, int intvls, float row, float col, unsigned int &nMin, unsigned int &nMax) const |
Gets the number of times that a point in the image is higher or lower than the surroundings in the image-scale space. | |
double | getLaplacianValue (void *dog_pyr, int octvs, int intvls, float row, float col) const |
Computes the Laplacian value of the feature in the corresponing image in the pyramid. | |
void | insertCvSeqInCFeatureList (void *features, CFeatureList &list, unsigned int init_ID=0) const |
Append a sequence of openCV features into an MRPT feature list. | |
void | convertCvSeqInCFeatureList (void *features, CFeatureList &list, unsigned int init_ID=0, const TImageROI &ROI=TImageROI()) const |
Converts a sequence of openCV features into an MRPT feature list. | |
Enumerator | |
---|---|
LoweBinary | |
CSBinary | |
VedaldiBinary | |
Hess | |
OpenCV |
Definition at line 62 of file CFeatureExtraction.h.
mrpt::vision::CFeatureExtraction::CFeatureExtraction | ( | ) |
Constructor.
|
virtual |
Virtual destructor.
void mrpt::vision::CFeatureExtraction::computeDescriptors | ( | const mrpt::utils::CImage & | in_img, |
CFeatureList & | inout_features, | ||
TDescriptorType | in_descriptor_list | ||
) | const |
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.
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:
|
private |
Converts a sequence of openCV features into an MRPT feature list.
features | The sequence of features. |
list | [in-out] The list of MRPT features. |
init_ID | [in][optional] The initial ID for the features (default = 0). |
ROI | [in][optional] The initial ID for the features (default = empty ROI -> not used). |
void mrpt::vision::CFeatureExtraction::detectFeatures | ( | const mrpt::utils::CImage & | img, |
CFeatureList & | feats, | ||
const unsigned int | init_ID = 0 , |
||
const unsigned int | nDesiredFeatures = 0 , |
||
const TImageROI & | ROI = TImageROI() |
||
) | const |
Extract features from the image based on the method defined in TOptions.
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. |
|
private |
Extract features from the image based on the BCD method.
img | The image from where to extract the images. |
feats | The list of extracted features. |
nDesiredFeatures | Number of features to be extracted. Default: authomatic. |
ROI | (op. input) Region of Interest. Default: All the image. |
|
private |
Extract features from the image based on the FAST method.
img | The image from where to extract the images. |
feats | The list of extracted features. |
nDesiredFeatures | Number of features to be extracted. Default: authomatic. |
|
private |
Edward's "FASTER & Better" detector, N=9,10,12.
|
private |
Extract features from the image based on the KLT method.
img | The image from where to extract the images. |
feats | The list of extracted features. |
nDesiredFeatures | Number of features to be extracted. Default: authomatic. |
|
private |
Extract features from the image based on the ORB method.
img | The image from where to extract the images. |
feats | The list of extracted features. |
nDesiredFeatures | Number of features to be extracted. Default: authomatic. |
|
private |
Extract features from the image based on the SIFT method.
img | The image from where to extract the images. |
feats | The list of extracted features. |
nDesiredFeatures | Number of features to be extracted. Default: authomatic. |
ROI | (op. input) Region of Interest. Default: All the image. |
|
private |
Extract features from the image based on the SURF method.
img | The image from where to extract the images. |
feats | The list of extracted features. |
nDesiredFeatures | Number of features to be extracted. Default: authomatic. |
|
private |
Computes the Laplacian value of the feature in the corresponing image in the pyramid.
dog_pyr | Pyramid of images. |
octvs | Number of considered octaves. |
intvls | Number of intervales in octaves. |
row | The row of the feature in the original image. |
col | The column of the feature in the original image. |
|
private |
Gets the number of times that a point in the image is higher or lower than the surroundings in the image-scale space.
dog_pyr | Pyramid of images. |
octvs | Number of considered octaves. |
intvls | Number of intervales in octaves. |
row | The row of the feature in the original image. |
col | The column of the feature in the original image. |
nMin | [out]: Times that the feature is lower than the surroundings. |
nMax | [out]: Times that the feature is higher than the surroundings. |
|
private |
Append a sequence of openCV features into an MRPT feature list.
features | The sequence of features. |
list | [in-out] The list of MRPT features. |
init_ID | [in] The initial ID for the new features. |
|
private |
Compute a log-polar image descriptor of the provided features into the input image.
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. |
|
private |
Compute the ORB descriptor of the provided features into the input image.
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. |
|
private |
Compute a polar-image descriptor of the provided features into the input image.
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. |
|
private |
Compute the SIFT descriptor of the provided features into the input image.
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. |
|
private |
Compute the intensity-domain spin images descriptor of the provided features into the input image.
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. |
|
private |
Compute the SURF descriptor of the provided features into the input image.
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. |
|
private |
Adjust scale if the image was initially doubled.
features | The sequence of features. |
|
private |
Computes extrema in the scale space.
dog_pyr | Pyramid of images. |
octvs | Number of considered octaves. |
intvls | Number of intervales in octaves. |
TOptions mrpt::vision::CFeatureExtraction::options |
Set all the parameters of the desired method here before calling "detectFeatures".
Definition at line 198 of file CFeatureExtraction.h.
Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 27 17:12:06 UTC 2023 |