Class ModelToImage

Nested Relationships

Nested Types

Class Documentation

class ModelToImage

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

Public Types

enum ProjectionType

The ProjectionType enum.

Values:

enumerator CYLINDRICAL
enumerator CONICAL
enumerator EQUALAREACYLINDRICAL
enumerator RECTILINEAR
enumerator PANNINI
enumerator STEREOGRAPHIC
enumerator ZAXIS
enumerator AZIMUTHAL
enum ProjectionPolicy

Values:

enumerator FIRST
enumerator LAST
enumerator MINRANGE
enumerator MAXRANGE
enumerator AVERAGE
enumerator COLOR
enumerator INTENSITY
enum CoordinateSystem

Values:

enumerator NATIVE
enumerator SLAM6D
enumerator UOS
typedef struct lvr2::ModelToImage::PanoPoint PanoramaPoint
typedef struct lvr2::ModelToImage::DI DepthImage

Image with single depth information.

typedef struct lvr2::ModelToImage::PLI DepthListMatrix

Image with list of projected points at each pixel.

Public Functions

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.

Parameters:
  • buffer – A point buffer containing a point cloud

  • projection – Type of used projection

  • width – Desired image with. May be changed to fit panorama angles

  • height – Desired image height. May be changed to fit panorama angles

  • minZ – Minimum depth value

  • maxZ – Maximum depth value

  • minHorizontenAngle – Start of horizontal field of view in degrees

  • maxHorizontalAngle – End of horizontal field of view in degrees

  • mainVerticalAngle – Start of vertical field of view in degrees

  • maxVerticalAngle – End of vertical field of view in degrees

  • imageOptimization – If true, the aspect ration will be adapted to the chosen field of view

  • leftHandedInputData – Set this to true of the scan points are in a left handed coordinate system (like 3dtk)

void writePGM(string filename, float cutoff)

Writes the scan panaroma to an pgm file.

Parameters:
  • filename – Filename of the bitmap

  • cutoff – Max range cutoff. Reduce this to enhance contrast on pixels with low depths.

virtual ~ModelToImage()

Destructor.

void getCVMatrix(cv::Mat &image)
void computeDepthImage(DepthImage &img, ProjectionPolicy policy = LAST)

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

Parameters:
  • img – A DepthImage to store the projection result.

  • policy – Specifies 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.

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.

Parameters:

mat – The generated DepthListMatrix

inline PointBufferPtr pointBuffer()

Retruns the point buffer.

struct DepthPixel

Pixelcoordinates with depth value.

Public Members

int i
int j
float depth
struct DI

Image with single depth information.

Public Functions

inline DI()

Public Members

vector<vector<float>> pixels
float maxRange
float minRange
struct PanoPoint

Public Functions

inline PanoPoint(size_t index_)

Public Members

size_t index
struct PLI

Image with list of projected points at each pixel.

Public Functions

inline PLI()

Public Members

vector<vector<vector<PanoramaPoint>>> pixels
float maxRange
float minRange