libvisiontransfer
5.1.0

Transforms a disparity map into a set of 3D points. More...
#include <visiontransfer/reconstruct3d.h>
Classes  
class  Pimpl 
Public Member Functions  
Reconstruct3D ()  
Constructs a new object for 3D reconstructing. More...  
float *  createPointMap (const unsigned short *dispMap, int width, int height, int rowStride, const float *q, unsigned short minDisparity=1) 
Reconstructs the 3D location of each pixel in the given disparity map. More...  
float *  createPointMap (const ImagePair &imagePair, unsigned short minDisparity=1) 
Reconstructs the 3D location of each pixel in the given disparity map. More...  
void  writePlyFile (const char *file, const unsigned short *dispMap, const unsigned char *image, int width, int height, int dispRowStride, int imageRowStride, const float *q, double maxZ=std::numeric_limits< double >::max(), bool binary=false) 
Projects the given disparity map to 3D points and exports the result to a PLY file. More...  
void  writePlyFile (const char *file, const ImagePair &imagePair, double maxZ=std::numeric_limits< double >::max(), bool binary=false) 
Projects the given disparity map to 3D points and exports the result to a PLY file. More...  
Transforms a disparity map into a set of 3D points.
Use this class for reconstructing the 3D location for each valid point in a disparity map.
Definition at line 28 of file reconstruct3d.h.
Reconstruct3D::Reconstruct3D  (  ) 
Constructs a new object for 3D reconstructing.
Definition at line 67 of file reconstruct3d.cpp.
float * Reconstruct3D::createPointMap  (  const unsigned short *  dispMap, 
int  width,  
int  height,  
int  rowStride,  
const float *  q,  
unsigned short  minDisparity = 1 

) 
Reconstructs the 3D location of each pixel in the given disparity map.
dispMap  Pointer to the data of the disparity map. The disparity map is assumed to have a 4bit subpixel resolution. This means that each value needs to be divided by 16 to receive the true disparity. 
width  Width of the disparity map. 
height  Height of the disparity map. 
rowStride  Row stride (i.e. distance between two rows in bytes) of the disparity map. 
q  Disparitytodepth mapping matrix of size 4x4. The matrix is stored in a rowwise alignment. Obtain this matrix from your camera calibration data. 
minDisparity  The minimum disparity, again with 4bit subpixel resolution. Lower disparities will be clamped to this value before computing the 3D location. 
The output map will have a size of exactly 4*width*height float values. For each point the x, y and z coordinates are stored consecutively, plus one additional float (four bytes) as padding. Invalid disparities will be set to the given minimum disparity.
If the minimum disparity is set to 0, points with a disparity of 0 or an invalid disparity will receive a z coordinate of +inf.
The returned point map is valid until the next call of createPointMap() or writePlyFile().
Definition at line 75 of file reconstruct3d.cpp.
float * Reconstruct3D::createPointMap  (  const ImagePair &  imagePair, 
unsigned short  minDisparity = 1 

) 
Reconstructs the 3D location of each pixel in the given disparity map.
imagePair  Image pair containing the disparity map. 
minDisparity  The minimum disparity with 4bit subpixel resolution. 
The second image in imagePair
is interpreted as the disparity map.
Please see createPointMap(const unsigned short*, int, int, int, const float*, unsigned short) for further details.
Definition at line 80 of file reconstruct3d.cpp.
void Reconstruct3D::writePlyFile  (  const char *  file, 
const unsigned short *  dispMap,  
const unsigned char *  image,  
int  width,  
int  height,  
int  dispRowStride,  
int  imageRowStride,  
const float *  q,  
double  maxZ = std::numeric_limits<double>::max() , 

bool  binary = false 

) 
Projects the given disparity map to 3D points and exports the result to a PLY file.
file  The output file 
dispMap  Pointer to the data of the disparity map. The disparity map is assumed to have a 4bit subpixel resolution. This means that each value needs to be divided by 16 to receive the true disparity. 
left  Rectified left input image in 8bit gray scale format. 
width  Width of the disparity map and left image. 
height  Height of the disparity map and left image. 
dispRowStride  Row stride (i.e. distance between two rows in bytes) of the disparity map. 
imageRowStride  Row stride (i.e. distance between two rows in bytes) of the left image. 
q  Disparitytodepth mapping matrix of size 4x4. The matrix is stored in a rowwise alignment. Obtain this matrix from your camera calibration data. 
maxZ  Maximum allowed zcoordinate. Points with a higher zcoordinate are not exported. 
binary  Specifies whether the ASCII or binary PLYformat should be used. 
The left image has to be provided for assigning a color to each point.
Definition at line 84 of file reconstruct3d.cpp.
void Reconstruct3D::writePlyFile  (  const char *  file, 
const ImagePair &  imagePair,  
double  maxZ = std::numeric_limits<double>::max() , 

bool  binary = false 

) 
Projects the given disparity map to 3D points and exports the result to a PLY file.
imagePair  Image pair containing camera image and disparity map. 
maxZ  Maximum allowed zcoordinate. 
binary  Specifies whether the ASCII or binary PLYformat should be used. 
The first image in imagePair
is interpreted as camera image and the second image as disparity map.
Please see writePlyFile(const char*, const unsigned short*, const unsigned char*, int, int, int, int, const float*, double) for further details.
Definition at line 91 of file reconstruct3d.cpp.