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 extractFeaturesFASTER_N(
67 9,
img, feats, init_ID, nDesiredFeatures, ROI);
70 extractFeaturesFASTER_N(
71 10,
img, feats, init_ID, nDesiredFeatures, ROI);
74 extractFeaturesFASTER_N(
75 12,
img, feats, init_ID, nDesiredFeatures, ROI);
79 extractFeaturesORB(
img, feats, init_ID, nDesiredFeatures, ROI);
84 extractFeaturesAKAZE(
img, feats, init_ID, nDesiredFeatures, ROI);
87 extractFeaturesLSD(
img, feats, init_ID, nDesiredFeatures, ROI);
99 void CFeatureExtraction::computeDescriptors(
106 int nDescComputed = 0;
108 if ((in_descriptor_list &
descSIFT) != 0)
110 this->internal_computeSiftDescriptors(in_img, inout_features);
113 if ((in_descriptor_list &
descSURF) != 0)
115 this->internal_computeSurfDescriptors(in_img, inout_features);
120 this->internal_computeSpinImageDescriptors(in_img, inout_features);
125 this->internal_computePolarImageDescriptors(in_img, inout_features);
130 this->internal_computeLogPolarImageDescriptors(in_img, inout_features);
133 if ((in_descriptor_list &
descORB) != 0)
135 this->internal_computeORBDescriptors(in_img, inout_features);
139 if ((in_descriptor_list &
descBLD) != 0)
141 this->internal_computeBLDLineDescriptors(in_img, inout_features);
144 if ((in_descriptor_list &
descLATCH) != 0)
146 this->internal_computeLATCHDescriptors(in_img, inout_features);
151 "No known descriptor value found in in_descriptor_list=%u",
152 (
unsigned)in_descriptor_list);
157 void CFeatureExtraction::TOptions::dumpToTextStream(std::ostream& out)
const 160 "\n----------- [CFeatureExtraction::TOptions] ------------ \n\n");
235 void CFeatureExtraction::TOptions::loadFromConfigFile(
238 featsType =
iniFile.read_enum(section,
"featsType", featsType);
277 SpinImagesOptions.hist_size_distance,
int,
iniFile, section)
279 SpinImagesOptions.hist_size_intensity,
int,
iniFile, section)
283 SpinImagesOptions.std_intensity,
float,
iniFile, section)
287 PolarImagesOptions.bins_distance,
int,
iniFile, section)
292 LogPolarImagesOptions.num_angles,
int,
iniFile, section)
294 LogPolarImagesOptions.rho_scale,
double,
iniFile, section)
300 AKAZEOptions.descriptor_channels,
int,
iniFile, section)
316 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].
GLsizei const GLchar ** string
FAST feature detector, OpenCV's implementation ("Faster and better: A machine learning approach to...
FASTER-9 detector, Edward Rosten's libcvd, SSE2 optimized.
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.
FASTER-9 detector, Edward Rosten's libcvd, SSE2 optimized.
Harris border and corner detector [HARRIS].
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
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.
FASTER-9 detector, Edward Rosten's libcvd, SSE2 optimized.