diff --git a/src/software/pipeline/main_featureExtraction.cpp b/src/software/pipeline/main_featureExtraction.cpp index f82ea5483e..8fefd38385 100644 --- a/src/software/pipeline/main_featureExtraction.cpp +++ b/src/software/pipeline/main_featureExtraction.cpp @@ -142,8 +142,7 @@ int aliceVision_main(int argc, char **argv) // set extraction range if(rangeStart != -1) { - if(rangeStart < 0 || rangeSize < 0 || - rangeStart > sfmData.getViews().size()) + if(rangeStart < 0 || rangeSize < 0) { ALICEVISION_LOG_ERROR("Range is incorrect"); return EXIT_FAILURE; @@ -152,6 +151,11 @@ int aliceVision_main(int argc, char **argv) if(rangeStart + rangeSize > sfmData.views.size()) rangeSize = sfmData.views.size() - rangeStart; + if(rangeSize <= 0) + { + ALICEVISION_LOG_WARNING("Nothing to compute."); + return EXIT_SUCCESS; + } extractor.setRange(rangeStart, rangeSize); } diff --git a/src/software/pipeline/main_prepareDenseScene.cpp b/src/software/pipeline/main_prepareDenseScene.cpp index dc1d063c1f..2451037e49 100644 --- a/src/software/pipeline/main_prepareDenseScene.cpp +++ b/src/software/pipeline/main_prepareDenseScene.cpp @@ -188,7 +188,7 @@ bool prepareDenseScene(const SfMData& sfmData, projectionMatrix << P(0, 0), P(0, 1), P(0, 2), P(0, 3), P(1, 0), P(1, 1), P(1, 2), P(1, 3), P(2, 0), P(2, 1), P(2, 2), P(2, 3), - 0, 0, 0, 1; + 0, 0, 0, 1; // convert matrices to rowMajor std::vector vP(projectionMatrix.size()); @@ -346,8 +346,7 @@ int aliceVision_main(int argc, char *argv[]) // set range if(rangeStart != -1) { - if(rangeStart < 0 || rangeSize < 0 || - rangeStart > sfmData.getViews().size()) + if(rangeStart < 0 || rangeSize < 0) { ALICEVISION_LOG_ERROR("Range is incorrect"); return EXIT_FAILURE; @@ -357,6 +356,12 @@ int aliceVision_main(int argc, char *argv[]) rangeSize = sfmData.views.size() - rangeStart; rangeEnd = rangeStart + rangeSize; + + if(rangeSize <= 0) + { + ALICEVISION_LOG_WARNING("Nothing to compute."); + return EXIT_SUCCESS; + } } else { @@ -364,7 +369,8 @@ int aliceVision_main(int argc, char *argv[]) } // export - if(prepareDenseScene(sfmData, imagesFolders, masksFolders, rangeStart, rangeEnd, outFolder, outputFileType, saveMetadata, saveMatricesTxtFiles, evCorrection)) + if(prepareDenseScene(sfmData, imagesFolders, masksFolders, rangeStart, rangeEnd, + outFolder, outputFileType, saveMetadata, saveMatricesTxtFiles, evCorrection)) return EXIT_SUCCESS; return EXIT_FAILURE;