Skip to content

Commit

Permalink
[software] add sub-range support for parallelization in convertDepthMap
Browse files Browse the repository at this point in the history
  • Loading branch information
almarouk committed Aug 1, 2023
1 parent 7d50f65 commit d58ebc6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/software/convert/main_convertDepthMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ int aliceVision_main(int argc, char** argv)
std::string sfmDataFilename;
std::string depthMapsFolder;
std::string outputFolder;
// program range
int rangeStart = -1;
int rangeSize = -1;

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
Expand All @@ -164,10 +167,18 @@ int aliceVision_main(int argc, char** argv)
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output folder for depth maps meshes.");

po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("rangeStart", po::value<int>(&rangeStart)->default_value(rangeStart),
"Compute a sub-range of images from index rangeStart to rangeStart+rangeSize.")
("rangeSize", po::value<int>(&rangeSize)->default_value(rangeSize),
"Compute a sub-range of N images (N=rangeSize).");

CmdLine cmdline("The program allows to convert depth maps to mesh format.\n"
"AliceVision convertDepthMap");

cmdline.add(requiredParams);
cmdline.add(optionalParams);

// check command-line execution
if(!cmdline.execute(argc, argv))
Expand All @@ -191,7 +202,7 @@ int aliceVision_main(int argc, char** argv)
cams.reserve(mp.ncams);

// TODO: chunks / multithreading
for(int rc = 0; rc < mp.ncams; rc++)
for(int rc = 0; rc < std::min(rangeStart + rangeSize, mp.ncams); rc++)
cams.push_back(rc);

// we do not need mtl file
Expand Down

0 comments on commit d58ebc6

Please sign in to comment.