Go to the documentation of this file.
43 useOriFilter = cfg.read_bool(section,
"useOriFilter",
true,
false);
44 oriThreshold = cfg.read_double(section,
"oriThreshold", 0.2,
false);
45 lastSeenThreshold = cfg.read_int(section,
"lastSeenThreshold", 10,
false);
46 timesSeenThreshold = cfg.read_int(section,
"timesSeenThreshold", 5,
false);
47 minFeaturesToFind = cfg.read_int(section,
"minFeaturesToFind", 5,
false);
49 cfg.read_int(section,
"minFeaturesToBeLost", 5,
false);
51 useDepthFilter = cfg.read_bool(section,
"useDepthFilter",
true,
false);
54 cfg.read_double(section,
"matchingThreshold", 1e4,
false);
55 matchingRatioThreshold =
56 cfg.read_double(section,
"matchingRatioThreshold", 0.5,
false);
58 lowScl1 = cfg.read_int(section,
"lowScl1", 0,
false);
59 lowScl2 = cfg.read_int(section,
"lowScl1", 0,
false);
60 highScl1 = cfg.read_int(section,
"highScl1", 6,
false);
61 highScl2 = cfg.read_int(section,
"highScl2", 6,
false);
63 searchAreaSize = cfg.read_double(section,
"searchAreaSize", 20,
false);
74 cfg.
write(section,
"useOriFilter",
"true");
75 cfg.
write(section,
"oriThreshold", oriThreshold);
78 cfg.
write(section,
"useOriFilter",
"false");
81 cfg.
write(section,
"useDepthFilter",
"true");
83 cfg.
write(section,
"useDepthFilter",
"false");
85 cfg.
write(section,
"matchingThreshold", matchingThreshold);
86 cfg.
write(section,
"matchingRatioThreshold", matchingRatioThreshold);
87 cfg.
write(section,
"lowScl1", lowScl1);
88 cfg.
write(section,
"lowScl2", lowScl2);
89 cfg.
write(section,
"highScl1", highScl1);
90 cfg.
write(section,
"highScl2", highScl2);
92 cfg.
write(section,
"searchAreaSize", searchAreaSize);
93 cfg.
write(section,
"lastSeenThreshold", lastSeenThreshold);
94 cfg.
write(section,
"timesSeenThreshold", timesSeenThreshold);
95 cfg.
write(section,
"minFeaturesToFind", minFeaturesToFind);
96 cfg.
write(section,
"minFeaturesToBeLost", minFeaturesToBeLost);
105 "\n----------- [vision::TMultiResDescMatchOptions] ------------ \n");
111 "· Orientation threshold: %.1f deg\n",
122 out <<
mrpt::format(
"Lowest scale in list1: %d\n", lowScl1);
123 out <<
mrpt::format(
"Highest scale in list1: %d\n", highScl1);
124 out <<
mrpt::format(
"Lowest scale in list2: %d\n", lowScl2);
125 out <<
mrpt::format(
"Highest scale in list2: %d\n", highScl2);
128 "#frames last seen threshold: %d\n", lastSeenThreshold);
130 "#frames to be stable threshold: %d\n", timesSeenThreshold);
132 "min. # features in system: %d\n", minFeaturesToFind);
134 "min. # features to be lost: %d\n", minFeaturesToBeLost);
136 "Matching threshold: %.2f\n", matchingThreshold);
138 "Matching ratio threshold: %.2f\n", matchingRatioThreshold);
140 "Size of the search window: %d px\n", searchAreaSize);
142 "-------------------------------------------------------- \n");
154 basePSize = cfg.
read_double(section,
"basePSize", 23,
false);
155 comLScl = cfg.
read_int(section,
"comLScl", 0,
false);
156 comHScl = cfg.
read_int(section,
"comHScl", 6,
false);
160 computeDepth = cfg.
read_bool(section,
"computeDepth",
true,
false);
161 blurImage = cfg.
read_bool(section,
"blurImage",
true,
false);
165 baseline = cfg.
read_double(section,
"baseline", 0.0,
false);
167 cfg.
read_bool(section,
"computeHashCoeffs",
false,
false);
169 cfg.
read_vector(section,
"scales", vector<double>(), scales,
false);
170 if (scales.size() < 1)
189 cfg.
write(section,
"basePSize", basePSize);
190 cfg.
write(section,
"comLScl", comLScl);
191 cfg.
write(section,
"comHScl", comHScl);
192 cfg.
write(section,
"sg1", sg1);
193 cfg.
write(section,
"sg2", sg2);
194 cfg.
write(section,
"sg3", sg3);
196 cfg.
write(section,
"computeDepth", computeDepth ?
"true" :
"false");
197 cfg.
write(section,
"blurImage", blurImage ?
"true" :
"false");
198 cfg.
write(section,
"fx", fx);
199 cfg.
write(section,
"cx", cx);
200 cfg.
write(section,
"cy", cy);
201 cfg.
write(section,
"baseline", baseline);
203 section,
"computeHashCoeffs", computeHashCoeffs ?
"true" :
"false");
206 for (
unsigned int k = 0; k < scales.size(); ++k)
208 cfg.
write(section,
"scales", buf);
217 "\n----------- [vision::TMultiResDescOptions] ------------ \n");
218 out <<
mrpt::format(
"Base patch size: %d px\n", basePSize);
219 out <<
mrpt::format(
"Lowest scale to compute: %d\n", comLScl);
220 out <<
mrpt::format(
"Highest scale to compute: %d\n", comHScl);
221 out <<
mrpt::format(
"Image smoothing sigma: %.2f px\n", sg1);
222 out <<
mrpt::format(
"Orientation histogram sigma: %.2f\n", sg2);
223 out <<
mrpt::format(
"Descriptor histogram sigma: %.2f\n", sg3);
229 out <<
mrpt::format(
"Principal point (cx): %.2f px\n", cx);
230 out <<
mrpt::format(
"Principal point (cy): %.2f px\n", cy);
232 "Baseline: %.2f m\n", baseline);
238 if (computeHashCoeffs)
250 for (
unsigned int k = 0; k < scales.size(); ++k)
254 "-------------------------------------------------------- \n");
259 out <<
mrpt::format(
"\n----------- [vision::CFeature] ------------ \n");
262 "Coordinates: (%.2f,%.2f) px\n",
x,
y);
311 switch (track_status)
328 out <<
mrpt::format(
"Main orientation: %.2f\n", orientation);
331 out <<
mrpt::format(
"# frames not seen: %d\n", nTimesNotSeen);
332 out <<
mrpt::format(
"# frames since last seen: %d\n", nTimesLastSeen);
334 "Initial Depth: %.2f m\n", initialDepth);
337 "3D point: (%.2f,%.2f,%.2f) m\n", p3D.x, p3D.y,
344 descriptors.hasDescriptorSIFT() ? out <<
mrpt::format(
"Yes\n")
347 descriptors.hasDescriptorSURF() ? out <<
mrpt::format(
"Yes\n")
350 descriptors.hasDescriptorSpinImg() ? out <<
mrpt::format(
"Yes\n")
353 descriptors.hasDescriptorPolarImg() ? out <<
mrpt::format(
"Yes\n")
356 descriptors.hasDescriptorLogPolarImg() ? out <<
mrpt::format(
"Yes\n")
359 descriptors.hasDescriptorORB() ? out <<
mrpt::format(
"Yes\n")
363 descriptors.hasDescriptorBLD() ? out <<
mrpt::format(
"Yes\n")
366 descriptors.hasDescriptorLATCH() ? out <<
mrpt::format(
"Yes\n")
370 if (!descriptors.hasDescriptorMultiSIFT())
374 out <<
mrpt::format(
"Yes [%d]\n", (
int)multiScales.size());
375 for (
int k = 0; k < (int)multiScales.size(); ++k)
377 out <<
mrpt::format(
" · Scale %d: %.2f\n", k, multiScales[k]);
378 for (
int m = 0; m < (int)multiOrientations[k].
size(); ++m)
381 " ·· Orientation %d: %.2f\n", m, multiOrientations[k][m]);
384 n < (int)descriptors.multiSIFTDescriptors[k][m].size();
387 "%d ", descriptors.multiSIFTDescriptors[k][m][
n]);
389 if (multiHashCoeffs.size() > 0)
391 " ·· HASH coefficients %d,%d,%d\n",
392 multiHashCoeffs[k][m][0], multiHashCoeffs[k][m][1],
393 multiHashCoeffs[k][m][2]);
405 << (
uint32_t)track_status << response << orientation <<
scale
406 << user_flags << nTimesSeen << nTimesNotSeen << nTimesLastSeen <<
depth
407 << initialDepth << p3D << multiScales << multiOrientations
408 << multiHashCoeffs << descriptors.SIFT << descriptors.SURF
409 << descriptors.SpinImg << descriptors.SpinImg_range_rows
410 << descriptors.PolarImg << descriptors.LogPolarImg
411 << descriptors.polarImgsNoRotation << descriptors.multiSIFTDescriptors
414 << descriptors.BLD << descriptors.LATCH;
427 in >>
x >>
y >> ID >> patch >> patchSize >> aux_type >> aux_KLTS >>
428 response >> orientation >>
scale >> user_flags;
431 in >> nTimesSeen >> nTimesNotSeen >> nTimesLastSeen >>
depth >>
432 initialDepth >> p3D >> multiScales >> multiOrientations >>
435 in >> descriptors.SIFT >> descriptors.SURF >> descriptors.SpinImg >>
436 descriptors.SpinImg_range_rows >> descriptors.PolarImg >>
437 descriptors.LogPolarImg >> descriptors.polarImgsNoRotation
439 >> descriptors.BLD >> descriptors.LATCH;
440 if (version > 0)
in >> descriptors.multiSIFTDescriptors;
441 if (version > 1)
in >> descriptors.ORB;
485 SpinImg_range_rows(0),
488 polarImgsNoRotation(false),
525 bool normalize_distances)
const
530 if (descriptorToUse ==
descAny)
551 "Feature has no descriptors and descriptorToUse=descAny")
554 switch (descriptorToUse)
566 oFeature, minAng, normalize_distances);
572 oFeature, minAng, normalize_distances);
583 "Unknown value for 'descriptorToUse'=%u",
584 (
unsigned)descriptorToUse);
594 const CFeature& oFeature,
bool normalize_distances)
const
605 itDesc1 != this->descriptors.SIFT.end(); itDesc1++, itDesc2++)
607 dist +=
square(*itDesc1 - *itDesc2);
611 if (normalize_distances) dist /= 64.0f;
619 const CFeature& oFeature,
bool normalize_distances)
const
630 itDesc1 != this->descriptors.SURF.end(); itDesc1++, itDesc2++)
632 dist +=
square(*itDesc1 - *itDesc2);
636 if (normalize_distances)
646 const CFeature& oFeature,
bool normalize_by_vector_length)
const
659 itDesc1 != this->descriptors.SpinImg.end(); itDesc1++, itDesc2++)
661 dist +=
square(*itDesc1 - *itDesc2);
674 bool normalize_distances,
bool dont_shift_angle)
679 unsigned int delta, i, j, ii,
height = desc1.rows(),
width = desc1.cols();
680 float dist, minDist = 0;
684 #define LM_CORR_METHOD_EUCLID
688 #if defined(LM_CORR_BIAS_MEAN) || defined(LM_CORR_METHOD_CORRELATION)
689 const float desc1_mean = desc1.sum() /
static_cast<float>(
width *
height);
690 const float desc2_mean = desc2.sum() /
static_cast<float>(
width *
height);
695 for (delta = 0; delta <
height; delta++)
697 #if defined(LM_CORR_METHOD_CORRELATION)
704 for (i = 0; i <
height; i++)
706 ii = (i + delta) %
height;
707 for (j = 0; j <
width; j++)
709 #ifdef LM_CORR_METHOD_EUCLID
710 #ifdef LM_CORR_BIAS_MEAN
712 desc1.get_unsafe(i, j) - desc1_mean -
713 desc2.get_unsafe(ii, j) + desc2_mean);
716 square(desc1.get_unsafe(i, j) - desc2.get_unsafe(ii, j));
718 #elif defined(LM_CORR_METHOD_MANHATTAN)
719 #ifdef LM_CORR_BIAS_MEAN
721 abs(desc1.get_unsafe(i, j) - desc1_mean -
722 desc2.get_unsafe(ii, j) + desc2_mean);
724 dist += abs(desc1.get_unsafe(i, j) - desc2.get_unsafe(ii, j));
726 #elif defined(LM_CORR_METHOD_CORRELATION)
727 float d1 = desc1.get_unsafe(i, j) - desc1_mean;
728 float d2 = desc2.get_unsafe(ii, j) - desc2_mean;
733 #error A LM_CORR_METHOD_XXX method must be selected!
739 if (normalize_distances) dist /=
static_cast<float>(
width *
height);
741 #ifdef LM_CORR_METHOD_EUCLID
745 #if defined(LM_CORR_METHOD_CORRELATION)
746 dist = 1 - (s12 / sqrt(s11 * s22));
749 distances[delta] = dist;
750 if (!delta && dont_shift_angle)
758 minDist = distances.minimum(&minDistIdx);
760 double dist_mean, dist_std;
765 cout <<
"min dist: " << minDist << endl;
768 win.plot(distances,
"b.4");
770 win.image(img1,0,-0.5,0.4*
width,0.5,
"img1");
781 minDistAngle = minDistIdx *
M_2PI /
static_cast<float>(
width);
791 const CFeature& oFeature,
float& minDistAngle,
792 bool normalize_distances)
const
817 const CFeature& oFeature,
float& minDistAngle,
818 bool normalize_distances)
const
857 for (
uint8_t k = 0; k < t_desc.size(); ++k)
859 uint8_t x_or = t_desc[k] ^ o_desc[k];
876 const CFeature& oFeature,
bool normalize_distances)
const
887 itDesc1 != this->descriptors.BLD.end(); itDesc1++, itDesc2++)
889 dist +=
square(*itDesc1 - *itDesc2);
893 if (normalize_distances) dist /= 64.0f;
901 const CFeature& oFeature,
bool normalize_distances)
const
913 itDesc1 != this->descriptors.LATCH.end(); itDesc1++, itDesc2++)
915 dist +=
square(*itDesc1 - *itDesc2);
919 if (normalize_distances) dist /= 64.0f;
946 if (!f.open(filename, APPEND))
948 "[CFeature::saveToTextFile] ERROR: File could not be open for "
952 "%5u %2d %7.3f %7.3f %6.2f %6.2f %2d %6.3f ", (
unsigned int)this->
ID,
961 f.printf(
"%4d ", this->descriptors.SIFT[k]);
964 f.printf(
"%2d ",
int(this->
descriptors.hasDescriptorSURF() ? 1 : 0));
969 f.printf(
"%8.5f ", this->descriptors.SURF[k]);
975 for (
int k = 0; k < int(this->
multiScales.size()); ++k)
985 for (
unsigned int n = 0;
990 this->descriptors.multiSIFTDescriptors[k][m][
n]);
995 f.printf(
"%2d ",
int(this->
descriptors.hasDescriptorORB() ? 1 : 0));
998 f.printf(
"%d ", this->descriptors.ORB[k]);
1001 f.printf(
"%2d ",
int(this->
descriptors.hasDescriptorBLD() ? 1 : 0));
1006 f.printf(
"%4d ", this->descriptors.BLD[k]);
1009 f.printf(
"%2d ",
int(this->
descriptors.hasDescriptorLATCH() ? 1 : 0));
1014 f.printf(
"%4d ", this->descriptors.LATCH[k]);
1045 if (!f.open(filename, APPEND))
1047 "[CFeatureList::saveToTextFile] ERROR: File could not be open for "
1051 "%% Dump of mrpt::vision::CFeatureList. Each line format is:\n"
1052 "%% ID TYPE X Y ORIENTATION SCALE TRACK_STATUS RESPONSE HAS_SIFT "
1053 "[SIFT] HAS_SURF [SURF]\n"
1054 "%% \\---------------------- feature ------------------/ \\--------- "
1055 "descriptors -------/\n"
1057 "%% TYPE : The used detector: 0:KLT, 1: Harris, 2: BCD, 3: SIFT, 4: "
1058 "SURF, 5: Beacon, 6: FAST\n"
1059 "%% HAS_* : 1 if a descriptor of that type is associated to the "
1061 "%% SIFT : Present if HAS_SIFT=1: N DESC_0 ... DESC_N-1 \n"
1062 "%% SURF : Present if HAS_SURF=1: N DESC_0 ... DESC_N-1 \n"
1063 "%%--------------------------------------------------------------------"
1064 "-----------------------\n");
1069 "%5u %2d %7.3f %7.3f %6.2f %6.2f %2d %6.3f ",
1070 (
unsigned int)(*it)->ID, (int)(*it)->get_type(), (*it)->x, (*it)->y,
1071 (*it)->orientation, (*it)->scale, (int)(*it)->track_status,
1074 f.printf(
"%2d ",
int((*it)->descriptors.hasDescriptorSIFT() ? 1 : 0));
1075 if ((*it)->descriptors.hasDescriptorSIFT())
1077 f.printf(
"%4d ",
int((*it)->descriptors.SIFT.size()));
1078 for (
unsigned int k = 0; k < (*it)->descriptors.SIFT.size(); k++)
1079 f.printf(
"%4d ", (*it)->descriptors.SIFT[k]);
1082 f.printf(
"%2d ",
int((*it)->descriptors.hasDescriptorSURF() ? 1 : 0));
1083 if ((*it)->descriptors.hasDescriptorSURF())
1085 f.printf(
"%4d ",
int((*it)->descriptors.SURF.size()));
1086 for (
unsigned int k = 0; k < (*it)->descriptors.SURF.size(); k++)
1087 f.printf(
"%8.5f ", (*it)->descriptors.SURF[k]);
1090 f.printf(
"%2d ",
int((*it)->descriptors.hasDescriptorBLD() ? 1 : 0));
1091 if ((*it)->descriptors.hasDescriptorBLD())
1093 f.printf(
"%4d ",
int((*it)->descriptors.BLD.size()));
1094 for (
unsigned int k = 0; k < (*it)->descriptors.BLD.size(); k++)
1095 f.printf(
"%4d ", (*it)->descriptors.BLD[k]);
1098 f.printf(
"%2d ",
int((*it)->descriptors.hasDescriptorLATCH() ? 1 : 0));
1099 if ((*it)->descriptors.hasDescriptorLATCH())
1101 f.printf(
"%4d ",
int((*it)->descriptors.LATCH.size()));
1102 for (
unsigned int k = 0; k < (*it)->descriptors.LATCH.size(); k++)
1103 f.printf(
"%4d ", (*it)->descriptors.LATCH[k]);
1122 std::istringstream line;
1124 while (parser.getNextLine(line))
1139 if (!(line >> feat->
x >> feat->
y))
throw std::string(
"x,y");
1144 if (!(line >> _track_st))
throw std::string(
"track_status");
1150 if (!(line >> hasSIFT))
throw std::string(
"hasSIFT");
1156 for (
size_t i = 0; i < N; i++)
1170 if (!(line >> hasBLD))
throw std::string(
"hasBLD");
1176 for (
size_t i = 0; i < N; i++)
1190 if (!(line >> hasLATCH))
throw std::string(
"hasLATCH");
1196 for (
size_t i = 0; i < N; i++)
1210 if (!(line >> hasSURF))
throw std::string(
"hasSURF");
1216 for (
size_t i = 0; i < N; i++)
1227 "%s:%d: Error parsing features text file (%s).",
1228 filename.c_str(), (
int)parser.getCurrentLineNumber(),
1241 this->resize(otherList.
size());
1244 for (it1 = otherList.
begin(), it2 = this->begin(); it1 != otherList.
end();
1248 (*it2).reset(
dynamic_cast<CFeature*
>((*it2)->clone()));
1258 if ((*it)->ID ==
ID)
return (*it);
1270 if ((*it)->ID ==
ID)
1283 const vector<TFeatureID>& IDs, vector<CFeature::Ptr>& out,
1284 vector<int>& outIndex)
const
1288 out.reserve(IDs.size());
1289 outIndex.reserve(IDs.size());
1291 for (
int k = 0; k < int(IDs.size()); ++k)
1296 outIndex.push_back(idx);
1304 const float x,
const float y,
double& dist_prev)
const
1308 float closest_x, closest_y;
1309 float closest_sqDist;
1312 const size_t closest_idx =
1313 this->kdTreeClosestPoint2D(
x,
y, closest_x, closest_y, closest_sqDist);
1314 float closest_dist = std::sqrt(closest_sqDist);
1316 if (closest_dist <= dist_prev)
1318 dist_prev = closest_dist;
1319 return m_feats[closest_idx];
1359 FILE* f =
os::fopen(filename.c_str(),
"wt");
1363 for (it = this->
begin(); it != this->
end(); it++)
1366 f,
"%d %.3f %.3f %d %.3f %.3f\n", (
unsigned int)(*it->first).ID,
1367 (*it->first).x, (*it->first).y, (
unsigned int)(*it->second).ID,
1368 (*it->second).x, (*it->second).y);
1381 for (it =
begin(); it !=
end(); ++it)
1384 if (feat->ID == ID)
return feat;
1440 list1[k] = it->first;
1441 list2[k] = it->second;
1484 desc.resize(nR, nC);
1486 for (
size_t r = 0;
r < nR;
r++)
1487 for (
size_t c = 0;
c < nC;
c++) desc.coeffRef(
r,
c) = *itD++;
CFeature::Ptr getByID(const TFeatureID &ID) const
Get a reference to a Feature from its ID.
void getByMultiIDs(const std::vector< TFeatureID > &IDs, std::vector< CFeature::Ptr > &out, std::vector< int > &outIndex) const
Get a vector of references to a subset of features from their IDs.
bool hasDescriptorPolarImg() const
Whether this feature has this kind of descriptor.
@ descORB
Bit-based feature descriptor.
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
@ descBLD
BLD Line descriptor.
std::vector< uint8_t > ORB
orientation and scale of the multiResolution feature (there is a vector of descriptors for each scale...
size_t getWidth() const override
Returns the width of the image in pixels.
EIGEN_STRONG_INLINE iterator begin()
std::deque< std::vector< std::vector< int32_t > > > multiSIFTDescriptors
the call to "descriptorDistanceTo" will not consider all the rotations between polar image descriptor...
float descriptorLATCHDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
const Scalar * const_iterator
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
@ descPolarImages
Polar image descriptor.
int void fclose(FILE *f)
An OS-independent version of fclose.
TDescriptorType
The bitwise OR combination of values of TDescriptorType are used in CFeatureExtraction::computeDescri...
void write(const std::string §ion, const std::string &name, enum_t value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string())
bool hasDescriptorSIFT() const
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
TInternalFeatList::const_iterator const_iterator
float response
process (old name: KLT_status)
Classes for computer vision, detectors, features, etc.
double read_double(const std::string §ion, const std::string &name, double defaultValue, bool failIfNotFound=false) const
bool getFirstDescriptorAsMatrix(mrpt::math::CMatrixFloat &desc) const
Return the first found descriptor, as a matrix.
void meanAndStd(const VECTORLIKE &v, double &out_mean, double &out_std, bool unbiased=true)
Computes the standard deviation of a vector.
float patchCorrelationTo(const CFeature &oFeature) const
Computes the normalized cross-correlation between the patches of this and another feature (normalized...
bool hasDescriptorMultiSIFT() const
Whether this feature has this kind of descriptor.
Struct containing the options when matching multi-resolution SIFT-like descriptors.
float descriptorPolarImgDistanceTo(const CFeature &oFeature, float &minDistAngle, bool normalize_distances=true) const
Returns the minimum Euclidean Distance between "this" and the "other" polar image descriptor,...
TInternalFeatList::iterator iterator
void cross_correlation(const CImage &patch_img, size_t &u_max, size_t &v_max, double &max_val, int u_search_ini=-1, int v_search_ini=-1, int u_search_size=-1, int v_search_size=-1, CImage *out_corr_image=nullptr) const
Computes the correlation between this image and another one, encapsulating the openCV function cvMatc...
void getMaxID(const TListIdx &idx, TFeatureID &firstListID, TFeatureID &secondListID)
Returns the maximum ID of the features in the list.
std::vector< uint8_t > BLD
BLD feature descriptor.
bool read_bool(const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const
GLint GLint GLsizei GLsizei GLsizei depth
std::vector< float > SURF
SURF feature descriptor.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
bool hasDescriptorSpinImg() const
GLuint GLuint GLsizei GLenum type
bool hasDescriptorLogPolarImg() const
Whether this feature has this kind of descriptor.
@ descLogPolarImages
Log-Polar image descriptor.
#define THROW_EXCEPTION(msg)
#define ASSERT_(f)
Defines an assertion mechanism.
CMatchedFeatureList()
Constructor.
T square(const T x)
Inline function for the square of a number.
double RAD2DEG(const double x)
Radians to degrees.
@ descAny
Used in some methods to mean "any of the present descriptors".
uint16_t SpinImg_range_rows
The number of rows (corresponding to.
Virtual base class for "archives": classes abstracting I/O streams.
float orientation
KLT_val)
uint64_t TFeatureID
Definition of a feature ID.
A matrix of dynamic size.
A list of visual features, to be used as output by detectors, as input/output by trackers,...
mrpt::math::CMatrix LogPolarImg
A log-polar image centered at the interest point.
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
std::vector< uint8_t > SIFT
SIFT feature descriptor.
float descriptorLogPolarImgDistanceTo(const CFeature &oFeature, float &minDistAngle, bool normalize_distances=true) const
Returns the minimum Euclidean Distance between "this" and the "other" log-polar image descriptor,...
GLdouble GLdouble GLdouble r
int sprintf(char *buf, size_t bufSize, const char *format,...) noexcept MRPT_printf_format_check(3
An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compiler...
EIGEN_STRONG_INLINE void push_back(Scalar val)
Insert an element at the end of the container (for 1D vectors/arrays)
mrpt::img::CImage patch
A patch of the image surrounding the feature.
@ descSIFT
SIFT descriptors.
float descriptorBLDDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
virtual ~CFeatureList()
Virtual destructor.
std::shared_ptr< CFeature > Ptr
GLuint GLuint GLsizei count
@ descSpinImages
Intensity-domain spin image descriptors.
This class is a "CSerializable" wrapper for "CMatrixFloat".
void saveToTextFile(const std::string &fileName, bool APPEND=false)
Save feature list to a text file.
void loadFromTextFile(const std::string &fileName)
Save feature list to a text file.
TFeatureID ID
ID of the feature.
uint8_t descriptorORBDistanceTo(const CFeature &oFeature) const
Computes the Hamming distance "this" and the "other" descriptor ORB descriptor.
This class allows loading and storing values and vectors of different types from a configuration text...
bool isPointFeature() const
a HASH table of descriptors
CFeatureList()
Constructor.
mrpt::gui::CDisplayWindow3D::Ptr win
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
void keep_max(T &var, const K test_val)
If the second argument is above the first one, set the first argument to this higher value.
bool polarImgsNoRotation
If set to true (manually, default=false)
void getBothFeatureLists(CFeatureList &list1, CFeatureList &list2)
Returns the matching features as two separate CFeatureLists.
CFeature::Ptr getByID(const TFeatureID &ID, const TListIdx &idx)
Returns a smart pointer to the feature with the provided ID or a empty one if not found.
@ featSIFT
Scale Invariant Feature Transform [LOWE'04].
@ descLATCH
LATCH Line descriptor.
@ descSURF
SURF descriptors.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
float descriptorDistanceTo(const CFeature &oFeature, TDescriptorType descriptorToUse=descAny, bool normalize_distances=true) const
Computes the Euclidean Distance between this feature's and other feature's descriptors,...
void copyListFrom(const CFeatureList &otherList)
Copies the content of another CFeatureList inside this one.
TFeatureType
Types of features - This means that the point has been detected with this algorithm,...
std::vector< uint8_t > LATCH
LATCH feature descriptor.
TFeatureID getMaxID() const
Get the maximum ID into the list.
mrpt::config::CConfigFileBase CConfigFileBase
TFeatureTrackStatus track_status
featKLT, featHarris, featSURF, featBeacon
float descriptorSIFTDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
void dumpToConsole() const
void saveToTextFile(const std::string &fileName)
Save list of matched features to a text file.
float descriptorSpinImgDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
float scale
Feature scale into the scale space.
std::vector< float > SpinImg
The 2D histogram as a single row.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
float descriptorSURFDistanceTo(const CFeature &oFeature, bool normalize_distances=true) const
Computes the Euclidean Distance between "this" and the "other" descriptors.
GLenum GLsizei GLsizei height
This CStream derived class allow using a file as a write-only, binary stream.
A class for storing images as grayscale or RGB bitmaps.
@ status_IDLE
Inactive (right after detection, and before being tried to track)
Create a GUI window and display plots with MATLAB-like interfaces and commands.
struct mrpt::vision::CFeature::TDescriptors descriptors
GLenum GLenum GLenum GLenum GLenum scale
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
CFeature::Ptr nearest(const float x, const float y, double &max_dist) const
Get a reference to the nearest feature to the a given 2D point (version returning distance to closest...
size_t getHeight() const override
Returns the height of the image in pixels.
@ featSURF
Speeded Up Robust Feature [BAY'06].
std::deque< double > multiScales
A set of scales where the.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
TFeatureType get_type() const
Get the type of the feature.
A class for parsing text files, returning each non-empty and non-comment line, along its line number.
void dumpToTextStream(std::ostream &out) const
Dump feature information into a text stream.
This base provides a set of functions for maths stuff.
float y
Coordinates in the image.
virtual ~CMatchedFeatureList()
Virtual destructor.
EIGEN_STRONG_INLINE bool empty() const
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
GLsizei const GLchar ** string
void updateMaxID(const TListIdx &idx)
Updates the value of the maximum ID of the features in the matched list, i.e.
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion) override
Load all the params from a config source, in the format described in saveToConfigFile()
void saveToConfigFile(mrpt::config::CConfigFileBase &cfg, const std::string §ion) const override
This method saves the options to a ".ini"-like file or memory-stored string list.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
void saveToConfigFile(mrpt::config::CConfigFileBase &cfg, const std::string §ion) const override
This method saves the options to a ".ini"-like file or memory-stored string list.
void saveToTextFile(const std::string &filename, bool APPEND=false)
Save the feature to a text file in this format: "%% Dump of mrpt::vision::CFeatureList....
TFeatureType type
be an odd number)
void read_vector(const std::string §ion, const std::string &name, const VECTOR_TYPE &defaultValue, VECTOR_TYPE &outValues, bool failIfNotFound=false) const
Reads a configuration parameter of type vector, stored in the file as a string: "[v1 v2 v3 ....
std::deque< std::vector< double > > multiOrientations
multi-resolution descriptor has been computed
A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...
unsigned __int32 uint32_t
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
static float internal_distanceBetweenPolarImages(const mrpt::math::CMatrix &desc1, const mrpt::math::CMatrix &desc2, float &minDistAngle, bool normalize_distances, bool dont_shift_angle)
Internal function used by "descriptorLogPolarImgDistanceTo" and "descriptorPolarImgDistanceTo".
@ featNotDefined
Non-defined feature (also used for Occupancy features)
mrpt::math::CMatrix PolarImg
range bins in the 2D histogram) of the original matrix from which SpinImg was extracted as a vector.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |