Skip to content

Commit

Permalink
[software] use new command-line system in aliceVision_triangulate
Browse files Browse the repository at this point in the history
  • Loading branch information
mugulmd authored and mh0g committed Dec 22, 2022
1 parent ffb4764 commit 6d32632
Showing 1 changed file with 5 additions and 40 deletions.
45 changes: 5 additions & 40 deletions src/software/pipeline/main_triangulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ int aliceVision_main(int argc, char** argv)

int randomSeed = std::mt19937::default_seed;

po::options_description allParams(
"Triangulation\n"
"Perform the triangulation from the incremental SfM step\n"
"AliceVision Triangulation");

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
Expand Down Expand Up @@ -142,44 +137,14 @@ int aliceVision_main(int argc, char** argv)
("randomSeed", po::value<int>(&randomSeed)->default_value(randomSeed),
"This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.")
;

po::options_description logParams("Log parameters");
logParams.add_options()
("verboseLevel,v", po::value<std::string>(&verboseLevel)->default_value(verboseLevel),
"verbosity level (fatal, error, warning, info, debug, trace).");

allParams.add(requiredParams).add(optionalParams).add(logParams);

po::variables_map vm;
try
{
po::store(po::parse_command_line(argc, argv, allParams), vm);

if (vm.count("help") || (argc == 1))
{
ALICEVISION_COUT(allParams);
return EXIT_SUCCESS;
}
po::notify(vm);
}
catch (boost::program_options::required_option& e)

CmdLine cmdline("AliceVision Triangulation");
cmdline.add(requiredParams);
cmdline.add(optionalParams);
if (!cmdline.execute(argc, argv))
{
ALICEVISION_CERR("ERROR: " << e.what());
ALICEVISION_COUT("Usage:\n\n" << allParams);
return EXIT_FAILURE;
}
catch (boost::program_options::error& e)
{
ALICEVISION_CERR("ERROR: " << e.what());
ALICEVISION_COUT("Usage:\n\n" << allParams);
return EXIT_FAILURE;
}

ALICEVISION_COUT("Program called with the following parameters:");
ALICEVISION_COUT(vm);

// set verbose level
system::Logger::get()->setLogLevel(verboseLevel);

const double defaultLoRansacLocalizationError = 4.0;
if (!robustEstimation::adjustRobustEstimatorThreshold(sfmParams.localizerEstimator, sfmParams.localizerEstimatorError, defaultLoRansacLocalizationError))
Expand Down

0 comments on commit 6d32632

Please sign in to comment.