Skip to content

Commit a465f44

Browse files
committed
[software] add sub-range support for parallelization in convertDepthMap
1 parent 2ca3592 commit a465f44

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/software/convert/main_convertDepthMap.cpp

+12-1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ int aliceVision_main(int argc, char** argv)
154154
std::string sfmDataFilename;
155155
std::string depthMapsFolder;
156156
std::string outputFolder;
157+
// program range
158+
int rangeStart = -1;
159+
int rangeSize = -1;
157160

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

170+
po::options_description optionalParams("Optional parameters");
171+
optionalParams.add_options()
172+
("rangeStart", po::value<int>(&rangeStart)->default_value(rangeStart),
173+
"Compute a sub-range of images from index rangeStart to rangeStart+rangeSize.")
174+
("rangeSize", po::value<int>(&rangeSize)->default_value(rangeSize),
175+
"Compute a sub-range of N images (N=rangeSize).");
176+
167177
CmdLine cmdline("The program allows to convert depth maps to mesh format.\n"
168178
"AliceVision convertDepthMap");
169179

170180
cmdline.add(requiredParams);
181+
cmdline.add(optionalParams);
171182

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

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

197208
// we do not need mtl file

0 commit comments

Comments
 (0)