Main MRPT website > C++ reference for MRPT 1.3.2
List of all members | Public Types | Public Member Functions | Public Attributes
mrpt::vision::TSequenceFeatureObservations Struct Reference

Detailed Description

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

Note
Pixel coordinates can be either "raw" or "undistorted". Read the doc of functions handling this structure to see what they expect.
See also
mrpt::vision::bundle_adj_full

Definition at line 114 of file vision/include/mrpt/vision/types.h.

#include <mrpt/vision/types.h>

Inheritance diagram for mrpt::vision::TSequenceFeatureObservations:
Inheritance graph

Public Types

typedef std::vector< TFeatureObservationBASE
 

Public Member Functions

 TSequenceFeatureObservations ()
 
 TSequenceFeatureObservations (size_t size)
 
 TSequenceFeatureObservations (const TSequenceFeatureObservations &o)
 
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=NULL, std::map< TLandmarkID, TLandmarkID > *old2new_lmIDs=NULL)
 Rearrange frame and feature IDs such as they start at 0 and there are no gaps. More...
 

Public Attributes

elements
 STL member. More...
 

Member Typedef Documentation

§ BASE

Definition at line 116 of file vision/include/mrpt/vision/types.h.

Constructor & Destructor Documentation

§ TSequenceFeatureObservations() [1/3]

mrpt::vision::TSequenceFeatureObservations::TSequenceFeatureObservations ( )
inline

Definition at line 118 of file vision/include/mrpt/vision/types.h.

§ TSequenceFeatureObservations() [2/3]

mrpt::vision::TSequenceFeatureObservations::TSequenceFeatureObservations ( size_t  size)
inline

Definition at line 119 of file vision/include/mrpt/vision/types.h.

§ TSequenceFeatureObservations() [3/3]

mrpt::vision::TSequenceFeatureObservations::TSequenceFeatureObservations ( const TSequenceFeatureObservations o)
inline

Definition at line 120 of file vision/include/mrpt/vision/types.h.

References loadFromTextFile(), and saveToTextFile().

Member Function Documentation

§ compressIDs()

void mrpt::vision::TSequenceFeatureObservations::compressIDs ( std::map< TCameraPoseID, TCameraPoseID > *  old2new_camIDs = NULL,
std::map< TLandmarkID, TLandmarkID > *  old2new_lmIDs = NULL 
)

Rearrange frame and feature IDs such as they start at 0 and there are no gaps.

Parameters
old2new_camIDsIf provided, the mapping from old to new IDs is stored here.
old2new_lmIDsIf provided, the mapping from old to new IDs is stored here.

§ decimateCameraFrames()

void mrpt::vision::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.

See also
After calling this you may want to call compressIDs

§ loadFromTextFile()

void mrpt::vision::TSequenceFeatureObservations::loadFromTextFile ( const std::string &  filName)

Load from a text file, in the format described in saveToTextFile.

Exceptions
std::exceptionOn I/O or format error

§ removeFewObservedFeatures()

size_t mrpt::vision::TSequenceFeatureObservations::removeFewObservedFeatures ( size_t  minNumObservations = 3)

Remove all those features that don't have a minimum number of observations from different camera frame IDs.

Returns
the number of erased entries.
See also
After calling this you may want to call compressIDs

§ saveAsSBAFiles()

bool mrpt::vision::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)

Returns
false on any error

§ saveToTextFile()

void mrpt::vision::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.

Generated files can be loaded from MATLAB.

See also
loadFromTextFile
Exceptions
std::exceptionOn I/O error

Member Data Documentation

§ elements

T std::vector< T >::elements
inherited

STL member.




Page generated by Doxygen 1.8.12 for MRPT 1.3.2 SVN: at Thu Nov 10 13:46:27 UTC 2016