27 const std::vector<unsigned int>& left,
28 const std::vector<unsigned int>& right)
30 return left[1] < right[1];
37 void CFeatureExtraction::detectFeatures(
39 const unsigned int nDesiredFeatures,
const TImageROI& ROI)
43 switch (options.featsType)
46 extractFeaturesKLT(img, feats, init_ID, nDesiredFeatures, ROI);
50 extractFeaturesKLT(img, feats, init_ID, nDesiredFeatures, ROI);
54 extractFeaturesSIFT(img, feats, init_ID, nDesiredFeatures, ROI);
58 extractFeaturesSURF(img, feats, init_ID, nDesiredFeatures, ROI);
62 extractFeaturesFAST(img, feats, init_ID, nDesiredFeatures);
66 extractFeaturesORB(img, feats, init_ID, nDesiredFeatures, ROI);
71 extractFeaturesAKAZE(img, feats, init_ID, nDesiredFeatures, ROI);
74 extractFeaturesLSD(img, feats, init_ID, nDesiredFeatures, ROI);
86 void CFeatureExtraction::computeDescriptors(
93 int nDescComputed = 0;
95 if ((in_descriptor_list &
descSIFT) != 0)
97 this->internal_computeSiftDescriptors(in_img, inout_features);
100 if ((in_descriptor_list &
descSURF) != 0)
102 this->internal_computeSurfDescriptors(in_img, inout_features);
107 this->internal_computeSpinImageDescriptors(in_img, inout_features);
112 this->internal_computePolarImageDescriptors(in_img, inout_features);
117 this->internal_computeLogPolarImageDescriptors(in_img, inout_features);
120 if ((in_descriptor_list &
descORB) != 0)
122 this->internal_computeORBDescriptors(in_img, inout_features);
126 if ((in_descriptor_list &
descBLD) != 0)
128 this->internal_computeBLDLineDescriptors(in_img, inout_features);
131 if ((in_descriptor_list &
descLATCH) != 0)
133 this->internal_computeLATCHDescriptors(in_img, inout_features);
138 "No known descriptor value found in in_descriptor_list=%u",
139 (
unsigned)in_descriptor_list);
144 void CFeatureExtraction::TOptions::dumpToTextStream(std::ostream&
out)
const 146 out <<
"\n----------- [CFeatureExtraction::TOptions] ------------ \n\n";
221 void CFeatureExtraction::TOptions::loadFromConfigFile(
224 featsType =
iniFile.read_enum(section,
"featsType", featsType);
263 SpinImagesOptions.hist_size_distance,
int,
iniFile, section)
265 SpinImagesOptions.hist_size_intensity,
int,
iniFile, section)
269 SpinImagesOptions.std_intensity,
float,
iniFile, section)
273 PolarImagesOptions.bins_distance,
int,
iniFile, section)
278 LogPolarImagesOptions.num_angles,
int,
iniFile, section)
280 LogPolarImagesOptions.rho_scale,
double,
iniFile, section)
286 AKAZEOptions.descriptor_channels,
int,
iniFile, section)
302 LATCHOptions.rotationInvariance,
bool,
iniFile, section)
#define THROW_EXCEPTION(msg)
A safe way to call enter() and leave() of a mrpt::system::CTimeLogger upon construction and destructi...
Intensity-domain spin image descriptors.
Bit-based feature descriptor.
Scale Invariant Feature Transform [LOWE'04].
LSD detector, OpenCV's implementation.
bool operator()(const std::vector< unsigned int > &left, const std::vector< unsigned int > &right)
A structure for defining a ROI within an image.
This class allows loading and storing values and vectors of different types from a configuration text...
TDescriptorType
The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...
string iniFile(myDataDir+string("benchmark-options.ini"))
Classes for computer vision, detectors, features, etc.
Speeded Up Robust Feature [BAY'06].
FAST feature detector, OpenCV's implementation ("Faster and better: A machine learning approach to...
A list of visual features, to be used as output by detectors, as input/output by trackers, etc.
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
#define MRPT_LOAD_CONFIG_VAR( variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
AKAZE detector, OpenCV's implementation.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Harris border and corner detector [HARRIS].
mrpt::vision::TStereoCalibResults out
Kanade-Lucas-Tomasi feature [SHI'94].
Log-Polar image descriptor.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
ORB detector and descriptor, OpenCV's implementation.
#define MRPT_LOAD_CONFIG_VAR_CAST( variableName, variableType, variableTypeCast, configFileObject, sectionNameStr)
A class for storing images as grayscale or RGB bitmaps.