From 3edcdc8b79889790420a129660b3908514b16c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 11 Jan 2024 15:39:35 +0100 Subject: [PATCH] [software] Disable clang-format around program options clang-format does not handle the syntax of boost::program_options that we use, which leads to a formatting that is difficult to read when it is applied. It is thus disabled around all the program options for every executable with this commit. --- src/software/convert/main_convertMesh.cpp | 10 +- .../convert/main_convertSfMFormat.cpp | 49 +++-- .../convert/main_importKnownPoses.cpp | 16 +- .../export/main_exportAnimatedCamera.cpp | 2 + src/software/export/main_exportColmap.cpp | 16 +- .../export/main_exportColoredPointCloud.cpp | 17 +- src/software/export/main_exportDistortion.cpp | 19 +- src/software/export/main_exportKeypoints.cpp | 28 +-- src/software/export/main_exportMVE2.cpp | 16 +- .../export/main_exportMVSTexturing.cpp | 14 +- src/software/export/main_exportMatches.cpp | 32 +-- src/software/export/main_exportMatlab.cpp | 14 +- src/software/export/main_exportMeshlab.cpp | 18 +- .../export/main_exportMeshroomMaya.cpp | 14 +- src/software/export/main_exportPMVS.cpp | 32 +-- src/software/export/main_exportTracks.cpp | 40 ++-- src/software/export/main_exportUSD.cpp | 14 +- .../pipeline/main_LdrToHdrCalibration.cpp | 6 +- src/software/pipeline/main_LdrToHdrMerge.cpp | 2 + .../pipeline/main_LdrToHdrSampling.cpp | 3 +- .../pipeline/main_cameraCalibration.cpp | 4 +- src/software/pipeline/main_cameraInit.cpp | 107 +++++----- .../pipeline/main_cameraLocalization.cpp | 186 ++++++++--------- .../pipeline/main_checkerboardCalibration.cpp | 14 +- .../pipeline/main_checkerboardDetection.cpp | 22 +- .../main_computeStructureFromKnownPoses.cpp | 43 ++-- .../pipeline/main_depthMapEstimation.cpp | 131 ++++++------ .../pipeline/main_depthMapFiltering.cpp | 30 +-- .../pipeline/main_distortionCalibration.cpp | 10 +- .../pipeline/main_featureExtraction.cpp | 8 +- .../pipeline/main_featureMatching.cpp | 133 ++++++------ src/software/pipeline/main_globalSfM.cpp | 64 +++--- src/software/pipeline/main_imageMasking.cpp | 42 ++-- src/software/pipeline/main_imageMatching.cpp | 90 ++++---- .../pipeline/main_imageSegmentation.cpp | 11 +- src/software/pipeline/main_incrementalSfM.cpp | 197 +++++++++--------- .../pipeline/main_lightingCalibration.cpp | 2 + src/software/pipeline/main_meshDecimate.cpp | 17 +- src/software/pipeline/main_meshDenoising.cpp | 24 ++- src/software/pipeline/main_meshFiltering.cpp | 25 ++- src/software/pipeline/main_meshMasking.cpp | 26 +-- src/software/pipeline/main_meshResampling.cpp | 19 +- src/software/pipeline/main_meshing.cpp | 94 +++++---- src/software/pipeline/main_nodalSfM.cpp | 20 +- .../pipeline/main_normalIntegration.cpp | 2 + .../pipeline/main_panoramaCompositing.cpp | 38 ++-- .../pipeline/main_panoramaEstimation.cpp | 87 ++++---- src/software/pipeline/main_panoramaInit.cpp | 57 ++--- .../pipeline/main_panoramaMerging.cpp | 19 +- .../pipeline/main_panoramaPostProcessing.cpp | 38 ++-- .../pipeline/main_panoramaPrepareImages.cpp | 2 + src/software/pipeline/main_panoramaSeams.cpp | 20 +- .../pipeline/main_panoramaWarping.cpp | 37 ++-- .../pipeline/main_photometricStereo.cpp | 2 + .../pipeline/main_prepareDenseScene.cpp | 6 +- .../pipeline/main_relativePoseEstimating.cpp | 33 +-- src/software/pipeline/main_rigCalibration.cpp | 147 +++++++------ .../pipeline/main_rigLocalization.cpp | 151 +++++++------- .../pipeline/main_sfmBootstraping.cpp | 20 +- .../pipeline/main_sfmTriangulation.cpp | 47 +++-- .../pipeline/main_sphereDetection.cpp | 2 + src/software/pipeline/main_texturing.cpp | 78 +++---- src/software/pipeline/main_tracksBuilding.cpp | 38 +++- src/software/utils/main_applyCalibration.cpp | 8 +- .../utils/main_colorCheckerCorrection.cpp | 20 +- .../utils/main_colorCheckerDetection.cpp | 5 +- .../utils/main_computeUncertainty.cpp | 28 +-- src/software/utils/main_frustumFiltering.cpp | 28 +-- .../utils/main_generateSampleScene.cpp | 7 +- src/software/utils/main_imageProcessing.cpp | 115 +++++----- src/software/utils/main_importMiddlebury.cpp | 16 +- src/software/utils/main_keyframeSelection.cpp | 98 ++++----- .../utils/main_lightingEstimation.cpp | 50 ++--- src/software/utils/main_mergeMeshes.cpp | 26 +-- src/software/utils/main_qualityEvaluation.cpp | 20 +- src/software/utils/main_rigTransform.cpp | 24 ++- src/software/utils/main_sfmAlignment.cpp | 65 +++--- src/software/utils/main_sfmColorHarmonize.cpp | 42 ++-- src/software/utils/main_sfmDistances.cpp | 52 +++-- src/software/utils/main_sfmMerge.cpp | 11 +- src/software/utils/main_sfmRegression.cpp | 2 - .../utils/main_sfmSplitReconstructed.cpp | 15 +- src/software/utils/main_sfmToRig.cpp | 8 +- src/software/utils/main_sfmTransfer.cpp | 29 +-- src/software/utils/main_sfmTransform.cpp | 90 ++++---- src/software/utils/main_split360Images.cpp | 28 +-- src/software/utils/main_voctreeCreation.cpp | 38 ++-- .../utils/main_voctreeQueryUtility.cpp | 2 + src/software/utils/main_voctreeStatistics.cpp | 42 ++-- 89 files changed, 1813 insertions(+), 1561 deletions(-) diff --git a/src/software/convert/main_convertMesh.cpp b/src/software/convert/main_convertMesh.cpp index 7110638e6e..ed726b563a 100644 --- a/src/software/convert/main_convertMesh.cpp +++ b/src/software/convert/main_convertMesh.cpp @@ -42,12 +42,14 @@ int aliceVision_main(int argc, char** argv) std::string inputMeshPath; std::string outputFilePath; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("inputMesh", po::value(&inputMeshPath)->default_value(inputMeshPath), - "Mesh file path (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).") - ("output,o", po::value(&outputFilePath)->default_value(outputFilePath), - "Output file path for the new mesh file (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl)"); + ("inputMesh", po::value(&inputMeshPath)->default_value(inputMeshPath), + "Mesh file path (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).") + ("output,o", po::value(&outputFilePath)->default_value(outputFilePath), + "Output file path for the new mesh file (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl)."); + // clang-format on CmdLine cmdline("The program allows to convert a mesh to another mesh format.\n" "AliceVision convertMesh"); diff --git a/src/software/convert/main_convertSfMFormat.cpp b/src/software/convert/main_convertSfMFormat.cpp index acdd5c2fcf..02aef19de2 100644 --- a/src/software/convert/main_convertSfMFormat.cpp +++ b/src/software/convert/main_convertSfMFormat.cpp @@ -50,29 +50,32 @@ int aliceVision_main(int argc, char **argv) bool flagStructure = true; bool flagObservations = true; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputSfMDataFilename)->required(), - "Path to the output Alembic file."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()) - ("imageWhiteList", po::value>(&imageWhiteList)->multitoken()->default_value(imageWhiteList), - "image white list containing uid(s), image filenames or regex(es) on the image file path (supported regex: '#' matches a single digit, '@' one or more digits, '?' one character and '*' zero or more)") - ("views", po::value(&flagViews)->default_value(flagViews), - "Export views.") - ("intrinsics", po::value(&flagIntrinsics)->default_value(flagIntrinsics), - "Export intrinsics.") - ("extrinsics", po::value(&flagExtrinsics)->default_value(flagExtrinsics), - "Export extrinsics.") - ("structure", po::value(&flagStructure)->default_value(flagStructure), - "Export structure.") - ("observations", po::value(&flagObservations)->default_value(flagObservations), - "Export observations."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputSfMDataFilename)->required(), + "Path to the output Alembic file."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()) + ("imageWhiteList", po::value>(&imageWhiteList)->multitoken()->default_value(imageWhiteList), + "Image white list containing uid(s), image filenames or regex(es) on the image file path (supported regex: '#'" + " matches a single digit, '@' one or more digits, '?' one character and '*' zero or more).") + ("views", po::value(&flagViews)->default_value(flagViews), + "Export views.") + ("intrinsics", po::value(&flagIntrinsics)->default_value(flagIntrinsics), + "Export intrinsics.") + ("extrinsics", po::value(&flagExtrinsics)->default_value(flagExtrinsics), + "Export extrinsics.") + ("structure", po::value(&flagStructure)->default_value(flagStructure), + "Export structure.") + ("observations", po::value(&flagObservations)->default_value(flagObservations), + "Export observations."); + // clang-format on CmdLine cmdline("AliceVision convertSfMFormat"); cmdline.add(requiredParams); diff --git a/src/software/convert/main_importKnownPoses.cpp b/src/software/convert/main_importKnownPoses.cpp index 642afbf8b4..5e80b8a2d6 100644 --- a/src/software/convert/main_importKnownPoses.cpp +++ b/src/software/convert/main_importKnownPoses.cpp @@ -137,12 +137,16 @@ int aliceVision_main(int argc, char **argv) sfmData::SfMData sfmData; - // enter the parameter - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("knownPosesData", po::value(&knownPosesFilePath)->required(), "Input path to a json file or a folder containing an XMP file per image.") - ("sfmData", po::value(&sfmDataFilePath)->required(), "SfmData filepath.") - ("output,o", po::value(&outputFilename)->required(), "Output sfmData filepath."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("knownPosesData", po::value(&knownPosesFilePath)->required(), + "Input path to a json file or a folder containing an XMP file per image.") + ("sfmData", po::value(&sfmDataFilePath)->required(), + "SfmData filepath.") + ("output,o", po::value(&outputFilename)->required(), + "Output sfmData filepath."); + // clang-format on CmdLine cmdline("AliceVision importKnownPoses"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportAnimatedCamera.cpp b/src/software/export/main_exportAnimatedCamera.cpp index a107655efb..08d3e9998a 100644 --- a/src/software/export/main_exportAnimatedCamera.cpp +++ b/src/software/export/main_exportAnimatedCamera.cpp @@ -111,6 +111,7 @@ int aliceVision_main(int argc, char** argv) std::string outImageFileTypeName = image::EImageFileType_enumToString(image::EImageFileType::JPEG); std::string outMapFileTypeName = image::EImageFileType_enumToString(image::EImageFileType::EXR); + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), @@ -135,6 +136,7 @@ int aliceVision_main(int argc, char** argv) "Filter out cameras from the export if they are part of this SfMData. Export all cameras if empty.") ("undistortedImageType", po::value(&outImageFileTypeName)->default_value(outImageFileTypeName), image::EImageFileType_informations().c_str()); + // clang-format on CmdLine cmdline("AliceVision exportAnimatedCamera"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportColmap.cpp b/src/software/export/main_exportColmap.cpp index 46ff61215a..dd07ebeaa9 100644 --- a/src/software/export/main_exportColmap.cpp +++ b/src/software/export/main_exportColmap.cpp @@ -34,18 +34,20 @@ int aliceVision_main(int argc, char* argv[]) std::string outDirectory; bool copyImages{false}; - + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), "SfMData file.") + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") ("output,o", po::value(&outDirectory)->required(), - "The base path where the folder structure will be created with the relevant cameras.txt, images.txt " - "and points3D.txt files.") + "The base path where the folder structure will be created with the relevant cameras.txt, images.txt " + "and points3D.txt files.") ("copyImages", po::value(©Images)->default_value(copyImages), - "Copy original images to colmap folder. This is required if your images are not all in the same " - "folder."); + "Copy original images to Colmap folder. This is required if your images are not all in the same " + "folder."); + // clang-format on - CmdLine cmdline("Export an AV sfmdata to a Colmap scene, creating the folder structure and " + CmdLine cmdline("Export an AV SfMData to a Colmap scene, creating the folder structure and " "the scene files that can be used for running a MVS step.\n" "AliceVision exportColmap"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportColoredPointCloud.cpp b/src/software/export/main_exportColoredPointCloud.cpp index 6649d39b38..c4a0b83c98 100644 --- a/src/software/export/main_exportColoredPointCloud.cpp +++ b/src/software/export/main_exportColoredPointCloud.cpp @@ -36,15 +36,14 @@ int aliceVision_main(int argc, char **argv) std::string sfmDataFilename; std::string outputSfMDataFilename; - po::options_description allParams("AliceVision exportColoredPointCloud"); - - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputSfMDataFilename)->required(), - "Output point cloud with visibilities as SfMData file."); - + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputSfMDataFilename)->required(), + "Output point cloud with visibilities as SfMData file."); + // clang-format on CmdLine cmdline("AliceVision exportColoredPointCloud"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportDistortion.cpp b/src/software/export/main_exportDistortion.cpp index 3a1903dc71..7e93101d35 100644 --- a/src/software/export/main_exportDistortion.cpp +++ b/src/software/export/main_exportDistortion.cpp @@ -120,22 +120,25 @@ int aliceVision_main(int argc, char* argv[]) bool exportSTMaps = true; // Command line parameters + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmInputDataFilepath)->required(), - "SfMData file input.") + "SfMData file input.") ("output,o", po::value(&outputFilePath)->required(), - "Output directory."); + "Output directory."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("exportNukeNode", po::value(&exportNukeNode)->default_value(exportLensGridsUndistorted), "Export Nuke node as FILE.nk") - ("exportSTMaps", po::value(&exportSTMaps)->default_value(exportLensGridsUndistorted), "Export STMaps") - ("exportLensGridsUndistorted,e", po::value(&exportLensGridsUndistorted)->default_value(exportLensGridsUndistorted), "Export lens grids undistorted for validation") - ; + ("exportNukeNode", po::value(&exportNukeNode)->default_value(exportLensGridsUndistorted), + "Export Nuke node as FILE.nk.") + ("exportSTMaps", po::value(&exportSTMaps)->default_value(exportLensGridsUndistorted), + "Export STMaps.") + ("exportLensGridsUndistorted,e", po::value(&exportLensGridsUndistorted)->default_value(exportLensGridsUndistorted), + "Export lens grids undistorted for validation."); + // clang-format on - - CmdLine cmdline("AliceVision export distortion"); + CmdLine cmdline("AliceVision exportDistortion"); cmdline.add(requiredParams); cmdline.add(optionalParams); diff --git a/src/software/export/main_exportKeypoints.cpp b/src/software/export/main_exportKeypoints.cpp index 1705f07cab..e351e98ad9 100644 --- a/src/software/export/main_exportKeypoints.cpp +++ b/src/software/export/main_exportKeypoints.cpp @@ -53,19 +53,21 @@ int aliceVision_main(int argc, char ** argv) std::string describerTypesName = feature::EImageDescriberType_enumToString(feature::EImageDescriberType::SIFT); - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFolder)->required(), - "Output path for keypoints.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFolder)->required(), + "Output path for keypoints.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()); + // clang-format on CmdLine cmdline("AliceVision exportKeypoints"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportMVE2.cpp b/src/software/export/main_exportMVE2.cpp index 153e161cf3..b4d82fc2d3 100644 --- a/src/software/export/main_exportMVE2.cpp +++ b/src/software/export/main_exportMVE2.cpp @@ -253,13 +253,15 @@ int aliceVision_main(int argc, char *argv[]) po::options_description allParams("AliceVision exportMVE2"); - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outDirectory)->required(), - "Output folder.\n" - "Note: this program writes output in MVE file format"); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outDirectory)->required(), + "Output folder.\n" + "Note: this program writes output in MVE file format."); + // clang-format on CmdLine cmdline("AliceVision exportMVE2"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportMVSTexturing.cpp b/src/software/export/main_exportMVSTexturing.cpp index 718951a1c6..eb867abf8b 100644 --- a/src/software/export/main_exportMVSTexturing.cpp +++ b/src/software/export/main_exportMVSTexturing.cpp @@ -34,12 +34,14 @@ int aliceVision_main(int argc, char **argv) std::string sfmDataFilename; std::string outDirectory; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outDirectory)->required(), - "Output folder."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outDirectory)->required(), + "Output folder."); + // clang-format on CmdLine cmdline("AliceVision exportMVSTexturing"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportMatches.cpp b/src/software/export/main_exportMatches.cpp index 276b34eb4d..6e37de1159 100644 --- a/src/software/export/main_exportMatches.cpp +++ b/src/software/export/main_exportMatches.cpp @@ -84,21 +84,23 @@ int aliceVision_main(int argc, char ** argv) std::string describerTypesName = EImageDescriberType_enumToString(EImageDescriberType::SIFT); - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFolder)->required(), - "Output path for matches.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features.") - ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), - "Path to folder(s) in which computed matches are stored."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - EImageDescriberType_informations().c_str()); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFolder)->required(), + "Output path for matches.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features.") + ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), + "Path to folder(s) in which computed matches are stored."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + EImageDescriberType_informations().c_str()); + // clang-format on CmdLine cmdline("AliceVision exportMatches"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportMatlab.cpp b/src/software/export/main_exportMatlab.cpp index 0782594671..d8c8da8481 100644 --- a/src/software/export/main_exportMatlab.cpp +++ b/src/software/export/main_exportMatlab.cpp @@ -144,12 +144,14 @@ int aliceVision_main(int argc, char *argv[]) std::string sfmDataFilename; std::string outputFolder; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFolder)->required(), - "Output folder."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFolder)->required(), + "Output folder."); + // clang-format on CmdLine cmdline("AliceVision exportMatlab"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportMeshlab.cpp b/src/software/export/main_exportMeshlab.cpp index 5a4f12f47b..18d80392f9 100644 --- a/src/software/export/main_exportMeshlab.cpp +++ b/src/software/export/main_exportMeshlab.cpp @@ -37,14 +37,16 @@ int aliceVision_main(int argc, char **argv) std::string plyPath; std::string outDirectory; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("ply", po::value(&plyPath)->required(), - "Ply.") - ("output,o", po::value(&outDirectory)->required(), - "Output folder."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("ply", po::value(&plyPath)->required(), + "PLY path.") + ("output,o", po::value(&outDirectory)->required(), + "Output folder."); + // clang-format on CmdLine cmdline("AliceVision exportMeshlab"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportMeshroomMaya.cpp b/src/software/export/main_exportMeshroomMaya.cpp index 2d2fb38a8f..1235a6b6ae 100644 --- a/src/software/export/main_exportMeshroomMaya.cpp +++ b/src/software/export/main_exportMeshroomMaya.cpp @@ -34,12 +34,14 @@ int aliceVision_main(int argc, char **argv) std::string sfmDataFilename; std::string outputFolder; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFolder)->required(), - "Output folder."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFolder)->required(), + "Output folder."); + // clang-format on CmdLine cmdline("AliceVision exportMeshroomMaya"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportPMVS.cpp b/src/software/export/main_exportPMVS.cpp index 1940680bb5..cf27af3c0c 100644 --- a/src/software/export/main_exportPMVS.cpp +++ b/src/software/export/main_exportPMVS.cpp @@ -335,21 +335,23 @@ int aliceVision_main(int argc, char *argv[]) int nbCore = 8; bool useVisData = true; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFolder)->required(), - "Output path for keypoints."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("resolution", po::value(&resolution)->default_value(resolution), - "Divide image coefficient") - ("nbCore", po::value(&nbCore)->default_value(nbCore), - "Nb core") - ("useVisData", po::value(&useVisData)->default_value(useVisData), - "Use visibility information."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFolder)->required(), + "Output path for keypoints."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("resolution", po::value(&resolution)->default_value(resolution), + "Divide image coefficient.") + ("nbCore", po::value(&nbCore)->default_value(nbCore), + "Number of cores.") + ("useVisData", po::value(&useVisData)->default_value(useVisData), + "Use visibility information."); + // clang-format on CmdLine cmdline("AliceVision exportPMVS"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportTracks.cpp b/src/software/export/main_exportTracks.cpp index 9eaf9451dc..033a84c4fb 100644 --- a/src/software/export/main_exportTracks.cpp +++ b/src/software/export/main_exportTracks.cpp @@ -57,25 +57,27 @@ int aliceVision_main(int argc, char ** argv) // user optional parameters std::string describerTypesName = feature::EImageDescriberType_enumToString(feature::EImageDescriberType::SIFT); - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFolder)->required(), - "Output path for tracks.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features.") - ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), - "Path to folder(s) in which computed matches are stored."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("clearForks", po::value(&clearForks), - "Filter tracks forks.") - ("minTrackLength", po::value(&minTrackLength), - "Minimum track length.") - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFolder)->required(), + "Output path for tracks.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features.") + ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), + "Path to folder(s) in which computed matches are stored."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("clearForks", po::value(&clearForks), + "Filter tracks forks.") + ("minTrackLength", po::value(&minTrackLength), + "Minimum track length.") + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()); + // clang-format on CmdLine cmdline("AliceVision exportTracks"); cmdline.add(requiredParams); diff --git a/src/software/export/main_exportUSD.cpp b/src/software/export/main_exportUSD.cpp index 6f5b93e0ac..9601e7fbb4 100644 --- a/src/software/export/main_exportUSD.cpp +++ b/src/software/export/main_exportUSD.cpp @@ -34,7 +34,7 @@ using namespace aliceVision; -namespace bpo = boost::program_options; +namespace po = boost::program_options; namespace fs = std::filesystem; PXR_NAMESPACE_USING_DIRECTIVE @@ -119,12 +119,16 @@ int aliceVision_main(int argc, char **argv) std::string outputFolderPath; EUSDFileType fileType = EUSDFileType::USDA; - bpo::options_description requiredParams("Required parameters"); + // clang-format off + po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input", bpo::value(&inputMeshPath), "Input textured mesh to export.") - ("output", bpo::value(&outputFolderPath), "Output folder for USD file and textures.") - ("fileType", bpo::value(&fileType)->default_value(fileType), + ("input", po::value(&inputMeshPath), + "Input textured mesh to export.") + ("output", po::value(&outputFolderPath), + "Output folder for USD file and textures.") + ("fileType", po::value(&fileType)->default_value(fileType), EUSDFileType_informations().c_str()); + // clang-format on CmdLine cmdline("The program converts a textured mesh to USD.\nAliceVision exportUSD"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_LdrToHdrCalibration.cpp b/src/software/pipeline/main_LdrToHdrCalibration.cpp index a014bcf720..2973e4fd36 100644 --- a/src/software/pipeline/main_LdrToHdrCalibration.cpp +++ b/src/software/pipeline/main_LdrToHdrCalibration.cpp @@ -151,7 +151,7 @@ int aliceVision_main(int argc, char** argv) bool byPass = false; // Command line parameters - + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmInputDataFilename)->required(), @@ -180,8 +180,8 @@ int aliceVision_main(int argc, char** argv) ("Working color space: " + image::EImageColorSpace_informations()).c_str()) ("maxTotalPoints", po::value(&maxTotalPoints)->default_value(maxTotalPoints), "Maximum number of points used from the sampling. This ensures that the number of pixels values extracted by " - "the sampling can be managed by the calibration step (in terms of computation time and memory usage).") - ; + "the sampling can be managed by the calibration step (in terms of computation time and memory usage)."); + // clang-format on CmdLine cmdline("This program recovers the Camera Response Function (CRF) from samples extracted from LDR images with multi-bracketing.\n" "AliceVision LdrToHdrCalibration"); diff --git a/src/software/pipeline/main_LdrToHdrMerge.cpp b/src/software/pipeline/main_LdrToHdrMerge.cpp index cb8ff382f0..8b4ec16fcf 100644 --- a/src/software/pipeline/main_LdrToHdrMerge.cpp +++ b/src/software/pipeline/main_LdrToHdrMerge.cpp @@ -99,6 +99,7 @@ int aliceVision_main(int argc, char** argv) int rangeSize = 1; // Command line parameters + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmInputDataFilename)->required(), @@ -146,6 +147,7 @@ int aliceVision_main(int argc, char** argv) "Range image index start.") ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), "Range size."); + // clang-format on CmdLine cmdline("This program merges LDR images into HDR images.\n" "AliceVision LdrToHdrMerge"); diff --git a/src/software/pipeline/main_LdrToHdrSampling.cpp b/src/software/pipeline/main_LdrToHdrSampling.cpp index 6ccc72468c..5b0f2ef9ca 100644 --- a/src/software/pipeline/main_LdrToHdrSampling.cpp +++ b/src/software/pipeline/main_LdrToHdrSampling.cpp @@ -65,7 +65,7 @@ int aliceVision_main(int argc, char** argv) int rangeSize = 1; // Command line parameters - + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmInputDataFilename)->required(), @@ -99,6 +99,7 @@ int aliceVision_main(int argc, char** argv) "Range image index start.") ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), "Range size."); + // clang-format on CmdLine cmdline("This program extracts stable samples from multiple LDR images with different bracketing.\n" "AliceVision LdrToHdrSampling"); diff --git a/src/software/pipeline/main_cameraCalibration.cpp b/src/software/pipeline/main_cameraCalibration.cpp index 2938370a8a..5054dcdd2f 100644 --- a/src/software/pipeline/main_cameraCalibration.cpp +++ b/src/software/pipeline/main_cameraCalibration.cpp @@ -64,6 +64,7 @@ int aliceVision_main(int argc, char** argv) double squareSize = 1.0; double maxTotalAvgErr = 0.1; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&inputPath)->required(), @@ -97,11 +98,12 @@ int aliceVision_main(int argc, char** argv) ("minInputFrames", po::value(&minInputFrames)->default_value(minInputFrames), "Minimum number of frames to limit the refinement loop.") ("maxTotalAvgErr,e", po::value(&maxTotalAvgErr)->default_value(maxTotalAvgErr), - "Max Total Average Error.") + "Maximum total average error.") ("debugRejectedImgFolder", po::value(&debugRejectedImgFolder)->default_value(""), "Folder to export images that were deleted during the refinement loop.") ("debugSelectedImgFolder,d", po::value(&debugSelectedImgFolder)->default_value(""), "Folder to export debug images."); + // clang-format on aliceVision::CmdLine cmdline("This program is used to calibrate a camera from a dataset of images.\n" "AliceVision cameraCalibration"); diff --git a/src/software/pipeline/main_cameraInit.cpp b/src/software/pipeline/main_cameraInit.cpp index 3877dcf4b9..15bc6f2b91 100644 --- a/src/software/pipeline/main_cameraInit.cpp +++ b/src/software/pipeline/main_cameraInit.cpp @@ -190,59 +190,60 @@ int aliceVision_main(int argc, char **argv) image::ERawColorInterpretation rawColorInterpretation = image::ERawColorInterpretation::LibRawWhiteBalancing; bool lensCorrectionProfileSearchIgnoreCameraModel = true; - - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmFilePath)->default_value(sfmFilePath), - "A SfMData file (*.sfm) [if specified, --imageFolder cannot be used].") - ("imageFolder", po::value(&imageFolder)->default_value(imageFolder), - "Input images folder [if specified, --input cannot be used].") - ("output,o", po::value(&outputFilePath)->default_value("cameraInit.sfm"), - "Output file path for the new SfMData file"); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("sensorDatabase,s", po::value(&sensorDatabasePath)->default_value(""), - "Camera sensor width database path.") - ("colorProfileDatabase,c", po::value(&colorProfileDatabaseDirPath)->default_value(""), - "DNG Color Profiles (DCP) database path.") - ("lensCorrectionProfileInfo", po::value(&lensCorrectionProfileInfo)->default_value(""), - "Lens Correction Profile filepath or database directory path.") - ("lensCorrectionProfileSearchIgnoreCameraModel", po::value(&lensCorrectionProfileSearchIgnoreCameraModel)->default_value(lensCorrectionProfileSearchIgnoreCameraModel), - "Automatic LCP Search considers only the camera maker and the lens name") - ("defaultFocalLength", po::value(&defaultFocalLength)->default_value(defaultFocalLength), - "Focal length in mm. (or '-1' to unset)") - ("defaultFieldOfView", po::value(&defaultFieldOfView)->default_value(defaultFieldOfView), - "Empirical value for the field of view in degree. (or '-1' to unset)") - ("defaultFocalRatio", po::value(&defaultFocalRatio)->default_value(defaultFocalRatio), - "Ratio between the pixel X size on the sensor and the Y size.") - ("defaultOffsetX", po::value(&defaultOffsetX)->default_value(defaultOffsetX), - "default offset from the principal point X coordinate") - ("defaultOffsetY", po::value(&defaultOffsetY)->default_value(defaultOffsetY), - "default offset from the principal point Y coordinate") - ("defaultCameraModel", po::value(&defaultCameraModelName)->default_value(defaultCameraModelName), - "Default camera model type (pinhole, radial1, radial3, brown, fisheye4, fisheye1).") - ("allowedCameraModels", po::value(&allowedCameraModelsStr)->default_value(allowedCameraModelsStr), - "Permitted model type (pinhole, radial1, radial3, brown, fisheye4, fisheye1).") - ("groupCameraFallback", po::value(&groupCameraFallback)->default_value(groupCameraFallback), - std::string("When there is no serial number in the image metadata, we cannot know if the images come from the same camera. " - "This is problematic for grouping images sharing the same internal camera settings and we have to decide on a fallback strategy:\n" - " * " + EGroupCameraFallback_enumToString(EGroupCameraFallback::GLOBAL) + ": all images may come from a single device (make/model/focal will still be a differentiator).\n" - " * " + EGroupCameraFallback_enumToString(EGroupCameraFallback::FOLDER) + ": different folders will be considered as different devices\n" - " * " + EGroupCameraFallback_enumToString(EGroupCameraFallback::IMAGE) + ": consider that each image has different internal camera parameters").c_str()) - ("viewIdMethod", po::value(&viewIdMethod)->default_value(viewIdMethod), - std::string("Allows to choose the way the viewID is generated:\n" - " * " + EViewIdMethod_enumToString(EViewIdMethod::METADATA) + ": Generate viewId from image metadata.\n" - " * " + EViewIdMethod_enumToString(EViewIdMethod::FILENAME) + ": Generate viewId from file names using regex.") .c_str()) - ("viewIdRegex", po::value(&viewIdRegex)->default_value(viewIdRegex), - "Regex used to catch number used as viewId in filename.") - ("rawColorInterpretation", po::value(&rawColorInterpretation)->default_value(rawColorInterpretation), - ("RAW color interpretation: " + image::ERawColorInterpretation_informations()).c_str()) - ("errorOnMissingColorProfile", po::value(&errorOnMissingColorProfile)->default_value(errorOnMissingColorProfile), - "Rise an error if a DCP color profiles database is specified but no DCP file matches with the camera model (maker+name) extracted from metadata (Only for raw images)") - ("allowSingleView", po::value(&allowSingleView)->default_value(allowSingleView), - "Allow the program to process a single view.\n" - "Warning: if a single view is process, the output file can't be use in many other programs."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmFilePath)->default_value(sfmFilePath), + "A SfMData file (*.sfm) [if specified, --imageFolder cannot be used].") + ("imageFolder", po::value(&imageFolder)->default_value(imageFolder), + "Input images folder [if specified, --input cannot be used].") + ("output,o", po::value(&outputFilePath)->default_value("cameraInit.sfm"), + "Output file path for the new SfMData file."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("sensorDatabase,s", po::value(&sensorDatabasePath)->default_value(""), + "Camera sensor width database path.") + ("colorProfileDatabase,c", po::value(&colorProfileDatabaseDirPath)->default_value(""), + "DNG Color Profiles (DCP) database path.") + ("lensCorrectionProfileInfo", po::value(&lensCorrectionProfileInfo)->default_value(""), + "Lens Correction Profile filepath or database directory path.") + ("lensCorrectionProfileSearchIgnoreCameraModel", po::value(&lensCorrectionProfileSearchIgnoreCameraModel)->default_value(lensCorrectionProfileSearchIgnoreCameraModel), + "Automatic LCP Search considers only the camera maker and the lens name.") + ("defaultFocalLength", po::value(&defaultFocalLength)->default_value(defaultFocalLength), + "Focal length in mm (or '-1' to unset).") + ("defaultFieldOfView", po::value(&defaultFieldOfView)->default_value(defaultFieldOfView), + "Empirical value for the field of view in degrees (or '-1' to unset).") + ("defaultFocalRatio", po::value(&defaultFocalRatio)->default_value(defaultFocalRatio), + "Ratio between the pixel X size on the sensor and the Y size.") + ("defaultOffsetX", po::value(&defaultOffsetX)->default_value(defaultOffsetX), + "Default offset from the principal point X coordinate.") + ("defaultOffsetY", po::value(&defaultOffsetY)->default_value(defaultOffsetY), + "Default offset from the principal point Y coordinate.") + ("defaultCameraModel", po::value(&defaultCameraModelName)->default_value(defaultCameraModelName), + "Default camera model type (pinhole, radial1, radial3, brown, fisheye4, fisheye1).") + ("allowedCameraModels", po::value(&allowedCameraModelsStr)->default_value(allowedCameraModelsStr), + "Permitted model type (pinhole, radial1, radial3, brown, fisheye4, fisheye1).") + ("groupCameraFallback", po::value(&groupCameraFallback)->default_value(groupCameraFallback), + std::string("When there is no serial number in the image metadata, we cannot know if the images come from the same camera. " + "This is problematic for grouping images sharing the same internal camera settings and we have to decide on a fallback strategy:\n" + " * " + EGroupCameraFallback_enumToString(EGroupCameraFallback::GLOBAL) + ": all images may come from a single device (make/model/focal will still be a differentiator).\n" + " * " + EGroupCameraFallback_enumToString(EGroupCameraFallback::FOLDER) + ": different folders will be considered as different devices.\n" + " * " + EGroupCameraFallback_enumToString(EGroupCameraFallback::IMAGE) + ": consider that each image has different internal camera parameters.").c_str()) + ("viewIdMethod", po::value(&viewIdMethod)->default_value(viewIdMethod), + std::string("Allows to choose the way the viewID is generated:\n" + " * " + EViewIdMethod_enumToString(EViewIdMethod::METADATA) + ": Generate viewId from image metadata.\n" + " * " + EViewIdMethod_enumToString(EViewIdMethod::FILENAME) + ": Generate viewId from file names using regex.") .c_str()) + ("viewIdRegex", po::value(&viewIdRegex)->default_value(viewIdRegex), + "Regex used to catch number used as viewId in filename.") + ("rawColorInterpretation", po::value(&rawColorInterpretation)->default_value(rawColorInterpretation), + ("RAW color interpretation: " + image::ERawColorInterpretation_informations()).c_str()) + ("errorOnMissingColorProfile", po::value(&errorOnMissingColorProfile)->default_value(errorOnMissingColorProfile), + "Rise an error if a DCP color profiles database is specified but no DCP file matches with the camera model (maker+name) extracted from metadata (only for raw images).") + ("allowSingleView", po::value(&allowSingleView)->default_value(allowSingleView), + "Allow the program to process a single view.\n" + "Warning: if a single view is process, the output file can't be use in many other programs."); + // clang-format on CmdLine cmdline("AliceVision cameraInit"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_cameraLocalization.cpp b/src/software/pipeline/main_cameraLocalization.cpp index b804105985..d333a59872 100644 --- a/src/software/pipeline/main_cameraLocalization.cpp +++ b/src/software/pipeline/main_cameraLocalization.cpp @@ -127,108 +127,100 @@ int aliceVision_main(int argc, char** argv) std::string visualDebug = ""; int randomSeed = std::mt19937::default_seed; - - po::options_description inputParams("Required input parameters"); - - inputParams.add_options() - ("sfmdata", po::value(&sfmFilePath)->required(), - "The sfm_data.json kind of file generated by AliceVision.") - ("mediafile", po::value(&mediaFilepath)->required(), - "The folder path or the filename for the media to track"); + // clang-format off + po::options_description inputParams("Required input parameters"); + inputParams.add_options() + ("sfmdata", po::value(&sfmFilePath)->required(), + "The sfm_data.json kind of file generated by AliceVision.") + ("mediafile", po::value(&mediaFilepath)->required(), + "The folder path or the filename for the media to track."); - po::options_description commonParams( - "Common optional parameters for the localizer"); - commonParams.add_options() - ("descriptorPath", po::value(&descriptorsFolder), - "Folder containing the descriptors for all the images (ie the *.desc.)") - ("matchDescTypes", po::value(&matchDescTypeNames)->default_value(matchDescTypeNames), - "The describer types to use for the matching") - ("preset", po::value(&featDescPreset.descPreset)->default_value(featDescPreset.descPreset), - "Preset for the feature extractor when localizing a new image " - "{LOW,MEDIUM,NORMAL,HIGH,ULTRA}") - ("resectionEstimator", po::value(&resectionEstimator)->default_value(resectionEstimator), - std::string("The type of *sac framework to use for resection " - "("+str_estimatorChoices+")").c_str()) - ("matchingEstimator", po::value(&matchingEstimator)->default_value(matchingEstimator), - std::string("The type of *sac framework to use for matching " - "("+str_estimatorChoices+")").c_str()) - ("calibration", po::value(&calibFile)/*->required( )*/, - "Calibration file") - ("refineIntrinsics", po::value(&refineIntrinsics), - "Enable/Disable camera intrinsics refinement for each localized image") - ("reprojectionError", po::value(&resectionErrorMax)->default_value(resectionErrorMax), - "Maximum reprojection error (in pixels) allowed for resectioning. If set " - "to 0 it lets the ACRansac select an optimal value.") - ("randomSeed", po::value(&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 commonParams("Common optional parameters for the localizer"); + commonParams.add_options() + ("descriptorPath", po::value(&descriptorsFolder), + "Folder containing the descriptors for all the images (ie the *.desc.).") + ("matchDescTypes", po::value(&matchDescTypeNames)->default_value(matchDescTypeNames), + "The describer types to use for the matching.") + ("preset", po::value(&featDescPreset.descPreset)->default_value(featDescPreset.descPreset), + "Preset for the feature extractor when localizing a new image ({LOW,MEDIUM,NORMAL,HIGH,ULTRA}).") + ("resectionEstimator", po::value(&resectionEstimator)->default_value(resectionEstimator), + std::string("The type of *sac framework to use for resection (" +str_estimatorChoices + ").").c_str()) + ("matchingEstimator", po::value(&matchingEstimator)->default_value(matchingEstimator), + std::string("The type of *sac framework to use for matching (" + str_estimatorChoices + ").").c_str()) + ("calibration", po::value(&calibFile)/*->required( )*/, + "Calibration file.") + ("refineIntrinsics", po::value(&refineIntrinsics), + "Enable/Disable camera intrinsics refinement for each localized image.") + ("reprojectionError", po::value(&resectionErrorMax)->default_value(resectionErrorMax), + "Maximum reprojection error (in pixels) allowed for resectioning. If set " + "to 0 it lets the ACRansac select an optimal value.") + ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); -// voctree specific options - po::options_description voctreeParams("Parameters specific for the vocabulary tree-based localizer"); - voctreeParams.add_options() - ("nbImageMatch", po::value(&numResults)->default_value(numResults), - "[voctree] Number of images to retrieve in database") - ("maxResults", po::value(&maxResults)->default_value(maxResults), - "[voctree] For algorithm AllResults, it stops the image matching when " - "this number of matched images is reached. If 0 it is ignored.") - ("commonviews", po::value(&numCommonViews)->default_value(numCommonViews), - "[voctree] Number of minimum images in which a point must be seen to " - "be used in cluster tracking") - ("voctree", po::value(&vocTreeFilepath), - "[voctree] Filename for the vocabulary tree") - ("voctreeWeights", po::value(&weightsFilepath), - "[voctree] Filename for the vocabulary tree weights") - ("algorithm", po::value(&algostring)->default_value(algostring), - "[voctree] Algorithm type: FirstBest, AllResults" ) - ("matchingError", po::value(&matchingErrorMax)->default_value(matchingErrorMax), - "[voctree] Maximum matching error (in pixels) allowed for image matching with " - "geometric verification. If set to 0 it lets the ACRansac select " - "an optimal value.") - ("nbFrameBufferMatching", po::value(&nbFrameBufferMatching)->default_value(nbFrameBufferMatching), - "[voctree] Number of previous frame of the sequence to use for matching " - "(0 = Disable)") - ("robustMatching", po::value(&robustMatching)->default_value(robustMatching), - "[voctree] Enable/Disable the robust matching between query and database images, " - "all putative matches will be considered.") -// cctag specific options -#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) - ("nNearestKeyFrames", po::value(&nNearestKeyFrames)->default_value(nNearestKeyFrames), - "[cctag] Number of images to retrieve in the database") -#endif - ; + // voctree specific options + po::options_description voctreeParams("Parameters specific for the vocabulary tree-based localizer"); + voctreeParams.add_options() + ("nbImageMatch", po::value(&numResults)->default_value(numResults), + "[voctree] Number of images to retrieve in database.") + ("maxResults", po::value(&maxResults)->default_value(maxResults), + "[voctree] For algorithm AllResults, it stops the image matching when " + "this number of matched images is reached. If 0 it is ignored.") + ("commonviews", po::value(&numCommonViews)->default_value(numCommonViews), + "[voctree] Number of minimum images in which a point must be seen to " + "be used in cluster tracking.") + ("voctree", po::value(&vocTreeFilepath), + "[voctree] Filename for the vocabulary tree.") + ("voctreeWeights", po::value(&weightsFilepath), + "[voctree] Filename for the vocabulary tree weights.") + ("algorithm", po::value(&algostring)->default_value(algostring), + "[voctree] Algorithm type: FirstBest, AllResults.") + ("matchingError", po::value(&matchingErrorMax)->default_value(matchingErrorMax), + "[voctree] Maximum matching error (in pixels) allowed for image matching with " + "geometric verification. If set to 0 it lets the ACRansac select an optimal value.") + ("nbFrameBufferMatching", po::value(&nbFrameBufferMatching)->default_value(nbFrameBufferMatching), + "[voctree] Number of previous frame of the sequence to use for matching (0 = Disable).") + ("robustMatching", po::value(&robustMatching)->default_value(robustMatching), + "[voctree] Enable/Disable the robust matching between query and database images, " + "all putative matches will be considered.") + // cctag specific options + #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) + ("nNearestKeyFrames", po::value(&nNearestKeyFrames)->default_value(nNearestKeyFrames), + "[cctag] Number of images to retrieve in the database.") + #endif + ; -// final bundle adjustment options - po::options_description bundleParams("Parameters specific for final (optional) bundle adjustment optimization of the sequence"); - bundleParams.add_options() - ("globalBundle", po::value(&globalBundle), - "[bundle adjustment] If --refineIntrinsics is not set, this option " - "allows to run a final global budndle adjustment to refine the scene") - ("noDistortion", po::value(&noDistortion), - "[bundle adjustment] It does not take into account distortion during " - "the BA, it consider the distortion coefficients all equal to 0") - ("noBArefineIntrinsics", po::value(&noBArefineIntrinsics), - "[bundle adjustment] It does not refine intrinsics during BA") - ("minPointVisibility", po::value(&minPointVisibility)->default_value(minPointVisibility), - "[bundle adjustment] Minimum number of observation that a point must " - "have in order to be considered for bundle adjustment"); + // final bundle adjustment options + po::options_description bundleParams("Parameters specific for final (optional) bundle adjustment optimization of the sequence"); + bundleParams.add_options() + ("globalBundle", po::value(&globalBundle), + "[bundle adjustment] If --refineIntrinsics is not set, this option " + "allows to run a final global budndle adjustment to refine the scene.") + ("noDistortion", po::value(&noDistortion), + "[bundle adjustment] It does not take into account distortion during " + "the BA, it consider the distortion coefficients all equal to 0.") + ("noBArefineIntrinsics", po::value(&noBArefineIntrinsics), + "[bundle adjustment] It does not refine intrinsics during BA.") + ("minPointVisibility", po::value(&minPointVisibility)->default_value(minPointVisibility), + "[bundle adjustment] Minimum number of observation that a point must " + "have in order to be considered for bundle adjustment."); -// output options - po::options_description outputParams("Options for the output of the localizer"); - outputParams.add_options() - ("help,h", "Print this message") - ("visualDebug", po::value(&visualDebug), - "If a folder is provided it enables visual debug and saves all the " - "debugging info in that folder") - -#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_ALEMBIC) - ("outputAlembic", po::value(&exportAlembicFile)->default_value(exportAlembicFile), - "Filename for the SfMData export file (where camera poses will be stored). " - "Default : trackedcameras.abc.") -#endif - ("outputJSON", po::value(&exportJsonFile)->default_value(exportJsonFile), - "Filename for the localization results (raw data) as .json") + // output options + po::options_description outputParams("Options for the output of the localizer"); + outputParams.add_options() + ("help,h", + "Print this message.") + ("visualDebug", po::value(&visualDebug), + "If a folder is provided it enables visual debug and saves all the " + "debugging info in that folder.") - ; + #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_ALEMBIC) + ("outputAlembic", po::value(&exportAlembicFile)->default_value(exportAlembicFile), + "Filename for the SfMData export file (where camera poses will be stored). " + "Default: trackedcameras.abc.") + #endif + ("outputJSON", po::value(&exportJsonFile)->default_value(exportJsonFile), + "Filename for the localization results (raw data) as .json."); + // clang-format on CmdLine cmdline("This program takes as input a media (image, image sequence, video) and a database (vocabulary tree, 3D scene data) \n" diff --git a/src/software/pipeline/main_checkerboardCalibration.cpp b/src/software/pipeline/main_checkerboardCalibration.cpp index 468eb2e74e..8ac30baf64 100644 --- a/src/software/pipeline/main_checkerboardCalibration.cpp +++ b/src/software/pipeline/main_checkerboardCalibration.cpp @@ -454,15 +454,21 @@ int aliceVision_main(int argc, char* argv[]) double squareSize = 10.; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmInputDataFilepath)->required(), "SfMData file input.") - ("checkerboards,c", po::value(&checkerBoardsPath)->required(), "Checkerboards json files directory.") - ("output,o", po::value(&sfmOutputDataFilepath)->required(), "SfMData file output."); + ("input,i", po::value(&sfmInputDataFilepath)->required(), + "SfMData file input.") + ("checkerboards,c", po::value(&checkerBoardsPath)->required(), + "Checkerboards json files directory.") + ("output,o", po::value(&sfmOutputDataFilepath)->required(), + "SfMData file output."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("squareSize,s", po::value(&squareSize)->default_value(squareSize), "Checkerboard square width in mm"); + ("squareSize,s", po::value(&squareSize)->default_value(squareSize), + "Checkerboard square width in mm."); + // clang-format on CmdLine cmdline("This program calibrates camera intrinsics and extrinsics.\n" "AliceVision checkerboardCalibration"); diff --git a/src/software/pipeline/main_checkerboardDetection.cpp b/src/software/pipeline/main_checkerboardDetection.cpp index 21495e51e6..d8f4cc2fd6 100644 --- a/src/software/pipeline/main_checkerboardDetection.cpp +++ b/src/software/pipeline/main_checkerboardDetection.cpp @@ -39,28 +39,30 @@ int aliceVision_main(int argc, char* argv[]) bool useNestedGrids = false; // Command line parameters + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmInputDataFilepath)->required(), - "SfMData file input.") - ("output,o", po::value(&outputFilePath)->required(), - "calibration boards json output directory."); + ("input,i", po::value(&sfmInputDataFilepath)->required(), + "SfMData file input.") + ("output,o", po::value(&outputFilePath)->required(), + "Calibration boards JSON output directory."); // Description of optional parameters po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), - "Range start for processing views (ordered by image filepath). Set to -1 to process all images.") + "Range start for processing views (ordered by image filepath). Set to -1 to process all images.") ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), - "Range size for processing views (ordered by image filepath).") + "Range size for processing views (ordered by image filepath).") ("exportDebugImages", po::value(&exportDebugImages)->default_value(exportDebugImages), - "Export Debug Images.") + "Export debug images.") ("doubleSize", po::value(&doubleSize)->default_value(doubleSize), - "Double image size prior to processing.") + "Double image size prior to processing.") ("useNestedGrids", po::value(&useNestedGrids)->default_value(useNestedGrids), - "Images contain nested calibration grids. These grids must be centered on image center."); + "Images contain nested calibration grids. These grids must be centered on image center."); + // clang-format on - CmdLine cmdline("AliceVision checkerboard detection"); + CmdLine cmdline("AliceVision checkerboardDetection"); cmdline.add(requiredParams); cmdline.add(optionalParams); if (!cmdline.execute(argc, argv)) diff --git a/src/software/pipeline/main_computeStructureFromKnownPoses.cpp b/src/software/pipeline/main_computeStructureFromKnownPoses.cpp index 2297262622..f28fe97a5d 100644 --- a/src/software/pipeline/main_computeStructureFromKnownPoses.cpp +++ b/src/software/pipeline/main_computeStructureFromKnownPoses.cpp @@ -44,27 +44,28 @@ int aliceVision_main(int argc, char **argv) std::vector matchesFolders; int randomSeed = std::mt19937::default_seed; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outSfMDataFilename)->required(), - "Output path for the features and descriptors files (*.feat, *.desc).") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()) - ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), - "Path to folder(s) in which computed matches are stored.") - ("geometricErrorMax", po::value(&geometricErrorMax)->default_value(geometricErrorMax), - "Maximum error (in pixels) allowed for features matching during geometric verification for known camera poses. " - "If set to 0 it lets the ACRansac select an optimal value.") - ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), - "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.") - ; + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outSfMDataFilename)->required(), + "Output path for the features and descriptors files (*.feat, *.desc).") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()) + ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), + "Path to folder(s) in which computed matches are stored.") + ("geometricErrorMax", po::value(&geometricErrorMax)->default_value(geometricErrorMax), + "Maximum error (in pixels) allowed for features matching during geometric verification for known camera poses. " + "If set to 0 it lets the ACRansac select an optimal value.") + ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); + // clang-format on CmdLine cmdline("AliceVision computeStructureFromKnownPoses"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_depthMapEstimation.cpp b/src/software/pipeline/main_depthMapEstimation.cpp index 58f2956c41..14a02afbbf 100644 --- a/src/software/pipeline/main_depthMapEstimation.cpp +++ b/src/software/pipeline/main_depthMapEstimation.cpp @@ -90,132 +90,135 @@ int aliceVision_main(int argc, char* argv[]) // number of GPUs to use (0 means use all GPUs) int nbGPUs = 0; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") + "SfMData file.") ("imagesFolder", po::value(&imagesFolder)->required(), - "Images folder. Filename should be the image uid.") + "Images folder. Filename should be the image uid.") ("output,o", po::value(&outputFolder)->required(), - "Output folder for generated depth maps."); + "Output folder for generated depth maps."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), - "Compute a sub-range of images from index rangeStart to rangeStart+rangeSize.") + "Compute a sub-range of images from index rangeStart to rangeStart+rangeSize.") ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), - "Compute a sub-range of N images (N=rangeSize).") + "Compute a sub-range of N images (N=rangeSize).") ("downscale", po::value(&downscale)->default_value(downscale), - "Downscale the input images to compute the depth map. " - "Full resolution (downscale=1) gives the best result, " - "but using a larger downscale will reduce computation time at the expense of quality. " - "If the images are noisy, blurry or if the surfaces are challenging (weakly-textured or with specularities) a larger downscale may improve.") + "Downscale the input images to compute the depth map. " + "Full resolution (downscale=1) gives the best result, " + "but using a larger downscale will reduce computation time at the expense of quality. " + "If the images are noisy, blurry or if the surfaces are challenging (weakly-textured or with specularities), " + "a larger downscale may improve.") ("minViewAngle", po::value(&minViewAngle)->default_value(minViewAngle), - "Minimum angle between two views (select the neighbouring cameras, select depth planes from epipolar segment point).") + "Minimum angle between two views (select the neighbouring cameras, select depth planes from epipolar segment point).") ("maxViewAngle", po::value(&maxViewAngle)->default_value(maxViewAngle), - "Maximum angle between two views (select the neighbouring cameras, select depth planes from epipolar segment point).") + "Maximum angle between two views (select the neighbouring cameras, select depth planes from epipolar segment point).") ("tileBufferWidth", po::value(&tileParams.bufferWidth)->default_value(tileParams.bufferWidth), - "Maximum tile buffer width.") + "Maximum tile buffer width.") ("tileBufferHeight", po::value(&tileParams.bufferHeight)->default_value(tileParams.bufferHeight), - "Maximum tile buffer height.") + "Maximum tile buffer height.") ("tilePadding", po::value(&tileParams.padding)->default_value(tileParams.padding), - "Buffer padding for overlapping tiles.") + "Buffer padding for overlapping tiles.") ("chooseTCamsPerTile", po::value(&depthMapParams.chooseTCamsPerTile)->default_value(depthMapParams.chooseTCamsPerTile), - "Choose neighbour cameras per tile or globally to the image.") + "Choose neighbour cameras per tile or globally to the image.") ("maxTCams", po::value(&depthMapParams.maxTCams)->default_value(depthMapParams.maxTCams), - "Maximum number of neighbour cameras per image.") + "Maximum number of neighbour cameras per image.") ("sgmScale", po::value(&sgmParams.scale)->default_value(sgmParams.scale), - "Semi Global Matching: Downscale factor applied on source images for the SGM step (in addition to the global downscale).") + "Semi Global Matching: Downscale factor applied on source images for the SGM step (in addition to the global downscale).") ("sgmStepXY", po::value(&sgmParams.stepXY)->default_value(sgmParams.stepXY), - "Semi Global Matching: Step is used to compute the similarity volume for one pixel over N (in the XY image plane).") + "Semi Global Matching: Step is used to compute the similarity volume for one pixel over N (in the XY image plane).") ("sgmStepZ", po::value(&sgmParams.stepZ)->default_value(sgmParams.stepZ), - "Semi Global Matching: Initial step used to compute the similarity volume on Z axis (every N pixels on the epilolar line). " - "-1 means automatic estimation. " - "This value will be adjusted in all case to fit in the max memory (sgmMaxDepths).") + "Semi Global Matching: Initial step used to compute the similarity volume on Z axis (every N pixels on the epilolar line). " + "-1 means automatic estimation. " + "This value will be adjusted in all case to fit in the max memory (sgmMaxDepths).") ("sgmMaxTCamsPerTile", po::value(&sgmParams.maxTCamsPerTile)->default_value(sgmParams.maxTCamsPerTile), - "Semi Global Matching: Maximum number of neighbour cameras used per tile.") + "Semi Global Matching: Maximum number of neighbour cameras used per tile.") ("sgmWSH", po::value(&sgmParams.wsh)->default_value(sgmParams.wsh), - "Semi Global Matching: Half-size of the patch used to compute the similarity. Patch width is wsh*2+1.") + "Semi Global Matching: Half-size of the patch used to compute the similarity. Patch width is wsh*2+1.") ("sgmUseSfmSeeds", po::value(&sgmParams.useSfmSeeds)->default_value(sgmParams.useSfmSeeds), - "Semi Global Matching: Use landmarks from Structure-from-Motion as input seeds to define min/max depth ranges.") + "Semi Global Matching: Use landmarks from Structure-from-Motion as input seeds to define min/max depth ranges.") ("sgmSeedsRangeInflate", po::value(&sgmParams.seedsRangeInflate)->default_value(sgmParams.seedsRangeInflate), - "Semi Global Matching: Inflate factor to add margins around SfM seeds.") + "Semi Global Matching: Inflate factor to add margins around SfM seeds.") ("sgmDepthThicknessInflate", po::value(&sgmParams.depthThicknessInflate)->default_value(sgmParams.depthThicknessInflate), - "Semi Global Matching: Inflate factor to add margins to the depth thickness.") + "Semi Global Matching: Inflate factor to add margins to the depth thickness.") ("sgmMaxSimilarity", po::value(&sgmParams.maxSimilarity)->default_value(sgmParams.maxSimilarity), - "Semi Global Matching: Maximum similarity threshold (between 0 and 1) used to filter out poorly supported depth values.") + "Semi Global Matching: Maximum similarity threshold (between 0 and 1) used to filter out poorly supported depth values.") ("sgmGammaC", po::value(&sgmParams.gammaC)->default_value(sgmParams.gammaC), - "Semi Global Matching: GammaC threshold used for similarity computation, strength of grouping by color similarity.") + "Semi Global Matching: GammaC threshold used for similarity computation, strength of grouping by color similarity.") ("sgmGammaP", po::value(&sgmParams.gammaP)->default_value(sgmParams.gammaP), - "Semi Global Matching: GammaP threshold used for similarity computation, strength of grouping by proximity.") + "Semi Global Matching: GammaP threshold used for similarity computation, strength of grouping by proximity.") ("sgmP1", po::value(&sgmParams.p1)->default_value(sgmParams.p1), - "Semi Global Matching: P1 parameter for SGM filtering.") + "Semi Global Matching: P1 parameter for SGM filtering.") ("sgmP2Weighting", po::value(&sgmParams.p2Weighting)->default_value(sgmParams.p2Weighting), - "Semi Global Matching: P2 weighting parameter for SGM filtering.") + "Semi Global Matching: P2 weighting parameter for SGM filtering.") ("sgmMaxDepths", po::value(&sgmParams.maxDepths)->default_value(sgmParams.maxDepths), - "Semi Global Matching: Maximum number of depths in the similarity volume.") + "Semi Global Matching: Maximum number of depths in the similarity volume.") ("sgmFilteringAxes", po::value(&sgmParams.filteringAxes)->default_value(sgmParams.filteringAxes), - "Semi Global Matching: Define axes for the filtering of the similarity volume.") + "Semi Global Matching: Define axes for the filtering of the similarity volume.") ("sgmDepthListPerTile", po::value(&sgmParams.depthListPerTile)->default_value(sgmParams.depthListPerTile), - "Semi Global Matching: Select the list of depth planes per tile or globally to the image.") + "Semi Global Matching: Select the list of depth planes per tile or globally to the image.") ("sgmUseConsistentScale", po::value(&sgmParams.useConsistentScale)->default_value(sgmParams.useConsistentScale), - "Semi Global Matching: Compare patch with consistent scale for similarity volume computation.") + "Semi Global Matching: Compare patch with consistent scale for similarity volume computation.") ("sgmUseCustomPatchPattern", po::value(&sgmParams.useCustomPatchPattern)->default_value(sgmParams.useCustomPatchPattern), - "Semi Global Matching: Use user custom patch pattern for similarity volume computation.") + "Semi Global Matching: Use user custom patch pattern for similarity volume computation.") ("refineScale", po::value(&refineParams.scale)->default_value(refineParams.scale), - "Refine: Downscale factor applied on source images for the Refine step (in addition to the global downscale).") + "Refine: Downscale factor applied on source images for the Refine step (in addition to the global downscale).") ("refineStepXY", po::value(&refineParams.stepXY)->default_value(refineParams.stepXY), - "Refine: Step is used to compute the refine volume for one pixel over N (in the XY image plane).") + "Refine: Step is used to compute the refine volume for one pixel over N (in the XY image plane).") ("refineMaxTCamsPerTile", po::value(&refineParams.maxTCamsPerTile)->default_value(refineParams.maxTCamsPerTile), - "Refine: Maximum number of neighbour cameras used per tile.") + "Refine: Maximum number of neighbour cameras used per tile.") ("refineHalfNbDepths", po::value(&refineParams.halfNbDepths)->default_value(refineParams.halfNbDepths), - "Refine: The thickness of the refine area around the initial depth map. " - "This parameter defines the number of depths in front of and behind the initial value " - "for which we evaluate the similarity with a finer z sampling.") + "Refine: The thickness of the refine area around the initial depth map. " + "This parameter defines the number of depths in front of and behind the initial value " + "for which we evaluate the similarity with a finer z sampling.") ("refineSubsampling", po::value(&refineParams.nbSubsamples)->default_value(refineParams.nbSubsamples), - "Refine: Number of subsamples used to extract the best depth from the refine volume (sliding gaussian window precision).") + "Refine: Number of subsamples used to extract the best depth from the refine volume (sliding gaussian window precision).") ("refineWSH", po::value(&refineParams.wsh)->default_value(refineParams.wsh), - "Refine: Half-size of the patch used to compute the similarity. Patch width is wsh*2+1.") + "Refine: Half-size of the patch used to compute the similarity. Patch width is wsh*2+1.") ("refineSigma", po::value(&refineParams.sigma)->default_value(refineParams.sigma), - "Refine: Sigma (2*sigma^2) of the gaussian filter used to extract the best depth from the refine volume.") + "Refine: Sigma (2*sigma^2) of the gaussian filter used to extract the best depth from the refine volume.") ("refineGammaC", po::value(&refineParams.gammaC)->default_value(refineParams.gammaC), - "Refine: GammaC threshold used for similarity computation.") + "Refine: GammaC threshold used for similarity computation.") ("refineGammaP", po::value(&refineParams.gammaP)->default_value(refineParams.gammaP), - "Refine: GammaP threshold used for similarity computation.") + "Refine: GammaP threshold used for similarity computation.") ("refineInterpolateMiddleDepth", po::value(&refineParams.interpolateMiddleDepth)->default_value(refineParams.interpolateMiddleDepth), - "Refine: Enable/Disable middle depth bilinear interpolation for the refinement process.") + "Refine: Enable/Disable middle depth bilinear interpolation for the refinement process.") ("refineUseConsistentScale", po::value(&refineParams.useConsistentScale)->default_value(refineParams.useConsistentScale), - "Refine: Compare patch with consistent scale for similarity volume computation.") + "Refine: Compare patch with consistent scale for similarity volume computation.") ("refineUseCustomPatchPattern", po::value(&refineParams.useCustomPatchPattern)->default_value(refineParams.useCustomPatchPattern), - "Refine: Use user custom patch pattern for similarity volume computation.") + "Refine: Use user custom patch pattern for similarity volume computation.") ("colorOptimizationNbIterations", po::value(&refineParams.optimizationNbIterations)->default_value(refineParams.optimizationNbIterations), - "Color Optimization: Number of iterations of the optimization.") + "Color Optimization: Number of iterations of the optimization.") ("refineEnabled", po::value(&refineParams.useRefineFuse)->default_value(refineParams.useRefineFuse), - "Enable/Disable depth/similarity map refinement process.") + "Enable/Disable depth/similarity map refinement process.") ("colorOptimizationEnabled", po::value(&refineParams.useColorOptimization)->default_value(refineParams.useColorOptimization), - "Enable/Disable depth/similarity map post-process color optimization.") + "Enable/Disable depth/similarity map post-process color optimization.") ("autoAdjustSmallImage", po::value(&depthMapParams.autoAdjustSmallImage)->default_value(depthMapParams.autoAdjustSmallImage), - "Automatically adjust depth map parameters if images are smaller than one tile (maxTCamsPerTile=maxTCams, adjust step if needed).") + "Automatically adjust depth map parameters if images are smaller than one tile (maxTCamsPerTile=maxTCams, adjust step if needed).") ("customPatchPatternSubparts", po::value>(&depthMapParams.customPatchPattern.subpartsParams)->multitoken()->default_value(depthMapParams.customPatchPattern.subpartsParams), - "User custom patch pattern subparts for similarity volume computation.") + "User custom patch pattern subparts for similarity volume computation.") ("customPatchPatternGroupSubpartsPerLevel", po::value(&depthMapParams.customPatchPattern.groupSubpartsPerLevel)->default_value(depthMapParams.customPatchPattern.groupSubpartsPerLevel), - "Group all custom patch pattern subparts with the same image level.") + "Group all custom patch pattern subparts with the same image level.") ("exportIntermediateDepthSimMaps", po::value(&exportIntermediateDepthSimMaps)->default_value(exportIntermediateDepthSimMaps), - "Export intermediate depth/similarity maps from the SGM and Refine steps.") + "Export intermediate depth/similarity maps from the SGM and Refine steps.") ("exportIntermediateNormalMaps", po::value(&exportIntermediateNormalMaps)->default_value(exportIntermediateNormalMaps), - "Export intermediate normal maps from the SGM and Refine steps.") + "Export intermediate normal maps from the SGM and Refine steps.") ("exportIntermediateVolumes", po::value(&exportIntermediateVolumes)->default_value(exportIntermediateVolumes), - "Export intermediate full similarity volumes from the SGM and Refine steps.") + "Export intermediate full similarity volumes from the SGM and Refine steps.") ("exportIntermediateCrossVolumes", po::value(&exportIntermediateCrossVolumes)->default_value(exportIntermediateCrossVolumes), - "Export intermediate similarity cross volumes from the SGM and Refine steps.") + "Export intermediate similarity cross volumes from the SGM and Refine steps.") ("exportIntermediateTopographicCutVolumes", po::value(&exportIntermediateTopographicCutVolumes)->default_value(exportIntermediateTopographicCutVolumes), - "Export intermediate similarity topographic cut volumes from the SGM and Refine steps.") + "Export intermediate similarity topographic cut volumes from the SGM and Refine steps.") ("exportIntermediateVolume9pCsv", po::value(&exportIntermediateVolume9pCsv)->default_value(exportIntermediateVolume9pCsv), - "Export intermediate volumes 9 points from the SGM and Refine steps in CSV files.") + "Export intermediate volumes 9 points from the SGM and Refine steps in CSV files.") ("exportTilePattern", po::value(&depthMapParams.exportTilePattern)->default_value(depthMapParams.exportTilePattern), - "Export workflow tile pattern.") + "Export workflow tile pattern.") ("nbGPUs", po::value(&nbGPUs)->default_value(nbGPUs), - "Number of GPUs to use (0 means use all GPUs)."); + "Number of GPUs to use (0 means use all GPUs)."); + // clang-format on CmdLine cmdline("Dense Reconstruction.\n" "This program estimate a depth map for each input calibrated camera using Plane Sweeping, a multi-view stereo algorithm notable for its efficiency on modern graphics hardware (GPU).\n" diff --git a/src/software/pipeline/main_depthMapFiltering.cpp b/src/software/pipeline/main_depthMapFiltering.cpp index 0e55964028..439ee69c56 100644 --- a/src/software/pipeline/main_depthMapFiltering.cpp +++ b/src/software/pipeline/main_depthMapFiltering.cpp @@ -54,39 +54,41 @@ int aliceVision_main(int argc, char* argv[]) int nNearestCams = 10; bool computeNormalMaps = false; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") + "SfMData file.") ("depthMapsFolder", po::value(&depthMapsFolder)->required(), - "Input depth map folder.") + "Input depth map folder.") ("output,o", po::value(&outputFolder)->required(), - "Output folder for filtered depth maps."); + "Output folder for filtered depth maps."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), - "Compute only a sub-range of images from index rangeStart to rangeStart+rangeSize.") + "Compute only a sub-range of images from index rangeStart to rangeStart+rangeSize.") ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), - "Compute only a sub-range of N images (N=rangeSize).") + "Compute only a sub-range of N images (N=rangeSize).") ("minViewAngle", po::value(&minViewAngle)->default_value(minViewAngle), - "minimum angle between two views.") + "Minimum angle between two views.") ("maxViewAngle", po::value(&maxViewAngle)->default_value(maxViewAngle), - "maximum angle between two views.") + "Maximum angle between two views.") ("minNumOfConsistentCams", po::value(&minNumOfConsistentCams)->default_value(minNumOfConsistentCams), - "Minimal number of consistent cameras to consider the pixel.") + "Minimal number of consistent cameras to consider the pixel.") ("minNumOfConsistentCamsWithLowSimilarity", po::value(&minNumOfConsistentCamsWithLowSimilarity)->default_value(minNumOfConsistentCamsWithLowSimilarity), - "Minimal number of consistent cameras to consider the pixel when the similarity is weak or ambiguous.") + "Minimal number of consistent cameras to consider the pixel when the similarity is weak or ambiguous.") ("pixToleranceFactor", po::value(&pixToleranceFactor)->default_value(pixToleranceFactor), - "Filtering tolerance size factor (in px).") + "Filtering tolerance size factor (in px).") ("pixSizeBall", po::value(&pixSizeBall)->default_value(pixSizeBall), - "Filter ball size (in px).") + "Filter ball size (in px).") ("pixSizeBallWithLowSimilarity", po::value(&pixSizeBallWithLowSimilarity)->default_value(pixSizeBallWithLowSimilarity), - "Filter ball size (in px) when the similarity is weak or ambiguous.") + "Filter ball size (in px) when the similarity is weak or ambiguous.") ("nNearestCams", po::value(&nNearestCams)->default_value(nNearestCams), - "Number of nearest cameras.") + "Number of nearest cameras.") ("computeNormalMaps", po::value(&computeNormalMaps)->default_value(computeNormalMaps), - "Compute normal maps per depth map"); + "Compute normal maps per depth map."); + // clang-format on CmdLine cmdline("This program filters depth maps to remove values that are not consistent with other depth maps.\n" "AliceVision depthMapFiltering"); diff --git a/src/software/pipeline/main_distortionCalibration.cpp b/src/software/pipeline/main_distortionCalibration.cpp index 44cf9c235f..5013b3f3f2 100644 --- a/src/software/pipeline/main_distortionCalibration.cpp +++ b/src/software/pipeline/main_distortionCalibration.cpp @@ -145,19 +145,21 @@ int aliceVision_main(int argc, char* argv[]) std::string cameraModelName = "3deanamorphic4"; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmInputDataFilepath)->required(), - "SfMData file input.") + "SfMData file input.") ("checkerboards", po::value(&checkerBoardsPath)->required(), - "Checkerboards json files directory.") + "Checkerboards json files directory.") ("output,o", po::value(&sfmOutputDataFilepath)->required(), - "SfMData file output."); + "SfMData file output."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("cameraModel", po::value(&cameraModelName)->default_value(cameraModelName), - "Camera model used for estimating distortion."); + "Camera model used for estimating distortion."); + // clang-format on CmdLine cmdline("This program calibrates camera distortion.\n" "AliceVision distortionCalibration"); diff --git a/src/software/pipeline/main_featureExtraction.cpp b/src/software/pipeline/main_featureExtraction.cpp index e540a604fe..ecaa328b3e 100644 --- a/src/software/pipeline/main_featureExtraction.cpp +++ b/src/software/pipeline/main_featureExtraction.cpp @@ -60,6 +60,7 @@ int aliceVision_main(int argc, char **argv) std::string maskExtension = "png"; bool maskInvert = false; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), @@ -73,13 +74,13 @@ int aliceVision_main(int argc, char **argv) feature::EImageDescriberType_informations().c_str()) ("describerPreset,p", po::value(&featDescConfig.descPreset)->default_value(featDescConfig.descPreset), "Control the ImageDescriber configuration (low, medium, normal, high, ultra).\n" - "Configuration 'ultra' can take long time !") + "Configuration 'ultra' can take a long time!") ("describerQuality", po::value(&featDescConfig.quality)->default_value(featDescConfig.quality), feature::EFeatureQuality_information().c_str()) ("gridFiltering", po::value(&featDescConfig.gridFiltering)->default_value(featDescConfig.gridFiltering), - "Enable grid filtering. Highly recommended to ensure usable number of features.") + "Enable grid filtering. Highly recommended to ensure a usable number of features.") ("maxNbFeatures", po::value(&featDescConfig.maxNbFeatures)->default_value(featDescConfig.maxNbFeatures), - "Max number of features extracted (0 means default value based on describerPreset).") + "Maximum number of features extracted (0 means default value based on describerPreset).") ("contrastFiltering", po::value(&featDescConfig.contrastFiltering)->default_value(featDescConfig.contrastFiltering), feature::EFeatureConstrastFiltering_information().c_str()) ("relativePeakThreshold", po::value(&featDescConfig.relativePeakThreshold)->default_value(featDescConfig.relativePeakThreshold), @@ -100,6 +101,7 @@ int aliceVision_main(int argc, char **argv) "Range size.") ("maxThreads", po::value(&maxThreads)->default_value(maxThreads), "Specifies the maximum number of threads to run simultaneously (0 for automatic mode)."); + // clang-format on CmdLine cmdline("AliceVision featureExtraction"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_featureMatching.cpp b/src/software/pipeline/main_featureMatching.cpp index 34fb81aa1b..fc9ac8d8a1 100644 --- a/src/software/pipeline/main_featureMatching.cpp +++ b/src/software/pipeline/main_featureMatching.cpp @@ -119,72 +119,73 @@ int aliceVision_main(int argc, char **argv) int randomSeed = std::mt19937::default_seed; double minRequired2DMotion = -1.0; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&matchesFolder)->required(), - "Path to a folder in which computed matches will be stored.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("geometricFilterType,g", po::value(&geometricFilterTypeName)->default_value(geometricFilterTypeName), - matchingImageCollection::EGeometricFilterType_informations().c_str()) - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()) - ("imagePairsList,l", po::value>(&predefinedPairList)->multitoken(), - "Path(s) to one or more files which contain the list of image pairs to match.") - ("photometricMatchingMethod,p", po::value(&nearestMatchingMethod)->default_value(nearestMatchingMethod), - "For Scalar based regions descriptor:\n" - "* BRUTE_FORCE_L2: L2 BruteForce matching\n" - "* ANN_L2: L2 Approximate Nearest Neighbor matching\n" - "* CASCADE_HASHING_L2: L2 Cascade Hashing matching\n" - "* FAST_CASCADE_HASHING_L2: L2 Cascade Hashing with precomputed hashed regions\n" - "(faster than CASCADE_HASHING_L2 but use more memory)\n" - "For Binary based descriptor:\n" - "* BRUTE_FORCE_HAMMING: BruteForce Hamming matching") - ("geometricEstimator", po::value(&geometricEstimator)->default_value(geometricEstimator), - "Geometric estimator:\n" - "* acransac: A-Contrario Ransac\n" - "* loransac: LO-Ransac (only available for fundamental matrix). Need to set '--geometricError'") - ("geometricError", po::value(&geometricErrorMax)->default_value(geometricErrorMax), - "Maximum error (in pixels) allowed for features matching during geometric verification. " - "If set to 0 it lets the ACRansac select an optimal value.") - ("matchFromKnownCameraPoses", po::value(&matchFromKnownCameraPoses)->default_value(matchFromKnownCameraPoses), - "Enable the usage of geometric information from known camera poses to guide the feature matching. " - "If some cameras have unknown poses (so there is no geometric prior), the standard feature matching will be performed.") - ("knownPosesGeometricErrorMax", po::value(&knownPosesGeometricErrorMax)->default_value(knownPosesGeometricErrorMax), - "Maximum error (in pixels) allowed for features matching guided by geometric information from known camera poses. " - "If set to 0 it lets the ACRansac select an optimal value.") - ("savePutativeMatches", po::value(&savePutativeMatches)->default_value(savePutativeMatches), - "Save putative matches.") - ("guidedMatching", po::value(&guidedMatching)->default_value(guidedMatching), - "Use the found model to improve the pairwise correspondences.") - ("crossMatching", po::value(&crossMatching)->default_value(crossMatching), - "Make sure that the matching process is symmetric (same matches for I->J than fo J->I).") - ("matchFilePerImage", po::value(&matchFilePerImage)->default_value(matchFilePerImage), - "Save matches in a separate file per image.") - ("distanceRatio", po::value(&distRatio)->default_value(distRatio), - "Distance ratio to discard non meaningful matches.") - ("maxIteration", po::value(&maxIteration)->default_value(maxIteration), - "Maximum number of iterations allowed in ransac step.") - ("useGridSort", po::value(&useGridSort)->default_value(useGridSort), - "Use matching grid sort.") - ("minRequired2DMotion", po::value(&minRequired2DMotion)->default_value(minRequired2DMotion), - "A match is invalid if the 2d motion between the 2 points is less than a threshold (or -1 to disable this filter).") - ("exportDebugFiles", po::value(&exportDebugFiles)->default_value(exportDebugFiles), - "Export debug files (svg, dot).") - ("maxMatches", po::value(&numMatchesToKeep)->default_value(numMatchesToKeep), - "Maximum number pf matches to keep.") - ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), - "Range image index start.") - ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), - "Range size.") - ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), - "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.") - ; + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&matchesFolder)->required(), + "Path to a folder in which computed matches will be stored.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("geometricFilterType,g", po::value(&geometricFilterTypeName)->default_value(geometricFilterTypeName), + matchingImageCollection::EGeometricFilterType_informations().c_str()) + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()) + ("imagePairsList,l", po::value>(&predefinedPairList)->multitoken(), + "Path(s) to one or more files which contain the list of image pairs to match.") + ("photometricMatchingMethod,p", po::value(&nearestMatchingMethod)->default_value(nearestMatchingMethod), + "For Scalar based regions descriptor:\n" + "* BRUTE_FORCE_L2: L2 BruteForce matching\n" + "* ANN_L2: L2 Approximate Nearest Neighbor matching\n" + "* CASCADE_HASHING_L2: L2 Cascade Hashing matching\n" + "* FAST_CASCADE_HASHING_L2: L2 Cascade Hashing with precomputed hashed regions\n" + "(faster than CASCADE_HASHING_L2 but use more memory)\n" + "For Binary based descriptor:\n" + "* BRUTE_FORCE_HAMMING: BruteForce Hamming matching") + ("geometricEstimator", po::value(&geometricEstimator)->default_value(geometricEstimator), + "Geometric estimator:\n" + "* acransac: A-Contrario Ransac\n" + "* loransac: LO-Ransac (only available for fundamental matrix). Need to set '--geometricError'") + ("geometricError", po::value(&geometricErrorMax)->default_value(geometricErrorMax), + "Maximum error (in pixels) allowed for features matching during geometric verification. " + "If set to 0, it lets the ACRansac select an optimal value.") + ("matchFromKnownCameraPoses", po::value(&matchFromKnownCameraPoses)->default_value(matchFromKnownCameraPoses), + "Enable the usage of geometric information from known camera poses to guide the feature matching. " + "If some cameras have unknown poses (so there is no geometric prior), the standard feature matching will be performed.") + ("knownPosesGeometricErrorMax", po::value(&knownPosesGeometricErrorMax)->default_value(knownPosesGeometricErrorMax), + "Maximum error (in pixels) allowed for features matching guided by geometric information from known camera poses. " + "If set to 0 it lets the ACRansac select an optimal value.") + ("savePutativeMatches", po::value(&savePutativeMatches)->default_value(savePutativeMatches), + "Save putative matches.") + ("guidedMatching", po::value(&guidedMatching)->default_value(guidedMatching), + "Use the found model to improve the pairwise correspondences.") + ("crossMatching", po::value(&crossMatching)->default_value(crossMatching), + "Make sure that the matching process is symmetric (same matches for I->J than fo J->I).") + ("matchFilePerImage", po::value(&matchFilePerImage)->default_value(matchFilePerImage), + "Save matches in a separate file per image.") + ("distanceRatio", po::value(&distRatio)->default_value(distRatio), + "Distance ratio to discard non meaningful matches.") + ("maxIteration", po::value(&maxIteration)->default_value(maxIteration), + "Maximum number of iterations allowed in ransac step.") + ("useGridSort", po::value(&useGridSort)->default_value(useGridSort), + "Use matching grid sort.") + ("minRequired2DMotion", po::value(&minRequired2DMotion)->default_value(minRequired2DMotion), + "A match is invalid if the 2D motion between the 2 points is less than a threshold (or -1 to disable this filter).") + ("exportDebugFiles", po::value(&exportDebugFiles)->default_value(exportDebugFiles), + "Export debug files (svg, dot).") + ("maxMatches", po::value(&numMatchesToKeep)->default_value(numMatchesToKeep), + "Maximum number pf matches to keep.") + ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), + "Range image index start.") + ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), + "Range size.") + ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); + // clang-format on CmdLine cmdline("This program computes corresponding features between a series of views:\n" "- Load view images description (regions: features & descriptors)\n" diff --git a/src/software/pipeline/main_globalSfM.cpp b/src/software/pipeline/main_globalSfM.cpp index 20ffa1acf3..7c5e0b0b2c 100644 --- a/src/software/pipeline/main_globalSfM.cpp +++ b/src/software/pipeline/main_globalSfM.cpp @@ -48,38 +48,38 @@ int aliceVision_main(int argc, char **argv) bool lockAllIntrinsics = false; int randomSeed = std::mt19937::default_seed; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilepath)->required(), - "SfMData file.") - ("output,o", po::value(&outSfMDataFilepath)->required(), - "Path to the output SfMData file.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features.") - ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), - "Path to folder(s) in which computed matches are stored.") - ; - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("outputViewsAndPoses", po::value(&outputSfMViewsAndPoses)->default_value(outputSfMViewsAndPoses), - "Path to the output SfMData file (with only views and poses).") - ("extraInfoFolder", po::value(&extraInfoFolder)->default_value(extraInfoFolder), - "Folder for intermediate reconstruction files and additional reconstruction information files.") - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()) - ("rotationAveraging", po::value(&rotationAveragingMethod)->default_value(rotationAveragingMethod), - "* 1: L1 minimization\n" - "* 2: L2 minimization") - ("translationAveraging", po::value(&translationAveragingMethod)->default_value(translationAveragingMethod), - "* 1: L1 minimization\n" - "* 2: L2 minimization of sum of squared Chordal distances\n" - "* 3: L1 soft minimization") - ("lockAllIntrinsics", po::value(&lockAllIntrinsics)->default_value(lockAllIntrinsics), - "Force lock of all camera intrinsic parameters, so they will not be refined during Bundle Adjustment.") - ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), - "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.") - ; + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilepath)->required(), + "SfMData file.") + ("output,o", po::value(&outSfMDataFilepath)->required(), + "Path to the output SfMData file.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features.") + ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), + "Path to folder(s) in which computed matches are stored."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("outputViewsAndPoses", po::value(&outputSfMViewsAndPoses)->default_value(outputSfMViewsAndPoses), + "Path to the output SfMData file (with only views and poses).") + ("extraInfoFolder", po::value(&extraInfoFolder)->default_value(extraInfoFolder), + "Folder for intermediate reconstruction files and additional reconstruction information files.") + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()) + ("rotationAveraging", po::value(&rotationAveragingMethod)->default_value(rotationAveragingMethod), + "* 1: L1 minimization\n" + "* 2: L2 minimization") + ("translationAveraging", po::value(&translationAveragingMethod)->default_value(translationAveragingMethod), + "* 1: L1 minimization\n" + "* 2: L2 minimization of sum of squared Chordal distances\n" + "* 3: L1 soft minimization") + ("lockAllIntrinsics", po::value(&lockAllIntrinsics)->default_value(lockAllIntrinsics), + "Force lock of all camera intrinsic parameters, so they will not be refined during Bundle Adjustment.") + ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); + // clang-format on CmdLine cmdline("This program is an implementation of the paper\n" "\"Global Fusion of Relative Motions for " diff --git a/src/software/pipeline/main_imageMasking.cpp b/src/software/pipeline/main_imageMasking.cpp index d919fa8242..eaddcbfca4 100644 --- a/src/software/pipeline/main_imageMasking.cpp +++ b/src/software/pipeline/main_imageMasking.cpp @@ -108,52 +108,50 @@ int main(int argc, char **argv) std::string depthMapFolder; std::string depthMapExp; - + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmFilePath)->required(), - "A SfMData file (*.sfm) [if specified, --imageFolder cannot be used].") + "A SfMData file (*.sfm) [if specified, --imageFolder cannot be used].") ("output,o", po::value(&outputFilePath)->required(), - "Output file path for the new SfMData file"); + "Output file path for the new SfMData file."); po::options_description hsvParams("HSV parameters"); hsvParams.add_options() ("algorithm,a", po::value(&algorithm)->default_value(algorithm), - std::string("Masking algorithm:\n" - " * " + EAlgorithm_enumToString(EAlgorithm::HSV) + ": selected range in the Hue Saturation Value color space.\n" - " * " + EAlgorithm_enumToString(EAlgorithm::GrabCut) + ": not implemented" - ).c_str()) + std::string("Masking algorithm:\n" + " * " + EAlgorithm_enumToString(EAlgorithm::HSV) + ": selected range in the Hue Saturation Value color space.\n" + " * " + EAlgorithm_enumToString(EAlgorithm::GrabCut) + ": not implemented.").c_str()) ("hsvHue", po::value(&hsv.hue)->default_value(hsv.hue)->notifier(optInRange(0.f, 1.f, "hsvHue")), - "Hue value to isolate in [0,1] range. 0 = red, 0.33 = green, 0.66 = blue, 1 = red.") + "Hue value to isolate in [0,1] range. 0 = red, 0.33 = green, 0.66 = blue, 1 = red.") ("hsvHueRange", po::value(&hsv.hueRange)->default_value(hsv.hueRange)->notifier(optInRange(0.f, 1.f, "hsvHueRange")), - "Tolerance around the hue value to isolate.") + "Tolerance around the hue value to isolate.") ("hsvMinSaturation", po::value(&hsv.minSaturation)->default_value(hsv.minSaturation)->notifier(optInRange(0.f, 1.f, "hsvMinSaturation")), - "Hue is meaningless if saturation is low. Do not mask pixels below this threshold.") + "Hue is meaningless if saturation is low. Do not mask pixels below this threshold.") ("hsvMaxSaturation", po::value(&hsv.maxSaturation)->default_value(hsv.maxSaturation)->notifier(optInRange(0.f, 1.f, "hsvMaxSaturation")), - "Do not mask pixels above this threshold. It might be useful to mask white/black pixels.") + "Do not mask pixels above this threshold. It might be useful to mask white/black pixels.") ("hsvMinValue", po::value(&hsv.minValue)->default_value(hsv.minValue)->notifier(optInRange(0.f, 1.f, "hsvMinValue")), - "Hue is meaningless if value is low. Do not mask pixels below this threshold.") + "Hue is meaningless if value is low. Do not mask pixels below this threshold.") ("hsvMaxValue", po::value(&hsv.maxValue)->default_value(hsv.maxValue)->notifier(optInRange(0.f, 1.f, "hsvMaxValue")), - "Do not mask pixels above this threshold. It might be useful to mask white/black pixels.") + "Do not mask pixels above this threshold. It might be useful to mask white/black pixels.") ("depthMapFolder", po::value(&depthMapFolder)->default_value(depthMapFolder), - "Optional input depth map folder to use instead of the color image to generate the mask.") + "Optional input depth map folder to use instead of the color image to generate the mask.") ("depthMapExp", po::value(&depthMapExp)->default_value(depthMapExp), - "Optional expression to find and use the input depth map instead of the color image to generate the mask.") - ; + "Optional expression to find and use the input depth map instead of the color image to generate the mask."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("invert", po::value(&invert)->default_value(invert), - "Invert the mask.") + "Invert the mask.") ("growRadius", po::value(&growRadius)->default_value(growRadius)->notifier(optInRange(0, INT_MAX, "growRadius")), - "Grow the selected area. It might be used to fill the holes: then use shrinkRadius to restore the initial coutours.") + "Grow the selected area. It might be used to fill the holes: then use shrinkRadius to restore the initial coutours.") ("shrinkRadius", po::value(&shrinkRadius)->default_value(shrinkRadius)->notifier(optInRange(0, INT_MAX, "shrinkRadius")), - "Shrink the selected area.") + "Shrink the selected area.") ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), - "Compute a sub-range of images from index rangeStart to rangeStart+rangeSize.") + "Compute a sub-range of images from index rangeStart to rangeStart+rangeSize.") ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), - "Compute a sub-range of N images (N=rangeSize).") - ; + "Compute a sub-range of N images (N=rangeSize)."); + // clang-format on CmdLine cmdline("AliceVision imageMasking"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_imageMatching.cpp b/src/software/pipeline/main_imageMatching.cpp index 085e99ca71..d51a12ace8 100644 --- a/src/software/pipeline/main_imageMatching.cpp +++ b/src/software/pipeline/main_imageMatching.cpp @@ -76,49 +76,51 @@ int aliceVision_main(int argc, char** argv) /// the combine SfM output std::string outputCombinedSfM; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilenameA)->required(), - "SfMData file.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features.") - ("output,o", po::value(&outputFile)->required(), - "Filepath to the output file with the list of selected image pairs."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("method", po::value(&method)->default_value(method), - "Method used to select the image pairs to match:\n" - " * VocabularyTree: select images that appear to share content\n" - " * Sequential: use images neighbors based on filename\n" - " * SequentialAndVocabularyTree: combine both previous approaches\n" - " * Exhaustive: all images combinations\n" - " * Frustum: images with camera frustum intersection (only for cameras with known poses)\n" - " * FrustumOrVocTree: frustum intersection if cameras with known poses else use VocTree.\n") - ("minNbImages", po::value(&minNbImages)->default_value(minNbImages), - "Minimal number of images to use the vocabulary tree. If we have less images than this threshold, we will compute all matching combinations.") - ("maxDescriptors", po::value(&nbMaxDescriptors)->default_value(nbMaxDescriptors), - "Limit the number of descriptors you load per image. Zero means no limit.") - ("nbMatches", po::value(&numImageQuery)->default_value(numImageQuery), - "The number of matches to retrieve for each image (If 0 it will " - "retrieve all the matches).") - ("nbNeighbors", po::value(&numImageQuerySequential)->default_value(numImageQuerySequential), - "The number of neighbors to retrieve for each image (If 0 it will " - "retrieve all the neighbors).") - ("tree,t", po::value(&treeFilepath)->default_value(treeFilepath), - "Input file path of the vocabulary tree. This file can be generated by 'createVoctree'. " - "This software is intended to be used with a generic, pre-trained vocabulary tree.") - ("weights,w", po::value(&weightsFilepath)->default_value(weightsFilepath), - "Input name for the vocabulary tree weight file, if not provided all voctree leaves will have the same weight."); - - po::options_description multiSfMParams("Multiple SfM"); - multiSfMParams.add_options() - ("inputB", po::value(&sfmDataFilenameB), - "SfMData file.") - ("matchingMode", po::value(&matchingModeName)->default_value(matchingModeName), - EImageMatchingMode_description().c_str()) - ("outputCombinedSfM", po::value(&outputCombinedSfM)->default_value(outputCombinedSfM), - "Output file path for the combined SfMData file (if empty, don't combine)."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilenameA)->required(), + "SfMData file.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features.") + ("output,o", po::value(&outputFile)->required(), + "Filepath to the output file with the list of selected image pairs."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("method", po::value(&method)->default_value(method), + "Method used to select the image pairs to match:\n" + " * VocabularyTree: select images that appear to share content\n" + " * Sequential: use images neighbors based on filename\n" + " * SequentialAndVocabularyTree: combine both previous approaches\n" + " * Exhaustive: all images combinations\n" + " * Frustum: images with camera frustum intersection (only for cameras with known poses)\n" + " * FrustumOrVocTree: frustum intersection if cameras with known poses else use VocTree.\n") + ("minNbImages", po::value(&minNbImages)->default_value(minNbImages), + "Minimal number of images to use the vocabulary tree. " + "If we have less images than this threshold, we will compute all matching combinations.") + ("maxDescriptors", po::value(&nbMaxDescriptors)->default_value(nbMaxDescriptors), + "Limit the number of descriptors you load per image. 0 means no limit.") + ("nbMatches", po::value(&numImageQuery)->default_value(numImageQuery), + "The number of matches to retrieve for each image (If 0, it will retrieve all the matches).") + ("nbNeighbors", po::value(&numImageQuerySequential)->default_value(numImageQuerySequential), + "The number of neighbors to retrieve for each image (If 0, it will retrieve all the neighbors).") + ("tree,t", po::value(&treeFilepath)->default_value(treeFilepath), + "Input file path of the vocabulary tree. This file can be generated by 'createVoctree'. " + "This software is intended to be used with a generic, pre-trained vocabulary tree.") + ("weights,w", po::value(&weightsFilepath)->default_value(weightsFilepath), + "Input name for the vocabulary tree weight file. " + "If not provided, all the voctree leaves will have the same weight."); + + po::options_description multiSfMParams("Multiple SfM"); + multiSfMParams.add_options() + ("inputB", po::value(&sfmDataFilenameB), + "SfMData file.") + ("matchingMode", po::value(&matchingModeName)->default_value(matchingModeName), + EImageMatchingMode_description().c_str()) + ("outputCombinedSfM", po::value(&outputCombinedSfM)->default_value(outputCombinedSfM), + "Output file path for the combined SfMData file (if empty, don't combine)."); + // clang-format on CmdLine cmdline("The objective of this software is to find images that are looking to the same areas of the scene. " "For that, we use the image retrieval techniques to find images that share content without " @@ -126,7 +128,7 @@ int aliceVision_main(int argc, char** argv) "a compact image descriptor which allows to compute the distance between all images descriptors efficiently.\n" "This program generates a pair list file to be passed to the aliceVision_featureMatching software. " "This file contains for each image the list of most similar images.\n" - "AliceVision featureMatching"); + "AliceVision imageMatching"); cmdline.add(requiredParams); cmdline.add(optionalParams); cmdline.add(multiSfMParams); diff --git a/src/software/pipeline/main_imageSegmentation.cpp b/src/software/pipeline/main_imageSegmentation.cpp index 92296ca007..86f1224dbd 100644 --- a/src/software/pipeline/main_imageSegmentation.cpp +++ b/src/software/pipeline/main_imageSegmentation.cpp @@ -96,11 +96,15 @@ int aliceVision_main(int argc, char** argv) bool keepFilename = false; // Description of mandatory parameters + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmDataFilepath)->required(), "Input SfMData.") - ("modelPath,m", po::value(&modelWeightsPath)->required(), "Input Model weights file.") - ("output,o", po::value(&outputPath)->required(), "Output folder."); + ("input,i", po::value(&sfmDataFilepath)->required(), + "Input SfMData.") + ("modelPath,m", po::value(&modelWeightsPath)->required(), + "Input model weights file.") + ("output,o", po::value(&outputPath)->required(), + "Output folder."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() @@ -116,6 +120,7 @@ int aliceVision_main(int argc, char** argv) "Range start for processing views (ordered by image filepath). Set to -1 to process all images.") ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), "Range size for processing views (ordered by image filepath)."); + // clang-format on CmdLine cmdline("AliceVision imageSegmentation"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_incrementalSfM.cpp b/src/software/pipeline/main_incrementalSfM.cpp index 91558e4f08..0c90e5f8e8 100644 --- a/src/software/pipeline/main_incrementalSfM.cpp +++ b/src/software/pipeline/main_incrementalSfM.cpp @@ -97,103 +97,106 @@ int aliceVision_main(int argc, char **argv) int randomSeed = std::mt19937::default_seed; bool logIntermediateSteps = false; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputSfM)->required(), - "Path to the output SfMData file."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), - "Path to folder(s) containing the extracted features.") - ("matchesFolders,m", po::value>(&matchesFolders)->multitoken(), - "Path to folder(s) in which computed matches are stored.") - ("outputViewsAndPoses", po::value(&outputSfMViewsAndPoses)->default_value(outputSfMViewsAndPoses), - "Path to the output SfMData file (with only views and poses).") - ("extraInfoFolder", po::value(&extraInfoFolder)->default_value(extraInfoFolder), - "Folder for intermediate reconstruction files and additional reconstruction information files.") - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()) - ("interFileExtension", po::value(&sfmParams.sfmStepFileExtension)->default_value(sfmParams.sfmStepFileExtension), - "Extension of the intermediate file export.") - ("maxNumberOfMatches", po::value(&maxNbMatches)->default_value(maxNbMatches), - "Maximum number of matches per image pair (and per feature type). " - "This can be useful to have a quick reconstruction overview. 0 means no limit.") - ("minNumberOfMatches", po::value(&minNbMatches)->default_value(minNbMatches), - "Minimum number of matches per image pair (and per feature type). " - "This can be useful to have a meaningful reconstruction with accurate keypoints. 0 means no limit.") - ("minInputTrackLength", po::value(&sfmParams.minInputTrackLength)->default_value(sfmParams.minInputTrackLength), - "Minimum track length in input of SfM.") - ("minAngleForTriangulation", po::value(&sfmParams.minAngleForTriangulation)->default_value(sfmParams.minAngleForTriangulation), - "Minimum angle for triangulation.") - ("minAngleForLandmark", po::value(&sfmParams.minAngleForLandmark)->default_value(sfmParams.minAngleForLandmark), - "Minimum angle for landmark.") - ("maxReprojectionError", po::value(&sfmParams.maxReprojectionError)->default_value(sfmParams.maxReprojectionError), - "Maximum reprojection error.") - ("minAngleInitialPair", po::value(&sfmParams.minAngleInitialPair)->default_value(sfmParams.minAngleInitialPair), - "Minimum angle for the initial pair.") - ("maxAngleInitialPair", po::value(&sfmParams.maxAngleInitialPair)->default_value(sfmParams.maxAngleInitialPair), - "Maximum angle for the initial pair.") - ("minNumberOfObservationsForTriangulation", po::value(&sfmParams.minNbObservationsForTriangulation)->default_value(sfmParams.minNbObservationsForTriangulation), - "Minimum number of observations to triangulate a point.\n" - "Set it to 3 (or more) reduces drastically the noise in the point cloud, but the number of final poses is a little bit reduced (from 1.5% to 11% on the tested datasets).\n" - "Note: set it to 0 or 1 to use the old triangulation algorithm (using 2 views only) during resection.") - ("initialPairA", po::value(&initialPairString.first)->default_value(initialPairString.first), - "UID or filepath or filename of the first image.") - ("initialPairB", po::value(&initialPairString.second)->default_value(initialPairString.second), - "UID or filepath or filename of the second image.") - ("lockAllIntrinsics", po::value(&sfmParams.lockAllIntrinsics)->default_value(sfmParams.lockAllIntrinsics), - "Force lock of all camera intrinsic parameters, so they will not be refined during Bundle Adjustment.") - ("minNbCamerasToRefinePrincipalPoint", po::value(&sfmParams.minNbCamerasToRefinePrincipalPoint)->default_value(sfmParams.minNbCamerasToRefinePrincipalPoint), - "Minimal number of cameras to refine the principal point of the cameras (one of the intrinsic parameters of the camera). " - "If we do not have enough cameras, the principal point in consider is considered in the center of the image. " - "If minNbCamerasToRefinePrincipalPoint<=0, the principal point is never refined. " - "If minNbCamerasToRefinePrincipalPoint==1, the principal point is always refined.") - ("useLocalBA,l", po::value(&sfmParams.useLocalBundleAdjustment)->default_value(sfmParams.useLocalBundleAdjustment), - "Enable/Disable the Local bundle adjustment strategy.\n" - "It reduces the reconstruction time, especially for big datasets (500+ images).") - ("localBAGraphDistance", po::value(&sfmParams.localBundelAdjustementGraphDistanceLimit)->default_value(sfmParams.localBundelAdjustementGraphDistanceLimit), - "Graph-distance limit setting the Active region in the Local Bundle Adjustment strategy.") - ("nbFirstUnstableCameras", po::value(&sfmParams.nbFirstUnstableCameras)->default_value(sfmParams.nbFirstUnstableCameras), - "Number of cameras for which the bundle adjustment is performed every single time a camera is added, leading to more stable " - "results while the computations are not too expensive since there is not much data. Past this number, the bundle adjustment " - "will only be performed once for N added cameras.") - ("maxImagesPerGroup", po::value(&sfmParams.maxImagesPerGroup)->default_value(sfmParams.maxImagesPerGroup), - "Maximum number of cameras that can be added before the bundle adjustment is performed. This prevents adding too much data " - "at once without performing the bundle adjustment.") - ("bundleAdjustmentMaxOutliers", po::value(&sfmParams.bundleAdjustmentMaxOutliers)->default_value(sfmParams.bundleAdjustmentMaxOutliers), - "Threshold for the maximum number of outliers allowed at the end of a bundle adjustment iteration." - "Using a negative value for this threshold will disable BA iterations.") - ("localizerEstimator", po::value(&sfmParams.localizerEstimator)->default_value(sfmParams.localizerEstimator), - "Estimator type used to localize cameras (acransac (default), ransac, lsmeds, loransac, maxconsensus)") - ("localizerEstimatorError", po::value(&sfmParams.localizerEstimatorError)->default_value(0.0), - "Reprojection error threshold (in pixels) for the localizer estimator (0 for default value according to the estimator).") - ("localizerEstimatorMaxIterations", po::value(&sfmParams.localizerEstimatorMaxIterations)->default_value(sfmParams.localizerEstimatorMaxIterations), - "Max number of RANSAC iterations.") - ("useOnlyMatchesFromInputFolder", po::value(&useOnlyMatchesFromInputFolder)->default_value(useOnlyMatchesFromInputFolder), - "Use only matches from the input matchesFolder parameter.\n" - "Matches folders previously added to the SfMData file will be ignored.") - ("filterTrackForks", po::value(&sfmParams.filterTrackForks)->default_value(sfmParams.filterTrackForks), - "Enable/Disable the track forks removal. A track contains a fork when incoherent matches leads to multiple features in the same image for a single track.\n") - ("useRigConstraint", po::value(&sfmParams.rig.useRigConstraint)->default_value(sfmParams.rig.useRigConstraint), - "Enable/Disable rig constraint.\n") - ("rigMinNbCamerasForCalibration", po::value(&sfmParams.rig.minNbCamerasForCalibration)->default_value(sfmParams.rig.minNbCamerasForCalibration), - "Minimal number of cameras to start the calibration of the rig.\n") - ("lockScenePreviouslyReconstructed", po::value(&lockScenePreviouslyReconstructed)->default_value(lockScenePreviouslyReconstructed), - "Lock/Unlock scene previously reconstructed.\n") - ("observationConstraint", po::value(&sfmParams.featureConstraint)->default_value(sfmParams.featureConstraint), - "Use of an observation constraint : basic, scale the observation or use of the covariance.\n") - ("computeStructureColor", po::value(&computeStructureColor)->default_value(computeStructureColor), - "Compute each 3D point color.\n") - ("useAutoTransform", po::value(&useAutoTransform)->default_value(useAutoTransform), - "Transform the result with the alignment method 'AUTO'.\n") - ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), - "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.") - ("logIntermediateSteps", po::value(&sfmParams.logIntermediateSteps)->default_value(logIntermediateSteps), - "If set to true, the current state of the scene will be dumped as an SfMData file every 3 resections.") - ; + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputSfM)->required(), + "Path to the output SfMData file."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), + "Path to folder(s) containing the extracted features.") + ("matchesFolders,m", po::value>(&matchesFolders)->multitoken(), + "Path to folder(s) in which computed matches are stored.") + ("outputViewsAndPoses", po::value(&outputSfMViewsAndPoses)->default_value(outputSfMViewsAndPoses), + "Path to the output SfMData file (with only views and poses).") + ("extraInfoFolder", po::value(&extraInfoFolder)->default_value(extraInfoFolder), + "Folder for intermediate reconstruction files and additional reconstruction information files.") + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()) + ("interFileExtension", po::value(&sfmParams.sfmStepFileExtension)->default_value(sfmParams.sfmStepFileExtension), + "Extension of the intermediate file export.") + ("maxNumberOfMatches", po::value(&maxNbMatches)->default_value(maxNbMatches), + "Maximum number of matches per image pair (and per feature type). " + "This can be useful to have a quick reconstruction overview. 0 means no limit.") + ("minNumberOfMatches", po::value(&minNbMatches)->default_value(minNbMatches), + "Minimum number of matches per image pair (and per feature type). " + "This can be useful to have a meaningful reconstruction with accurate keypoints. 0 means no limit.") + ("minInputTrackLength", po::value(&sfmParams.minInputTrackLength)->default_value(sfmParams.minInputTrackLength), + "Minimum track length in input of SfM.") + ("minAngleForTriangulation", po::value(&sfmParams.minAngleForTriangulation)->default_value(sfmParams.minAngleForTriangulation), + "Minimum angle for triangulation.") + ("minAngleForLandmark", po::value(&sfmParams.minAngleForLandmark)->default_value(sfmParams.minAngleForLandmark), + "Minimum angle for landmark.") + ("maxReprojectionError", po::value(&sfmParams.maxReprojectionError)->default_value(sfmParams.maxReprojectionError), + "Maximum reprojection error.") + ("minAngleInitialPair", po::value(&sfmParams.minAngleInitialPair)->default_value(sfmParams.minAngleInitialPair), + "Minimum angle for the initial pair.") + ("maxAngleInitialPair", po::value(&sfmParams.maxAngleInitialPair)->default_value(sfmParams.maxAngleInitialPair), + "Maximum angle for the initial pair.") + ("minNumberOfObservationsForTriangulation", po::value(&sfmParams.minNbObservationsForTriangulation)->default_value(sfmParams.minNbObservationsForTriangulation), + "Minimum number of observations to triangulate a point.\n" + "Set it to 3 (or more) reduces drastically the noise in the point cloud, but the number of final poses is " + "a little bit reduced (from 1.5% to 11% on the tested datasets).\n" + "Note: set it to 0 or 1 to use the old triangulation algorithm (using 2 views only) during resection.") + ("initialPairA", po::value(&initialPairString.first)->default_value(initialPairString.first), + "UID or filepath or filename of the first image.") + ("initialPairB", po::value(&initialPairString.second)->default_value(initialPairString.second), + "UID or filepath or filename of the second image.") + ("lockAllIntrinsics", po::value(&sfmParams.lockAllIntrinsics)->default_value(sfmParams.lockAllIntrinsics), + "Force lock of all camera intrinsic parameters, so they will not be refined during Bundle Adjustment.") + ("minNbCamerasToRefinePrincipalPoint", po::value(&sfmParams.minNbCamerasToRefinePrincipalPoint)->default_value(sfmParams.minNbCamerasToRefinePrincipalPoint), + "Minimal number of cameras to refine the principal point of the cameras (one of the intrinsic parameters of the camera). " + "If we do not have enough cameras, the principal point in consider is considered in the center of the image. " + "If minNbCamerasToRefinePrincipalPoint<=0, the principal point is never refined. " + "If minNbCamerasToRefinePrincipalPoint==1, the principal point is always refined.") + ("useLocalBA,l", po::value(&sfmParams.useLocalBundleAdjustment)->default_value(sfmParams.useLocalBundleAdjustment), + "Enable/Disable the Local bundle adjustment strategy.\n" + "It reduces the reconstruction time, especially for big datasets (500+ images).") + ("localBAGraphDistance", po::value(&sfmParams.localBundelAdjustementGraphDistanceLimit)->default_value(sfmParams.localBundelAdjustementGraphDistanceLimit), + "Graph-distance limit setting the Active region in the Local Bundle Adjustment strategy.") + ("nbFirstUnstableCameras", po::value(&sfmParams.nbFirstUnstableCameras)->default_value(sfmParams.nbFirstUnstableCameras), + "Number of cameras for which the bundle adjustment is performed every single time a camera is added, leading to more stable " + "results while the computations are not too expensive since there is not much data. Past this number, the bundle adjustment " + "will only be performed once for N added cameras.") + ("maxImagesPerGroup", po::value(&sfmParams.maxImagesPerGroup)->default_value(sfmParams.maxImagesPerGroup), + "Maximum number of cameras that can be added before the bundle adjustment is performed. " + "This prevents adding too much data at once without performing the bundle adjustment.") + ("bundleAdjustmentMaxOutliers", po::value(&sfmParams.bundleAdjustmentMaxOutliers)->default_value(sfmParams.bundleAdjustmentMaxOutliers), + "Threshold for the maximum number of outliers allowed at the end of a bundle adjustment iteration." + "Using a negative value for this threshold will disable BA iterations.") + ("localizerEstimator", po::value(&sfmParams.localizerEstimator)->default_value(sfmParams.localizerEstimator), + "Estimator type used to localize cameras (acransac (default), ransac, lsmeds, loransac, maxconsensus).") + ("localizerEstimatorError", po::value(&sfmParams.localizerEstimatorError)->default_value(0.0), + "Reprojection error threshold (in pixels) for the localizer estimator (0 for default value according to the estimator).") + ("localizerEstimatorMaxIterations", po::value(&sfmParams.localizerEstimatorMaxIterations)->default_value(sfmParams.localizerEstimatorMaxIterations), + "Maximum number of RANSAC iterations.") + ("useOnlyMatchesFromInputFolder", po::value(&useOnlyMatchesFromInputFolder)->default_value(useOnlyMatchesFromInputFolder), + "Use only matches from the input matchesFolder parameter.\n" + "Matches folders previously added to the SfMData file will be ignored.") + ("filterTrackForks", po::value(&sfmParams.filterTrackForks)->default_value(sfmParams.filterTrackForks), + "Enable/Disable the track forks removal. A track contains a fork when incoherent matches leads to multiple " + "features in the same image for a single track.") + ("useRigConstraint", po::value(&sfmParams.rig.useRigConstraint)->default_value(sfmParams.rig.useRigConstraint), + "Enable/Disable rig constraint.") + ("rigMinNbCamerasForCalibration", po::value(&sfmParams.rig.minNbCamerasForCalibration)->default_value(sfmParams.rig.minNbCamerasForCalibration), + "Minimal number of cameras to start the calibration of the rig.") + ("lockScenePreviouslyReconstructed", po::value(&lockScenePreviouslyReconstructed)->default_value(lockScenePreviouslyReconstructed), + "Lock/Unlock scene previously reconstructed.") + ("observationConstraint", po::value(&sfmParams.featureConstraint)->default_value(sfmParams.featureConstraint), + "Use of an observation constraint: basic, scale the observation or use of the covariance.") + ("computeStructureColor", po::value(&computeStructureColor)->default_value(computeStructureColor), + "Compute each 3D point color.") + ("useAutoTransform", po::value(&useAutoTransform)->default_value(useAutoTransform), + "Transform the result with the alignment method 'AUTO'.") + ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.") + ("logIntermediateSteps", po::value(&sfmParams.logIntermediateSteps)->default_value(logIntermediateSteps), + "If set to true, the current state of the scene will be dumped as an SfMData file every 3 resections."); + // clang-format on CmdLine cmdline("Sequential/Incremental reconstruction.\n" "This program performs incremental SfM (Initial Pair Essential + Resection).\n" diff --git a/src/software/pipeline/main_lightingCalibration.cpp b/src/software/pipeline/main_lightingCalibration.cpp index a302f71687..6ff3766e07 100644 --- a/src/software/pipeline/main_lightingCalibration.cpp +++ b/src/software/pipeline/main_lightingCalibration.cpp @@ -52,6 +52,7 @@ int aliceVision_main(int argc, char **argv) std::string method; bool saveAsModel; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("inputPath,i", po::value(&inputPath)->required(), @@ -67,6 +68,7 @@ int aliceVision_main(int argc, char **argv) "Calibration used for several datasets.") ("method, m", po::value(&method)->default_value("brightestPoint"), "Method for light estimation."); + // clang-format on CmdLine cmdline("AliceVision lightingCalibration"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_meshDecimate.cpp b/src/software/pipeline/main_meshDecimate.cpp index 14069782c5..b7491c43c3 100644 --- a/src/software/pipeline/main_meshDecimate.cpp +++ b/src/software/pipeline/main_meshDecimate.cpp @@ -44,25 +44,28 @@ int aliceVision_main(int argc, char* argv[]) int maxVertices = 0; bool flipNormals = false; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&inputMeshPath)->required(), - "Input Mesh (OBJ file format).") + "Input Mesh (OBJ file format).") ("output,o", po::value(&outputMeshPath)->required(), - "Output mesh (OBJ file format)."); + "Output mesh (OBJ file format)."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("simplificationFactor", po::value(&simplificationFactor)->default_value(simplificationFactor), - "Simplification factor.") + "Simplification factor.") ("nbVertices", po::value(&fixedNbVertices)->default_value(fixedNbVertices), - "Fixed number of output vertices.") + "Fixed number of output vertices.") ("minVertices", po::value(&minVertices)->default_value(minVertices), - "Min number of output vertices.") + "Min number of output vertices.") ("maxVertices", po::value(&maxVertices)->default_value(maxVertices), - "Max number of output vertices.") + "Max number of output vertices.") ("flipNormals", po::value(&flipNormals)->default_value(flipNormals), - "Option to flip face normals. It can be needed as it depends on the vertices order in triangles and the convention change from one software to another."); + "Option to flip face normals. It can be needed as it depends on the vertices order in triangles and the " + "convention changes from one software to another."); + // clang-format on CmdLine cmdline("AliceVision meshDecimate"); diff --git a/src/software/pipeline/main_meshDenoising.cpp b/src/software/pipeline/main_meshDenoising.cpp index dd2e623ef1..11c8d45cb4 100644 --- a/src/software/pipeline/main_meshDenoising.cpp +++ b/src/software/pipeline/main_meshDenoising.cpp @@ -49,31 +49,33 @@ int aliceVision_main(int argc, char* argv[]) float mu = 1.5; float nu = 0.3; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&inputMeshPath)->required(), - "Input Mesh (OBJ file format).") + "Input Mesh (OBJ file format).") ("output,o", po::value(&outputMeshPath)->required(), - "Output mesh (OBJ file format)."); + "Output mesh (OBJ file format)."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("denoisingIterations", po::value(&denoisingIterations)->default_value(denoisingIterations), - "Number of denoising iterations.") + "Number of denoising iterations.") ("meshUpdateClosenessWeight", po::value(&meshUpdateClosenessWeight)->default_value(meshUpdateClosenessWeight), - "Closeness weight for mesh update, must be positive.") + "Closeness weight for mesh update, must be positive.") ("lambda", po::value(&lambda)->default_value(lambda), - "Regularization weight.") + "Regularization weight.") ("eta", po::value(&eta)->default_value(eta), - "Gaussian standard deviation for spatial weight, scaled by the average distance between adjacent face centroids. Must be positive.") + "Gaussian standard deviation for spatial weight, scaled by the average distance between adjacent face centroids. Must be positive.") ("mu", po::value(&mu)->default_value(mu), - "Gaussian standard deviation for guidance weight.") + "Gaussian standard deviation for guidance weight.") ("nu", po::value(&nu)->default_value(nu), - "Gaussian standard deviation for signal weight.") + "Gaussian standard deviation for signal weight.") ("meshUpdateMethod", po::value(&meshUpdateMethod)->default_value(meshUpdateMethod), - "Mesh Update Method: \n" - "* ITERATIVE_UPDATE(" BOOST_PP_STRINGIZE(SDFilter::MeshFilterParameters::ITERATIVE_UPDATE) ") (default): ShapeUp styled iterative solver\n" - "* POISSON_UPDATE(" BOOST_PP_STRINGIZE(SDFilter::MeshFilterParameters::POISSON_UPDATE) "): Poisson-based update from [Wang et al. 2015] \"Rolling guidance normal filter for geometric processing\"\n"); + "Mesh Update Method: \n" + "* ITERATIVE_UPDATE(" BOOST_PP_STRINGIZE(SDFilter::MeshFilterParameters::ITERATIVE_UPDATE) ") (default): ShapeUp styled iterative solver\n" + "* POISSON_UPDATE(" BOOST_PP_STRINGIZE(SDFilter::MeshFilterParameters::POISSON_UPDATE) "): Poisson-based update from [Wang et al. 2015] \"Rolling guidance normal filter for geometric processing\"\n"); + // clang-format on CmdLine cmdline("AliceVision meshDenoising"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_meshFiltering.cpp b/src/software/pipeline/main_meshFiltering.cpp index 73070783eb..44272eb300 100644 --- a/src/software/pipeline/main_meshFiltering.cpp +++ b/src/software/pipeline/main_meshFiltering.cpp @@ -117,33 +117,36 @@ int aliceVision_main(int argc, char* argv[]) double filterLargeTrianglesFactor = 60.0; double filterTrianglesRatio = 0.0; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("inputMesh,i", po::value(&inputMeshPath)->required(), - "Input Mesh") + "Input mesh.") ("outputMesh,o", po::value(&outputMeshPath)->required(), - "Output mesh"); + "Output mesh."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("keepLargestMeshOnly", po::value(&keepLargestMeshOnly)->default_value(keepLargestMeshOnly), - "Keep only the largest connected triangles group.") + "Keep only the largest connected triangles group.") ("smoothingSubset",po::value(&smoothingSubsetTypeName)->default_value(smoothingSubsetTypeName), - ESubsetType_informations().c_str()) + ESubsetType_informations().c_str()) ("smoothingBoundariesNeighbours", po::value(&smoothingBoundariesNeighbours)->default_value(smoothingBoundariesNeighbours), - "Neighbours of the boudaries to consider.") + "Neighbours of the boudaries to consider.") ("smoothingIterations", po::value(&smoothNIter)->default_value(smoothNIter), - "Number of smoothing iterations.") + "Number of smoothing iterations.") ("smoothingLambda", po::value(&lambda)->default_value(lambda), - "Smoothing size.") + "Smoothing size.") ("filteringSubset",po::value(&filteringSubsetTypeName)->default_value(filteringSubsetTypeName), - ESubsetType_informations().c_str()) + ESubsetType_informations().c_str()) ("filteringIterations", po::value(&filteringIterations)->default_value(filteringIterations), - "Number of mesh filtering iterations.") + "Number of mesh filtering iterations.") ("filterLargeTrianglesFactor", po::value(&filterLargeTrianglesFactor)->default_value(filterLargeTrianglesFactor), - "Remove all large triangles. We consider a triangle as large if one edge is bigger than N times the average edge length. Put zero to disable it.") + "Remove all large triangles. We consider a triangle as large if one edge is bigger than N times the average " + "edge length. Set to 0 to disable it.") ("filterTrianglesRatio", po::value(&filterTrianglesRatio)->default_value(filterTrianglesRatio), - "Remove all triangles by ratio (largest edge /smallest edge). Put zero to disable it."); + "Remove all triangles by ratio (largest edge /smallest edge). Set to 0 to disable it."); + // clang-format on CmdLine cmdline("AliceVision meshFiltering"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_meshMasking.cpp b/src/software/pipeline/main_meshMasking.cpp index 570e1aa2a1..1031ca3ab1 100644 --- a/src/software/pipeline/main_meshMasking.cpp +++ b/src/software/pipeline/main_meshMasking.cpp @@ -519,34 +519,34 @@ int main(int argc, char **argv) bool usePointsVisibilities = false; std::string maskExtension = "png"; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmFilePath)->default_value(sfmFilePath)->required(), - "A SfMData file (*.sfm).") + "A SfMData file (*.sfm).") ("inputMesh,i", po::value(&inputMeshPath)->required(), - "Input Mesh") + "Input mesh.") ("masksFolders", po::value>(&masksFolders)->multitoken(), - "Use masks from specific folder(s).\n" - "Filename should be the same or the image uid.") + "Use masks from specific folder(s).\n" + "Filename should be the same or the image UID.") ("outputMesh,o", po::value(&outputMeshPath)->required(), - "Output mesh") + "Output mesh.") ("threshold", po::value(&threshold)->default_value(threshold)->notifier(optInRange(1, INT_MAX, "threshold"))->required(), - "The minimum number of visibility to keep a vertex.") - ; + "The minimum number of visibility to keep a vertex."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("invert", po::value(&invert)->default_value(invert), - "Invert the mask.") + "Invert the mask.") ("smoothBoundary", po::value(&smoothBoundary)->default_value(smoothBoundary), - "Modify the triangles at the boundary to fit the masks.") + "Modify the triangles at the boundary to fit the masks.") ("undistortMasks", po::value(&undistortMasks)->default_value(undistortMasks), - "Undistort the masks with the same parameters as the matching image. Use it if the masks are drawn on the original images.") + "Undistort the masks with the same parameters as the matching image. Use it if the masks are drawn on the original images.") ("usePointsVisibilities", po::value(&usePointsVisibilities)->default_value(usePointsVisibilities), - "Use the points visibilities from the meshing to filter triangles. Example: when they are occluded, back-face, etc.") + "Use the points visibilities from the meshing to filter triangles. Example: when they are occluded, back-face, etc.") ("maskExtension", po::value(&maskExtension)->default_value(maskExtension), - "File extension for the masks to use.") - ; + "File extension for the masks to use."); + // clang-format on CmdLine cmdline("AliceVision meshMasking"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_meshResampling.cpp b/src/software/pipeline/main_meshResampling.cpp index e39b632995..ff7e71d0a8 100644 --- a/src/software/pipeline/main_meshResampling.cpp +++ b/src/software/pipeline/main_meshResampling.cpp @@ -47,27 +47,30 @@ int aliceVision_main(int argc, char* argv[]) unsigned int nbLloydIter = 40; bool flipNormals = false; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&inputMeshPath)->required(), - "Input Mesh (OBJ file format).") + "Input Mesh (OBJ file format).") ("output,o", po::value(&outputMeshPath)->required(), - "Output mesh (OBJ file format)."); + "Output mesh (OBJ file format)."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("simplificationFactor", po::value(&simplificationFactor)->default_value(simplificationFactor), - "Simplification factor.") + "Simplification factor.") ("nbVertices", po::value(&fixedNbVertices)->default_value(fixedNbVertices), - "Fixed number of output vertices.") + "Fixed number of output vertices.") ("minVertices", po::value(&minVertices)->default_value(minVertices), - "Min number of output vertices.") + "Minimum number of output vertices.") ("maxVertices", po::value(&maxVertices)->default_value(maxVertices), - "Max number of output vertices.") + "Maximum number of output vertices.") ("nbLloydIter", po::value(&nbLloydIter)->default_value(nbLloydIter), - "Number of iterations for Lloyd pre-smoothing.") + "Number of iterations for Lloyd pre-smoothing.") ("flipNormals", po::value(&flipNormals)->default_value(flipNormals), - "Option to flip face normals. It can be needed as it depends on the vertices order in triangles and the convention change from one software to another."); + "Option to flip face normals. It can be needed as it depends on the vertices order in triangles and the " + "convention changes from one software to another."); + // clang-format on CmdLine cmdline("AliceVision meshResampling"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_meshing.cpp b/src/software/pipeline/main_meshing.cpp index ef9a816e2d..8121463165 100644 --- a/src/software/pipeline/main_meshing.cpp +++ b/src/software/pipeline/main_meshing.cpp @@ -323,103 +323,107 @@ int aliceVision_main(int argc, char* argv[]) bool exportDebugTetrahedralization = false; int maxNbConnectedHelperPoints = 50; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") + "SfMData file.") ("output,o", po::value(&outputDensePointCloud)->required(), - "Output Dense SfMData file.") + "Output Dense SfMData file.") ("outputMesh,o", po::value(&outputMesh)->required(), - "Output mesh"); + "Output mesh."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("depthMapsFolder", po::value(&depthMapsFolder), - "Input filtered depth maps folder.") + "Input filtered depth maps folder.") ("boundingBox", po::value(&boundingBox), - "Specifies a bounding box to reconstruct: position, rotation (Euler ZXY) and scale.") + "Specifies a bounding box to reconstruct: position, rotation (Euler ZXY) and scale.") ("maxInputPoints", po::value(&fuseParams.maxInputPoints)->default_value(fuseParams.maxInputPoints), - "Max input points loaded from images.") + "Maximum number of input points loaded from images.") ("maxPoints", po::value(&fuseParams.maxPoints)->default_value(fuseParams.maxPoints), - "Max points at the end of the depth maps fusion.") + "Maximum number of points at the end of the depth maps fusion.") ("maxPointsPerVoxel", po::value(&maxPtsPerVoxel)->default_value(maxPtsPerVoxel), - "Max points per voxel.") + "Maximum number of points per voxel.") ("minStep", po::value(&fuseParams.minStep)->default_value(fuseParams.minStep), - "The step used to load depth values from depth maps is computed from maxInputPts. Here we define the minimal value for this step, " - "so on small datasets we will not spend too much time at the beginning loading all depth values.") + "The step used to load depth values from depth maps is computed from maxInputPts. " + "Here we define the minimal value for this step, so on small datasets we will not spend too much time at the " + "beginning loading all depth values.") ("simFactor", po::value(&fuseParams.simFactor)->default_value(fuseParams.simFactor), - "simFactor") + "simFactor.") ("angleFactor", po::value(&fuseParams.angleFactor)->default_value(fuseParams.angleFactor), - "angleFactor") + "angleFactor.") ("minVis", po::value(&fuseParams.minVis)->default_value(fuseParams.minVis), - "Filter points based on their number of observations") + "Filter points based on their number of observations.") ("partitioning", po::value(&partitioningMode)->default_value(partitioningMode), - "Partitioning: 'singleBlock' or 'auto'.") + "Partitioning: 'singleBlock' or 'auto'.") ("repartition", po::value(&repartitionMode)->default_value(repartitionMode), - "Repartition: 'multiResolution' or 'regularGrid'.") + "Repartition: 'multiResolution' or 'regularGrid'.") ("estimateSpaceFromSfM", po::value(&estimateSpaceFromSfM)->default_value(estimateSpaceFromSfM), - "Estimate the 3d space from the SfM.") + "Estimate the 3d space from the SfM.") ("addLandmarksToTheDensePointCloud", po::value(&addLandmarksToTheDensePointCloud)->default_value(addLandmarksToTheDensePointCloud), - "Add SfM Landmarks into the dense point cloud (created from depth maps). If only the SfM is provided in input, SfM landmarks will be used regardless of this option.") + "Add SfM Landmarks into the dense point cloud (created from depth maps). " + "If only the SfM is provided in input, SfM landmarks will be used regardless of this option.") ("colorizeOutput", po::value(&colorizeOutput)->default_value(colorizeOutput), - "Whether to colorize output dense point cloud and mesh."); + "Whether to colorize output dense point cloud and mesh."); po::options_description advancedParams("Advanced parameters"); advancedParams.add_options() ("universePercentile", po::value(&universePercentile)->default_value(universePercentile), - "universe percentile") + "Universe percentile.") ("estimateSpaceMinObservations", po::value(&estimateSpaceMinObservations)->default_value(estimateSpaceMinObservations), - "Minimum number of observations for SfM space estimation.") + "Minimum number of observations for SfM space estimation.") ("estimateSpaceMinObservationAngle", po::value(&estimateSpaceMinObservationAngle)->default_value(estimateSpaceMinObservationAngle), - "Minimum angle between two observations for SfM space estimation.") + "Minimum angle between two observations for SfM space estimation.") ("pixSizeMarginInitCoef", po::value(&fuseParams.pixSizeMarginInitCoef)->default_value(fuseParams.pixSizeMarginInitCoef), - "pixSizeMarginInitCoef") + "pixSizeMarginInitCoef.") ("pixSizeMarginFinalCoef", po::value(&fuseParams.pixSizeMarginFinalCoef)->default_value(fuseParams.pixSizeMarginFinalCoef), - "pixSizeMarginFinalCoef") + "pixSizeMarginFinalCoef.") ("voteMarginFactor", po::value(&fuseParams.voteMarginFactor)->default_value(fuseParams.voteMarginFactor), - "voteMarginFactor") + "voteMarginFactor.") ("contributeMarginFactor", po::value(&fuseParams.contributeMarginFactor)->default_value(fuseParams.contributeMarginFactor), - "contributeMarginFactor") + "contributeMarginFactor.") ("simGaussianSizeInit", po::value(&fuseParams.simGaussianSizeInit)->default_value(fuseParams.simGaussianSizeInit), - "simGaussianSizeInit") + "simGaussianSizeInit.") ("simGaussianSize", po::value(&fuseParams.simGaussianSize)->default_value(fuseParams.simGaussianSize), - "simGaussianSize") + "simGaussianSize.") ("minAngleThreshold", po::value(&fuseParams.minAngleThreshold)->default_value(fuseParams.minAngleThreshold), - "minAngleThreshold") + "minAngleThreshold.") ("refineFuse", po::value(&fuseParams.refineFuse)->default_value(fuseParams.refineFuse), - "refineFuse") + "refineFuse.") ("helperPointsGridSize", po::value(&helperPointsGridSize)->default_value(helperPointsGridSize), - "Helper points grid size.") + "Helper points grid size.") ("densifyNbFront", po::value(&densifyNbFront)->default_value(densifyNbFront), - "Number of points in front of the vertices to densify the scene.") + "Number of points in front of the vertices to densify the scene.") ("densifyNbBack", po::value(&densifyNbBack)->default_value(densifyNbBack), - "Number of points behind the vertices to densify the scene.") + "Number of points behind the vertices to densify the scene.") ("densifyScale", po::value(&densifyScale)->default_value(densifyScale), - "Scale between points used to densify the scene.") + "Scale between points used to densify the scene.") ("maskHelperPointsWeight", po::value(&fuseParams.maskHelperPointsWeight)->default_value(fuseParams.maskHelperPointsWeight), - "Mask helper points weight. Zero to disable it.") + "Mask helper points weight. Set to 0 to disable it.") ("maskBorderSize", po::value(&fuseParams.maskBorderSize)->default_value(fuseParams.maskBorderSize), - "How many pixels on mask borders? 1 by default.") + "How many pixels on mask borders? 1 by default.") ("nPixelSizeBehind", po::value(&nPixelSizeBehind)->default_value(nPixelSizeBehind), - "Number of pixel size units to vote behind the vertex with FULL status.") + "Number of pixel size units to vote behind the vertex with FULL status.") ("fullWeight", po::value(&fullWeight)->default_value(fullWeight), - "Weighting of the FULL cells.") + "Weighting of the FULL cells.") ("saveRawDensePointCloud", po::value(&saveRawDensePointCloud)->default_value(saveRawDensePointCloud), - "Save dense point cloud before cut and filtering.") + "Save dense point cloud before cut and filtering.") ("voteFilteringForWeaklySupportedSurfaces", po::value(&voteFilteringForWeaklySupportedSurfaces)->default_value(voteFilteringForWeaklySupportedSurfaces), - "Improve support of weakly supported surfaces with a tetrahedra fullness score filtering.") + "Improve support of weakly supported surfaces with a tetrahedra fullness score filtering.") ("invertTetrahedronBasedOnNeighborsNbIterations", po::value(&invertTetrahedronBasedOnNeighborsNbIterations)->default_value(invertTetrahedronBasedOnNeighborsNbIterations), - "Invert cells status around surface to improve smoothness.") + "Invert cells status around surface to improve smoothness.") ("minSolidAngleRatio", po::value(&minSolidAngleRatio)->default_value(minSolidAngleRatio), - "Filter cells status on surface around vertices to improve smoothness using solid angle ratio between full/empty parts.") + "Filter cells status on surface around vertices to improve smoothness using solid angle ratio between full/empty parts.") ("nbSolidAngleFilteringIterations", po::value(&nbSolidAngleFilteringIterations)->default_value(nbSolidAngleFilteringIterations), - "Number of iterations to filter the status cells based on solid angle ratio.") + "Number of iterations to filter the status cells based on solid angle ratio.") ("maxNbConnectedHelperPoints", po::value(&maxNbConnectedHelperPoints)->default_value(maxNbConnectedHelperPoints), - "Maximum number of connected helper points before we remove them.") + "Maximum number of connected helper points before we remove them.") ("exportDebugTetrahedralization", po::value(&exportDebugTetrahedralization)->default_value(exportDebugTetrahedralization), - "Export debug cells score as tetrahedral mesh. WARNING: could create huge meshes, only use on very small datasets.") + "Export debug cells score as tetrahedral mesh. WARNING: could create huge meshes, only use on very small datasets.") ("seed", po::value(&seed)->default_value(seed), - "Seed used in random processes. (0 to use a random seed)."); + "Seed used in random processes. (0 to use a random seed)."); + // clang-format on CmdLine cmdline("AliceVision meshing"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_nodalSfM.cpp b/src/software/pipeline/main_nodalSfM.cpp index 637628b4d3..9334bbd24b 100644 --- a/src/software/pipeline/main_nodalSfM.cpp +++ b/src/software/pipeline/main_nodalSfM.cpp @@ -383,14 +383,22 @@ int aliceVision_main(int argc, char** argv) int randomSeed = std::mt19937::default_seed; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), "SfMData file.") - ("output,o", po::value(&sfmDataOutputFilename)->required(), "SfMData output file.") - ("tracksFilename,t", po::value(&tracksFilename)->required(), "Tracks file.") - ("pairs,p", po::value(&pairsDirectory)->required(), "Path to the pairs directory.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), "Path to folder(s) containing the extracted features.") - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName),feature::EImageDescriberType_informations().c_str()); + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&sfmDataOutputFilename)->required(), + "SfMData output file.") + ("tracksFilename,t", po::value(&tracksFilename)->required(), + "Tracks file.") + ("pairs,p", po::value(&pairsDirectory)->required(), + "Path to the pairs directory.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), + "Path to folder(s) containing the extracted features.") + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()); + // clang-format on CmdLine cmdline("AliceVision Nodal SfM"); diff --git a/src/software/pipeline/main_normalIntegration.cpp b/src/software/pipeline/main_normalIntegration.cpp index b970ade013..853d1078f2 100644 --- a/src/software/pipeline/main_normalIntegration.cpp +++ b/src/software/pipeline/main_normalIntegration.cpp @@ -62,6 +62,7 @@ int aliceVision_main(int argc, char **argv) // Image downscale factor during process int downscale = 1; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("inputPath,i", po::value(&inputPath)->required(), @@ -75,6 +76,7 @@ int aliceVision_main(int argc, char **argv) "Path to the input SfMData file.") ("downscale,d", po::value(&downscale)->default_value(downscale), "Downscale factor for faster results."); + // clang-format on CmdLine cmdline("AliceVision normalIntegration"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_panoramaCompositing.cpp b/src/software/pipeline/main_panoramaCompositing.cpp index 15fbc89e62..ef766a0678 100644 --- a/src/software/pipeline/main_panoramaCompositing.cpp +++ b/src/software/pipeline/main_panoramaCompositing.cpp @@ -646,24 +646,38 @@ int aliceVision_main(int argc, char** argv) image::EStorageDataType storageDataType = image::EStorageDataType::Float; // Description of mandatory parameters + // clang-format off po::options_description requiredParams("Required parameters"); - requiredParams.add_options()("input,i", po::value(&sfmDataFilepath)->required(), "Input sfmData.")( - "warpingFolder,w", po::value(&warpingFolder)->required(), "Folder with warped images.")( - "output,o", po::value(&outputFolder)->required(), "Path of the output panorama."); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilepath)->required(), + "Input SfMData.") + ("warpingFolder,w", po::value(&warpingFolder)->required(), + "Folder with warped images.") + ("output,o", po::value(&outputFolder)->required(), + "Path of the output panorama."); // Description of optional parameters po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("compositerType,c", po::value(&compositerType)->required(), "Compositer Type [replace, alpha, multiband].") - ("forceMinPyramidLevels,f", po::value(&forceMinPyramidLevels)->default_value(forceMinPyramidLevels), "For multiband compositer, force a minimum number of levels in the image pyramid.") - ("overlayType,c", po::value(&overlayType)->required(), "Overlay Type [none, borders, seams, all].") + ("compositerType,c", po::value(&compositerType)->required(), + "Compositer type: [replace, alpha, multiband].") + ("forceMinPyramidLevels,f", po::value(&forceMinPyramidLevels)->default_value(forceMinPyramidLevels), + "For multiband compositer, force a minimum number of levels in the image pyramid.") + ("overlayType,c", po::value(&overlayType)->required(), + "Overlay type: [none, borders, seams, all].") ("storageDataType", po::value(&storageDataType)->default_value(storageDataType), - ("Storage data type: " + image::EStorageDataType_informations()).c_str()) - ("rangeIteration", po::value(&rangeIteration)->default_value(rangeIteration), "Range chunk id.") - ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), "Range size.") - ("maxThreads", po::value(&maxThreads)->default_value(maxThreads), "max number of threads to use.") - ("labels,l", po::value(&labelsFilepath)->required(), "Labels image from seams estimation.") - ("useTiling,n", po::value(&useTiling)->default_value(useTiling), "use tiling for compositing."); + ("Storage data type: " + image::EStorageDataType_informations()).c_str()) + ("rangeIteration", po::value(&rangeIteration)->default_value(rangeIteration), + "Range chunk ID.") + ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), + "Range size.") + ("maxThreads", po::value(&maxThreads)->default_value(maxThreads), + "Maximum number of threads to use.") + ("labels,l", po::value(&labelsFilepath)->required(), + "Labels image from seams estimation.") + ("useTiling,n", po::value(&useTiling)->default_value(useTiling), + "Use tiling for compositing."); + // clang-format on CmdLine cmdline( "Performs the panorama stiching of warped images, with an option to use constraints from precomputed seams maps.\n" diff --git a/src/software/pipeline/main_panoramaEstimation.cpp b/src/software/pipeline/main_panoramaEstimation.cpp index 27a3d34448..5a5407a54d 100644 --- a/src/software/pipeline/main_panoramaEstimation.cpp +++ b/src/software/pipeline/main_panoramaEstimation.cpp @@ -57,55 +57,56 @@ int aliceVision_main(int argc, char** argv) sfm::ReconstructionEngine_panorama::Params params; + // clang-format off po::options_description requiredParams("Required parameters"); - requiredParams.add_options()("input,i", po::value(&sfmDataFilename)->required(), "SfMData file.")( - "output,o", po::value(&outputSfMDataFilepath)->required(), "Path of the output SfMData file.")( - "featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features.")( - "matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), - "Path to folder(s) in which computed matches are stored."); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputSfMDataFilepath)->required(), + "Path of the output SfMData file.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features.") + ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), + "Path to folder(s) in which computed matches are stored."); po::options_description optionalParams("Optional parameters"); - optionalParams.add_options()("describerTypes,d", - po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str())( - "rotationAveraging", - po::value(¶ms.eRotationAveragingMethod) - ->default_value(params.eRotationAveragingMethod), - "* 1: L1 minimization\n" - "* 2: L2 minimization")("relativeRotation", - po::value(¶ms.eRelativeRotationMethod) - ->default_value(params.eRelativeRotationMethod), - "* from essential matrix" - "* from rotation matrix" - "* from homography matrix")( - "rotationAveragingWeighting", - po::value(¶ms.rotationAveragingWeighting)->default_value(params.rotationAveragingWeighting), - "Use weighting of image links during rotation averaging.")( - "offsetLongitude", po::value(&offsetLongitude)->default_value(offsetLongitude), - "offset to camera longitude")( - "offsetLatitude", po::value(&offsetLatitude)->default_value(offsetLatitude), - "offset to camera latitude")("filterMatches", po::value(&filterMatches)->default_value(filterMatches), - "Filter Matches before solving the Panorama.")( - "refine", po::value(&refine)->default_value(refine), "Refine cameras with a Bundle Adjustment")( - "lockAllIntrinsics", po::value(¶ms.lockAllIntrinsics)->default_value(params.lockAllIntrinsics), - "Force lock of all camera intrinsic parameters, so they will not be refined during Bundle Adjustment.") + optionalParams.add_options() + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()) + ("rotationAveraging", po::value(¶ms.eRotationAveragingMethod)->default_value(params.eRotationAveragingMethod), + "* 1: L1 minimization\n" + "* 2: L2 minimization") + ("relativeRotation", po::value(¶ms.eRelativeRotationMethod)->default_value(params.eRelativeRotationMethod), + "* from essential matrix\n" + "* from rotation matrix\n" + "* from homography matrix") + ("rotationAveragingWeighting", po::value(¶ms.rotationAveragingWeighting)->default_value(params.rotationAveragingWeighting), + "Use weighting of image links during rotation averaging.") + ("offsetLongitude", po::value(&offsetLongitude)->default_value(offsetLongitude), + "Offset to camera longitude.") + ("offsetLatitude", po::value(&offsetLatitude)->default_value(offsetLatitude), + "Offset to camera latitude.") + ("filterMatches", po::value(&filterMatches)->default_value(filterMatches), + "Filter matches before solving the Panorama.") + ("refine", po::value(&refine)->default_value(refine), + "Refine cameras with a Bundle Adjustment") + ("lockAllIntrinsics", po::value(¶ms.lockAllIntrinsics)->default_value(params.lockAllIntrinsics), + "Force lock of all camera intrinsic parameters, so they will not be refined during Bundle Adjustment.") ("maxAngleToPrior", po::value(¶ms.maxAngleToPrior)->default_value(params.maxAngleToPrior), - "Maximal angle allowed regarding the input prior.") + "Maximal angle allowed regarding the input prior.") ("maxAngleToPriorRefined", po::value(¶ms.maxAngleToPriorRefined)->default_value(params.maxAngleToPriorRefined), - "Maximal angle allowed regarding the input prior after refinement.") + "Maximal angle allowed regarding the input prior after refinement.") ("maxAngularError", po::value(¶ms.maxAngularError)->default_value(params.maxAngularError), - "Maximal angular error in global rotation averaging.")( - "intermediateRefineWithFocal", - po::value(¶ms.intermediateRefineWithFocal)->default_value(params.intermediateRefineWithFocal), - "Add an intermediate refine with rotation+focal in the different BA steps.")( - "intermediateRefineWithFocalDist", - po::value(¶ms.intermediateRefineWithFocalDist)->default_value(params.intermediateRefineWithFocalDist), - "Add an intermediate refine with rotation+focal+distortion in the different BA steps.")( - "outputViewsAndPoses", po::value(&outputViewsAndPosesFilepath), - "Path of the output SfMData file.")( - "randomSeed", po::value(&randomSeed)->default_value(randomSeed), - "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); + "Maximal angular error in global rotation averaging.") + ("intermediateRefineWithFocal", po::value(¶ms.intermediateRefineWithFocal)->default_value(params.intermediateRefineWithFocal), + "Add an intermediate refine with rotation+focal in the different BA steps.") + ("intermediateRefineWithFocalDist", po::value(¶ms.intermediateRefineWithFocalDist)->default_value(params.intermediateRefineWithFocalDist), + "Add an intermediate refine with rotation+focal+distortion in the different BA steps.") + ("outputViewsAndPoses", po::value(&outputViewsAndPosesFilepath), + "Path of the output SfMData file.") + ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); + // clang-format on CmdLine cmdline("Estimates the orientation of a camera around a nodal point for the creation of a 360° panorama.\n" "AliceVision panoramaEstimation"); diff --git a/src/software/pipeline/main_panoramaInit.cpp b/src/software/pipeline/main_panoramaInit.cpp index 93d2bc03f7..9742be68fe 100644 --- a/src/software/pipeline/main_panoramaInit.cpp +++ b/src/software/pipeline/main_panoramaInit.cpp @@ -869,35 +869,44 @@ int main(int argc, char* argv[]) int contactSheetItemMaxSize = 256; // Command line parameters - + // clang-format off po::options_description requiredParams("Required parameters"); - requiredParams.add_options()("input,i", po::value(&sfmInputDataFilepath)->required(), - "SfMData file input.")( - "outSfMData,o", po::value(&sfmOutputDataFilepath)->required(), "SfMData file output."); + requiredParams.add_options() + ("input,i", po::value(&sfmInputDataFilepath)->required(), + "SfMData file input.") + ("outSfMData,o", po::value(&sfmOutputDataFilepath)->required(), + "SfMData file output."); po::options_description motorizedHeadParams("Motorized Head parameters"); - motorizedHeadParams.add_options()("config,c", po::value(&externalInfoFilepath), - "External info xml file from a motorized head system.")( - "inputAngle,a", po::value(&inputAngleString), "External info xml additional angle.")( - "yawCW", po::value(&yawCW), "Yaw rotation is ClockWise or ConterClockWise.")( - "initializeCameras", po::value(&initializeCameras), "Initialization type for the cameras poses.")( - "nbViewsPerLine", po::value(&nbViewsPerLineString), - "Number of views per line splitted by comma. For instance, \"2,4,*,4,2\".")( - "buildContactSheet", po::value(&buildContactSheet)->default_value(buildContactSheet), - "Build a contact sheet"); + motorizedHeadParams.add_options() + ("config,c", po::value(&externalInfoFilepath), + "External info xml file from a motorized head system.") + ("inputAngle,a", po::value(&inputAngleString), + "External info xml additional angle.") + ("yawCW", po::value(&yawCW), + "Yaw rotation is ClockWise or ConterClockWise.") + ("initializeCameras", po::value(&initializeCameras), + "Initialization type for the cameras poses.") + ("nbViewsPerLine", po::value(&nbViewsPerLineString), + "Number of views per line splitted by comma. For instance, \"2,4,*,4,2\".") + ("buildContactSheet", po::value(&buildContactSheet)->default_value(buildContactSheet), + "Build a contact sheet"); po::options_description fisheyeParams("Fisheye parameters"); - fisheyeParams.add_options()("useFisheye", po::value(&useFisheye), - "Declare all input images as fisheye with 'equidistant' model.")( - "estimateFisheyeCircle", po::value(&estimateFisheyeCircle), - "Automatically estimate the Fisheye Circle center and radius instead of using user values.")( - "fisheyeCenterOffset_x", po::value(&fisheyeCenterOffset(0)), - "Fisheye circle's center offset X (pixels).")("fisheyeCenterOffset_y", - po::value(&fisheyeCenterOffset(1)), - "Fisheye circle's center offset Y (pixels).")( - "fisheyeRadius,r", po::value(&fisheyeRadius), "Fisheye circle's radius (% of image shortest side).")( - "debugFisheyeCircleEstimation", po::value(&debugFisheyeCircleEstimation), - "Debug fisheye circle detection."); + fisheyeParams.add_options() + ("useFisheye", po::value(&useFisheye), + "Declare all input images as fisheye with 'equidistant' model.") + ("estimateFisheyeCircle", po::value(&estimateFisheyeCircle), + "Automatically estimate the Fisheye Circle center and radius instead of using user values.") + ("fisheyeCenterOffset_x", po::value(&fisheyeCenterOffset(0)), + "Fisheye circle's center offset X (pixels).") + ("fisheyeCenterOffset_y", po::value(&fisheyeCenterOffset(1)), + "Fisheye circle's center offset Y (pixels).") + ("fisheyeRadius,r", po::value(&fisheyeRadius), + "Fisheye circle's radius (% of image shortest side).") + ("debugFisheyeCircleEstimation", po::value(&debugFisheyeCircleEstimation), + "Debug fisheye circle detection."); + // clang-format on CmdLine cmdline("Initialize information on the panorama pipeline's input images, specifically from a file " "generated by a motorized head system.\n" diff --git a/src/software/pipeline/main_panoramaMerging.cpp b/src/software/pipeline/main_panoramaMerging.cpp index 19af3cf960..8d2700e3e9 100644 --- a/src/software/pipeline/main_panoramaMerging.cpp +++ b/src/software/pipeline/main_panoramaMerging.cpp @@ -48,21 +48,28 @@ int aliceVision_main(int argc, char** argv) bool useTiling = true; // Description of mandatory parameters + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmDataFilepath)->required(), "Input sfmData.") - ("compositingFolder,w", po::value(&compositingFolder)->required(), "Folder with composited images.") - ("outputPanorama,o", po::value(&outputPanoramaPath)->required(), "Path of the output panorama."); + ("input,i", po::value(&sfmDataFilepath)->required(), + "Input SfMData.") + ("compositingFolder,w", po::value(&compositingFolder)->required(), + "Folder with composited images.") + ("outputPanorama,o", po::value(&outputPanoramaPath)->required(), + "Path of the output panorama."); // Description of optional parameters po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("storageDataType", po::value(&storageDataType)->default_value(storageDataType), ("Storage data type: " + image::EStorageDataType_informations()).c_str()) - ("useTiling,n", po::value(&useTiling)->default_value(useTiling), "use tiling for compositing."); + ("storageDataType", po::value(&storageDataType)->default_value(storageDataType), + ("Storage data type: " + image::EStorageDataType_informations()).c_str()) + ("useTiling,n", po::value(&useTiling)->default_value(useTiling), + "Use tiling for compositing."); + // clang-format on CmdLine cmdline( "Merges all the image tiles created by the PanoramaCompositing.\n" - "AliceVision PanoramaMerging"); + "AliceVision panoramaMerging"); cmdline.add(requiredParams); cmdline.add(optionalParams); if (!cmdline.execute(argc, argv)) diff --git a/src/software/pipeline/main_panoramaPostProcessing.cpp b/src/software/pipeline/main_panoramaPostProcessing.cpp index 3cb7b27257..e868ae5f92 100644 --- a/src/software/pipeline/main_panoramaPostProcessing.cpp +++ b/src/software/pipeline/main_panoramaPostProcessing.cpp @@ -251,32 +251,40 @@ int aliceVision_main(int argc, char** argv) int lastLevelMaxSize = 3840; // Description of mandatory parameters + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("inputPanorama,i", po::value(&inputPanoramaPath)->required(), "Input Panorama.") - ("outputPanorama,o", po::value(&outputPanoramaPath)->required(), "Path of the output panorama."); + ("inputPanorama,i", po::value(&inputPanoramaPath)->required(), + "Input panorama.") + ("outputPanorama,o", po::value(&outputPanoramaPath)->required(), + "Path of the output panorama."); // Description of optional parameters po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("storageDataType", po::value(&storageDataType)->default_value(storageDataType), ("Storage data type: " + image::EStorageDataType_informations()).c_str()) - + ("storageDataType", po::value(&storageDataType)->default_value(storageDataType), + ("Storage data type: " + image::EStorageDataType_informations()).c_str()) ("compressionMethod", po::value(&compressionMethod)->default_value(compressionMethod), - ("Compression Method: " + image::EImageExrCompression_informations()).c_str()) - + ("Compression method: " + image::EImageExrCompression_informations()).c_str()) ("compressionLevel", po::value(&compressionLevel)->default_value(compressionLevel), - "Compression Level (must be strictly positive to be considered)\n" + "Compression Level (must be strictly positive to be considered).\n" "Only dwaa, dwab, zip and zips compression methods are concerned.") - - ("fillHoles", po::value(&fillHoles)->default_value(fillHoles), "Execute fill holes algorithm") - ("exportLevels", po::value(&exportLevels)->default_value(exportLevels), "Export downscaled panorama levels") - ("lastLevelMaxSize", po::value(&lastLevelMaxSize)->default_value(lastLevelMaxSize), "Maximum width of smallest downscaled panorama level.") - ("previewSize", po::value(&previewSize)->default_value(previewSize), "Preview image width") - ("outputColorSpace", po::value(&outputColorSpace)->default_value(outputColorSpace), "Color space for the output panorama.") - ("outputPanoramaPreview,p", po::value(&outputPanoramaPreviewPath)->default_value(outputPanoramaPreviewPath), "Path of the output panorama preview."); + ("fillHoles", po::value(&fillHoles)->default_value(fillHoles), + "Execute fill holes algorithm.") + ("exportLevels", po::value(&exportLevels)->default_value(exportLevels), + "Export downscaled panorama levels.") + ("lastLevelMaxSize", po::value(&lastLevelMaxSize)->default_value(lastLevelMaxSize), + "Maximum width of smallest downscaled panorama level.") + ("previewSize", po::value(&previewSize)->default_value(previewSize), + "Preview image width.") + ("outputColorSpace", po::value(&outputColorSpace)->default_value(outputColorSpace), + "Color space for the output panorama.") + ("outputPanoramaPreview,p", po::value(&outputPanoramaPreviewPath)->default_value(outputPanoramaPreviewPath), + "Path of the output panorama preview."); + // clang-format on CmdLine cmdline("This program performs estimation of cameras orientation around a nodal point for 360° panorama.\n" - "AliceVision PanoramaPostProcessing"); + "AliceVision panoramaPostProcessing"); cmdline.add(requiredParams); cmdline.add(optionalParams); if (!cmdline.execute(argc, argv)) diff --git a/src/software/pipeline/main_panoramaPrepareImages.cpp b/src/software/pipeline/main_panoramaPrepareImages.cpp index 95a4c829e3..5e63f0c507 100644 --- a/src/software/pipeline/main_panoramaPrepareImages.cpp +++ b/src/software/pipeline/main_panoramaPrepareImages.cpp @@ -70,12 +70,14 @@ int aliceVision_main(int argc, char* argv[]) std::string sfmOutputDataFilename; // Command line parameters + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmInputDataFilename)->required(), "SfMData file input.") ("output,o", po::value(&sfmOutputDataFilename)->required(), "SfMData file output."); + // clang-format on CmdLine cmdline("Prepares images for use in the panorama pipeline " "by correcting inconsistent orientations caused by the camera being in zenith or nadir position.\n" diff --git a/src/software/pipeline/main_panoramaSeams.cpp b/src/software/pipeline/main_panoramaSeams.cpp index e00197f946..0055d175b4 100644 --- a/src/software/pipeline/main_panoramaSeams.cpp +++ b/src/software/pipeline/main_panoramaSeams.cpp @@ -186,18 +186,26 @@ int aliceVision_main(int argc, char** argv) image::EStorageDataType storageDataType = image::EStorageDataType::Float; // Description of mandatory parameters + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmDataFilepath)->required(), "Input sfmData.") - ("warpingFolder,w", po::value(&warpingFolder)->required(), "Folder with warped images.") - ("output,o", po::value(&outputLabels)->required(), "Path of the output labels.") - ("outputSfm,o", po::value(&sfmOutDataFilepath)->required(), "Path of the output SfMData file."); + ("input,i", po::value(&sfmDataFilepath)->required(), + "Input SfMData.") + ("warpingFolder,w", po::value(&warpingFolder)->required(), + "Folder with warped images.") + ("output,o", po::value(&outputLabels)->required(), + "Path of the output labels.") + ("outputSfm,o", po::value(&sfmOutDataFilepath)->required(), + "Path of the output SfMData file."); // Description of optional parameters po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("maxWidth", po::value(&maxPanoramaWidth)->required(), "Max Panorama Width.") - ("useGraphCut,g", po::value(&useGraphCut)->default_value(useGraphCut), "Enable graphcut algorithm to improve seams."); + ("maxWidth", po::value(&maxPanoramaWidth)->required(), + "Maximum panorama width.") + ("useGraphCut,g", po::value(&useGraphCut)->default_value(useGraphCut), + "Enable graphcut algorithm to improve seams."); + // clang-format on CmdLine cmdline("Estimates the ideal path for the transition between images in order to minimize seams artifacts.\n" "AliceVision panoramaSeams"); diff --git a/src/software/pipeline/main_panoramaWarping.cpp b/src/software/pipeline/main_panoramaWarping.cpp index 448d60cc9f..a0ff875a8c 100644 --- a/src/software/pipeline/main_panoramaWarping.cpp +++ b/src/software/pipeline/main_panoramaWarping.cpp @@ -113,25 +113,32 @@ int aliceVision_main(int argc, char** argv) // Program description // Description of mandatory parameters + // clang-format off po::options_description requiredParams("Required parameters"); - requiredParams.add_options()("input,i", po::value(&sfmDataFilename)->required(), "SfMData file.")( - "output,o", po::value(&outputDirectory)->required(), "Path of the output folder."); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputDirectory)->required(), + "Path of the output folder."); // Description of optional parameters po::options_description optionalParams("Optional parameters"); - optionalParams.add_options()("panoramaWidth,w", - po::value(&panoramaSize.first)->default_value(panoramaSize.first), - "Panorama Width in pixels.")( - "maxPanoramaWidth", po::value(&maxPanoramaWidth)->default_value(maxPanoramaWidth), - "Max Panorama Width in pixels.")("percentUpscale", - po::value(&percentUpscale)->default_value(percentUpscale), - "Percentage of upscaled pixels.")( - "workingColorSpace", po::value(&workingColorSpace)->default_value(workingColorSpace), - ("Output color space: " + image::EImageColorSpace_informations()).c_str())( - "storageDataType", po::value(&storageDataType)->default_value(storageDataType), - ("Storage data type: " + image::EStorageDataType_informations()).c_str())( - "rangeStart", po::value(&rangeStart)->default_value(rangeStart), - "Range image index start.")("rangeSize", po::value(&rangeSize)->default_value(rangeSize), "Range size."); + optionalParams.add_options() + ("panoramaWidth,w", po::value(&panoramaSize.first)->default_value(panoramaSize.first), + "Panorama width in pixels.") + ("maxPanoramaWidth", po::value(&maxPanoramaWidth)->default_value(maxPanoramaWidth), + "Maximum panorama width in pixels.") + ("percentUpscale", po::value(&percentUpscale)->default_value(percentUpscale), + "Percentage of upscaled pixels.") + ("workingColorSpace", po::value(&workingColorSpace)->default_value(workingColorSpace), + ("Output color space: " + image::EImageColorSpace_informations()).c_str()) + ("storageDataType", po::value(&storageDataType)->default_value(storageDataType), + ("Storage data type: " + image::EStorageDataType_informations()).c_str()) + ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), + "Range image index start.") + ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), + "Range size."); + // clang-format on CmdLine cmdline("Warps the input images in the panorama coordinate system.\n" "AliceVision panoramaWarping"); diff --git a/src/software/pipeline/main_photometricStereo.cpp b/src/software/pipeline/main_photometricStereo.cpp index bcf936d1c1..3a947debe1 100644 --- a/src/software/pipeline/main_photometricStereo.cpp +++ b/src/software/pipeline/main_photometricStereo.cpp @@ -63,6 +63,7 @@ int aliceVision_main(int argc, char **argv) // PhotometricStereo parameters photometricStereo::PhotometricSteroParameters PSParameters; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("inputPath,i", po::value(&inputPath)->required(), @@ -84,6 +85,7 @@ int aliceVision_main(int argc, char **argv) "True to use the robust algorithm, false otherwise.") ("downscale, d", po::value(&PSParameters.downscale)->default_value(1), "Downscale factor for faster results."); + // clang-format on CmdLine cmdline("AliceVision photometricStereo"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_prepareDenseScene.cpp b/src/software/pipeline/main_prepareDenseScene.cpp index a76ddc4d18..5181358c1d 100644 --- a/src/software/pipeline/main_prepareDenseScene.cpp +++ b/src/software/pipeline/main_prepareDenseScene.cpp @@ -294,6 +294,7 @@ int aliceVision_main(int argc, char *argv[]) bool saveMatricesTxtFiles = false; bool evCorrection = false; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), @@ -305,10 +306,10 @@ int aliceVision_main(int argc, char *argv[]) optionalParams.add_options() ("imagesFolders", po::value>(&imagesFolders)->multitoken(), "Use images from specific folder(s) instead of those specify in the SfMData file.\n" - "Filename should be the same or the image uid.") + "Filename should be the same or the image UID.") ("masksFolders", po::value>(&masksFolders)->multitoken(), "Use masks from specific folder(s).\n" - "Filename should be the same or the image uid.") + "Filename should be the same or the image UID.") ("maskExtension", po::value(&maskExtension)->default_value(maskExtension), "File extension of the masks to use.") ("outputFileType", po::value(&outImageFileTypeName)->default_value(outImageFileTypeName), @@ -323,6 +324,7 @@ int aliceVision_main(int argc, char *argv[]) "Range size.") ("evCorrection", po::value(&evCorrection)->default_value(evCorrection), "Correct exposure value."); + // clang-format on CmdLine cmdline("AliceVision prepareDenseScene"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_relativePoseEstimating.cpp b/src/software/pipeline/main_relativePoseEstimating.cpp index be9f753097..e18aa64356 100644 --- a/src/software/pipeline/main_relativePoseEstimating.cpp +++ b/src/software/pipeline/main_relativePoseEstimating.cpp @@ -251,24 +251,33 @@ int aliceVision_main(int argc, char** argv) // user optional parameters std::string describerTypesName = feature::EImageDescriberType_enumToString(feature::EImageDescriberType::SIFT); - int randomSeed = std::mt19937::default_seed; + // clang-format off po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), "SfMData file.") - ("tracksFilename,t", po::value(&tracksFilename)->required(), "Tracks file.") - ("output,o", po::value(&outputDirectory)->required(), "Path to the output directory."); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("tracksFilename,t", po::value(&tracksFilename)->required(), + "Tracks file.") + ("output,o", po::value(&outputDirectory)->required(), + "Path to the output directory."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), "Path to folder(s) containing the extracted features.") - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName),feature::EImageDescriberType_informations().c_str()) - ("enforcePureRotation,e", po::value(&enforcePureRotation)->default_value(enforcePureRotation), "Enforce pure rotation in estimation.") - ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), "Range image index start.") - ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), "Range size."); - - CmdLine cmdline("AliceVision Relative Pose Estimating"); + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), + "Path to folder(s) containing the extracted features.") + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()) + ("enforcePureRotation,e", po::value(&enforcePureRotation)->default_value(enforcePureRotation), + "Enforce pure rotation in estimation.") + ("rangeStart", po::value(&rangeStart)->default_value(rangeStart), + "Range image index start.") + ("rangeSize", po::value(&rangeSize)->default_value(rangeSize), + "Range size."); + // clang-format on + + CmdLine cmdline("AliceVision relativePoseEstimating"); cmdline.add(requiredParams); cmdline.add(optionalParams); diff --git a/src/software/pipeline/main_rigCalibration.cpp b/src/software/pipeline/main_rigCalibration.cpp index cec3f44eb4..ad2f125b12 100644 --- a/src/software/pipeline/main_rigCalibration.cpp +++ b/src/software/pipeline/main_rigCalibration.cpp @@ -112,81 +112,78 @@ int aliceVision_main(int argc, char** argv) std::size_t numCameras = 0; - po::options_description ioParams("Required input and output parameters"); - ioParams.add_options() - ("sfmdata", po::value(&sfmFilePath)->required(), - "The sfm_data.json kind of file generated by AliceVision.") - ("mediapath", po::value >(&mediaPath)->multitoken()->required(), - "The path to the video file, the folder of the image sequence or a text " - "file (one image path per line) for each camera of the rig " - "(eg. --mediapath /path/to/cam1.mov /path/to/cam2.mov).") - ("cameraIntrinsics", po::value >(&cameraIntrinsics)->multitoken()->required(), - "The intrinsics calibration file for each camera of the rig. " - "(eg. --cameraIntrinsics /path/to/calib1.txt /path/to/calib2.txt).") - ("outfile,o", po::value(&outputFile)->required(), - "The name of the file where to store the calibration data"); - - po::options_description commonParams("Common optional parameters for the localizer"); - commonParams.add_options() - ("descriptorPath", po::value(&descriptorsFolder), - "Folder containing the .desc.") - ("matchDescTypes", po::value(&matchDescTypeNames)->default_value(matchDescTypeNames), - "The describer types to use for the matching") - ("preset", po::value(&featDescPreset.descPreset)->default_value(featDescPreset.descPreset), - "Preset for the feature extractor when localizing a new image " - "{LOW,MEDIUM,NORMAL,HIGH,ULTRA}") - ("resectionEstimator", po::value(&resectionEstimator)->default_value(resectionEstimator), - std::string("The type of *sac framework to use for resection " - "("+str_estimatorChoices+")").c_str()) - ("matchingEstimator", po::value(&matchingEstimator)->default_value(matchingEstimator), - std::string("The type of *sac framework to use for matching " - "("+str_estimatorChoices+")").c_str()) - ("refineIntrinsics", po::value(&refineIntrinsics), - "Enable/Disable camera intrinsics refinement for each localized image") - ("reprojectionError", po::value(&resectionErrorMax)->default_value(resectionErrorMax), - "Maximum reprojection error (in pixels) allowed for resectioning. If set " - "to 0 it lets the ACRansac select an optimal value.") - ("maxInputFrames", po::value(&maxInputFrames)->default_value(maxInputFrames), - "Maximum number of frames to read in input. 0 means no limit.") - ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), - "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.") - ; - - // parameters for voctree localizer - po::options_description voctreeParams("Parameters specific for the vocabulary tree-based localizer"); - voctreeParams.add_options() - ("voctree", po::value(&vocTreeFilepath), - "[voctree] Filename for the vocabulary tree") - ("voctreeWeights", po::value(&weightsFilepath), - "[voctree] Filename for the vocabulary tree weights") - ("algorithm", po::value(&algostring)->default_value(algostring), - "[voctree] Algorithm type: {FirstBest,AllResults}" ) - ("nbImageMatch", po::value(&numResults)->default_value(numResults), - "[voctree] Number of images to retrieve in the database") - ("maxResults", po::value(&maxResults)->default_value(maxResults), - "[voctree] For algorithm AllResults, it stops the image matching when " - "this number of matched images is reached. If 0 it is ignored.") - ("matchingError", po::value(&matchingErrorMax)->default_value(matchingErrorMax), - "[voctree] Maximum matching error (in pixels) allowed for image matching with " - "geometric verification. If set to 0 it lets the ACRansac select " - "an optimal value.") -#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) - // parameters for cctag localizer - ("nNearestKeyFrames", po::value(&nNearestKeyFrames)->default_value(nNearestKeyFrames), - "[cctag] Number of images to retrieve in database") -#endif - ; - - // output options - po::options_description outputParams("Options for the output of the localizer"); - outputParams.add_options() - ("help,h", "Print this message") -#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_ALEMBIC) - ("export,e", po::value(&exportFile)->default_value(exportFile), - "Filename for the alembic file containing the rig poses with the 3D points. " - "It also saves a file for each camera named 'filename.cam##.abc'.") -#endif - ; + // clang-format off + po::options_description ioParams("Required input and output parameters"); + ioParams.add_options() + ("sfmdata", po::value(&sfmFilePath)->required(), + "The sfm_data.json kind of file generated by AliceVision.") + ("mediapath", po::value >(&mediaPath)->multitoken()->required(), + "The path to the video file, the folder of the image sequence or a text " + "file (one image path per line) for each camera of the rig " + "(eg. --mediapath /path/to/cam1.mov /path/to/cam2.mov).") + ("cameraIntrinsics", po::value >(&cameraIntrinsics)->multitoken()->required(), + "The intrinsics calibration file for each camera of the rig. " + "(eg. --cameraIntrinsics /path/to/calib1.txt /path/to/calib2.txt).") + ("outfile,o", po::value(&outputFile)->required(), + "The name of the file where to store the calibration data."); + + po::options_description commonParams("Common optional parameters for the localizer"); + commonParams.add_options() + ("descriptorPath", po::value(&descriptorsFolder), + "Folder containing the .desc.") + ("matchDescTypes", po::value(&matchDescTypeNames)->default_value(matchDescTypeNames), + "The describer types to use for the matching.") + ("preset", po::value(&featDescPreset.descPreset)->default_value(featDescPreset.descPreset), + "Preset for the feature extractor when localizing a new image {LOW,MEDIUM,NORMAL,HIGH,ULTRA}.") + ("resectionEstimator", po::value(&resectionEstimator)->default_value(resectionEstimator), + std::string("The type of *sac framework to use for resection (" + str_estimatorChoices + ").").c_str()) + ("matchingEstimator", po::value(&matchingEstimator)->default_value(matchingEstimator), + std::string("The type of *sac framework to use for matching (" + str_estimatorChoices + ")").c_str()) + ("refineIntrinsics", po::value(&refineIntrinsics), + "Enable/Disable camera intrinsics refinement for each localized image.") + ("reprojectionError", po::value(&resectionErrorMax)->default_value(resectionErrorMax), + "Maximum reprojection error (in pixels) allowed for resectioning. If set to 0, " + "it lets the ACRansac select an optimal value.") + ("maxInputFrames", po::value(&maxInputFrames)->default_value(maxInputFrames), + "Maximum number of frames to read in input. 0 means no limit.") + ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); + + // parameters for voctree localizer + po::options_description voctreeParams("Parameters specific for the vocabulary tree-based localizer"); + voctreeParams.add_options() + ("voctree", po::value(&vocTreeFilepath), + "[voctree] Filename for the vocabulary tree.") + ("voctreeWeights", po::value(&weightsFilepath), + "[voctree] Filename for the vocabulary tree weights.") + ("algorithm", po::value(&algostring)->default_value(algostring), + "[voctree] Algorithm type: {FirstBest,AllResults}.") + ("nbImageMatch", po::value(&numResults)->default_value(numResults), + "[voctree] Number of images to retrieve in the database.") + ("maxResults", po::value(&maxResults)->default_value(maxResults), + "[voctree] For algorithm AllResults, it stops the image matching when " + "this number of matched images is reached. If 0 it is ignored.") + ("matchingError", po::value(&matchingErrorMax)->default_value(matchingErrorMax), + "[voctree] Maximum matching error (in pixels) allowed for image matching with " + "geometric verification. If set to 0 it lets the ACRansac select an optimal value.") + #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) + // parameters for cctag localizer + ("nNearestKeyFrames", po::value(&nNearestKeyFrames)->default_value(nNearestKeyFrames), + "[cctag] Number of images to retrieve in database.") + #endif + ; + + // output options + po::options_description outputParams("Options for the output of the localizer"); + outputParams.add_options() + ("help,h", "Print this message.") + #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_ALEMBIC) + ("export,e", po::value(&exportFile)->default_value(exportFile), + "Filename for the Alembic file containing the rig poses with the 3D points. " + "It also saves a file for each camera named 'filename.cam##.abc'.") + #endif + ; + // clang-format on CmdLine cmdline("This program is used to calibrate a camera rig composed of internally calibrated cameras." "It takes as input a synchronized sequence of N cameras and it saves the estimated " diff --git a/src/software/pipeline/main_rigLocalization.cpp b/src/software/pipeline/main_rigLocalization.cpp index 8a8fcc569b..d38086a082 100644 --- a/src/software/pipeline/main_rigLocalization.cpp +++ b/src/software/pipeline/main_rigLocalization.cpp @@ -114,87 +114,82 @@ int aliceVision_main(int argc, char** argv) int randomSeed = std::mt19937::default_seed; - - po::options_description inputParams("Required input parameters"); - inputParams.add_options() - ("sfmdata", po::value(&sfmFilePath)->required(), - "The sfm_data.json kind of file generated by AliceVision.") - ("mediapath", po::value >(&mediaPath)->multitoken()->required(), - "The path to the video file, the folder of the image sequence or a text " - "file (one image path per line) for each camera of the rig " - "(eg. --mediapath /path/to/cam1.mov /path/to/cam2.mov).") - ("calibration", po::value(&rigCalibPath)->required(), - "The file containing the calibration data for the rig (subposes)") - ("cameraIntrinsics", po::value >(&cameraIntrinsics)->multitoken()->required(), - "The intrinsics calibration file for each camera of the rig. " - "(eg. --cameraIntrinsics /path/to/calib1.txt /path/to/calib2.txt)."); - - po::options_description commonParams("Common optional parameters for the localizer"); - commonParams.add_options() - ("descriptorPath", po::value(&descriptorsFolder), - "Folder containing the .desc.") - ("matchDescTypes", po::value(&matchDescTypeNames)->default_value(matchDescTypeNames), - "The describer types to use for the matching") - ("preset", po::value(&featDescPreset.descPreset)->default_value(featDescPreset.descPreset), - "Preset for the feature extractor when localizing a new image " - "{LOW,MEDIUM,NORMAL,HIGH,ULTRA}") - ("resectionEstimator", po::value(&resectionEstimator)->default_value(resectionEstimator), - std::string("The type of *sac framework to use for resection " - "("+str_estimatorChoices+")").c_str()) - ("matchingEstimator", po::value(&matchingEstimator)->default_value(matchingEstimator), - std::string("The type of *sac framework to use for matching " - "("+str_estimatorChoices+")").c_str()) - ("refineIntrinsics", po::value(&refineIntrinsics), - "Enable/Disable camera intrinsics refinement for each localized image") - ("reprojectionError", po::value(&resectionErrorMax)->default_value(resectionErrorMax), - "Maximum reprojection error (in pixels) allowed for resectioning. If set " - "to 0 it lets the ACRansac select an optimal value.") - ("useLocalizeRigNaive", po::value(&useLocalizeRigNaive), - "Enable/Disable the naive method for rig localization: naive method tries " - "to localize each camera separately. This is enabled by default if the " - "library has not been built with openGV.") - ("angularThreshold", po::value(&angularThreshold)->default_value(angularThreshold), - "The maximum angular threshold in degrees between feature bearing vector and 3D " - "point direction. Used only with the opengv method.") - ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), - "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.") - ; - - // parameters for voctree localizer + // clang-format off + po::options_description inputParams("Required input parameters"); + inputParams.add_options() + ("sfmdata", po::value(&sfmFilePath)->required(), + "The sfm_data.json kind of file generated by AliceVision.") + ("mediapath", po::value >(&mediaPath)->multitoken()->required(), + "The path to the video file, the folder of the image sequence or a text " + "file (one image path per line) for each camera of the rig " + "(eg. --mediapath /path/to/cam1.mov /path/to/cam2.mov).") + ("calibration", po::value(&rigCalibPath)->required(), + "The file containing the calibration data for the rig (subposes).") + ("cameraIntrinsics", po::value >(&cameraIntrinsics)->multitoken()->required(), + "The intrinsics calibration file for each camera of the rig. " + "(eg. --cameraIntrinsics /path/to/calib1.txt /path/to/calib2.txt)."); + + po::options_description commonParams("Common optional parameters for the localizer"); + commonParams.add_options() + ("descriptorPath", po::value(&descriptorsFolder), + "Folder containing the .desc.") + ("matchDescTypes", po::value(&matchDescTypeNames)->default_value(matchDescTypeNames), + "The describer types to use for the matching.") + ("preset", po::value(&featDescPreset.descPreset)->default_value(featDescPreset.descPreset), + "Preset for the feature extractor when localizing a new image {LOW,MEDIUM,NORMAL,HIGH,ULTRA}.") + ("resectionEstimator", po::value(&resectionEstimator)->default_value(resectionEstimator), + std::string("The type of *sac framework to use for resection (" + str_estimatorChoices + ").").c_str()) + ("matchingEstimator", po::value(&matchingEstimator)->default_value(matchingEstimator), + std::string("The type of *sac framework to use for matching (" + str_estimatorChoices + ").").c_str()) + ("refineIntrinsics", po::value(&refineIntrinsics), + "Enable/Disable camera intrinsics refinement for each localized image.") + ("reprojectionError", po::value(&resectionErrorMax)->default_value(resectionErrorMax), + "Maximum reprojection error (in pixels) allowed for resectioning. If set to 0, " + "it lets the ACRansac select an optimal value.") + ("useLocalizeRigNaive", po::value(&useLocalizeRigNaive), + "Enable/Disable the naive method for rig localization: naive method tries to localize " + "each camera separately. This is enabled by default if the library has not been built with OpenGV.") + ("angularThreshold", po::value(&angularThreshold)->default_value(angularThreshold), + "The maximum angular threshold in degrees between feature bearing vector and 3D " + "point direction. Used only with the OpenGV method.") + ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); + + // parameters for voctree localizer po::options_description voctreeParams("Parameters specific for the vocabulary tree-based localizer"); voctreeParams.add_options() - ("voctree", po::value(&vocTreeFilepath), - "[voctree] Filename for the vocabulary tree") - ("voctreeWeights", po::value(&weightsFilepath), - "[voctree] Filename for the vocabulary tree weights") - ("algorithm", po::value(&algostring)->default_value(algostring), - "[voctree] Algorithm type: {FirstBest,AllResults}" ) - ("nbImageMatch", po::value(&numResults)->default_value(numResults), - "[voctree] Number of images to retrieve in the database") - ("maxResults", po::value(&maxResults)->default_value(maxResults), - "[voctree] For algorithm AllResults, it stops the image matching when " - "this number of matched images is reached. If 0 it is ignored.") - ("matchingError", po::value(&matchingErrorMax)->default_value(matchingErrorMax), - "[voctree] Maximum matching error (in pixels) allowed for image matching with " - "geometric verification. If set to 0 it lets the ACRansac select " - "an optimal value.") -#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) - // parameters for cctag localizer - ("nNearestKeyFrames", po::value(&nNearestKeyFrames)->default_value(nNearestKeyFrames), - "[cctag] Number of images to retrieve in database") -#endif + ("voctree", po::value(&vocTreeFilepath), + "[voctree] Filename for the vocabulary tree.") + ("voctreeWeights", po::value(&weightsFilepath), + "[voctree] Filename for the vocabulary tree weights.") + ("algorithm", po::value(&algostring)->default_value(algostring), + "[voctree] Algorithm type: {FirstBest,AllResults}.") + ("nbImageMatch", po::value(&numResults)->default_value(numResults), + "[voctree] Number of images to retrieve in the database.") + ("maxResults", po::value(&maxResults)->default_value(maxResults), + "[voctree] For algorithm AllResults, it stops the image matching when " + "this number of matched images is reached. If 0, it is ignored.") + ("matchingError", po::value(&matchingErrorMax)->default_value(matchingErrorMax), + "[voctree] Maximum matching error (in pixels) allowed for image matching with " + "geometric verification. If set to 0, it lets the ACRansac select an optimal value.") + #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_CCTAG) + // parameters for cctag localizer + ("nNearestKeyFrames", po::value(&nNearestKeyFrames)->default_value(nNearestKeyFrames), + "[cctag] Number of images to retrieve in database.") + #endif ; - - // output options - po::options_description outputParams("Options for the output of the localizer"); - outputParams.add_options() - ("help,h", "Print this message") -#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_ALEMBIC) - ("outputAlembic", po::value(&exportAlembicFile)->default_value(exportAlembicFile), - "Filename for the SfMData export file (where camera poses will be stored). " - "Default : trackedcameras.abc.") -#endif - ; + + // output options + po::options_description outputParams("Options for the output of the localizer"); + outputParams.add_options() + ("help,h", "Print this message.") + #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_ALEMBIC) + ("outputAlembic", po::value(&exportAlembicFile)->default_value(exportAlembicFile), + "Filename for the SfMData export file (where camera poses will be stored). " + "Default : trackedcameras.abc.") + #endif + ; + // clang-format on CmdLine cmdline("This program is used to localize a camera rig composed of internally calibrated cameras.\n" "AliceVision rigLocalization"); diff --git a/src/software/pipeline/main_sfmBootstraping.cpp b/src/software/pipeline/main_sfmBootstraping.cpp index cd3f37018a..6000098dfb 100644 --- a/src/software/pipeline/main_sfmBootstraping.cpp +++ b/src/software/pipeline/main_sfmBootstraping.cpp @@ -304,14 +304,22 @@ int aliceVision_main(int argc, char** argv) int randomSeed = std::mt19937::default_seed; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), "SfMData file.") - ("output,o", po::value(&sfmDataOutputFilename)->required(), "SfMData output file.") - ("tracksFilename,t", po::value(&tracksFilename)->required(), "Tracks file.") - ("pairs,p", po::value(&pairsDirectory)->required(), "Path to the pairs directory.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), "Path to folder(s) containing the extracted features.") - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName),feature::EImageDescriberType_informations().c_str()); + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&sfmDataOutputFilename)->required(), + "SfMData output file.") + ("tracksFilename,t", po::value(&tracksFilename)->required(), + "Tracks file.") + ("pairs,p", po::value(&pairsDirectory)->required(), + "Path to the pairs directory.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), + "Path to folder(s) containing the extracted features.") + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()); + // clang-format on CmdLine cmdline("AliceVision SfM Bootstraping"); diff --git a/src/software/pipeline/main_sfmTriangulation.cpp b/src/software/pipeline/main_sfmTriangulation.cpp index 9d7f7475c5..694ad8b88a 100644 --- a/src/software/pipeline/main_sfmTriangulation.cpp +++ b/src/software/pipeline/main_sfmTriangulation.cpp @@ -57,51 +57,52 @@ int aliceVision_main(int argc, char** argv) int randomSeed = std::mt19937::default_seed; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file, must contain the camera calibration.") + "SfMData file, must contain the camera calibration.") ("output,o", po::value(&outputSfM)->required(), - "Path to the output SfMData file.") + "Path to the output SfMData file.") ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), - "Path to folder(s) containing the extracted features.") + "Path to folder(s) containing the extracted features.") ("matchesFolders,m", po::value>(&matchesFolders)->multitoken(), - "Path to folder(s) in which computed matches are stored."); + "Path to folder(s) in which computed matches are stored."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("extraInfoFolder", po::value(&extraInfoFolder)->default_value(extraInfoFolder), - "Folder for intermediate reconstruction files and additional reconstruction information files.") + "Folder for intermediate reconstruction files and additional reconstruction information files.") ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()) + feature::EImageDescriberType_informations().c_str()) ("interFileExtension", po::value(&sfmParams.sfmStepFileExtension)->default_value(sfmParams.sfmStepFileExtension), - "Extension of the intermediate file export.") + "Extension of the intermediate file export.") ("maxNumberOfMatches", po::value(&maxNbMatches)->default_value(maxNbMatches), - "Maximum number of matches per image pair (and per feature type). " - "This can be useful to have a quick reconstruction overview. 0 means no limit.") + "Maximum number of matches per image pair (and per feature type). " + "This can be useful to have a quick reconstruction overview. 0 means no limit.") ("minNumberOfMatches", po::value(&minNbMatches)->default_value(minNbMatches), - "Minimum number of matches per image pair (and per feature type). " - "This can be useful to have a meaningful reconstruction with accurate keypoints. 0 means no limit.") + "Minimum number of matches per image pair (and per feature type). " + "This can be useful to have a meaningful reconstruction with accurate keypoints. 0 means no limit.") ("minAngleForTriangulation", po::value(&sfmParams.minAngleForTriangulation)->default_value(sfmParams.minAngleForTriangulation), - "Minimum angle for triangulation.") + "Minimum angle for triangulation.") ("minAngleForLandmark", po::value(&sfmParams.minAngleForLandmark)->default_value(sfmParams.minAngleForLandmark), - "Minimum angle for landmark.") + "Minimum angle for landmark.") ("minNumberOfObservationsForTriangulation", po::value(&sfmParams.minNbObservationsForTriangulation)->default_value(sfmParams.minNbObservationsForTriangulation), - "Minimum number of observations to triangulate a point.\n" - "Set it to 3 (or more) reduces drastically the noise in the point cloud, but the number of final poses is a little bit reduced (from 1.5% to 11% on the tested datasets).\n" - "Note: set it to 0 or 1 to use the old triangulation algorithm (using 2 views only) during resection.") + "Minimum number of observations to triangulate a point.\n" + "Set it to 3 (or more) reduces drastically the noise in the point cloud, but the number of final poses is a " + "little bit reduced (from 1.5% to 11% on the tested datasets).\n" + "Note: set it to 0 or 1 to use the old triangulation algorithm (using 2 views only) during resection.") ("useRigConstraint", po::value(&sfmParams.rig.useRigConstraint)->default_value(sfmParams.rig.useRigConstraint), - "Enable/Disable rig constraint.\n") + "Enable/Disable rig constraint.") ("rigMinNbCamerasForCalibration", po::value(&sfmParams.rig.minNbCamerasForCalibration)->default_value(sfmParams.rig.minNbCamerasForCalibration), - "Minimal number of cameras to start the calibration of the rig.\n") + "Minimal number of cameras to start the calibration of the rig.") ("observationConstraint", po::value(&sfmParams.featureConstraint)->default_value(sfmParams.featureConstraint), - "Use of an observation constraint : basic, scale the observation or use of the covariance.\n") + "Use of an observation constraint: basic, scale the observation or use of the covariance.") ("computeStructureColor", po::value(&computeStructureColor)->default_value(computeStructureColor), - "Compute each 3D point color.\n") + "Compute each 3D point color.") ("randomSeed", po::value(&randomSeed)->default_value(randomSeed), - "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed.") - ; + "This seed value will generate a sequence using a linear random generator. Set -1 to use a random seed."); + // clang-format on CmdLine cmdline("AliceVision SfM Triangulation"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_sphereDetection.cpp b/src/software/pipeline/main_sphereDetection.cpp index 4ff43c84d7..99b9a10ead 100644 --- a/src/software/pipeline/main_sphereDetection.cpp +++ b/src/software/pipeline/main_sphereDetection.cpp @@ -50,6 +50,7 @@ int aliceVision_main(int argc, char** argv) Eigen::Vector2f sphereCenterOffset(0, 0); double sphereRadius = 1.0; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&inputSfMDataPath)->required(), @@ -71,6 +72,7 @@ int aliceVision_main(int argc, char** argv) "Sphere's center offset Y (pixels).") ("sphereRadius,r", po::value(&sphereRadius)->default_value(1.0), "Sphere's radius (pixels)."); + // clang-format on CmdLine cmdline("AliceVision sphereDetection"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_texturing.cpp b/src/software/pipeline/main_texturing.cpp index 4d5e89f331..f93cda9248 100644 --- a/src/software/pipeline/main_texturing.cpp +++ b/src/software/pipeline/main_texturing.cpp @@ -66,77 +66,81 @@ int aliceVision_main(int argc, char* argv[]) image::EImageFileType normalFileType; image::EImageFileType heightFileType; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), - "Dense point cloud SfMData file.") + "Dense point cloud SfMData file.") ("inputMesh", po::value(&inputMeshFilepath)->required(), - "Input mesh to texture.") + "Input mesh to texture.") ("output,o", po::value(&outputFolder)->required(), - "Folder for output mesh"); + "Folder for output mesh."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("inputRefMesh", po::value(&inputRefMeshFilepath), - "Optional input mesh to compute height maps and normal maps. If not provided, no additional maps with geometric information will be generated.") + "Optional input mesh to compute height maps and normal maps. " + "If not provided, no additional maps with geometric information will be generated.") ("imagesFolder", po::value(&imagesFolder), - "Use images from a specific folder instead of those specify in the SfMData file.\n" - "Filename should be the image uid.") + "Use images from a specific folder instead of those specify in the SfMData file.\n" + "Filename should be the image UID.") ("textureSide", po::value(&texParams.textureSide)->default_value(texParams.textureSide), - "Output texture size") + "Output texture size.") ("downscale", po::value(&texParams.downscale)->default_value(texParams.downscale), - "Texture downscale factor") + "Texture downscale factor.") ("outputMeshFileType", po::value(&outputMeshFileType)->default_value(aliceVision::mesh::EFileType::OBJ), - "output mesh file type") + "Output mesh file type.") ("colorMappingFileType", po::value(&texParams.textureFileType)->default_value(texParams.textureFileType), - image::EImageFileType_informations().c_str()) + image::EImageFileType_informations().c_str()) ("heightFileType", po::value(&heightFileType)->default_value(image::EImageFileType::NONE), - image::EImageFileType_informations().c_str()) + image::EImageFileType_informations().c_str()) ("normalFileType", po::value(&normalFileType)->default_value(image::EImageFileType::NONE), - image::EImageFileType_informations().c_str()) + image::EImageFileType_informations().c_str()) ("displacementMappingFileType", po::value(&bumpMappingParams.displacementFileType)->default_value(bumpMappingParams.displacementFileType), - image::EImageFileType_informations().c_str()) + image::EImageFileType_informations().c_str()) ("bumpType", po::value(&bumpMappingParams.bumpType)->default_value(bumpMappingParams.bumpType), - "Use HeightMap for displacement or bump mapping") + "Use HeightMap for displacement or bump mapping.") ("unwrapMethod", po::value(&unwrapMethod)->default_value(unwrapMethod), - "Method to unwrap input mesh if it does not have UV coordinates.\n" - " * Basic (> 600k faces) fast and simple. Can generate multiple atlases.\n" - " * LSCM (<= 600k faces): optimize space. Generates one atlas.\n" - " * ABF (<= 300k faces): optimize space and stretch. Generates one atlas.'") + "Method to unwrap input mesh if it does not have UV coordinates.\n" + " * Basic (> 600k faces) fast and simple. Can generate multiple atlases.\n" + " * LSCM (<= 600k faces): optimize space. Generates one atlas.\n" + " * ABF (<= 300k faces): optimize space and stretch. Generates one atlas.'") ("useUDIM", po::value(&texParams.useUDIM)->default_value(texParams.useUDIM), - "Use UDIM UV mapping.") + "Use UDIM UV mapping.") ("fillHoles", po::value(&texParams.fillHoles)->default_value(texParams.fillHoles), - "Fill texture holes with plausible values.") + "Fill texture holes with plausible values.") ("padding", po::value(&texParams.padding)->default_value(texParams.padding), - "Texture edge padding size in pixel") + "Texture edge padding size in pixels.") ("multiBandDownscale", po::value(&texParams.multiBandDownscale)->default_value(texParams.multiBandDownscale), - "Width of frequency bands.") + "Width of frequency bands.") ("multiBandNbContrib", po::value>(&texParams.multiBandNbContrib)->default_value(texParams.multiBandNbContrib)->multitoken(), - "Number of contributions per frequency band.") + "Number of contributions per frequency band.") ("useScore", po::value(&texParams.useScore)->default_value(texParams.useScore), - "Use triangles scores (based on observations and re-projected areas in source images) for weighting contributions.") + "Use triangles scores (based on observations and re-projected areas in source images) for weighting contributions.") ("bestScoreThreshold", po::value(&texParams.bestScoreThreshold)->default_value(texParams.bestScoreThreshold), - "(0.0 to disable filtering based on threshold to relative best score).") + "(0.0 to disable filtering based on threshold to relative best score).") ("angleHardThreshold", po::value(&texParams.angleHardThreshold)->default_value(texParams.angleHardThreshold), - "(0.0 to disable angle hard threshold filtering).") + "(0.0 to disable angle hard threshold filtering).") ("workingColorSpace", po::value(&workingColorSpace)->default_value(workingColorSpace), - "Color space for the texturing internal computation (does not impact the output file color space).") + "Color space for the texturing internal computation (does not impact the output file color space).") ("outputColorSpace", po::value(&outputColorSpace)->default_value(outputColorSpace), - "Output file colorspace.") + "Output file colorspace.") ("correctEV", po::value(&correctEV)->default_value(correctEV), - "Option to uniformize images exposure.") + "Option to uniformize images exposure.") ("forceVisibleByAllVertices", po::value(&texParams.forceVisibleByAllVertices)->default_value(texParams.forceVisibleByAllVertices), - "triangle visibility is based on the union of vertices visiblity.") + "Triangle visibility is based on the union of vertices visiblity.") ("flipNormals", po::value(&flipNormals)->default_value(flipNormals), - "Option to flip face normals. It can be needed as it depends on the vertices order in triangles and the convention change from one software to another.") + "Option to flip face normals. It can be needed as it depends on the vertices order in triangles and the " + "convention changes from one software to another.") ("visibilityRemappingMethod", po::value(&visibilityRemappingMethod)->default_value(visibilityRemappingMethod), - "Method to remap visibilities from the reconstruction to the input mesh.\n" - " * Pull: For each vertex of the input mesh, pull the visibilities from the closest vertex in the reconstruction.\n" - " * Push: For each vertex of the reconstruction, push the visibilities to the closest triangle in the input mesh.\n" - " * PullPush: Combine results from Pull and Push results.'") + "Method to remap visibilities from the reconstruction to the input mesh.\n" + " * Pull: For each vertex of the input mesh, pull the visibilities from the closest vertex in the reconstruction.\n" + " * Push: For each vertex of the reconstruction, push the visibilities to the closest triangle in the input mesh.\n" + " * PullPush: Combine results from Pull and Push results.'") ("subdivisionTargetRatio", po::value(&texParams.subdivisionTargetRatio)->default_value(texParams.subdivisionTargetRatio), - "Percentage of the density of the reconstruction as the target for the subdivision (0: disable subdivision, 0.5: half density of the reconstruction, 1: full density of the reconstruction)."); - + "Percentage of the density of the reconstruction as the target for the subdivision " + "(0: disable subdivision, 0.5: half density of the reconstruction, 1: full density of the reconstruction)."); + // clang-format on CmdLine cmdline("AliceVision texturing"); cmdline.add(requiredParams); diff --git a/src/software/pipeline/main_tracksBuilding.cpp b/src/software/pipeline/main_tracksBuilding.cpp index e9a56408e8..7ec25e01a9 100644 --- a/src/software/pipeline/main_tracksBuilding.cpp +++ b/src/software/pipeline/main_tracksBuilding.cpp @@ -50,21 +50,37 @@ int aliceVision_main(int argc, char** argv) // user optional parameters std::string describerTypesName = feature::EImageDescriberType_enumToString(feature::EImageDescriberType::SIFT); + // clang-format off po::options_description requiredParams("Required parameters"); - requiredParams.add_options()("input,i", po::value(&sfmDataFilename)->required(), "SfMData file.")( - "output,o", po::value(&tracksFilename)->required(), "Path to the tracks file."); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&tracksFilename)->required(), + "Path to the tracks file."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), "Path to folder(s) containing the extracted features.") - ("matchesFolders,m", po::value>(&matchesFolders)->multitoken(), "Path to folder(s) in which computed matches are stored.") - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), feature::EImageDescriberType_informations().c_str()) - ("maxNumberOfMatches", po::value(&maxNbMatches)->default_value(maxNbMatches), "Maximum number of matches per image pair (and per feature type). This can be useful to have a quick reconstruction overview. 0 means no limit.") - ("minNumberOfMatches", po::value(&minNbMatches)->default_value(minNbMatches), "Minimum number of matches per image pair (and per feature type). This can be useful to have a meaningful reconstruction with accurate keypoints. 0 means no limit.") - ("minInputTrackLength", po::value(&minInputTrackLength)->default_value(minInputTrackLength), "Minimum track length in input of SfM.") - ("useOnlyMatchesFromInputFolder", po::value(&useOnlyMatchesFromInputFolder)->default_value(useOnlyMatchesFromInputFolder), "Use only matches from the input matchesFolder parameter.\n" - "Matches folders previously added to the SfMData file will be ignored.") - ("filterTrackForks", po::value(&filterTrackForks)->default_value(filterTrackForks), "Enable/Disable the track forks removal. A track contains a fork when incoherent matches leads to multiple features in the same image for a single track.\n"); + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), + "Path to folder(s) containing the extracted features.") + ("matchesFolders,m", po::value>(&matchesFolders)->multitoken(), + "Path to folder(s) in which computed matches are stored.") + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()) + ("maxNumberOfMatches", po::value(&maxNbMatches)->default_value(maxNbMatches), + "Maximum number of matches per image pair (and per feature type). " + "This can be useful to have a quick reconstruction overview. 0 means no limit.") + ("minNumberOfMatches", po::value(&minNbMatches)->default_value(minNbMatches), + "Minimum number of matches per image pair (and per feature type). " + "This can be useful to have a meaningful reconstruction with accurate keypoints. 0 means no limit.") + ("minInputTrackLength", po::value(&minInputTrackLength)->default_value(minInputTrackLength), + "Minimum track length in input of SfM.") + ("useOnlyMatchesFromInputFolder", po::value(&useOnlyMatchesFromInputFolder)->default_value(useOnlyMatchesFromInputFolder), + "Use only matches from the input matchesFolder parameter.\n" + "Matches folders previously added to the SfMData file will be ignored.") + ("filterTrackForks", po::value(&filterTrackForks)->default_value(filterTrackForks), + "Enable/Disable the track forks removal. " + "A track contains a fork when incoherent matches leads to multiple features in the same image for a single track."); + // clang-format on CmdLine cmdline("AliceVision tracksBuilding"); diff --git a/src/software/utils/main_applyCalibration.cpp b/src/software/utils/main_applyCalibration.cpp index 201cd6a542..48b6201295 100644 --- a/src/software/utils/main_applyCalibration.cpp +++ b/src/software/utils/main_applyCalibration.cpp @@ -33,14 +33,16 @@ int aliceVision_main(int argc, char **argv) std::string outSfMDataFilename; std::string sfmDataCalibratedFilename; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData scene to apply calibration to.") + "SfMData scene to apply calibration to.") ("output,o", po::value(&outSfMDataFilename)->required(), - "Output SfMData scene.") + "Output SfMData scene.") ("calibration,c", po::value(&sfmDataCalibratedFilename)->required(), - "Calibrated SfMData scene."); + "Calibrated SfMData scene."); + // clang-format on CmdLine cmdline("AliceVision applyCalibration"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_colorCheckerCorrection.cpp b/src/software/utils/main_colorCheckerCorrection.cpp index f1ce3dc5dc..80719d7628 100644 --- a/src/software/utils/main_colorCheckerCorrection.cpp +++ b/src/software/utils/main_colorCheckerCorrection.cpp @@ -140,22 +140,24 @@ int aliceVision_main(int argc, char** argv) image::EStorageDataType storageDataType = image::EStorageDataType::Float; std::string outputPath; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&inputExpression)->default_value(inputExpression), - "SfMData file input, image filenames or regex(es) on the image file path (supported regex: '#' matches a " - "single digit, '@' one or more digits, '?' one character and '*' zero or more).")( - "inputData", po::value(&inputData)->default_value(inputData), - "Position and colorimetric data extracted from detected color checkers in the images") + "SfMData file input, image filenames or regex(es) on the image file path (supported regex: '#' matches a " + "single digit, '@' one or more digits, '?' one character and '*' zero or more).") + ("inputData", po::value(&inputData)->default_value(inputData), + "Position and colorimetric data extracted from detected color checkers in the images.") ("output,o", po::value(&outputPath)->required(), - "Output folder.") - ; + "Output folder."); po::options_description optionalParams("Optional parameters"); - optionalParams.add_options()("storageDataType", po::value(&storageDataType)->default_value(storageDataType), - ("Storage data type: " + image::EStorageDataType_informations()).c_str())( - "extension", po::value(&extension)->default_value(extension), + optionalParams.add_options() + ("storageDataType", po::value(&storageDataType)->default_value(storageDataType), + ("Storage data type: " + image::EStorageDataType_informations()).c_str()) + ("extension", po::value(&extension)->default_value(extension), "Output image extension (like exr, or empty to keep the original source file format."); + // clang-format on CmdLine cmdline("This program is used to perform color correction based on a color checker.\n" "AliceVision colorCheckerCorrection"); diff --git a/src/software/utils/main_colorCheckerDetection.cpp b/src/software/utils/main_colorCheckerDetection.cpp index 0ef2f14fab..bb7274f711 100644 --- a/src/software/utils/main_colorCheckerDetection.cpp +++ b/src/software/utils/main_colorCheckerDetection.cpp @@ -407,10 +407,12 @@ int aliceVision_main(int argc, char** argv) bool debug = false; unsigned int maxCountByImage = 1; + // clang-format off po::options_description inputParams("Required parameters"); inputParams.add_options() ("input,i", po::value(&inputExpression)->required(), - "SfMData file input, image filenames or regex(es) on the image file path (supported regex: '#' matches a single digit, '@' one or more digits, '?' one character and '*' zero or more).") + "SfMData file input, image filenames or regex(es) on the image file path (supported regex: '#' matches " + "a single digit, '@' one or more digits, '?' one character and '*' zero or more).") ("outputData", po::value(&outputData)->required(), "Output path for the color checker data."); @@ -420,6 +422,7 @@ int aliceVision_main(int argc, char** argv) "Output debug data.") ("maxCount", po::value(&maxCountByImage), "Maximum color charts count to detect in a single image."); + // clang-format on CmdLine cmdline("This program is used to perform Macbeth color checker chart detection.\n" "AliceVision colorCheckerDetection"); diff --git a/src/software/utils/main_computeUncertainty.cpp b/src/software/utils/main_computeUncertainty.cpp index 23d2ab9eee..79cecaee30 100644 --- a/src/software/utils/main_computeUncertainty.cpp +++ b/src/software/utils/main_computeUncertainty.cpp @@ -41,19 +41,21 @@ int aliceVision_main(int argc, char **argv) std::string algorithm = cov::EAlgorithm_enumToString(cov::eAlgorithmSvdTaylorExpansion); bool debug = false; - params.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file to align.") - ("output,o", po::value(&outSfMDataFilename)->required(), - "Output SfMData scene.") - ("outputCov,c", po::value(&outputStats), - "Output covariances file.") - ("algorithm,a", po::value(&algorithm)->default_value(algorithm), - "Algorithm.") - ("debug,d", po::value(&debug)->default_value(debug), - "Enable creation of debug files in the current folder.") - ("verboseLevel,v", po::value(&verboseLevel)->default_value(verboseLevel), - "verbosity level (fatal, error, warning, info, debug, trace)."); + // clang-format off + params.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file to align.") + ("output,o", po::value(&outSfMDataFilename)->required(), + "Output SfMData scene.") + ("outputCov,c", po::value(&outputStats), + "Output covariances file.") + ("algorithm,a", po::value(&algorithm)->default_value(algorithm), + "Algorithm.") + ("debug,d", po::value(&debug)->default_value(debug), + "Enable creation of debug files in the current folder.") + ("verboseLevel,v", po::value(&verboseLevel)->default_value(verboseLevel), + "Verbosity level (fatal, error, warning, info, debug, trace)."); + // clang-format on CmdLine cmdline("AliceVision computeUncertainty"); cmdline.add(params); diff --git a/src/software/utils/main_frustumFiltering.cpp b/src/software/utils/main_frustumFiltering.cpp index 7693b256b3..c8ea73123f 100644 --- a/src/software/utils/main_frustumFiltering.cpp +++ b/src/software/utils/main_frustumFiltering.cpp @@ -75,19 +75,21 @@ int aliceVision_main(int argc, char **argv) double zNear = -1.; double zFar = -1.; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFilename)->required(), - "Output pair filename."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("zNear", po::value(&zNear)->default_value(zNear), - "Distance of the near camera plane.") - ("zFar", po::value(&zFar)->default_value(zFar), - "Distance of the far camera plane."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFilename)->required(), + "Output pair filename."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("zNear", po::value(&zNear)->default_value(zNear), + "Distance of the near camera plane.") + ("zFar", po::value(&zFar)->default_value(zFar), + "Distance of the far camera plane."); + // clang-format on CmdLine cmdline("This program computes camera cones that share some putative visual content.\n" "AliceVision frustumFiltering"); diff --git a/src/software/utils/main_generateSampleScene.cpp b/src/software/utils/main_generateSampleScene.cpp index 520cbb56b2..a62e3ea3cc 100644 --- a/src/software/utils/main_generateSampleScene.cpp +++ b/src/software/utils/main_generateSampleScene.cpp @@ -29,9 +29,12 @@ int aliceVision_main(int argc, char** argv) // command-line parameters std::string sfmOutputDataFilepath; // output folder for splited images + // clang-format off po::options_description requiredParams("Required parameters"); - requiredParams.add_options()("output,o", po::value(&sfmOutputDataFilepath)->required(), - "Output sfm file to generate."); + requiredParams.add_options() + ("output,o", po::value(&sfmOutputDataFilepath)->required(), + "Output sfm file to generate."); + // clang-format on CmdLine cmdline("This program is used to generate a sample scene and save it to a given file path.\n" "AliceVision generateSampleScene"); diff --git a/src/software/utils/main_imageProcessing.cpp b/src/software/utils/main_imageProcessing.cpp index bc398429bd..fa45e9234d 100644 --- a/src/software/utils/main_imageProcessing.cpp +++ b/src/software/utils/main_imageProcessing.cpp @@ -1003,15 +1003,16 @@ int aliceVision_main(int argc, char * argv[]) ProcessingParams pParams; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&inputExpression)->default_value(inputExpression), - "SfMData file input, image filenames or regex(es) on the image file path (supported regex: '#' matches a single digit, '@' one or more digits, '?' one character and '*' zero or more).") + "SfMData file input, image filenames or regex(es) on the image file path (supported regex: '#' matches a " + "single digit, '@' one or more digits, '?' one character and '*' zero or more).") ("inputFolders", po::value>(&inputFolders)->multitoken(), - "Use images from specific folder(s) instead of those specify in the SfMData file.") + "Use images from specific folder(s) instead of those specify in the SfMData file.") ("output,o", po::value(&outputPath)->required(), - "Output folder or output image if a single image is given as input.") - ; + "Output folder or output image if a single image is given as input."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() @@ -1043,14 +1044,14 @@ int aliceVision_main(int argc, char * argv[]) "Exposure Adjustment in fstops limited to the range from -2 to +3 fstops.") ("rawAutoBright", po::value(&pParams.rawAutoBright)->default_value(pParams.rawAutoBright), - "Enable automatic exposure adjustment for raw images.") + "Enable automatic exposure adjustment for RAW images.") ("lensCorrection", po::value(&pParams.lensCorrection)->default_value(pParams.lensCorrection), - "Lens Correction parameters:\n" - " * Enabled: Use automatic lens correction.\n" - " * Geometry: For geometry if a model is available in sfm data.\n" - " * Vignetting: For vignetting if model parameters is available in metadata.\n " - " * Chromatic Aberration: For chromatic aberration (fringing) if model parameters is available in metadata.") + "Lens Correction parameters:\n" + " * Enabled: Use automatic lens correction.\n" + " * Geometry: For geometry if a model is available in SfM data.\n" + " * Vignetting: For vignetting if model parameters is available in metadata.\n " + " * Chromatic Aberration: For chromatic aberration (fringing) if model parameters is available in metadata.") ("contrast", po::value(&pParams.contrast)->default_value(pParams.contrast), "Contrast Factor (1.0: no change).") @@ -1059,50 +1060,56 @@ int aliceVision_main(int argc, char * argv[]) "Median Filter (0: no filter).") ("sharpenFilter", po::value(&pParams.sharpen)->default_value(pParams.sharpen), - "Sharpen Filter parameters:\n" - " * Enabled: Use Sharpen.\n" - " * Width: Sharpen kernel width.\n" - " * Contrast: Sharpen contrast value.\n " - " * Threshold: Threshold for minimal variation for contrast to avoid sharpening of small noise (0.0: no noise threshold).") + "Sharpen Filter parameters:\n" + " * Enabled: Use Sharpen.\n" + " * Width: Sharpen kernel width.\n" + " * Contrast: Sharpen contrast value.\n " + " * Threshold: Threshold for minimal variation for contrast to avoid sharpening of small noise (0.0: no noise threshold).") ("fillHoles", po::value(&pParams.fillHoles)->default_value(pParams.fillHoles), "Fill Holes.") ("bilateralFilter", po::value(&pParams.bilateralFilter)->default_value(pParams.bilateralFilter), - "Bilateral Filter parameters:\n" - " * Enabled: Use bilateral Filter.\n" - " * Distance: Diameter of each pixel neighborhood that is used during filtering (if <=0 is computed proportionaly from sigmaSpace).\n" - " * SigmaSpace: Filter sigma in the coordinate space.\n " - " * SigmaColor: Filter sigma in the color space.") + "Bilateral Filter parameters:\n" + " * Enabled: Use bilateral filter.\n" + " * Distance: Diameter of each pixel neighborhood that is used during filtering (if <= 0, it is computed " + "proportionally from sigmaSpace).\n" + " * SigmaSpace: Filter sigma in the coordinate space.\n " + " * SigmaColor: Filter sigma in the color space.") ("claheFilter", po::value(&pParams.claheFilter)->default_value(pParams.claheFilter), - "Sharpen Filter parameters:\n" - " * Enabled: Use Contrast Limited Adaptive Histogram Equalization (CLAHE).\n" - " * ClipLimit: Sets Threshold For Contrast Limiting.\n" - " * TileGridSize: Sets Size Of Grid For Histogram Equalization. Input Image Will Be Divided Into Equally Sized Rectangular Tiles.") + "Sharpen Filter parameters:\n" + " * Enabled: Use Contrast Limited Adaptive Histogram Equalization (CLAHE).\n" + " * ClipLimit: Sets threshold for contrast limiting.\n" + " * TileGridSize: Sets size of grid for histogram equalization. Input image will be divided into equally " + "sized rectangular tiles.") ("noiseFilter", po::value(&pParams.noise)->default_value(pParams.noise), - "Noise Filter parameters:\n" - " * Enabled: Add Noise.\n" - " * method: There are several noise types to choose from:\n" - " - uniform: adds noise values uninformly distributed on range [A,B).\n" - " - gaussian: adds Gaussian (normal distribution) noise values with mean value A and standard deviation B.\n" - " - salt: changes to value A a portion of pixels given by B.\n" - " * A, B: parameters that have a different interpretation depending on the method chosen.\n" - " * mono: If is true, a single noise value will be applied to all channels otherwise a separate noise value will be computed for each channel.") + "Noise Filter parameters:\n" + " * Enabled: Add noise.\n" + " * method: There are several noise types to choose from:\n" + " - uniform: adds noise values uninformly distributed on range [A,B).\n" + " - gaussian: adds Gaussian (normal distribution) noise values with mean value A and standard deviation B.\n" + " - salt: changes to value A a portion of pixels given by B.\n" + " * A, B: parameters that have a different interpretation depending on the method chosen.\n" + " * mono: If is true, a single noise value will be applied to all channels otherwise a separate noise value " + "will be computed for each channel.") ("nlmFilter", po::value(&pParams.nlmFilter)->default_value(pParams.nlmFilter), - "Non local means Filter parameters:\n" - " * Enabled: Use non local means Filter.\n" - " * H: Parameter regulating filter strength. Bigger H value perfectly removes noise but also removes image details, smaller H value preserves details but also preserves some noise.\n" - " * HColor: Parameter regulating filter strength for color images only. Normally same as Filtering Parameter H. Not necessary for grayscale images\n " - " * templateWindowSize: Size in pixels of the template patch that is used to compute weights. Should be odd. \n" - " * searchWindowSize:Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time.") + "Non-local means filter parameters:\n" + " * Enabled: Use non-local means filter.\n" + " * H: Parameter regulating filter strength. Bigger H value perfectly removes noise but also removes image " + "details, smaller H value preserves details but also preserves some noise.\n" + " * HColor: Parameter regulating filter strength for color images only. Normally same as Filtering " + "Parameter H. Not necessary for grayscale images.\n " + " * templateWindowSize: Size in pixels of the template patch that is used to compute weights. Should be odd.\n" + " * searchWindowSize: Size in pixels of the window that is used to compute weighted average for a given pixel. " + "Should be odd. Affects performance linearly: greater searchWindowsSize - greater denoising time.") ("parFilter", po::value(&pParams.par)->default_value(pParams.par), - "Pixel Aspect Ratio parameters:\n" - " * Enabled: Apply Pixel Aspect Ratio.\n" - " * RowDecimation: Decimate rows (reduce image height) instead of upsampling columns (increase image width).") + "Pixel Aspect Ratio parameters:\n" + " * Enabled: Apply pixel aspect ratio.\n" + " * RowDecimation: Decimate rows (reduce image height) instead of upsampling columns (increase image width).") ("inputColorSpace", po::value(&inputColorSpace)->default_value(inputColorSpace), ("Input image color space: " + image::EImageColorSpace_informations()).c_str()) @@ -1111,29 +1118,33 @@ int aliceVision_main(int argc, char * argv[]) ("Working color space: " + image::EImageColorSpace_informations()).c_str()) ("outputFormat", po::value(&outputFormat)->default_value(outputFormat), - "Output image format (rgba, rgb, grayscale)") + "Output image format (rgba, rgb, grayscale).") ("outputColorSpace", po::value(&outputColorSpace)->default_value(outputColorSpace), - ("Output color space: " + image::EImageColorSpace_informations()).c_str()) + ("Output color space: " + image::EImageColorSpace_informations()).c_str()) ("rawColorInterpretation", po::value(&rawColorInterpretation)->default_value(rawColorInterpretation), - ("RAW color interpretation: " + image::ERawColorInterpretation_informations() + "\ndefault : DcpLinearProcessing").c_str()) + ("RAW color interpretation: " + image::ERawColorInterpretation_informations() + "\n" + "Default: DcpLinearProcessing").c_str()) ("applyDcpMetadata", po::value(&pParams.applyDcpMetadata)->default_value(pParams.applyDcpMetadata), - "Apply after all processings a linear dcp profile generated from the image DCP metadata if any") + "Apply after all processings a linear DCP profile generated from the image DCP metadata if any.") ("colorProfileDatabase,c", po::value(&colorProfileDatabaseDirPath)->default_value(""), "DNG Color Profiles (DCP) database path.") ("errorOnMissingColorProfile", po::value(&errorOnMissingColorProfile)->default_value(errorOnMissingColorProfile), - "Rise an error if a DCP color profiles database is specified but no DCP file matches with the camera model (maker+name) extracted from metadata (Only for raw images)") + "Rise an error if a DCP color profiles database is specified but no DCP file matches with the camera model " + "(maker + name) extracted from metadata (only for RAW images).") ("useDCPColorMatrixOnly", po::value(&useDCPColorMatrixOnly)->default_value(useDCPColorMatrixOnly), - "Use only Color matrices of DCP profile, ignoring Forward matrices if any. Default: False.\n" - "In case white balancing has been done before demosaicing, the reverse operation is done before applying the color matrix.") + "Use only color matrices of DCP profile, ignoring forward matrices if any. Default: False.\n" + "In case white balancing has been done before demosaicing, the reverse operation is done before applying " + "the color matrix.") ("doWBAfterDemosaicing", po::value(&doWBAfterDemosaicing)->default_value(doWBAfterDemosaicing), - "Do not use libRaw white balancing. White balancing is applied just before DCP profile if useDCPColorMatrixOnly is set to False. Default: False.") + "Do not use libRaw white balancing. White balancing is applied just before DCP profile if " + "useDCPColorMatrixOnly is set to False. Default: False.") ("demosaicingAlgo", po::value(&demosaicingAlgo)->default_value(demosaicingAlgo), "Demosaicing algorithm (see libRaw documentation).\n" @@ -1147,7 +1158,7 @@ int aliceVision_main(int argc, char * argv[]) "Lens Correction Profile filepath or database directory path.") ("lensCorrectionProfileSearchIgnoreCameraModel", po::value(&lensCorrectionProfileSearchIgnoreCameraModel)->default_value(lensCorrectionProfileSearchIgnoreCameraModel), - "Automatic LCP Search considers only the camera maker and the lens name") + "Automatic LCP Search considers only the camera maker and the lens name.") ("correlatedColorTemperature", po::value(&correlatedColorTemperature)->default_value(correlatedColorTemperature), "Correlated Color Temperature in Kelvin of scene illuminant.\n" @@ -1178,8 +1189,8 @@ int aliceVision_main(int argc, char * argv[]) "JPEG quality after compression (between 0 and 100).") ("extension", po::value(&extension)->default_value(extension), - "Output image extension (like exr, or empty to keep the source file format.") - ; + "Output image extension (like exr, or empty to keep the source file format."); + // clang-format on CmdLine cmdline("AliceVision imageProcessing"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_importMiddlebury.cpp b/src/software/utils/main_importMiddlebury.cpp index c4aa97c04c..db2ea1b55b 100644 --- a/src/software/utils/main_importMiddlebury.cpp +++ b/src/software/utils/main_importMiddlebury.cpp @@ -51,21 +51,25 @@ int aliceVision_main(int argc, char** argv) // whether to lock or not the poses bool lockPoses{true}; + // clang-format off po::options_description requiredParams("Required parameters"); - requiredParams.add_options()("input,i", po::value(&middleburyFile)->required(), "The text file containing the cameras (e.g. temple_par.txt).") - ("output,o", po::value(&sfmDataFilename)->required(), "Output sfmdata filename"); + requiredParams.add_options() + ("input,i", po::value(&middleburyFile)->required(), + "The text file containing the cameras (e.g. temple_par.txt).") + ("output,o", po::value(&sfmDataFilename)->required(), + "Output SfMData filename."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("uniqueIntrinsics", po::bool_switch(&uniqueIntrinsics), - "Consider all the camera having the same intrinsics (the first camera instrinsics will be used for all the others") + "Consider all the camera having the same intrinsics (the first camera instrinsics will be used for all the others).") ("importPoses", po::value(&importPoses)->default_value(importPoses), "Import the poses, disable this if you want, e.g. test the sfm part and assess the camera pose estimation.") ("lockIntrinsics", po::value(&lockIntrinsics)->default_value(lockIntrinsics), - "Set the intrinsics to locked, so they will not be refined in the sfm step.") + "Set the intrinsics to locked, so they will not be refined in the SfM step.") ("lockPoses", po::value(&lockPoses)->default_value(lockPoses), - "Set the poses to locked, so they will not be refined in the sfm step") - ; + "Set the poses to locked, so they will not be refined in the SfM step."); + // clang-format on CmdLine cmdline("This program generates an SfMData from the configuration files of the Middlebury dataset: https://vision.middlebury.edu/mview/data\n" "AliceVision importMiddlebury"); diff --git a/src/software/utils/main_keyframeSelection.cpp b/src/software/utils/main_keyframeSelection.cpp index db53e7a28e..5436f184aa 100644 --- a/src/software/utils/main_keyframeSelection.cpp +++ b/src/software/utils/main_keyframeSelection.cpp @@ -67,103 +67,105 @@ int aliceVision_main(int argc, char** argv) bool flowVisualisationOnly = false; // export optical flow visualisation for all the frames but do not compute scores bool skipSharpnessComputation = false; // skip sharpness score computations + // clang-format off po::options_description inputParams("Required parameters"); inputParams.add_options() ("inputPaths", po::value>(&inputPaths)->required()->multitoken(), - "Input video files or image sequence directories.") + "Input video files or image sequence directories.") ("sensorDbPath", po::value(&sensorDbPath)->required(), - "Camera sensor width database path.") + "Camera sensor width database path.") ("outputFolder", po::value(&outputFolder)->required(), - "Output folder in which the selected keyframes are written.") + "Output folder in which the selected keyframes are written.") ("outputSfMDataKeyframes", po::value(&outputSfMDataKeyframes)->required(), - "Output SfMData file containing all the selected keyframes.") + "Output SfMData file containing all the selected keyframes.") ("outputSfMDataFrames", po::value(&outputSfMDataFrames)->required(), - "Output SfMData file containing all the rejected frames."); + "Output SfMData file containing all the rejected frames."); po::options_description metadataParams("Metadata parameters"); metadataParams.add_options() ("brands", po::value>(&brands)->default_value(brands)->multitoken(), - "Camera brands.") + "Camera brands.") ("models", po::value>(&models)->default_value(models)->multitoken(), - "Camera models.") + "Camera models.") ("mmFocals", po::value>(&mmFocals)->default_value(mmFocals)->multitoken(), - "Focals in mm (ignored if equal to 0)."); + "Focals in mm (ignored if equal to 0)."); po::options_description algorithmParams("Algorithm parameters"); // Parameters common to both methods algorithmParams.add_options() ("maxNbOutFrames", po::value(&maxNbOutFrames)->default_value(maxNbOutFrames), - "Maximum number of output keyframes.\n" - "\t- For the regular method, 0 = no limit. 'minFrameStep' and 'maxFrameStep' will always be respected, " - "so combining them with this parameter might cause the selection to stop before reaching the end of the " - "input sequence(s).\n" - "\t- For the smart method, the default value is set to 2000.") + "Maximum number of output keyframes.\n" + "\t- For the regular method, 0 = no limit. 'minFrameStep' and 'maxFrameStep' will always be respected, " + "so combining them with this parameter might cause the selection to stop before reaching the end of the " + "input sequence(s).\n" + "\t- For the smart method, the default value is set to 2000.") ("renameKeyframes", po::value(&renameKeyframes)->default_value(renameKeyframes), - "Instead of naming the keyframes according to their index in the input sequence / video, rename them as " - "consecutive frames, starting from 0.\n" - "If the selected keyframes should have originally be written as [00015.exr, 00294.exr, 00825.exr], they " - "will instead be written as [00000.exr, 00001.exr, 00002.exr] if this option is enabled.") + "Instead of naming the keyframes according to their index in the input sequence / video, rename them as " + "consecutive frames, starting from 0.\n" + "If the selected keyframes should have originally be written as [00015.exr, 00294.exr, 00825.exr], they " + "will instead be written as [00000.exr, 00001.exr, 00002.exr] if this option is enabled.") ("outputExtension", po::value(&outputExtension)->default_value(outputExtension), - ("File extension of the output keyframes (e.g. 'exr').\n" - "If set to 'none', the keyframes will not be written on disk, and only the SfMData file will be written.\n" - "For input videos, 'none' should not be used since written keyframes are used to generate the SfMData " - "file.\n" - "Supported extensions are: " + supportedExtensions).c_str()) + ("File extension of the output keyframes (e.g. 'exr').\n" + "If set to 'none', the keyframes will not be written on disk, and only the SfMData file will be written.\n" + "For input videos, 'none' should not be used since written keyframes are used to generate the SfMData " + "file.\n" + "Supported extensions are: " + supportedExtensions).c_str()) ("storageDataType", po::value(&exrDataType)->default_value(exrDataType), - ("Storage data type for EXR output files: " + image::EStorageDataType_informations()).c_str()); + ("Storage data type for EXR output files: " + image::EStorageDataType_informations()).c_str()); po::options_description regularAlgorithmParams("Regular algorithm parameters"); regularAlgorithmParams.add_options() ("minFrameStep", po::value(&minFrameStep)->default_value(minFrameStep), - "Minimum number of frames between two keyframes.") + "Minimum number of frames between two keyframes.") ("maxFrameStep", po::value(&maxFrameStep)->default_value(maxFrameStep), - "Maximum number of frames after which a keyframe can be taken (ignored if equal to 0)."); + "Maximum number of frames after which a keyframe can be taken (ignored if equal to 0)."); po::options_description smartAlgorithmParams("Smart algorithm parameters"); smartAlgorithmParams.add_options() ("useSmartSelection", po::value(&useSmartSelection)->default_value(useSmartSelection), - "True to use the smart keyframe selection method, false to use the regular keyframe selection method.") + "True to use the smart keyframe selection method, false to use the regular keyframe selection method.") ("minNbOutFrames", po::value(&minNbOutFrames)->default_value(minNbOutFrames), - "Minimum number of output keyframes.") + "Minimum number of output keyframes.") ("pxDisplacement", po::value(&pxDisplacement)->default_value(pxDisplacement), - "Percentage of pixels in the image that have been displaced since the last selected frame. The absolute " - "number of moving pixels is determined using min(imageWidth, imageHeight).") + "Percentage of pixels in the image that have been displaced since the last selected frame. The absolute " + "number of moving pixels is determined using min(imageWidth, imageHeight).") ("rescaledWidthSharpness", po::value(&rescaledWidthSharp)->default_value(rescaledWidthSharp), - "Width, in pixels, of the rescaled input frames used to compute the sharpness scores. The height of the " - "rescaled frames will be automatically determined to preserve the aspect ratio. 0 = no rescale.") + "Width, in pixels, of the rescaled input frames used to compute the sharpness scores. The height of the " + "rescaled frames will be automatically determined to preserve the aspect ratio. 0 = no rescale.") ("rescaledWidthFlow", po::value(&rescaledWidthFlow)->default_value(rescaledWidthFlow), - "Width, in pixels, of the rescaled input frames used to compute the motion scores. The height of the " - "rescaled frames will be automatically determined to preserve the aspect ratio. 0 = no rescale.") + "Width, in pixels, of the rescaled input frames used to compute the motion scores. The height of the " + "rescaled frames will be automatically determined to preserve the aspect ratio. 0 = no rescale.") ("sharpnessWindowSize", po::value(&sharpnessWindowSize)->default_value(sharpnessWindowSize), - "Size, in pixels, of the sliding window that is used to compute the sharpness score of a frame.") + "Size, in pixels, of the sliding window that is used to compute the sharpness score of a frame.") ("flowCellSize", po::value(&flowCellSize)->default_value(flowCellSize), - "Size, in pixels, of the cells within an input frame that are used to compute the optical flow scores.") + "Size, in pixels, of the cells within an input frame that are used to compute the optical flow scores.") ("minBlockSize", po::value(&minBlockSize)->default_value(minBlockSize), - "Minimum number of frames processed by a single thread when multi-threading is used.") + "Minimum number of frames processed by a single thread when multi-threading is used.") ("maskPaths", po::value>(&maskPaths)->default_value(models)->multitoken(), - "Paths to directories containing masks. Masks (e.g. segmentation masks) will be used to ignore some parts " - "of the frames when computing the scores."); + "Paths to directories containing masks. Masks (e.g. segmentation masks) will be used to ignore some parts " + "of the frames when computing the scores."); po::options_description debugParams("Debug parameters"); debugParams.add_options() ("exportScores", po::value(&exportScores)->default_value(exportScores), - "Export the sharpness and optical flow scores to a CSV file.") + "Export the sharpness and optical flow scores to a CSV file.") ("csvFilename", po::value(&csvFilename)->default_value(csvFilename), - "Name of the CSV file containing the sharpness and optical flow scores.") + "Name of the CSV file containing the sharpness and optical flow scores.") ("exportSelectedFrames", po::value(&exportSelectedFrames)->default_value(exportSelectedFrames), - "Add a column in the exported CSV file containing the selected frames (1 for frames that have been " - "selected, 0 otherwise).") + "Add a column in the exported CSV file containing the selected frames (1 for frames that have been " + "selected, 0 otherwise).") ("skipSelection", po::value(&skipSelection)->default_value(skipSelection), - "Only compute the sharpness and optical flow scores, but do not proceed with the selection.") + "Only compute the sharpness and optical flow scores, but do not proceed with the selection.") ("exportFlowVisualisation", po::value(&exportFlowVisualisation)->default_value(exportFlowVisualisation), - "For all frames, export the optical flow visualisation in HSV as PNG images.") + "For all frames, export the optical flow visualisation in HSV as PNG images.") ("flowVisualisationOnly", po::value(&flowVisualisationOnly)->default_value(flowVisualisationOnly), - "Export the optical flow visualisation in HSV as PNG images for all frames but do not compute scores.") + "Export the optical flow visualisation in HSV as PNG images for all frames but do not compute scores.") ("skipSharpnessComputation", po::value(&skipSharpnessComputation)->default_value(skipSharpnessComputation), - "Skip the computations for the sharpness score of each frame. A fixed sharpness score of 1.0 will be " - "assigned to each frame."); + "Skip the computations for the sharpness score of each frame. A fixed sharpness score of 1.0 will be " + "assigned to each frame."); + // clang-format on aliceVision::CmdLine cmdline("This program is used to extract keyframes from single camera or a camera rig.\n" - "AliceVision keyframeSelection"); + "AliceVision keyframeSelection"); cmdline.add(inputParams); cmdline.add(metadataParams); cmdline.add(algorithmParams); diff --git a/src/software/utils/main_lightingEstimation.cpp b/src/software/utils/main_lightingEstimation.cpp index fe4ddeac33..3a97558197 100644 --- a/src/software/utils/main_lightingEstimation.cpp +++ b/src/software/utils/main_lightingEstimation.cpp @@ -278,30 +278,32 @@ int main(int argc, char** argv) int albedoEstimationFilterSize = 3; ELightingColor lightingColor = ELightingColor::RGB; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("depthMapsFilterFolder", po::value(&depthMapsFilterFolder)->required(), - "Filtered depth maps folder.") - ("imagesFolder", po::value(&imagesFolder)->required(), - "Images used for depth map computation.\n" - "Filename should be the image uid.") - ("output,o", po::value(&outputFolder)->required(), - "Folder for output lighting vector files."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("lightingColor", po::value(&lightingColor)->default_value(lightingColor), - "Lighting color.") - ("lightingEstimationMode", po::value(&lightEstimationMode)->default_value(lightEstimationMode), - "Lighting Estimation Mode.") - ("albedoEstimationName", po::value(&albedoEstimationMethod)->default_value(albedoEstimationMethod), - EAlbedoEstimation_informations().c_str()) - ("albedoEstimationFilterSize", po::value(&albedoEstimationFilterSize)->default_value(albedoEstimationFilterSize), - "Albedo filter size for estimation method using filter."); - - CmdLine cmdline("AliceVision lighthingEstimation"); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("depthMapsFilterFolder", po::value(&depthMapsFilterFolder)->required(), + "Filtered depth maps folder.") + ("imagesFolder", po::value(&imagesFolder)->required(), + "Images used for depth map computation.\n" + "Filename should be the image UID.") + ("output,o", po::value(&outputFolder)->required(), + "Folder for output lighting vector files."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("lightingColor", po::value(&lightingColor)->default_value(lightingColor), + "Lighting color.") + ("lightingEstimationMode", po::value(&lightEstimationMode)->default_value(lightEstimationMode), + "Lighting Estimation Mode.") + ("albedoEstimationName", po::value(&albedoEstimationMethod)->default_value(albedoEstimationMethod), + EAlbedoEstimation_informations().c_str()) + ("albedoEstimationFilterSize", po::value(&albedoEstimationFilterSize)->default_value(albedoEstimationFilterSize), + "Albedo filter size for estimation method using filter."); + // clang-format on + + CmdLine cmdline("AliceVision lightingEstimation"); cmdline.add(requiredParams); cmdline.add(optionalParams); if (!cmdline.execute(argc, argv)) diff --git a/src/software/utils/main_mergeMeshes.cpp b/src/software/utils/main_mergeMeshes.cpp index cb8cac21ed..06aa17b6e3 100644 --- a/src/software/utils/main_mergeMeshes.cpp +++ b/src/software/utils/main_mergeMeshes.cpp @@ -134,23 +134,25 @@ int aliceVision_main(int argc, char** argv) bool preProcess = true; bool postProcess = true; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("inputFirstMesh", po::value(&inputFirstMeshPath)->default_value(inputFirstMeshPath), - "First mesh file path (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).") - ("inputSecondMesh", po::value(&inputSecondMeshPath)->default_value(inputSecondMeshPath), - "Second mesh file path (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).") - ("output,o", po::value(&outputFilePath)->default_value(outputFilePath), - "Output file path for the new mesh file (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl)"); + ("inputFirstMesh", po::value(&inputFirstMeshPath)->default_value(inputFirstMeshPath), + "First mesh file path (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).") + ("inputSecondMesh", po::value(&inputSecondMeshPath)->default_value(inputSecondMeshPath), + "Second mesh file path (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).") + ("output,o", po::value(&outputFilePath)->default_value(outputFilePath), + "Output file path for the new mesh file (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl)."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() - ("mergeOperation",po::value(&operationTypeName)->default_value(operationTypeName), - EOperationType_informations().c_str()) - ("preProcess", po::value(&preProcess)->default_value(preProcess), - "Pre-process input meshes in order to avoid geometric errors in the merging process") - ("postProcess", po::value(&postProcess)->default_value(postProcess), - "Post-process output mesh in order to avoid future geometric errors"); + ("mergeOperation",po::value(&operationTypeName)->default_value(operationTypeName), + EOperationType_informations().c_str()) + ("preProcess", po::value(&preProcess)->default_value(preProcess), + "Pre-process input meshes in order to avoid geometric errors in the merging process.") + ("postProcess", po::value(&postProcess)->default_value(postProcess), + "Post-process output mesh in order to avoid future geometric errors."); + // clang-format on CmdLine cmdline("The program takes two meshes and applies a boolean operation on them.\n" "AliceVision mergeMeshes"); diff --git a/src/software/utils/main_qualityEvaluation.cpp b/src/software/utils/main_qualityEvaluation.cpp index 715a7c00cc..2625a6c20e 100644 --- a/src/software/utils/main_qualityEvaluation.cpp +++ b/src/software/utils/main_qualityEvaluation.cpp @@ -40,16 +40,16 @@ int aliceVision_main(int argc, char **argv) std::string outputFolder; std::string gtFilename; - po::options_description allParams("AliceVision qualityEvaluation"); - - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFolder)->required(), - "Output path for statistics.") - ("groundTruthPath", po::value(>Filename)->required(), - "Path to a ground truth reconstructed scene"); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFolder)->required(), + "Output path for statistics.") + ("groundTruthPath", po::value(>Filename)->required(), + "Path to a ground truth reconstructed scene."); + // clang-format on CmdLine cmdline("AliceVision qualityEvaluation"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_rigTransform.cpp b/src/software/utils/main_rigTransform.cpp index 784e0836d1..745f8dd18c 100644 --- a/src/software/utils/main_rigTransform.cpp +++ b/src/software/utils/main_rigTransform.cpp @@ -48,17 +48,19 @@ int aliceVision_main(int argc, char** argv) std::string calibFile; std::vector extrinsics; // the rig subposes - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&importFile)->required(), - "The input file containing cameras.") - ("output,o", po::value(&exportFile)->required(), - "Filename for the SfMData export file (where camera poses will be stored).\n" - "Alembic file only.") - ("calibrationFile,c", po::value(&calibFile)->required(), - "A calibration file for the target camera.") - ("rigFile,e", po::value(&rigFile)->required(), - "Rig calibration file that will be applied to input."); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&importFile)->required(), + "The input file containing cameras.") + ("output,o", po::value(&exportFile)->required(), + "Filename for the SfMData export file (where camera poses will be stored).\n" + "Alembic file only.") + ("calibrationFile,c", po::value(&calibFile)->required(), + "A calibration file for the target camera.") + ("rigFile,e", po::value(&rigFile)->required(), + "Rig calibration file that will be applied to input."); + // clang-format on CmdLine cmdline("This program is used to deduce the pose of the not localized cameras of the RIG.\n" "Use if you have localized a single camera from an acquisition with a RIG of cameras.\n" diff --git a/src/software/utils/main_sfmAlignment.cpp b/src/software/utils/main_sfmAlignment.cpp index 5485393e30..bb5b4d8555 100644 --- a/src/software/utils/main_sfmAlignment.cpp +++ b/src/software/utils/main_sfmAlignment.cpp @@ -106,39 +106,38 @@ int aliceVision_main(int argc, char **argv) std::vector metadataMatchingList = {"Make", "Model", "Exif:BodySerialNumber" , "Exif:LensSerialNumber" }; std::string outputViewsAndPosesFilepath; - po::options_description allParams("AliceVision sfmAlignment"); - - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file to align.") - ("output,o", po::value(&outSfMDataFilename)->required(), - "Output SfMData scene.") - ("reference,r", po::value(&sfmDataReferenceFilename)->required(), - "Path to the scene used as the reference coordinate system."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("method", po::value(&alignmentMethod)->default_value(alignmentMethod), - "Alignment Method:\n" - "\t- from_cameras_viewid: Align cameras with same view Id\n" - "\t- from_cameras_poseid: Align cameras with same pose Id\n" - "\t- from_cameras_filepath: Align cameras with a filepath matching, using --fileMatchingPattern\n" - "\t- from_cameras_metadata: Align cameras with matching metadata, using --metadataMatchingList\n" - "\t- from_markers: Align from markers with the same Id\n") - ("fileMatchingPattern", po::value(&fileMatchingPattern)->default_value(fileMatchingPattern), - "Matching pattern for the from_cameras_filepath method.\n") - ("metadataMatchingList", po::value>(&metadataMatchingList)->multitoken()->default_value(metadataMatchingList), - "List of metadata that should match to create the correspondences.\n") - ("applyScale", po::value(&applyScale)->default_value(applyScale), - "Apply scale transformation.") - ("applyRotation", po::value(&applyRotation)->default_value(applyRotation), - "Apply rotation transformation.") - ("applyTranslation", po::value(&applyTranslation)->default_value(applyTranslation), - "Apply translation transformation.") - ("outputViewsAndPoses", po::value(&outputViewsAndPosesFilepath), - "Path of the output SfMData file.") - ; + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file to align.") + ("output,o", po::value(&outSfMDataFilename)->required(), + "Output SfMData scene.") + ("reference,r", po::value(&sfmDataReferenceFilename)->required(), + "Path to the scene used as the reference coordinate system."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("method", po::value(&alignmentMethod)->default_value(alignmentMethod), + "Alignment Method:\n" + "\t- from_cameras_viewid: Align cameras with same view ID.\n" + "\t- from_cameras_poseid: Align cameras with same pose ID.\n" + "\t- from_cameras_filepath: Align cameras with a filepath matching, using --fileMatchingPattern.\n" + "\t- from_cameras_metadata: Align cameras with matching metadata, using --metadataMatchingList.\n" + "\t- from_markers: Align from markers with the same ID.\n") + ("fileMatchingPattern", po::value(&fileMatchingPattern)->default_value(fileMatchingPattern), + "Matching pattern for the from_cameras_filepath method.\n") + ("metadataMatchingList", po::value>(&metadataMatchingList)->multitoken()->default_value(metadataMatchingList), + "List of metadata that should match to create the correspondences.\n") + ("applyScale", po::value(&applyScale)->default_value(applyScale), + "Apply scale transformation.") + ("applyRotation", po::value(&applyRotation)->default_value(applyRotation), + "Apply rotation transformation.") + ("applyTranslation", po::value(&applyTranslation)->default_value(applyTranslation), + "Apply translation transformation.") + ("outputViewsAndPoses", po::value(&outputViewsAndPosesFilepath), + "Path of the output SfMData file."); + // clang-format on CmdLine cmdline("AliceVision sfmAlignment"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_sfmColorHarmonize.cpp b/src/software/utils/main_sfmColorHarmonize.cpp index b6e3622610..24d17203dd 100644 --- a/src/software/utils/main_sfmColorHarmonize.cpp +++ b/src/software/utils/main_sfmColorHarmonize.cpp @@ -39,26 +39,28 @@ int aliceVision_main( int argc, char **argv ) EHistogramSelectionMethod selectionMethod; int imgRef; - // user optional parameters - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file.") - ("output,o", po::value(&outputFolder)->required(), - "Output path.") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), - "Path to folder(s) containing the extracted features.") - ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), - "Path to folder(s) in which computed matches are stored.") - ("referenceImage", po::value(&imgRef)->required(), - "Reference image id.") - ("selectionMethod", po::value(&selectionMethod)->required(), - EHistogramSelectionMethod_description().c_str()); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), - feature::EImageDescriberType_informations().c_str()); + // user optional parameters + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outputFolder)->required(), + "Output path.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken()->required(), + "Path to folder(s) containing the extracted features.") + ("matchesFolders,m", po::value>(&matchesFolders)->multitoken()->required(), + "Path to folder(s) in which computed matches are stored.") + ("referenceImage", po::value(&imgRef)->required(), + "Reference image ID.") + ("selectionMethod", po::value(&selectionMethod)->required(), + EHistogramSelectionMethod_description().c_str()); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("describerTypes,d", po::value(&describerTypesName)->default_value(describerTypesName), + feature::EImageDescriberType_informations().c_str()); + // clang-format on CmdLine cmdline("AliceVision sfmColorHarmonize"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_sfmDistances.cpp b/src/software/utils/main_sfmDistances.cpp index e0f0fb3991..7c1032ae04 100644 --- a/src/software/utils/main_sfmDistances.cpp +++ b/src/software/utils/main_sfmDistances.cpp @@ -149,33 +149,31 @@ int main(int argc, char **argv) std::string objectB; std::string landmarksDescriberTypesName; - po::options_description allParams("AliceVision sfmTransform"); - - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file to align."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("objectType", po::value(&objectType)->default_value(objectType), - "Object Type:\n" - "\t- cameras: Use cameras\n" - "\t- landmarks: Use landmarks\n") - ("A", po::value(&objectA)->default_value(objectA), - "Object ID:\n" - "Landmark: ID\n" - "Camera: camera UID or image filename") - ("B", po::value(&objectB)->default_value(objectB), - "Object ID:\n" - "Landmark: ID\n" - "Camera: camera UID or image filename") - ("landmarksDescriberTypes,d", po::value(&landmarksDescriberTypesName)->default_value(landmarksDescriberTypesName), - ("optional for 'landmarks' method:\n" - "Image describer types used to compute the mean of the point cloud\n" - "Use all of them if empty\n" - + feature::EImageDescriberType_informations()).c_str()) - ; + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file to align."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("objectType", po::value(&objectType)->default_value(objectType), + "Object Type:\n" + "\t- cameras: Use cameras.\n" + "\t- landmarks: Use landmarks.\n") + ("A", po::value(&objectA)->default_value(objectA), + "Object ID:\n" + "Landmark: ID\n" + "Camera: camera UID or image filename.") + ("B", po::value(&objectB)->default_value(objectB), + "Object ID:\n" + "Landmark: ID\n" + "Camera: camera UID or image filename.") + ("landmarksDescriberTypes,d", po::value(&landmarksDescriberTypesName)->default_value(landmarksDescriberTypesName), + ("Optional for 'landmarks' method:\n" + "Image describer types used to compute the mean of the point cloud.\n" + "Use all of them if empty\n" + feature::EImageDescriberType_informations()).c_str()); + // clang-format on CmdLine cmdline("AliceVision sfmDistances"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_sfmMerge.cpp b/src/software/utils/main_sfmMerge.cpp index 193720145b..58575b7ca7 100644 --- a/src/software/utils/main_sfmMerge.cpp +++ b/src/software/utils/main_sfmMerge.cpp @@ -32,11 +32,16 @@ int aliceVision_main(int argc, char **argv) std::string sfmDataFilename1, sfmDataFilename2; std::string outSfMDataFilename; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("firstinput,i1", po::value(&sfmDataFilename1)->required(), "First SfMData file to merge.") - ("secondinput,i2", po::value(&sfmDataFilename2)->required(), "Second SfMData file to merge.") - ("output,o", po::value(&outSfMDataFilename)->required(), "Output SfMData scene."); + ("firstinput,i1", po::value(&sfmDataFilename1)->required(), + "First SfMData file to merge.") + ("secondinput,i2", po::value(&sfmDataFilename2)->required(), + "Second SfMData file to merge.") + ("output,o", po::value(&outSfMDataFilename)->required(), + "Output SfMData scene."); + // clang-format on CmdLine cmdline("AliceVision sfmMerge"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_sfmRegression.cpp b/src/software/utils/main_sfmRegression.cpp index 642a664434..11af86a409 100644 --- a/src/software/utils/main_sfmRegression.cpp +++ b/src/software/utils/main_sfmRegression.cpp @@ -124,8 +124,6 @@ void generateSampleSceneOnePlane(sfmData::SfMData & returnSfmDataGT, sfmData::Sf int aliceVision_main(int argc, char **argv) { - po::options_description allParams("AliceVision sfmRegression"); - CmdLine cmdline("AliceVision sfmRegression"); if (!cmdline.execute(argc, argv)) { diff --git a/src/software/utils/main_sfmSplitReconstructed.cpp b/src/software/utils/main_sfmSplitReconstructed.cpp index 3095ebbd74..8f9d8170ec 100644 --- a/src/software/utils/main_sfmSplitReconstructed.cpp +++ b/src/software/utils/main_sfmSplitReconstructed.cpp @@ -33,13 +33,18 @@ int aliceVision_main(int argc, char** argv) std::string outRSfMDataFilename; std::string outNRSfMDataFilename; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), "SfMData file to align.") - ("reconstructedOutput", po::value(&outRSfMDataFilename)->required(), "Output SfMData scene.") - ("notReconstructedOutput", po::value(&outNRSfMDataFilename)->required(), "Output SfMData scene."); - - CmdLine cmdline("AliceVision sfmTransform"); + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file to align.") + ("reconstructedOutput", po::value(&outRSfMDataFilename)->required(), + "Output SfMData scene.") + ("notReconstructedOutput", po::value(&outNRSfMDataFilename)->required(), + "Output SfMData scene."); + // clang-format on + + CmdLine cmdline("AliceVision sfmSplitReconstructed"); cmdline.add(requiredParams); if(!cmdline.execute(argc, argv)) { diff --git a/src/software/utils/main_sfmToRig.cpp b/src/software/utils/main_sfmToRig.cpp index f640320f9d..35b89639ad 100644 --- a/src/software/utils/main_sfmToRig.cpp +++ b/src/software/utils/main_sfmToRig.cpp @@ -32,10 +32,14 @@ int aliceVision_main(int argc, char **argv) std::string sfmDataFilename; std::string outSfMDataFilename; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), "SfMData file") - ("output,o", po::value(&outSfMDataFilename)->required(), "Output SfMData scene."); + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file.") + ("output,o", po::value(&outSfMDataFilename)->required(), + "Output SfMData scene."); + // clang-format on CmdLine cmdline("AliceVision sfmToRig"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_sfmTransfer.cpp b/src/software/utils/main_sfmTransfer.cpp index 604a52c314..08a93a870d 100644 --- a/src/software/utils/main_sfmTransfer.cpp +++ b/src/software/utils/main_sfmTransfer.cpp @@ -102,35 +102,36 @@ int aliceVision_main(int argc, char **argv) std::vector metadataMatchingList = { "Make", "Model", "Exif:BodySerialNumber" , "Exif:LensSerialNumber" }; std::string outputViewsAndPosesFilepath; - + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file to align.") + "SfMData file to align.") ("output,o", po::value(&outSfMDataFilename)->required(), - "Output SfMData scene.") + "Output SfMData scene.") ("reference,r", po::value(&sfmDataReferenceFilename)->required(), - "Path to the scene used as the reference coordinate system."); + "Path to the scene used as the reference coordinate system."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("method", po::value(&matchingMethod)->default_value(matchingMethod), - "Matching Method:\n" - "\t- from_viewid: Align cameras with same view Id\n" - "\t- from_filepath: Align cameras with a filepath matching, using --fileMatchingPattern\n" - "\t- from_metadata: Align cameras with matching metadata, using --metadataMatchingList\n") + "Matching method:\n" + "\t- from_viewid: Align cameras with same view ID.\n" + "\t- from_filepath: Align cameras with a filepath matching, using --fileMatchingPattern.\n" + "\t- from_metadata: Align cameras with matching metadata, using --metadataMatchingList.\n") ("fileMatchingPattern", po::value(&fileMatchingPattern)->default_value(fileMatchingPattern), - "Matching pattern for the from_filepath method.\n") + "Matching pattern for the from_filepath method.\n") ("metadataMatchingList", po::value>(&metadataMatchingList)->multitoken()->default_value(metadataMatchingList), - "List of metadata that should match to create the correspondences.\n") + "List of metadata that should match to create the correspondences.\n") ("transferPoses", po::value(&transferPoses)->default_value(transferPoses), - "Transfer poses.") + "Transfer poses.") ("transferIntrinsics", po::value(&transferIntrinsics)->default_value(transferIntrinsics), - "Transfer intrinsics.") + "Transfer intrinsics.") ("transferLandmarks", po::value(&transferLandmarks)->default_value(transferLandmarks), - "Transfer landmarks.") + "Transfer landmarks.") ("outputViewsAndPoses", po::value(&outputViewsAndPosesFilepath), - "Path of the output SfMData file."); + "Path of the output SfMData file."); + // clang-format on CmdLine cmdline("AliceVision sfmTransfer"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_sfmTransform.cpp b/src/software/utils/main_sfmTransform.cpp index 940cf67e94..2aadb8fd61 100644 --- a/src/software/utils/main_sfmTransform.cpp +++ b/src/software/utils/main_sfmTransform.cpp @@ -256,51 +256,51 @@ int aliceVision_main(int argc, char **argv) std::string manualTransform; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), - "SfMData file to align.") - ("output,o", po::value(&outSfMDataFilename)->required(), - "Output SfMData scene."); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("method", po::value(&alignmentMethod)->default_value(alignmentMethod), - "Transform Method:\n" - "\t- transformation: Apply a given transformation\n" - "\t- manual: Apply the gizmo transformation\n" - "\t- auto: Determines scene orientation from the cameras' X axis, auto-scaling from GPS information if available, and defines ground level from the point cloud.\n" - "\t- auto_from_cameras: Defines coordinate system from cameras.\n" - "\t- auto_from_cameras_x_axis: Determines scene orientation from the cameras' X axis.\n" - "\t- auto_from_landmarks: Defines coordinate system from landmarks.\n" - "\t- from_single_camera: Refines the coordinate system from the camera specified by --tranformation\n" - "\t- from_markers: Refines the coordinate system from markers specified by --markers\n" - "\t- from_gps: Redefines coordinate system from GPS metadata\n" - "\t- align_ground: defines ground level from the point cloud density. It assumes that the scene is oriented.\n") - ("transformation", po::value(&transform)->default_value(transform), - "required only for 'transformation' and 'single camera' methods:\n" - "Transformation: Align [X,Y,Z] to +Y-axis, rotate around Y by R deg, scale by S; syntax: X,Y,Z;R;S\n" - "Single camera: camera UID or image filename") - ("manualTransform", po::value(&manualTransform), - "Translation, rotation and scale defined with the manual mode.") - ("landmarksDescriberTypes,d", po::value(&landmarksDescriberTypesName)->default_value(landmarksDescriberTypesName), - ("optional for 'landmarks' method:\n" - "Image describer types used to compute the mean of the point cloud\n" - "Use all of them if empty\n" - + feature::EImageDescriberType_informations()).c_str()) - ("scale", po::value(&userScale)->default_value(userScale), - "Additional scale to apply.") - ("applyScale", po::value(&applyScale)->default_value(applyScale), - "Apply scale transformation.") - ("applyRotation", po::value(&applyRotation)->default_value(applyRotation), - "Apply rotation transformation.") - ("applyTranslation", po::value(&applyTranslation)->default_value(applyTranslation), - "Apply translation transformation.") - ("markers", po::value>(&markers)->multitoken(), - "Markers ID and target coordinates 'ID:x,y,z'.") - ("outputViewsAndPoses", po::value(&outputViewsAndPosesFilepath), - "Path of the output SfMData file.") - ; + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "SfMData file to align.") + ("output,o", po::value(&outSfMDataFilename)->required(), + "Output SfMData scene."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("method", po::value(&alignmentMethod)->default_value(alignmentMethod), + "Transform Method:\n" + "\t- transformation: Apply a given transformation.\n" + "\t- manual: Apply the gizmo transformation.\n" + "\t- auto: Determines scene orientation from the cameras' X axis, auto-scaling from GPS information if available, and defines ground level from the point cloud.\n" + "\t- auto_from_cameras: Defines coordinate system from cameras.\n" + "\t- auto_from_cameras_x_axis: Determines scene orientation from the cameras' X axis.\n" + "\t- auto_from_landmarks: Defines coordinate system from landmarks.\n" + "\t- from_single_camera: Refines the coordinate system from the camera specified by --tranformation.\n" + "\t- from_markers: Refines the coordinate system from markers specified by --markers.\n" + "\t- from_gps: Redefines coordinate system from GPS metadata.\n" + "\t- align_ground: defines ground level from the point cloud density. It assumes that the scene is oriented.\n") + ("transformation", po::value(&transform)->default_value(transform), + "Required only for 'transformation' and 'single camera' methods:\n" + "Transformation: Align [X,Y,Z] to +Y-axis, rotate around Y by R deg, scale by S; syntax: X,Y,Z;R;S.\n" + "Single camera: camera UID or image filename.") + ("manualTransform", po::value(&manualTransform), + "Translation, rotation and scale defined with the manual mode.") + ("landmarksDescriberTypes,d", po::value(&landmarksDescriberTypesName)->default_value(landmarksDescriberTypesName), + ("Optional for 'landmarks' method:\n" + "Image describer types used to compute the mean of the point cloud.\n" + "Use all of them if empty\n" + feature::EImageDescriberType_informations()).c_str()) + ("scale", po::value(&userScale)->default_value(userScale), + "Additional scale to apply.") + ("applyScale", po::value(&applyScale)->default_value(applyScale), + "Apply scale transformation.") + ("applyRotation", po::value(&applyRotation)->default_value(applyRotation), + "Apply rotation transformation.") + ("applyTranslation", po::value(&applyTranslation)->default_value(applyTranslation), + "Apply translation transformation.") + ("markers", po::value>(&markers)->multitoken(), + "Markers ID and target coordinates 'ID:x,y,z'.") + ("outputViewsAndPoses", po::value(&outputViewsAndPosesFilepath), + "Path of the output SfMData file."); + // clang-format on CmdLine cmdline("AliceVision sfmTransform"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_split360Images.cpp b/src/software/utils/main_split360Images.cpp index 034b4f3d48..3d4d19cbef 100644 --- a/src/software/utils/main_split360Images.cpp +++ b/src/software/utils/main_split360Images.cpp @@ -378,37 +378,39 @@ int aliceVision_main(int argc, char** argv) int nbThreads = 3; std::string extension; // extension of output images + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&inputPath)->required(), - "Input image file, image folder or SfMData.") + "Input image file, image folder or SfMData.") ("output,o", po::value(&outputFolder)->required(), - "Output folder for extracted images.") + "Output folder for extracted images.") ("outSfMData", po::value(&outSfmDataFilepath)->required(), - "Filepath for output SfMData."); + "Filepath for output SfMData."); po::options_description optionalParams("Optional parameters"); optionalParams.add_options() ("splitMode,m", po::value(&splitMode)->default_value("equirectangular"), - "Split mode (equirectangular, dualfisheye)") + "Split mode (equirectangular, dualfisheye).") ("dualFisheyeOffsetPresetX", po::value(&dualFisheyeOffsetPresetX)->default_value("center"), - "Dual-Fisheye offset preset on X axis (left, center, right)") + "Dual-Fisheye offset preset on X axis (left, center, right).") ("dualFisheyeOffsetPresetY", po::value(&dualFisheyeOffsetPresetY)->default_value("center"), - "Dual-Fisheye offset preset on Y axis (top, center, left)") + "Dual-Fisheye offset preset on Y axis (top, center, left).") ("dualFisheyeCameraModel", po::value(&dualFisheyeCameraModel)->default_value("fisheye4"), - "Dual-Fisheye camera model (fisheye4 or equidistant_r3)") + "Dual-Fisheye camera model (fisheye4 or equidistant_r3).") ("equirectangularNbSplits", po::value(&equirectangularNbSplits)->default_value(2), - "Equirectangular number of splits") + "Equirectangular number of splits.") ("equirectangularSplitResolution", po::value(&equirectangularSplitResolution)->default_value(1200), - "Equirectangular split resolution") + "Equirectangular split resolution.") ("equirectangularPreviewMode", po::value(&equirectangularPreviewMode)->default_value(equirectangularPreviewMode), - "Export a SVG file that simulate the split") + "Export a SVG file that simulate the split.") ("fov", po::value(&fov)->default_value(fov), - "Field of View to extract (in degree).") + "Field of View to extract (in degree).") ("nbThreads", po::value(&nbThreads)->default_value(nbThreads), - "Number of threads.") + "Number of threads.") ("extension", po::value(&extension)->default_value(extension), - "Output image extension (empty to keep the source file format)."); + "Output image extension (empty to keep the source file format)."); + // clang-format on CmdLine cmdline("This program is used to extract multiple images from equirectangular or dualfisheye images or image folder.\n" "AliceVision split360Images"); diff --git a/src/software/utils/main_voctreeCreation.cpp b/src/software/utils/main_voctreeCreation.cpp index 88b23eb100..79e270be26 100644 --- a/src/software/utils/main_voctreeCreation.cpp +++ b/src/software/utils/main_voctreeCreation.cpp @@ -54,20 +54,30 @@ int aliceVision_main(int argc, char** argv) std::uint32_t LEVELS = 6; bool sanityCheck = true; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), "a SfMData file.") - ("weights,w", po::value(&weightName)->required(), "Output name for the weight file") - ("tree,t", po::value(&treeName)->required(), "Output name for the tree file"); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), - "Path to folder(s) containing the extracted features.") - (",k", po::value(&K)->default_value(10), "The branching factor of the tree") - ("restart,r", po::value(&restart)->default_value(5), "Number of times that the kmean is launched for each cluster, the best solution is kept") - (",L", po::value(&LEVELS)->default_value(6), "Number of levels of the tree") - ("sanitycheck,s", po::value(&sanityCheck)->default_value(sanityCheck), "Perform a sanity check at the end of the creation of the vocabulary tree. The sanity check is a query to the database with the same documents/images useed to train the vocabulary tree"); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "A SfMData file.") + ("weights,w", po::value(&weightName)->required(), + "Output name for the weight file.") + ("tree,t", po::value(&treeName)->required(), + "Output name for the tree file."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), + "Path to folder(s) containing the extracted features.") + (",k", po::value(&K)->default_value(10), + "The branching factor of the tree.") + ("restart,r", po::value(&restart)->default_value(5), + "Number of times that the kmean is launched for each cluster, the best solution is kept.") + (",L", po::value(&LEVELS)->default_value(6), + "Number of levels of the tree.") + ("sanitycheck,s", po::value(&sanityCheck)->default_value(sanityCheck), + "Perform a sanity check at the end of the creation of the vocabulary tree. " + "The sanity check is a query to the database with the same documents/images useed to train the vocabulary tree."); + // clang-format on CmdLine cmdline("This program is used to load the sift descriptors from a SfMData file and create a vocabulary tree.\n" "It takes as input either a list.txt file containing a simple list of images (bundler format and older AliceVision version format)\n" diff --git a/src/software/utils/main_voctreeQueryUtility.cpp b/src/software/utils/main_voctreeQueryUtility.cpp index e29591a6ef..41108aac86 100644 --- a/src/software/utils/main_voctreeQueryUtility.cpp +++ b/src/software/utils/main_voctreeQueryUtility.cpp @@ -127,6 +127,7 @@ int aliceVision_main(int argc, char** argv) aliceVision::sfmData::SfMData sfmData; aliceVision::sfmData::SfMData* querySfmData; + // clang-format off po::options_description requiredParams("Required parameters"); requiredParams.add_options() ("input,i", po::value(&sfmDataFilename)->required(), @@ -160,6 +161,7 @@ int aliceVision_main(int argc, char** argv) "Number of features extracted from the .feat files.") ("distance,d", po::value(&distance)->default_value("strongCommonPoints"), "Distance used."); + // clang-format on aliceVision::CmdLine cmdline(programDescription + "AliceVision voctreeQueryUtility"); cmdline.add(requiredParams); diff --git a/src/software/utils/main_voctreeStatistics.cpp b/src/software/utils/main_voctreeStatistics.cpp index 37ba57d579..155745d304 100644 --- a/src/software/utils/main_voctreeStatistics.cpp +++ b/src/software/utils/main_voctreeStatistics.cpp @@ -59,23 +59,31 @@ int aliceVision_main(int argc, char** argv) std::string querySfmDataFilename = ""; // the file containing the list of features to use as query std::string distance; - po::options_description requiredParams("Required parameters"); - requiredParams.add_options() - ("input,i", po::value(&sfmDataFilename)->required(), "a SfMData file.") - ("tree,t", po::value(&treeName)->required(), "Input name for the tree file"); - - po::options_description optionalParams("Optional parameters"); - optionalParams.add_options() - ("weights,w", po::value(&weightsName), "Input name for the weight file, if not provided the weights will be computed on the database built with the provided set") - ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), - "Path to folder(s) containing the extracted features.") - ("querySfmDataFilename,q", po::value(&querySfmDataFilename), "Path to the SfMData file to be used for querying the database") - ("distance,d",po::value(&distance)->default_value(""), "Method used to compute distance between histograms: \n " - "-classic: eucledian distance \n" - "-commonPoints: counts common points between histograms \n" - "-strongCommonPoints: counts common 1 values \n" - "-weightedStrongCommonPoints: strongCommonPoints with weights \n" - "-inversedWeightedCommonPoints: strongCommonPoints with inverted weights"); + // clang-format off + po::options_description requiredParams("Required parameters"); + requiredParams.add_options() + ("input,i", po::value(&sfmDataFilename)->required(), + "A SfMData file.") + ("tree,t", po::value(&treeName)->required(), + "Input name for the tree file."); + + po::options_description optionalParams("Optional parameters"); + optionalParams.add_options() + ("weights,w", po::value(&weightsName), + "Input name for the weight file, if not provided the weights will be computed on the database built " + "with the provided set.") + ("featuresFolders,f", po::value>(&featuresFolders)->multitoken(), + "Path to folder(s) containing the extracted features.") + ("querySfmDataFilename,q", po::value(&querySfmDataFilename), + "Path to the SfMData file to be used for querying the database.") + ("distance,d",po::value(&distance)->default_value(""), + "Method used to compute distance between histograms: \n" + " - classic: eucledian distance\n" + " - commonPoints: counts common points between histograms\n" + " - strongCommonPoints: counts common 1 values\n" + " - weightedStrongCommonPoints: strongCommonPoints with weights\n" + " - inversedWeightedCommonPoints: strongCommonPoints with inverted weights."); + // clang-format on CmdLine cmdline("This program is used to create a database with a provided dataset of image descriptors using a trained vocabulary tree.\n" "The database is then queried with the same images in order to retrieve for each image the set of most similar images in the dataset.\n"