Public Member Functions | Private Member Functions | Private Attributes | List of all members
lvr2::UosIO Class Reference

An input class for laser scans in UOS 3d format. More...

#include <UosIO.hpp>

Inheritance diagram for lvr2::UosIO:
Inheritance graph
[legend]

Public Member Functions

Matrix4< VecparseFrameFile (ifstream &frameFile)
 Creates a transformation matrix from given frame file. More...
 
ModelPtr read (string dir)
 Reads all scans or an specified range of scans from the given directory. More...
 
void reduce (string dir, string target, int reduction=1)
 
void save (string filename)
 
void saveRemission (bool yes)
 Save remission (if present) More...
 
void saveRemissionAsColor (bool convert)
 Convert remission value to pseudo RGB values while saving. More...
 
void setFirstScan (int n)
 Defines the first scan to read. More...
 
void setLastScan (int n)
 Defines the last scan to read. More...
 
 UosIO ()
 Contructor. More...
 
- Public Member Functions inherited from lvr2::BaseIO
 BaseIO ()
 
virtual ModelPtr getModel ()
 Get the model for io operations. More...
 
virtual ModelPtr read (std::string filename)=0
 Parse the given file and load supported elements. More...
 
virtual void save (ModelPtr model, std::string filename)
 Set the model and save the loaded elements to the given file. More...
 
virtual void save (std::string filename)=0
 Save the loaded elements to the given file. More...
 
virtual void setModel (ModelPtr m)
 Set the model for io operations to use. More...
 
virtual ~BaseIO ()
 

Private Member Functions

float deg (const float rad)
 
float rad (const float deg)
 
void readNewFormat (ModelPtr &m, string dir, int first, int last, size_t &n)
 Reads scans from first} to last} in new UOS format. More...
 
void readOldFormat (ModelPtr &m, string dir, int first, int last, size_t &n)
 Reads scans from first} to last} in old UOS format. More...
 
std::string to_string (const int &t)
 
std::string to_string (const int &t, int width)
 

Private Attributes

int m_firstScan
 The first scan to read (or -1 if all scans should be processed) More...
 
int m_lastScan
 The last scan to read (or -1 if all scans should be processed) More...
 
int m_numScans
 Number of loaded scans. More...
 
ofstream m_outputFile
 Filestream to save reduced data. More...
 
int m_reductionTarget
 Number of targeted points for reduction. More...
 
bool m_saveRemission
 If true, the original remission information will be saved. More...
 
bool m_saveRemissionColor
 If true, remission values will be converted to color. More...
 
bool m_saveToDisk
 If true, the read point will not be stored in local memory. More...
 

Additional Inherited Members

- Protected Attributes inherited from lvr2::BaseIO
ModelPtr m_model
 

Detailed Description

An input class for laser scans in UOS 3d format.

Per default, this class tries to read all scans in the given directory. If you don't want to specify which scans to read, use the setFirstScan} and setLastScan} methods to specify an interval to read. If .frame files are present, the single scans will be transformed according to the last transformation in the file. If no .frame file are present, the .pose files will be sued to transform the scans.

Definition at line 74 of file UosIO.hpp.

Constructor & Destructor Documentation

◆ UosIO()

lvr2::UosIO::UosIO ( )
inline

Contructor.

Definition at line 82 of file UosIO.hpp.

Member Function Documentation

◆ deg()

float lvr2::UosIO::deg ( const float  rad)
inlineprivate

Converts an angle (given in rad) to deg

Parameters
radangle in rad
Returns
angle in deg

Definition at line 214 of file UosIO.hpp.

◆ parseFrameFile()

Matrix4< Vec > lvr2::UosIO::parseFrameFile ( ifstream &  frameFile)

Creates a transformation matrix from given frame file.

Parameters
frameFile
Returns
A matrix representing the final transformation from a frame file

Definition at line 708 of file UosIO.cpp.

◆ rad()

float lvr2::UosIO::rad ( const float  deg)
inlineprivate

Converts an angle (given in deg) to rad

Parameters
deginteger indicating, whether the figure to be drawn to show the clusters should be circles (0) or rectangles(1)
Returns
the clustered image, with the clusters marked by colored figures

Definition at line 202 of file UosIO.hpp.

◆ read()

ModelPtr lvr2::UosIO::read ( string  dir)

Reads all scans or an specified range of scans from the given directory.

Parameters
dirA directory containing scans in UOS format.
Returns
An indexed array of scan points

Definition at line 59 of file UosIO.cpp.

◆ readNewFormat()

void lvr2::UosIO::readNewFormat ( ModelPtr m,
string  dir,
int  first,
int  last,
size_t &  n 
)
private

Reads scans from first} to last} in new UOS format.

Parameters
dirThe directory path
firstThe first scan to read
lastThe last scan to read
Returns
All read data points

Definition at line 201 of file UosIO.cpp.

◆ readOldFormat()

void lvr2::UosIO::readOldFormat ( ModelPtr m,
string  dir,
int  first,
int  last,
size_t &  n 
)
private

Reads scans from first} to last} in old UOS format.

Parameters
dirThe directory path
firstThe first scan to read
lastThe last scan to read
Returns
All read data points

Definition at line 517 of file UosIO.cpp.

◆ reduce()

void lvr2::UosIO::reduce ( string  dir,
string  target,
int  reduction = 1 
)

Reduces the given point cloud and exports all points into on single file.

Parameters
dirThe directory containg the scan data
reductionReduction factor (export only every n-th point)
targetA target file name

Definition at line 180 of file UosIO.cpp.

◆ save()

void lvr2::UosIO::save ( string  filename)
inline
Todo:
Implement this!
Warning
This function is not yet implemented!

Definition at line 130 of file UosIO.hpp.

◆ saveRemission()

void lvr2::UosIO::saveRemission ( bool  yes)
inline

Save remission (if present)

Definition at line 143 of file UosIO.hpp.

◆ saveRemissionAsColor()

void lvr2::UosIO::saveRemissionAsColor ( bool  convert)
inline

Convert remission value to pseudo RGB values while saving.

Definition at line 137 of file UosIO.hpp.

◆ setFirstScan()

void lvr2::UosIO::setFirstScan ( int  n)
inline

Defines the first scan to read.

Parameters
nThe first scan to read

Definition at line 105 of file UosIO.hpp.

◆ setLastScan()

void lvr2::UosIO::setLastScan ( int  n)
inline

Defines the last scan to read.

Parameters
nThe last scan to read

Definition at line 112 of file UosIO.hpp.

◆ to_string() [1/2]

std::string lvr2::UosIO::to_string ( const int &  t)
inlineprivate

Definition at line 185 of file UosIO.hpp.

◆ to_string() [2/2]

std::string lvr2::UosIO::to_string ( const int &  t,
int  width 
)
inlineprivate

Definition at line 177 of file UosIO.hpp.

Member Data Documentation

◆ m_firstScan

int lvr2::UosIO::m_firstScan
private

The first scan to read (or -1 if all scans should be processed)

Definition at line 221 of file UosIO.hpp.

◆ m_lastScan

int lvr2::UosIO::m_lastScan
private

The last scan to read (or -1 if all scans should be processed)

Definition at line 224 of file UosIO.hpp.

◆ m_numScans

int lvr2::UosIO::m_numScans
private

Number of loaded scans.

Definition at line 233 of file UosIO.hpp.

◆ m_outputFile

ofstream lvr2::UosIO::m_outputFile
private

Filestream to save reduced data.

Definition at line 230 of file UosIO.hpp.

◆ m_reductionTarget

int lvr2::UosIO::m_reductionTarget
private

Number of targeted points for reduction.

Definition at line 236 of file UosIO.hpp.

◆ m_saveRemission

bool lvr2::UosIO::m_saveRemission
private

If true, the original remission information will be saved.

Definition at line 242 of file UosIO.hpp.

◆ m_saveRemissionColor

bool lvr2::UosIO::m_saveRemissionColor
private

If true, remission values will be converted to color.

Definition at line 239 of file UosIO.hpp.

◆ m_saveToDisk

bool lvr2::UosIO::m_saveToDisk
private

If true, the read point will not be stored in local memory.

Definition at line 227 of file UosIO.hpp.


The documentation for this class was generated from the following files:


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:27