diff --git a/src/aliceVision/fuseCut/DelaunayGraphCut.cpp b/src/aliceVision/fuseCut/DelaunayGraphCut.cpp index be6da5c0cb..999d12eace 100644 --- a/src/aliceVision/fuseCut/DelaunayGraphCut.cpp +++ b/src/aliceVision/fuseCut/DelaunayGraphCut.cpp @@ -295,9 +295,20 @@ void createVerticesWithVisibilities(const StaticVector& cams, std::vector

simMapTmp(simMap.size()); imageAlgo::convolveImage(width, height, simMap, simMapTmp, "gaussian", simGaussianSize, simGaussianSize); @@ -879,9 +890,20 @@ void DelaunayGraphCut::fuseFromDepthMaps(const StaticVector& cams, const Po } int wTmp, hTmp; const std::string simMapFilepath = getFileNameFromIndex(mp, c, mvsUtils::EFileType::simMap, 0); - imageIO::readImage(simMapFilepath, wTmp, hTmp, simMap, imageIO::EImageColorSpace::NO_CONVERSION); - if(wTmp != width || hTmp != height) - throw std::runtime_error("Wrong sim map dimensions: " + simMapFilepath); + // If we have a simMap in input use it, + // else init with a constant value. + if(boost::filesystem::exists(simMapFilepath)) + { + imageIO::readImage(simMapFilepath, wTmp, hTmp, simMap, imageIO::EImageColorSpace::NO_CONVERSION); + if(wTmp != width || hTmp != height) + throw std::runtime_error("Wrong sim map dimensions: " + simMapFilepath); + } + else + { + ALICEVISION_LOG_WARNING("simMap file can't be found."); + simMap.resize(width * height, -1); + } + { std::vector simMapTmp(simMap.size()); imageAlgo::convolveImage(width, height, simMap, simMapTmp, "gaussian", params.simGaussianSizeInit, params.simGaussianSizeInit);