MRPT
1.9.9
|
A complete sequence of observations of features from different camera frames (poses).
This structure is the input to some (Bundle-adjustment) methods in mrpt::vision
Definition at line 170 of file vision/include/mrpt/vision/types.h.
#include <mrpt/vision/types.h>
Public Types | |
using | BASE = std::vector< TFeatureObservation > |
Public Member Functions | |
TSequenceFeatureObservations ()=default | |
TSequenceFeatureObservations (size_t size) | |
TSequenceFeatureObservations (const TSequenceFeatureObservations &o)=default | |
void | saveToTextFile (const std::string &filName, bool skipFirstCommentLine=false) const |
Saves all entries to a text file, with each line having this format: #FRAME_ID #FEAT_ID #PIXEL_X #PIXEL_Y The file is self-descripting, since the first line contains a comment line (starting with '') explaining the format. More... | |
void | loadFromTextFile (const std::string &filName) |
Load from a text file, in the format described in saveToTextFile. More... | |
bool | saveAsSBAFiles (const TLandmarkLocationsVec &pts, const std::string &pts_file, const TFramePosesVec &cams, const std::string &cams_file) const |
Save the list of observations + the point locations + the camera frame poses to a pair of files in the format used by the Sparse Bundle Adjustment (SBA) C++ library. More... | |
size_t | removeFewObservedFeatures (size_t minNumObservations=3) |
Remove all those features that don't have a minimum number of observations from different camera frame IDs. More... | |
void | decimateCameraFrames (const size_t decimate_ratio) |
Remove all but one out of decimate_ratio camera frame IDs from the list (eg: from N camera pose IDs at return there will be just N/decimate_ratio) The algorithm first builds a sorted list of frame IDs, then keep the lowest ID, remove the next "decimate_ratio-1", and so on. More... | |
void | compressIDs (std::map< TCameraPoseID, TCameraPoseID > *old2new_camIDs=nullptr, std::map< TLandmarkID, TLandmarkID > *old2new_lmIDs=nullptr) |
Rearrange frame and feature IDs such as they start at 0 and there are no gaps. More... | |
Public Attributes | |
T | elements |
STL member. More... | |
using mrpt::vision::TSequenceFeatureObservations::BASE = std::vector<TFeatureObservation> |
Definition at line 172 of file vision/include/mrpt/vision/types.h.
|
inlinedefault |
|
inline |
Definition at line 175 of file vision/include/mrpt/vision/types.h.
|
inlinedefault |
void TSequenceFeatureObservations::compressIDs | ( | std::map< TCameraPoseID, TCameraPoseID > * | old2new_camIDs = nullptr , |
std::map< TLandmarkID, TLandmarkID > * | old2new_lmIDs = nullptr |
||
) |
Rearrange frame and feature IDs such as they start at 0 and there are no gaps.
old2new_camIDs | If provided, the mapping from old to new IDs is stored here. |
old2new_lmIDs | If provided, the mapping from old to new IDs is stored here. |
Definition at line 198 of file types.cpp.
References mrpt::containers::begin(), mrpt::containers::end(), and mrpt::math::size().
void TSequenceFeatureObservations::decimateCameraFrames | ( | const size_t | decimate_ratio | ) |
Remove all but one out of decimate_ratio camera frame IDs from the list (eg: from N camera pose IDs at return there will be just N/decimate_ratio) The algorithm first builds a sorted list of frame IDs, then keep the lowest ID, remove the next "decimate_ratio-1", and so on.
Remove one out of decimate_ratio camera frame IDs from the list.
Definition at line 164 of file types.cpp.
References ASSERT_ABOVEEQ_, mrpt::containers::begin(), mrpt::containers::end(), mrpt::containers::erase_return_next(), and mrpt::math::size().
void TSequenceFeatureObservations::loadFromTextFile | ( | const std::string & | filName | ) |
Load from a text file, in the format described in saveToTextFile.
std::exception | On I/O or format error |
Definition at line 52 of file types.cpp.
References mrpt::containers::clear(), mrpt::format(), MRPT_END, MRPT_START, THROW_EXCEPTION, THROW_EXCEPTION_FMT, trim(), mrpt::img::TPixelCoordf::x, and mrpt::img::TPixelCoordf::y.
size_t TSequenceFeatureObservations::removeFewObservedFeatures | ( | size_t | minNumObservations = 3 | ) |
Remove all those features that don't have a minimum number of observations from different camera frame IDs.
Definition at line 136 of file types.cpp.
References mrpt::containers::begin(), MRPT_END, MRPT_START, and mrpt::math::size().
bool TSequenceFeatureObservations::saveAsSBAFiles | ( | const TLandmarkLocationsVec & | pts, |
const std::string & | pts_file, | ||
const TFramePosesVec & | cams, | ||
const std::string & | cams_file | ||
) | const |
Save the list of observations + the point locations + the camera frame poses to a pair of files in the format used by the Sparse Bundle Adjustment (SBA) C++ library.
Point file lines: X Y Z nframes frame0 x0 y0 frame1 x1 y1 ...
Camera file lines: qr qx qy qz x y z (Pose as a quaternion)
Definition at line 89 of file types.cpp.
References mrpt::vision::TFeatureObservation::id_feature, mrpt::vision::TFeatureObservation::id_frame, mrpt::poses::CPose3DQuat::m_quat, MRPT_END, MRPT_START, mrpt::vision::TFeatureObservation::px, mrpt::math::size(), mrpt::img::TPixelCoordf::x, mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y().
void TSequenceFeatureObservations::saveToTextFile | ( | const std::string & | filName, |
bool | skipFirstCommentLine = false |
||
) | const |
Saves all entries to a text file, with each line having this format: #FRAME_ID #FEAT_ID #PIXEL_X #PIXEL_Y The file is self-descripting, since the first line contains a comment line (starting with '') explaining the format.
Saves all entries to a text file, with each line having this format: #FRAME_ID #FEAT_ID #PIXEL_X #PIXEL_Y.
Generated files can be loaded from MATLAB.
std::exception | On I/O error |
Definition at line 31 of file types.cpp.
References MRPT_END, MRPT_START, and THROW_EXCEPTION_FMT.
|
inherited |
STL member.
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020 |