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... | |
Projection * | m_projection |
Pointer to projection. More... | |
int | m_width |
Image width. More... | |
The ModelToImage class provides methods to re-project 3D laser scans to image planes.
Definition at line 55 of file ModelToImage.hpp.
typedef struct lvr2::ModelToImage::DI lvr2::ModelToImage::DepthImage |
Image with single depth information.
typedef struct lvr2::ModelToImage::PLI lvr2::ModelToImage::DepthListMatrix |
Image with list of projected points at each pixel.
typedef struct lvr2::ModelToImage::PanoPoint lvr2::ModelToImage::PanoramaPoint |
Enumerator | |
---|---|
NATIVE | |
SLAM6D | |
UOS |
Definition at line 110 of file ModelToImage.hpp.
Enumerator | |
---|---|
FIRST | |
LAST | |
MINRANGE | |
MAXRANGE | |
AVERAGE | |
COLOR | |
INTENSITY |
Definition at line 105 of file ModelToImage.hpp.
The ProjectionType enum.
Enumerator | |
---|---|
CYLINDRICAL | |
CONICAL | |
EQUALAREACYLINDRICAL | |
RECTILINEAR | |
PANNINI | |
STEREOGRAPHIC | |
ZAXIS | |
AZIMUTHAL |
Definition at line 99 of file ModelToImage.hpp.
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.
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) |
Definition at line 52 of file ModelToImage.cpp.
|
virtual |
Destructor.
Definition at line 86 of file ModelToImage.cpp.
void lvr2::ModelToImage::computeDepthImage | ( | ModelToImage::DepthImage & | img, |
ModelToImage::ProjectionPolicy | policy = LAST |
||
) |
Computes a depth image from the given scan using the specified policy.
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. |
Definition at line 143 of file ModelToImage.cpp.
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.
mat | The generated DepthListMatrix |
Definition at line 91 of file ModelToImage.cpp.
void lvr2::ModelToImage::getCVMatrix | ( | cv::Mat & | image | ) |
|
inline |
Retruns the point buffer.
Definition at line 186 of file ModelToImage.hpp.
void lvr2::ModelToImage::writePGM | ( | string | filename, |
float | cutoff | ||
) |
Writes the scan panaroma to an pgm file.
filename | Filename of the bitmap |
cutoff | Max range cutoff. Reduce this to enhance contrast on pixels with low depths. |
Definition at line 192 of file ModelToImage.cpp.
|
private |
Set this to true if you are using a left-handed coordinate system.
Definition at line 219 of file ModelToImage.hpp.
|
private |
Image height.
Definition at line 201 of file ModelToImage.hpp.
|
private |
Max horizontal opening angle.
Definition at line 207 of file ModelToImage.hpp.
|
private |
Max horizontal opening angle.
Definition at line 213 of file ModelToImage.hpp.
|
private |
Maximal z value that will be projected.
Definition at line 222 of file ModelToImage.hpp.
|
private |
Min horizontal opening angle.
Definition at line 204 of file ModelToImage.hpp.
|
private |
Min horizontal opening angle.
Definition at line 210 of file ModelToImage.hpp.
|
private |
Minimal z value that will be projected.
Definition at line 225 of file ModelToImage.hpp.
|
private |
Image optimization flag.
Definition at line 216 of file ModelToImage.hpp.
|
private |
Pointer to the initial point cloud.
Definition at line 195 of file ModelToImage.hpp.
|
private |
Pointer to projection.
Definition at line 192 of file ModelToImage.hpp.
|
private |
Image width.
Definition at line 198 of file ModelToImage.hpp.