43 std::ostream&
operator<<(std::ostream &os,
const std::vector<std::string> &vec)
55 using namespace boost::program_options;
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), Dual Marching Cubes with an adaptive Octree (DMC) 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 ............")
122 float Options::getVoxelsize()
const
127 float Options::getSharpFeatureThreshold()
const
132 float Options::getSharpCornerThreshold()
const
137 int Options::getNumThreads()
const
142 int Options::getKi()
const
147 int Options::getKd()
const
152 int Options::getKn()
const
157 int Options::getIntersections()
const
162 int Options::getPlaneIterations()
const
167 string Options::getInputFileName()
const
169 return (
m_variables[
"inputFile"].as< vector<string> >())[0];
172 string Options::getOutputFileName()
const
174 return getOutputFileNames()[0];
177 vector<string> Options::getOutputFileNames()
const
179 return m_variables[
"outputFile"].as< vector<string> >();
182 string Options::getPCM()
const
187 string Options::getClassifier()
const
192 string Options::getDecomposition()
const
194 return (
m_variables[
"decomposition"].as< string >());
197 string Options::getScanPoseFile()
const
202 float Options::getEdgeCollapseReductionRatio()
const
204 return (
m_variables[
"reductionRatio"].as<float>());
207 int Options::getDanglingArtifacts()
const
212 int Options::getFillHoles()
const
217 int Options::getMinPlaneSize()
const
222 bool Options::printUsage()
const
232 cout <<
"Error: You must specify an input file." << endl;
240 bool Options::saveFaceNormals()
const
245 bool Options::writeClassificationResult()
const
247 return m_variables.count(
"writeClassificationResult")
251 bool Options::doTextureAnalysis()
const
256 bool Options::filenameSet()
const
258 return (
m_variables[
"inputFile"].as< vector<string> >()).size() > 0;
261 bool Options::recalcNormals()
const
266 bool Options::savePointNormals()
const
271 bool Options::saveNormals()
const
276 bool Options::saveGrid()
const
281 bool Options::useRansac()
const
286 bool Options::saveOriginalData()
const
291 bool Options::optimizePlanes()
const
297 bool Options::clusterPlanes()
const
302 bool Options::extrude()
const
314 bool Options::colorRegions()
const
319 bool Options::retesselate()
const
324 bool Options::generateTextures()
const
329 float Options::getNormalThreshold()
const
334 int Options::getSmallRegionThreshold()
const
336 return m_variables[
"smallRegionThreshold"].as<
int>();
339 int Options::getCleanContourIterations()
const
344 float Options::getTexelSize()
const
349 float Options::getLineFusionThreshold()
const
354 string Options::getTexturePack()
const
359 unsigned int Options::getNumStatsColors()
const
364 unsigned int Options::getNumCCVColors()
const
369 unsigned int Options::getCoherenceThreshold()
const
374 float Options::getColorThreshold()
const
379 float Options::getStatsThreshold()
const
384 float Options::getFeatureThreshold()
const
389 bool Options::getUseCrossCorr()
const
394 float Options::getPatternThreshold()
const
399 int Options::getMinimumTransformationVotes()
const
404 float* Options::getStatsCoeffs()
const
406 float* result =
new float[14];
407 std::ifstream in (
m_variables[
"tp"].as<string>().c_str());
410 for(
int i = 0; i < 14; i++)
418 for(
int i = 0; i < 14; i++)
426 int Options::getTexMinClusterSize()
const
431 int Options::getTexMaxClusterSize()
const
436 bool Options::vertexColorsFromPointcloud()
const
441 bool Options::useGPU()
const
446 vector<float> Options::getFlippoint()
const
451 dest = (
m_variables[
"flipPoint"].as< vector<float> >());
455 dest.push_back(10000000);
456 dest.push_back(10000000);
457 dest.push_back(10000000);
460 dest.push_back(10000000);
461 dest.push_back(10000000);
462 dest.push_back(10000000);
467 bool Options::texturesFromImages()
const
472 string Options::getProjectDir()
const