MRPT
2.0.4
|
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 :
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... | |
Enumerator | |
---|---|
LoweBinary | |
CSBinary | |
VedaldiBinary | |
Hess | |
OpenCV |
Definition at line 77 of file CFeatureExtraction.h.
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.
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:
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().
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.
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. |
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().
|
private |
Extract features from the image based on the AKAZE 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. |
Definition at line 31 of file CFeatureExtraction_AKAZE.cpp.
References mrpt::img::CImage::asCvMat(), mrpt::vision::CFeatureList::clear(), mrpt::vision::CFeatureList::emplace_back(), mrpt::img::CImage::extract_patch(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::featAKAZE, mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::ID, mrpt::vision::CFeature::keypoint, MRPT_END, MRPT_START, 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::CFeature::response, mrpt::round(), mrpt::img::SHALLOW_COPY, THROW_EXCEPTION, mrpt::vision::CFeature::type, mrpt::img::TPixelCoordf::x, and mrpt::img::TPixelCoordf::y.
|
private |
Extract features from the image based on the FAST method (OpenCV impl.)
img | The image from where to extract the images. |
feats | The list of extracted features. |
nDesiredFeatures | Number of features to be extracted. Default: authomatic. |
Definition at line 25 of file CFeatureExtraction_FAST.cpp.
References mrpt::img::CImage::asCvMat(), mrpt::vision::CFeatureList::clear(), mrpt::vision::CFeatureList::emplace_back(), mrpt::img::CImage::extract_patch(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::featFAST, mrpt::math::MatrixVectorBase< Scalar, Derived >::fill(), mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::ID, mrpt::vision::CFeature::keypoint, mrpt::img::CImage::KLT_response(), MRPT_END, MRPT_START, 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::CFeature::response, mrpt::round(), mrpt::img::SHALLOW_COPY, mrpt::vision::CFeature::type, mrpt::img::TPixelCoordf::x, and mrpt::img::TPixelCoordf::y.
|
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. |
Definition at line 27 of file CFeatureExtraction_harris_KLT.cpp.
References mrpt::img::CImage::asCvMatRef(), mrpt::vision::CFeatureList::clear(), mrpt::vision::CFeatureList::emplace_back(), mrpt::img::CImage::extract_patch(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::featHarris, mrpt::vision::featKLT, mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::ID, mrpt::vision::CFeature::keypoint, MRPT_END, MRPT_START, mrpt::vision::CFeature::patch, mrpt::vision::CFeature::patchSize, mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::pt, mrpt::vision::CFeature::response, mrpt::round(), mrpt::vision::status_TRACKED, THROW_EXCEPTION, mrpt::vision::CFeature::track_status, mrpt::vision::CFeature::type, mrpt::img::TPixelCoordf::x, and mrpt::img::TPixelCoordf::y.
|
private |
Extract features from the image based on the LSD 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. |
Definition at line 44 of file CFeatureExtraction_LSD_BLD.cpp.
References mrpt::img::CImage::asCvMatRef(), mrpt::vision::CFeatureList::clear(), mrpt::vision::CFeatureList::emplace_back(), mrpt::img::CImage::extract_patch(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::featLSD, mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::ID, mrpt::vision::CFeature::keypoint, MRPT_END, MRPT_START, mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::octave, mrpt::vision::CFeature::patch, mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::pt, mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::response, mrpt::round(), THROW_EXCEPTION, mrpt::vision::CFeature::type, mrpt::img::TPixelCoordf::x, mrpt::vision::CFeature::x2, mrpt::img::TPixelCoordf::y, and mrpt::vision::CFeature::y2.
|
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. |
Definition at line 24 of file CFeatureExtraction_ORB.cpp.
References mrpt::img::CImage::asCvMatRef(), mrpt::vision::CFeatureList::clear(), mrpt::vision::CFeature::descriptors, mrpt::vision::CFeatureList::emplace_back(), mrpt::img::CImage::extract_patch(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::featORB, mrpt::math::MatrixVectorBase< Scalar, Derived >::fill(), mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::ID, mrpt::vision::CFeature::keypoint, MRPT_END, MRPT_START, mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::octave, mrpt::vision::CFeature::TDescriptors::ORB, mrpt::vision::CFeature::orientation, mrpt::vision::CFeature::patch, mrpt::vision::CFeature::patchSize, mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::pt, mrpt::vision::CFeatureList::resize(), mrpt::vision::CFeature::response, mrpt::round(), mrpt::vision::CFeatureList::size(), mrpt::vision::CFeature::type, mrpt::img::TPixelCoordf::x, and mrpt::img::TPixelCoordf::y.
|
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. |
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.
|
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. |
Definition at line 42 of file CFeatureExtraction_SURF.cpp.
References mrpt::img::CImage::asCvMatRef(), mrpt::vision::CFeatureList::clear(), mrpt::vision::CFeature::descriptors, mrpt::vision::CFeatureList::emplace_back(), mrpt::img::CImage::extract_patch(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::vision::featSURF, mrpt::img::CImage::getHeight(), mrpt::img::CImage::getWidth(), mrpt::vision::TKeyPoint_templ< PIXEL_COORD_TYPE >::ID, mrpt::vision::CFeature::keypoint, 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::round(), mrpt::vision::CFeature::TDescriptors::SURF, THROW_EXCEPTION, mrpt::vision::CFeature::type, mrpt::img::TPixelCoordf::x, and mrpt::img::TPixelCoordf::y.
|
private |
Compute a BLD 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. |
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.
|
private |
Compute a LATCH 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. |
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.
|
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. |
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.
|
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. |
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().
|
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. |
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.
|
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. |
Definition at line 202 of file CFeatureExtraction_SIFT.cpp.
References ASSERT_, mrpt::vision::CFeatureList::size(), and THROW_EXCEPTION.
|
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. |
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().
|
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. |
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.
TOptions mrpt::vision::CFeatureExtraction::options |
Set all the parameters of the desired method here before calling detectFeatures()
Definition at line 295 of file CFeatureExtraction.h.
Referenced by mrpt::vision::CGenericFeatureTracker::internal_trackFeatures(), mrpt::maps::CLandmarksMap::loadSiftFeaturesFromImageObservation(), and mrpt::slam::COccupancyGridMapFeatureExtractor::uncached_extractFeatures().
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 |