45 std::cerr <<
"ERROR: Delaunay meshing requires CGAL, which is not "
46 "available on your system."
50 std::string input_path;
51 std::string input_type =
"dense";
52 std::string output_path;
56 "input_path", &input_path,
57 "Path to either the dense workspace folder or the sparse reconstruction");
61 options.
Parse(argc, argv);
64 if (input_type ==
"sparse") {
67 }
else if (input_type ==
"dense") {
71 std::cout <<
"WARNING: Invalid input type - "
72 "supported values are 'sparse' and 'dense'."
83 std::cerr <<
"ERROR: Dense stereo reconstruction requires CUDA, which is not "
84 "available on your system."
88 std::string workspace_path;
89 std::string workspace_format =
"COLMAP";
90 std::string pmvs_option_name =
"option-all";
91 std::string config_path;
95 "workspace_path", &workspace_path,
96 "Path to the folder containing the undistorted images");
102 options.
Parse(argc, argv);
105 if (workspace_format !=
"colmap" && workspace_format !=
"pmvs") {
106 std::cout <<
"WARNING: Invalid `workspace_format` - supported values are "
107 "'COLMAP' or 'PMVS'."
113 workspace_path, workspace_format,
114 pmvs_option_name, config_path);
124 std::string input_path;
125 std::string output_path;
131 options.
Parse(argc, argv);
139 std::string workspace_path;
140 std::string input_type =
"geometric";
141 std::string workspace_format =
"COLMAP";
142 std::string pmvs_option_name =
"option-all";
143 std::string output_type =
"PLY";
144 std::string output_path;
145 std::string bbox_path;
153 "{photometric, geometric}");
158 options.
Parse(argc, argv);
161 if (workspace_format !=
"colmap" && workspace_format !=
"pmvs") {
162 std::cout <<
"WARNING: Invalid `workspace_format` - supported values are "
163 "'COLMAP' or 'PMVS'."
169 if (input_type !=
"photometric" && input_type !=
"geometric") {
170 std::cout <<
"WARNING: Invalid input type - supported values are "
171 "'photometric' and 'geometric'."
176 if (!bbox_path.empty()) {
177 std::ifstream file(bbox_path);
178 if (file.is_open()) {
180 auto& max_bound = options.
stereo_fusion->bounding_box.second;
181 file >> min_bound(0) >> min_bound(1) >> min_bound(2);
182 file >> max_bound(0) >> max_bound(1) >> max_bound(2);
184 std::cout <<
"WARN: Invalid bounds path: \"" << bbox_path
185 <<
"\" - continuing without bounds check" <<
std::endl;
190 workspace_format, pmvs_option_name, input_type);
198 if (workspace_format ==
"colmap") {
205 std::cout <<
"Writing output: " << output_path <<
std::endl;
209 if (output_type ==
"bin") {
211 }
else if (output_type ==
"txt") {
213 }
else if (output_type ==
"ply") {
218 std::cerr <<
"ERROR: Invalid `output_type`" <<
std::endl;
void AddStereoFusionOptions()
void AddRequiredOption(const std::string &name, T *option, const std::string &help_text="")
std::shared_ptr< mvs::PoissonMeshingOptions > poisson_meshing
std::shared_ptr< mvs::DelaunayMeshingOptions > delaunay_meshing
std::shared_ptr< mvs::PatchMatchOptions > patch_match_stereo
void AddDefaultOption(const std::string &name, T *option, const std::string &help_text="")
std::shared_ptr< mvs::StereoFusionOptions > stereo_fusion
void AddPoissonMeshingOptions()
void AddDelaunayMeshingOptions()
void AddPatchMatchStereoOptions()
void Parse(const int argc, char **argv)
void WriteBinary(const std::string &path) const
void WriteText(const std::string &path) const
void ImportPLY(const std::string &path)
void Read(const std::string &path)
const std::vector< std::vector< int > > & GetFusedPointsVisibility() const
const std::vector< PlyPoint > & GetFusedPoints() const
QTextStream & endl(QTextStream &stream)
void WritePointsVisibility(const std::string &path, const std::vector< std::vector< int >> &points_visibility)
bool PoissonMeshing(const PoissonMeshingOptions &options, const std::string &input_path, const std::string &output_path)
int RunPoissonMesher(int argc, char **argv)
void StringToLower(std::string *str)
int RunPatchMatchStereo(int argc, char **argv)
int RunStereoFuser(int argc, char **argv)
void WriteBinaryPlyPoints(const std::string &path, const std::vector< PlyPoint > &points, const bool write_normal, const bool write_rgb)
std::string JoinPaths(T const &... paths)
int RunDelaunayMesher(int argc, char **argv)