Kiretu
Public Types | Public Member Functions | Private Member Functions | Private Attributes

CloudWriter Class Reference

C++-class which saves a point-cloud of Microsoft's Kinect to a ply-file. It supports per-vertex-color and the ability of mirroring the cloud along x-, y- and z-axis. It is also possible to export the points which don't have an corresponding color at the RGB-image in a custom color. More...

#include <CloudWriter.h>

Public Types

enum  CloudMirror { MIRROR_X, MIRROR_Y, MIRROR_Z }
 

Mirror-possibilities of CloudWriter.

More...

Public Member Functions

 CloudWriter (const std::string filenamePrefix)
 Constructor of the CloudWriter-class.
 ~CloudWriter ()
 Destructor of the CloudWriter-class.
void addCloud (std::vector< std::vector< float > > cloud)
 Adds a point-cloud to the CloudWriter. This cloud should be computed by KinectCloud before.
void addCloudRgb (std::vector< std::vector< int > > cloudRgb)
 Adds a vector of RGB-colors to the CloudWriter.This vector should be computed by KinectCloud before.
void addCloudRgbMapping (std::vector< std::vector< int > > cloudRgbMapping)
 Adds a vector of depth-RGB-mapping values to the CloudWriter. These values should be computed by KinectCloud::computeRgbMapping(std::vector< std::vector<float> > rgbCam) before.
void addValidValues (std::vector< bool > validValues)
 Adds a vector of valid-points-flags to the CloudWriter. Get these points with KinectCloud::getValidValues().
void addReconstructionSteps (std::vector< bool > reconstructionSteps)
 Adds a vector of reconstruction-steps-flags to the CloudWriter. Get these points with KinectCloud::getReconstructionSteps().
void setUndefined (bool printUndefined)
 Sets if points of the point-cloud, which don't have an equivalent color at the RGB-image should be added to the final point-cloud. They will be added with a custom color, specified with setUndefinedColor(int color[3]).
void setUndefinedColor (int color[3])
 Sets the color of points with undefined color.
void setMirror (CloudMirror mirror)
 Mirrors the point-cloud along the given axis. Multiple calls possible.
void writeCloud ()
 Writes the cloud to the ply-file.

Private Member Functions

void createOutput ()
void createFilename ()

Private Attributes

std::string filenamePrefix
std::string filename
std::vector< std::vector< float > > cloud
std::vector< std::vector< int > > cloudRgb
std::vector< std::vector< int > > cloudRgbMapping
std::vector< bool > validValues
std::vector< bool > reconstructionSteps
std::vector< std::vector< float > > cloudOutput
bool printUndefined
bool reconstructionStepsAdded
int undefinedColor [3]
int mirrorX
int mirrorY
int mirrorZ

Detailed Description

C++-class which saves a point-cloud of Microsoft's Kinect to a ply-file. It supports per-vertex-color and the ability of mirroring the cloud along x-, y- and z-axis. It is also possible to export the points which don't have an corresponding color at the RGB-image in a custom color.

Author:
Daniel Wunderlich (d.wunderlich@stud.uni-heidelberg.de)
Version:
0.8
Date:
2011-01-26

Member Enumeration Documentation

Mirror-possibilities of CloudWriter.

Enumerator:
MIRROR_X 

Mirror along x-axis

MIRROR_Y 

Mirror along y-axis

MIRROR_Z 

Mirror along z-axis


Constructor & Destructor Documentation

CloudWriter::CloudWriter ( const std::string  filenamePrefix)

Constructor of the CloudWriter-class.

Parameters:
filenamePrefixPrefix of filename.
CloudWriter::~CloudWriter ( )

Destructor of the CloudWriter-class.


Member Function Documentation

void CloudWriter::addCloud ( std::vector< std::vector< float > >  cloud)

Adds a point-cloud to the CloudWriter. This cloud should be computed by KinectCloud before.

Parameters:
cloudVector of $640 \times 480$ 3-dimensional points.
void CloudWriter::addCloudRgb ( std::vector< std::vector< int > >  cloudRgb)

Adds a vector of RGB-colors to the CloudWriter.This vector should be computed by KinectCloud before.

Parameters:
cloudRgbVector of $640 \times 480$ colors. Each color is specified in $R$-, $G$- and $B$-values with $R, G, B \in [1, 255]$.
void CloudWriter::addCloudRgbMapping ( std::vector< std::vector< int > >  cloudRgbMapping)

Adds a vector of depth-RGB-mapping values to the CloudWriter. These values should be computed by KinectCloud::computeRgbMapping(std::vector< std::vector<float> > rgbCam) before.

Parameters:
cloudRgbMappingVector of $640 \times 480$ 2-dimensional mapping-values.
void CloudWriter::addReconstructionSteps ( std::vector< bool >  reconstructionSteps)

Adds a vector of reconstruction-steps-flags to the CloudWriter. Get these points with KinectCloud::getReconstructionSteps().

Parameters:
reconstructionStepsVector of 5 booleans which indicate, if the equivalent reconstruction-step was done.
See also:
KinectCloud::getReconstructionSteps()
void CloudWriter::addValidValues ( std::vector< bool >  validValues)

Adds a vector of valid-points-flags to the CloudWriter. Get these points with KinectCloud::getValidValues().

Parameters:
validValuesVector of $640 \times 480$ booleans which indicate, if the corresponding vector is valid ( $depth < 2047$).
void CloudWriter::createFilename ( ) [private]

Generates the filename

void CloudWriter::createOutput ( ) [private]

Generates the ply-output

void CloudWriter::setMirror ( CloudMirror  mirror)

Mirrors the point-cloud along the given axis. Multiple calls possible.

Parameters:
mirrorThe mirror-axis.
void CloudWriter::setUndefined ( bool  printUndefined)

Sets if points of the point-cloud, which don't have an equivalent color at the RGB-image should be added to the final point-cloud. They will be added with a custom color, specified with setUndefinedColor(int color[3]).

Parameters:
printUndefinedTrue, if points with undefined color should be added to the exported file. False, if not.
void CloudWriter::setUndefinedColor ( int  color[3])

Sets the color of points with undefined color.

Parameters:
colorRGB-color with $R, G, B \in [1, 255]$.
void CloudWriter::writeCloud ( )

Writes the cloud to the ply-file.


Field Documentation

std::vector< std::vector<float> > CloudWriter::cloud [private]

Point-cloud

std::vector< std::vector<float> > CloudWriter::cloudOutput [private]

Final ply-output

std::vector< std::vector<int> > CloudWriter::cloudRgb [private]

RGB-values

std::vector< std::vector<int> > CloudWriter::cloudRgbMapping [private]

Coordinates of a point's corresponding color at the RGB-image

std::string CloudWriter::filename [private]

Resulting filename (Filename prefix + datetime + reconstruction-steps)

std::string CloudWriter::filenamePrefix [private]

Filename prefix

int CloudWriter::mirrorX [private]

Help-variable for mirroring along x-axis

int CloudWriter::mirrorY [private]

Help-variable for mirroring along y-axis

int CloudWriter::mirrorZ [private]

Help-variable for mirroring along z-axis

Flag for printing points without a corresponding color

std::vector<bool> CloudWriter::reconstructionSteps [private]

Reconstruction flags

Indicates, if the reconstruction-steps were added

int CloudWriter::undefinedColor[3] [private]

Color for points with undefined colors at the RGB-image

std::vector<bool> CloudWriter::validValues [private]

Valid flags for each point


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Enumerations Enumerator
[Page Up]