Classes | Public Types | Public Member Functions | Private Attributes | List of all members
lvr2::ModelToImage Class Reference

The ModelToImage class provides methods to re-project 3D laser scans to image planes. More...

#include <ModelToImage.hpp>

Classes

struct  DepthPixel
 Pixelcoordinates with depth value. More...
 
struct  DI
 Image with single depth information. More...
 
struct  PanoPoint
 
struct  PLI
 Image with list of projected points at each pixel. More...
 

Public Types

enum  CoordinateSystem { NATIVE, SLAM6D, UOS }
 
typedef struct lvr2::ModelToImage::DI DepthImage
 Image with single depth information. More...
 
typedef struct lvr2::ModelToImage::PLI DepthListMatrix
 Image with list of projected points at each pixel. More...
 
typedef struct lvr2::ModelToImage::PanoPoint PanoramaPoint
 
enum  ProjectionPolicy {
  FIRST, LAST, MINRANGE, MAXRANGE,
  AVERAGE, COLOR, INTENSITY
}
 
enum  ProjectionType {
  CYLINDRICAL, CONICAL, EQUALAREACYLINDRICAL, RECTILINEAR,
  PANNINI, STEREOGRAPHIC, ZAXIS, AZIMUTHAL
}
 The ProjectionType enum. More...
 

Public Member Functions

void computeDepthImage (DepthImage &img, ProjectionPolicy policy=LAST)
 Computes a depth image from the given scan using the specified policy. More...
 
void computeDepthListMatrix (DepthListMatrix &mat)
 Computes a DepthListMatrix, i.e., an image matrix where each entry holds a vector of all points that where projected to that image position. More...
 
void getCVMatrix (cv::Mat &image)
 
 ModelToImage (PointBufferPtr buffer, ProjectionType projection, int width, int height, float minZ, float maxZ, int minHorizontenAngle, int maxHorizontalAngle, int mainVerticalAngle, int maxVerticalAngle, bool imageOptimization=true, CoordinateSystem system=NATIVE)
 Constructor. More...
 
PointBufferPtr pointBuffer ()
 Retruns the point buffer. More...
 
void writePGM (string filename, float cutoff)
 Writes the scan panaroma to an pgm file. More...
 
virtual ~ModelToImage ()
 Destructor. More...
 

Private Attributes

CoordinateSystem m_coordinateSystem
 Set this to true if you are using a left-handed coordinate system. More...
 
int m_height
 Image height. More...
 
int m_maxHAngle
 Max horizontal opening angle. More...
 
int m_maxVAngle
 Max horizontal opening angle. More...
 
float m_maxZ
 Maximal z value that will be projected. More...
 
int m_minHAngle
 Min horizontal opening angle. More...
 
int m_minVAngle
 Min horizontal opening angle. More...
 
float m_minZ
 Minimal z value that will be projected. More...
 
bool m_optimize
 Image optimization flag. More...
 
PointBufferPtr m_points
 Pointer to the initial point cloud. More...
 
Projectionm_projection
 Pointer to projection. More...
 
int m_width
 Image width. More...
 

Detailed Description

The ModelToImage class provides methods to re-project 3D laser scans to image planes.

Definition at line 55 of file ModelToImage.hpp.

Member Typedef Documentation

◆ DepthImage

Image with single depth information.

◆ DepthListMatrix

Image with list of projected points at each pixel.

◆ PanoramaPoint

Member Enumeration Documentation

◆ CoordinateSystem

Enumerator
NATIVE 
SLAM6D 
UOS 

Definition at line 110 of file ModelToImage.hpp.

◆ ProjectionPolicy

Enumerator
FIRST 
LAST 
MINRANGE 
MAXRANGE 
AVERAGE 
COLOR 
INTENSITY 

Definition at line 105 of file ModelToImage.hpp.

◆ ProjectionType

The ProjectionType enum.

Enumerator
CYLINDRICAL 
CONICAL 
EQUALAREACYLINDRICAL 
RECTILINEAR 
PANNINI 
STEREOGRAPHIC 
ZAXIS 
AZIMUTHAL 

Definition at line 99 of file ModelToImage.hpp.

Constructor & Destructor Documentation

◆ ModelToImage()

lvr2::ModelToImage::ModelToImage ( PointBufferPtr  buffer,
ModelToImage::ProjectionType  projection,
int  width,
int  height,
float  minZ,
float  maxZ,
int  minHorizontenAngle,
int  maxHorizontalAngle,
int  mainVerticalAngle,
int  maxVerticalAngle,
bool  imageOptimization = true,
CoordinateSystem  system = NATIVE 
)

Constructor.

Parameters
bufferA point buffer containing a point cloud
projectionType of used projection
widthDesired image with. May be changed to fit panorama angles
heightDesired image height. May be changed to fit panorama angles
minZMinimum depth value
maxZMaximum depth value
minHorizontenAngleStart of horizontal field of view in degrees
maxHorizontalAngleEnd of horizontal field of view in degrees
mainVerticalAngleStart of vertical field of view in degrees
maxVerticalAngleEnd of vertical field of view in degrees
imageOptimizationIf true, the aspect ration will be adapted to the chosen field of view
leftHandedInputDataSet this to true of the scan points are in a left handed coordinate system (like 3dtk)

Definition at line 52 of file ModelToImage.cpp.

◆ ~ModelToImage()

lvr2::ModelToImage::~ModelToImage ( )
virtual

Destructor.

Definition at line 86 of file ModelToImage.cpp.

Member Function Documentation

◆ computeDepthImage()

void lvr2::ModelToImage::computeDepthImage ( ModelToImage::DepthImage img,
ModelToImage::ProjectionPolicy  policy = LAST 
)

Computes a depth image from the given scan using the specified policy.

Parameters
imgA DepthImage to store the projection result.
policySpecifies how the entries are generated. FIRST stores the first projected distance. LAST the last distance. MINRANGE and MAXRANGE the minimal and maximal projected distances. AVERAGE averages over all encountered distances.

Definition at line 143 of file ModelToImage.cpp.

◆ computeDepthListMatrix()

void lvr2::ModelToImage::computeDepthListMatrix ( DepthListMatrix mat)

Computes a DepthListMatrix, i.e., an image matrix where each entry holds a vector of all points that where projected to that image position.

Parameters
matThe generated DepthListMatrix

Definition at line 91 of file ModelToImage.cpp.

◆ getCVMatrix()

void lvr2::ModelToImage::getCVMatrix ( cv::Mat &  image)

◆ pointBuffer()

PointBufferPtr lvr2::ModelToImage::pointBuffer ( )
inline

Retruns the point buffer.

Definition at line 186 of file ModelToImage.hpp.

◆ writePGM()

void lvr2::ModelToImage::writePGM ( string  filename,
float  cutoff 
)

Writes the scan panaroma to an pgm file.

Parameters
filenameFilename of the bitmap
cutoffMax range cutoff. Reduce this to enhance contrast on pixels with low depths.

Definition at line 192 of file ModelToImage.cpp.

Member Data Documentation

◆ m_coordinateSystem

CoordinateSystem lvr2::ModelToImage::m_coordinateSystem
private

Set this to true if you are using a left-handed coordinate system.

Definition at line 219 of file ModelToImage.hpp.

◆ m_height

int lvr2::ModelToImage::m_height
private

Image height.

Definition at line 201 of file ModelToImage.hpp.

◆ m_maxHAngle

int lvr2::ModelToImage::m_maxHAngle
private

Max horizontal opening angle.

Definition at line 207 of file ModelToImage.hpp.

◆ m_maxVAngle

int lvr2::ModelToImage::m_maxVAngle
private

Max horizontal opening angle.

Definition at line 213 of file ModelToImage.hpp.

◆ m_maxZ

float lvr2::ModelToImage::m_maxZ
private

Maximal z value that will be projected.

Definition at line 222 of file ModelToImage.hpp.

◆ m_minHAngle

int lvr2::ModelToImage::m_minHAngle
private

Min horizontal opening angle.

Definition at line 204 of file ModelToImage.hpp.

◆ m_minVAngle

int lvr2::ModelToImage::m_minVAngle
private

Min horizontal opening angle.

Definition at line 210 of file ModelToImage.hpp.

◆ m_minZ

float lvr2::ModelToImage::m_minZ
private

Minimal z value that will be projected.

Definition at line 225 of file ModelToImage.hpp.

◆ m_optimize

bool lvr2::ModelToImage::m_optimize
private

Image optimization flag.

Definition at line 216 of file ModelToImage.hpp.

◆ m_points

PointBufferPtr lvr2::ModelToImage::m_points
private

Pointer to the initial point cloud.

Definition at line 195 of file ModelToImage.hpp.

◆ m_projection

Projection* lvr2::ModelToImage::m_projection
private

Pointer to projection.

Definition at line 192 of file ModelToImage.hpp.

◆ m_width

int lvr2::ModelToImage::m_width
private

Image width.

Definition at line 198 of file ModelToImage.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 Mon Feb 28 2022 22:46:12