Skip to content

Commit

Permalink
[software] Meshing: use only one depth map folder input
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmtE committed Jun 17, 2020
1 parent ce9c463 commit f8109b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/aliceVision/mvsUtils/MultiViewParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ MultiViewParams::MultiViewParams(const sfmData::SfMData& sfmData,

if(readFromDepthMaps)
{
path = getFileNameFromViewId(this, view.getViewId(), mvsUtils::EFileType::depthMap, 1);
// use output of DepthMapFilter if scale==0
// use output of DepthMap if scale==1
const int scale = (depthMapsFolder.empty() ? 0 : 1);
path = getFileNameFromViewId(this, view.getViewId(), mvsUtils::EFileType::depthMap, scale);
}
else if(_imagesFolder != "/" && !_imagesFolder.empty() && fs::is_directory(_imagesFolder) && !fs::is_empty(_imagesFolder))
{
Expand Down
10 changes: 3 additions & 7 deletions src/software/pipeline/main_meshing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ int aliceVision_main(int argc, char* argv[])
std::string outputMesh;
std::string outputDensePointCloud;
std::string depthMapsFolder;
std::string depthMapsFilterFolder;
EPartitioningMode partitioningMode = ePartitioningSingleBlock;
ERepartitionMode repartitionMode = eRepartitionMultiResolution;
std::size_t estimateSpaceMinObservations = 3;
Expand Down Expand Up @@ -168,8 +167,6 @@ int aliceVision_main(int argc, char* argv[])
po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("depthMapsFolder", po::value<std::string>(&depthMapsFolder),
"Input depth maps folder.")
("depthMapsFilterFolder", po::value<std::string>(&depthMapsFilterFolder),
"Input filtered depth maps folder.")
("maxInputPoints", po::value<int>(&fuseParams.maxInputPoints)->default_value(fuseParams.maxInputPoints),
"Max input points loaded from images.")
Expand Down Expand Up @@ -262,10 +259,9 @@ int aliceVision_main(int argc, char* argv[])
// set verbose level
system::Logger::get()->setLogLevel(verboseLevel);

if(depthMapsFolder.empty() || depthMapsFilterFolder.empty())
if(depthMapsFolder.empty())
{
if(depthMapsFolder.empty() &&
depthMapsFilterFolder.empty() &&
repartitionMode == eRepartitionMultiResolution &&
partitioningMode == ePartitioningSingleBlock)
{
Expand All @@ -275,7 +271,7 @@ int aliceVision_main(int argc, char* argv[])
else
{
ALICEVISION_LOG_ERROR("Invalid input options:\n"
"- Meshing from depth maps require --depthMapsFolder and --depthMapsFilterFolder options.\n"
"- Meshing from depth maps require --depthMapsFolder option.\n"
"- Meshing from SfM require option --partitioning set to 'singleBlock' and option --repartition set to 'multiResolution'.");
return EXIT_FAILURE;
}
Expand All @@ -290,7 +286,7 @@ int aliceVision_main(int argc, char* argv[])
}

// initialization
mvsUtils::MultiViewParams mp(sfmData, "", depthMapsFolder, depthMapsFilterFolder, meshingFromDepthMaps);
mvsUtils::MultiViewParams mp(sfmData, "", "", depthMapsFolder, meshingFromDepthMaps);

mp.userParams.put("LargeScale.universePercentile", universePercentile);

Expand Down

0 comments on commit f8109b0

Please sign in to comment.