43 std::ostream& operator<<(std::ostream &os, const std::vector<std::string> &vec)
58 : BaseOption(argc, argv)
62 (
"help",
"Produce help message")
63 (
"inputFile", value< vector<string> >(),
"Input file name. Supported formats are ASCII (.pts, .xyz) and .ply")
64 (
"outputFile", value< vector<string> >()->multitoken()->default_value(vector<string>{
"triangle_mesh.ply",
"triangle_mesh.obj"}),
"Output file name. Supported formats are ASCII (.pts, .xyz) and .ply")
65 (
"voxelsize,v", value<float>(&
m_voxelsize)->default_value(10),
"Voxelsize of grid used for reconstruction.")
66 (
"noExtrusion",
"Do not extend grid. Can be used to avoid artefacts in dense data sets but. Disabling will possibly create additional holes in sparse data sets.")
67 (
"intersections,i", value<int>(&
m_intersections)->default_value(-1),
"Number of intersections used for reconstruction. If other than -1, voxelsize will calculated automatically.")
68 (
"pcm,p", value<string>(&
m_pcm)->default_value(
"FLANN"),
"Point cloud manager used for point handling and normal estimation. Choose from {STANN, PCL, NABO}.")
69 (
"ransac",
"Set this flag for RANSAC based normal estimation.")
70 (
"decomposition,d", value<string>(&
m_pcm)->default_value(
"PMC"),
"Defines the type of decomposition that is used for the voxels (Standard Marching Cubes (MC), Planar Marching Cubes (PMC), Standard Marching Cubes with sharp feature detection (SF) or Tetraeder (MT) decomposition. Choose from {MC, PMC, MT, SF}")
71 (
"optimizePlanes,o",
"Shift all triangle vertices of a cluster onto their shared plane")
72 (
"clusterPlanes,c",
"Cluster planar regions based on normal threshold, do not shift vertices into regression plane.")
73 (
"cleanContours", value<int>(&
m_cleanContourIterations)->default_value(0),
"Remove noise artifacts from contours. Same values are between 2 and 4")
74 (
"planeIterations", value<int>(&
m_planeIterations)->default_value(3),
"Number of iterations for plane optimization")
75 (
"fillHoles,f", value<int>(&
m_fillHoles)->default_value(0),
"Maximum size for hole filling")
76 (
"rda", value<int>(&
m_rda)->default_value(0),
"Remove dangling artifacts, i.e. remove the n smallest not connected surfaces")
77 (
"pnt", value<float>(&
m_planeNormalThreshold)->default_value(0.85),
"(Plane Normal Threshold) Normal threshold for plane optimization. Default 0.85 equals about 3 degrees.")
78 (
"smallRegionThreshold", value<int>(&
m_smallRegionThreshold)->default_value(10),
"Threshold for small region removal. If 0 nothing will be deleted.")
79 (
"writeClassificationResult,w",
"Write classification results to file 'clusters.clu'")
80 (
"exportPointNormals,e",
"Exports original point cloud data together with normals into a single file called 'pointnormals.ply'")
81 (
"saveGrid,g",
"Writes the generated grid to a file called 'fastgrid.grid. The result can be rendered with qviewer.")
82 (
"saveOriginalData,s",
"Save the original points and the estimated normals together with the reconstruction into one file ('triangle_mesh.ply')")
83 (
"scanPoseFile", value<string>()->default_value(
""),
"ASCII file containing scan positions that can be used to flip normals")
84 (
"kd", value<int>(&
m_kd)->default_value(5),
"Number of normals used for distance function evaluation")
85 (
"ki", value<int>(&
m_ki)->default_value(10),
"Number of normals used in the normal interpolation process")
86 (
"kn", value<int>(&
m_kn)->default_value(10),
"Size of k-neighborhood used for normal estimation")
87 (
"mp", value<int>(&
m_minPlaneSize)->default_value(7),
"Minimum value for plane optimzation")
88 (
"retesselate,t",
"Retesselate regions that are in a regression plane. Implies --optimizePlanes.")
89 (
"lft", value<float>(&
m_lineFusionThreshold)->default_value(0.01),
"(Line Fusion Threshold) Threshold for fusing line segments while tesselating.")
90 (
"generateTextures",
"Generate textures during finalization.")
91 (
"texMinClusterSize", value<int>(&
m_texMinClusterSize)->default_value(100),
"Minimum number of faces of a cluster to create a texture from")
92 (
"texMaxClusterSize", value<int>(&
m_texMaxClusterSize)->default_value(0),
"Maximum number of faces of a cluster to create a texture from (0 = no limit)")
93 (
"textureAnalysis",
"Enable texture analysis features for texture matchung.")
94 (
"texelSize", value<float>(&
m_texelSize)->default_value(1),
"Texel size that determines texture resolution.")
95 (
"classifier", value<string>(&
m_classifier)->default_value(
"PlaneSimpsons"),
"Classfier object used to color the mesh.")
96 (
"recalcNormals,r",
"Always estimate normals, even if given in .ply file.")
98 (
"sft", value<float>(&
m_sft)->default_value(0.9),
"Sharp feature threshold when using sharp feature decomposition")
99 (
"sct", value<float>(&
m_sct)->default_value(0.7),
"Sharp corner threshold when using sharp feature decomposition")
100 (
"reductionRatio", value<float>(&
m_edgeCollapseReductionRatio)->default_value(0.0),
"Percentage of faces to remove via edge-collapse (0.0 means no reduction, 1.0 means to remove all faces which can be removed)")
101 (
"tp", value<string>(&
m_texturePack)->default_value(
""),
"Path to texture pack")
102 (
"co", value<string>(&
m_statsCoeffs)->default_value(
""),
"Coefficents file for texture matching based on statistics")
103 (
"nsc", value<unsigned int>(&
m_numStatsColors)->default_value(16),
"Number of colors for texture statistics")
104 (
"nccv", value<unsigned int>(&
m_numCCVColors)->default_value(64),
"Number of colors for texture matching based on color information")
105 (
"ct", value<unsigned int>(&
m_coherenceThreshold)->default_value(50),
"Coherence threshold for texture matching based on color information")
106 (
"colt", value<float>(&
m_colorThreshold)->default_value(FLT_MAX),
"Threshold for texture matching based on colors")
107 (
"stat", value<float>(&
m_statsThreshold)->default_value(FLT_MAX),
"Threshold for texture matching based on statistics")
108 (
"feat", value<float>(&
m_featuresThreshold)->default_value(FLT_MAX),
"Threshold for texture matching based on features")
109 (
"cro",
"Use texture matching based on cross correlation.")
110 (
"patt", value<float>(&
m_patternThreshold)->default_value(100),
"Threshold for pattern extraction from textures")
111 (
"mtv", value<int>(&
m_minimumTransformationVotes)->default_value(3),
"Minimum number of votes to consider a texture transformation as correct")
112 (
"vcfp",
"Use color information from pointcloud to paint vertices")
113 (
"useGPU",
"GPU normal estimation")
114 (
"flipPoint", value< vector<float> >()->multitoken(),
"Flippoint --flipPoint x y z" )
115 (
"texFromImages,q",
"Foo Bar ............")
116 (
"projectDir,a", value<string>()->default_value(
""),
"Foo Bar ............")
169 return (
m_variables[
"inputFile"].as< vector<string> >())[0];
179 return m_variables[
"outputFile"].as< vector<string> >();
194 return (
m_variables[
"decomposition"].as< string >());
204 return (
m_variables[
"reductionRatio"].as<float>());
227 cout <<
"Error: You must specify an input file." << endl;
249 return m_variables.count(
"writeClassificationResult")
260 return (
m_variables[
"inputFile"].as< vector<string> >()).size() > 0;
338 return m_variables[
"smallRegionThreshold"].as<
int>();
408 float* result =
new float[14];
409 std::ifstream in (
m_variables[
"tp"].as<string>().c_str());
412 for(
int i = 0; i < 14; i++)
420 for(
int i = 0; i < 14; i++)
453 dest = (
m_variables[
"flipPoint"].as< vector<float> >());
457 dest.push_back(10000000);
458 dest.push_back(10000000);
459 dest.push_back(10000000);
462 dest.push_back(10000000);
463 dest.push_back(10000000);
464 dest.push_back(10000000);
bool printUsage() const
Prints a usage message to stdout.
int getTexMaxClusterSize() const
static int getNumThreads()
Returns the number of supported threads (or 1 if OpenMP is not supported)
float m_edgeCollapseReductionRatio
Reduction ratio for mesh reduction via edge collapse.
bool colorRegions() const
Returns true of region coloring is enabled.
int m_intersections
The number of intersections used for reconstruction.
virtual void setup()
Setup internal data structures.
string getClassifier() const
Returns the name of the classifier used to color the mesh.
int getPlaneIterations() const
Returns to number plane optimization iterations.
float getPatternThreshold() const
bool getUseCrossCorr() const
float m_featuresThreshold
Threshold for texture matching based on features.
bool saveFaceNormals() const
Returns true if the face normals of the reconstructed mesh should be saved to an extra file ("face_no...
float m_texelSize
Texel size.
bool saveGrid() const
Returns true if the Marching Cubes grid should be save.
int getDanglingArtifacts() const
Returns the number of dangling artifacts to remove from a created mesh.
bool recalcNormals() const
If true, normals should be calculated even if they are already given in the input file...
int getKd() const
Returns the number of neighbors used for distance function evaluation.
int m_texMinClusterSize
Minimum number of textures of a cluster needed for generating textures.
bool saveNormals() const
Returns true if the interpolated normals should be saved in the putput file.
int m_kn
The number of neighbors for normal estimation.
float getSharpFeatureThreshold() const
Returns the sharp feature threshold when using sharp feature decomposition.
bool filenameSet() const
Returns true if an output filen name was set.
int m_ki
The number of neighbors for normal interpolation.
int m_cleanContourIterations
float getColorThreshold() const
float m_sft
Sharp feature threshold when using sharp feature decomposition.
int m_numThreads
The number of uesed threads.
unsigned int getCoherenceThreshold() const
vector< string > getOutputFileNames() const
Returns the output file names.
bool retesselate() const
Return whether the mesh should be retesselated or not.
int getCleanContourIterations() const
Number of iterations for contour cleanup.
float m_colorThreshold
Threshold for texture matching based on colors.
float getTexelSize() const
Returns the texel size for texture resolution.
int m_planeIterations
Number of iterations for plane optimzation.
int getKn() const
Returns the number of neighbors used for initial normal estimation.
float m_voxelsize
The set voxelsize.
float m_sct
Sharp corner threshold when using sharp feature decomposition.
int getKi() const
Returns the number of neighbors for normal interpolation.
vector< float > getFlippoint() const
bool extrude() const
Whether to extend the grid. Enable by default.
options_description m_descr
The internally used option description.
unsigned int m_numCCVColors
Number of colors for texture matching based on color information.
string getProjectDir() const
unsigned int getNumStatsColors() const
bool vertexColorsFromPointcloud() const
int getNumThreads() const
Returns the number of used threads.
int getSmallRegionThreshold() const
Returns the threshold for the size of small region deletion after plane optimization.
float m_lineFusionThreshold
Threshold for line fusing when tesselating.
float getVoxelsize() const
Returns the given voxelsize.
string getDecomposition() const
Returns the name of the used point cloud handler.
unsigned int m_coherenceThreshold
Coherence threshold for texture matching based on color information.
float getSharpCornerThreshold() const
Returns the sharp corner threshold when using sharp feature decomposition.
int getMinPlaneSize() const
Minimum value for plane optimzation.
int m_minPlaneSize
Threshold for plane optimization.
float getNormalThreshold() const
Returns the normal threshold for plane optimization.
string m_statsCoeffs
Coefficents file for texture matching based on statistics.
bool saveOriginalData() const
Returns true if the original points should be stored together with the reconstruction.
float getFeatureThreshold() const
int getFillHoles() const
Returns the region threshold for hole filling.
string getTexturePack() const
unsigned int m_numStatsColors
Number of colors for texture statistics.
string m_classifier
Name of the classifier object to color the mesh.
int getTexMinClusterSize() const
int m_smallRegionThreshold
Threshold for small ragions.
string getScanPoseFile() const
Returns the name of the given file with scan poses used for normal flipping.
string getInputFileName() const
Returns the input file name.
float getStatsThreshold() const
bool writeClassificationResult() const
True if region clustering without plane optimization is required.
variables_map m_variables
The internally used variable map.
float getEdgeCollapseReductionRatio() const
Reduction ratio for mesh reduction via edge collapse.
float m_patternThreshold
Threshold for pattern extraction from textures.
int getIntersections() const
Returns the number of intersections. If the return value is positive it will be used for reconstructi...
bool generateTextures() const
If true, textures will be generated during finalization of mesh.
float m_planeNormalThreshold
Threshold for plane optimization.
bool doTextureAnalysis() const
True if texture analysis is enabled.
bool savePointNormals() const
Indicates whether to save the used points together with the interpolated normals. ...
int getMinimumTransformationVotes() const
int m_minimumTransformationVotes
Minimum number of vote to consider a texture transformation as "correct".
bool texturesFromImages() const
bool useRansac() const
If true, RANSAC based normal estimation is used.
bool optimizePlanes() const
Returns true if cluster optimization is enabled.
int m_kd
The number of neighbors for distance function evaluation.
float * getStatsCoeffs() const
bool clusterPlanes() const
True if region clustering without plane optimization is required.
string m_pcm
The used point cloud manager.
float getLineFusionThreshold() const
Returns the fusion threshold for tesselation.
int m_rda
Number of dangling artifacts to remove.
int m_fillHoles
Threshold for hole filling.
string m_texturePack
Path to texture pack.
unsigned int getNumCCVColors() const
float m_statsThreshold
Threshold for texture matching based on statistics.
string getPCM() const
Returns the name of the used point cloud handler.
string getOutputFileName() const
Returns the output file name.