Kiretu
|
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 |
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.
Mirror-possibilities of CloudWriter.
CloudWriter::CloudWriter | ( | const std::string | filenamePrefix | ) |
Constructor of the CloudWriter-class.
filenamePrefix | Prefix of filename. |
CloudWriter::~CloudWriter | ( | ) |
Destructor of the CloudWriter-class.
void CloudWriter::addCloud | ( | std::vector< std::vector< float > > | cloud | ) |
Adds a point-cloud to the CloudWriter. This cloud should be computed by KinectCloud before.
cloud | Vector of 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.
cloudRgb | Vector of colors. Each color is specified in -, - and -values with . |
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.
cloudRgbMapping | Vector of 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().
reconstructionSteps | Vector of 5 booleans which indicate, if the equivalent reconstruction-step was done. |
void CloudWriter::addValidValues | ( | std::vector< bool > | validValues | ) |
Adds a vector of valid-points-flags to the CloudWriter. Get these points with KinectCloud::getValidValues().
validValues | Vector of booleans which indicate, if the corresponding vector is valid ( ). |
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.
mirror | The 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]).
printUndefined | True, 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.
color | RGB-color with . |
void CloudWriter::writeCloud | ( | ) |
Writes the cloud to the ply-file.
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
bool CloudWriter::printUndefined [private] |
Flag for printing points without a corresponding color
std::vector<bool> CloudWriter::reconstructionSteps [private] |
Reconstruction flags
bool CloudWriter::reconstructionStepsAdded [private] |
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