diff --git a/SDK/CPP/public/samples/fusion_evaluator/main.cpp b/SDK/CPP/public/samples/fusion_evaluator/main.cpp index edb621b1faebf97527dc904eea25769f87b02cd6..85abd616a41613eb1f77073e8692a918e02641c5 100644 --- a/SDK/CPP/public/samples/fusion_evaluator/main.cpp +++ b/SDK/CPP/public/samples/fusion_evaluator/main.cpp @@ -16,8 +16,11 @@ int main(int argc, char **argv) { bool do_fusion = true; bool do_eval = true; + bool do_carving = false; + bool show_changes = false; int frameno = 0; int sourceno = 0; + int iters = 2; voltu::Channel display_channel = voltu::Channel::kColour; std::list<std::string> paths; @@ -39,11 +42,20 @@ int main(int argc, char **argv) { display_channel = voltu::Channel::kDepth; } + else if (s.second == "\"corrections\"") + { + display_channel = voltu::Channel::kColour; + show_changes = true; + } } else if (s.first == "--no-eval") { do_eval = false; } + else if (s.first == "--carving") + { + do_carving = true; + } else if (s.first == "--frame") { frameno = std::stoi(s.second); @@ -52,6 +64,10 @@ int main(int argc, char **argv) { sourceno = std::stoi(s.second); } + else if (s.first == "--iterations") + { + iters = std::stoi(s.second); + } else if (s.first[0] != '-') { paths.push_back(s.first); @@ -62,11 +78,7 @@ int main(int argc, char **argv) for (const auto &p : paths) { - if (!vtu->open(p)) - { - cout << "Could not open source" << endl; - return -1; - } + vtu->open(p); } while (vtu->listRooms().size() == 0) @@ -76,11 +88,6 @@ int main(int argc, char **argv) } auto room = vtu->getRoom(vtu->listRooms().front()); - if (!room) - { - cout << "Could not get room" << endl; - return -1; - } for (int i=0; i<frameno; ++i) { @@ -95,16 +102,13 @@ int main(int argc, char **argv) op1->property("enabled")->setBool(do_fusion); op2->property("enabled")->setBool(do_eval); - op2->property("show_colour")->setBool(false); - op1->property("show_changes")->setBool(true); - op1->property("visibility_carving")->setBool(false); + op2->property("show_colour")->setBool(!show_changes); + op1->property("show_changes")->setBool(show_changes); + op1->property("visibility_carving")->setBool(do_carving); + op1->property("mls_iterations")->setInt(iters); pipe->submit(frame); - if (!pipe->waitCompletion(3000)) - { - cout << "Pipeline timeout" << endl; - return -1; - } + pipe->waitCompletion(3000); auto imgset = frame->getImageSet(display_channel);