diff --git a/meshroom/aliceVision/ImageMatchingMultiSfM.py b/meshroom/aliceVision/ImageMatchingMultiSfM.py index f2e812a5d6..b4cda96869 100644 --- a/meshroom/aliceVision/ImageMatchingMultiSfM.py +++ b/meshroom/aliceVision/ImageMatchingMultiSfM.py @@ -1,4 +1,4 @@ -__version__ = "1.0" +__version__ = "1.1" from meshroom.core import desc from meshroom.core.utils import VERBOSE_LEVEL @@ -91,6 +91,13 @@ class ImageMatchingMultiSfM(desc.AVCommandLineNode): value="a/a+a/b", values=["a/a+a/b","a/ab", "a/b"], ), + desc.BoolParam( + name="removeDuplicates", + label="Remove duplicates", + description="If enabled, views that belong to both A and B will be ignored in A.", + value=True, + advanced=True + ), desc.IntParam( name="minNbImages", label="Voc Tree: Minimum Number Of Images", diff --git a/meshroom/cameraTracking.mg b/meshroom/cameraTracking.mg index c0401ee7e6..a655bcba9f 100644 --- a/meshroom/cameraTracking.mg +++ b/meshroom/cameraTracking.mg @@ -17,7 +17,7 @@ "FeatureExtraction": "1.3", "FeatureMatching": "2.0", "ImageMatching": "2.0", - "ImageMatchingMultiSfM": "1.0", + "ImageMatchingMultiSfM": "1.1", "ImageSegmentationSam3": "1.0", "IntrinsicsTransforming": "1.1", "KeyframeSelection": "5.0", diff --git a/meshroom/cameraTrackingDepth.mg b/meshroom/cameraTrackingDepth.mg index aaf837b489..d55d066a40 100644 --- a/meshroom/cameraTrackingDepth.mg +++ b/meshroom/cameraTrackingDepth.mg @@ -18,7 +18,7 @@ "FeatureExtraction": "1.3", "FeatureMatching": "2.0", "ImageMatching": "2.0", - "ImageMatchingMultiSfM": "1.0", + "ImageMatchingMultiSfM": "1.1", "ImageSegmentationSam3": "1.0", "IntrinsicsTransforming": "1.1", "KeyframeSelection": "5.0", diff --git a/meshroom/cameraTrackingLegacy.mg b/meshroom/cameraTrackingLegacy.mg index f7a2f10261..9992eeebfc 100644 --- a/meshroom/cameraTrackingLegacy.mg +++ b/meshroom/cameraTrackingLegacy.mg @@ -17,7 +17,7 @@ "FeatureMatching": "2.0", "ImageDetectionPrompt": "1.0", "ImageMatching": "2.0", - "ImageMatchingMultiSfM": "1.0", + "ImageMatchingMultiSfM": "1.1", "ImageSegmentationBox": "1.0", "KeyframeSelection": "5.0", "MeshDecimate": "1.0", diff --git a/meshroom/cameraTrackingWithoutCalibration.mg b/meshroom/cameraTrackingWithoutCalibration.mg index d9e2940b26..d0190dffbd 100644 --- a/meshroom/cameraTrackingWithoutCalibration.mg +++ b/meshroom/cameraTrackingWithoutCalibration.mg @@ -16,7 +16,7 @@ "FeatureExtraction": "1.3", "FeatureMatching": "2.0", "ImageMatching": "2.0", - "ImageMatchingMultiSfM": "1.0", + "ImageMatchingMultiSfM": "1.1", "ImageSegmentationSam3": "1.0", "IntrinsicsTransforming": "1.1", "KeyframeSelection": "5.0", diff --git a/meshroom/cameraTrackingWithoutCalibrationLegacy.mg b/meshroom/cameraTrackingWithoutCalibrationLegacy.mg index 7b0bf2f0e7..2ba5c9918b 100644 --- a/meshroom/cameraTrackingWithoutCalibrationLegacy.mg +++ b/meshroom/cameraTrackingWithoutCalibrationLegacy.mg @@ -16,7 +16,7 @@ "FeatureMatching": "2.0", "ImageDetectionPrompt": "1.0", "ImageMatching": "2.0", - "ImageMatchingMultiSfM": "1.0", + "ImageMatchingMultiSfM": "1.1", "ImageSegmentationBox": "1.0", "KeyframeSelection": "5.0", "MeshDecimate": "1.0", diff --git a/meshroom/photogrammetryAndCameraTracking.mg b/meshroom/photogrammetryAndCameraTracking.mg index 891fda2574..7879013b4a 100644 --- a/meshroom/photogrammetryAndCameraTracking.mg +++ b/meshroom/photogrammetryAndCameraTracking.mg @@ -17,7 +17,7 @@ "FeatureExtraction": "1.3", "FeatureMatching": "2.0", "ImageMatching": "2.0", - "ImageMatchingMultiSfM": "1.0", + "ImageMatchingMultiSfM": "1.1", "ImageSegmentationSam3": "1.0", "IntrinsicsTransforming": "1.1", "KeyframeSelection": "5.0", diff --git a/meshroom/photogrammetryAndCameraTrackingLegacy.mg b/meshroom/photogrammetryAndCameraTrackingLegacy.mg index bc812a0fd7..d9526a9abc 100644 --- a/meshroom/photogrammetryAndCameraTrackingLegacy.mg +++ b/meshroom/photogrammetryAndCameraTrackingLegacy.mg @@ -17,7 +17,7 @@ "FeatureMatching": "2.0", "ImageDetectionPrompt": "1.0", "ImageMatching": "2.0", - "ImageMatchingMultiSfM": "1.0", + "ImageMatchingMultiSfM": "1.1", "ImageSegmentationBox": "1.0", "KeyframeSelection": "5.0", "MeshDecimate": "1.0", diff --git a/meshroom/photogrammetryObjectTwoSides.mg b/meshroom/photogrammetryObjectTwoSides.mg index 889383a134..5899233ca6 100644 --- a/meshroom/photogrammetryObjectTwoSides.mg +++ b/meshroom/photogrammetryObjectTwoSides.mg @@ -12,7 +12,7 @@ "FeatureMatching": "2.0", "ImageDetectionPrompt": "1.0", "ImageMatching": "2.0", - "ImageMatchingMultiSfM": "1.0", + "ImageMatchingMultiSfM": "1.1", "ImageSegmentationBox": "1.0", "MeshFiltering": "3.0", "Meshing": "7.0", diff --git a/src/software/pipeline/main_imageMatching.cpp b/src/software/pipeline/main_imageMatching.cpp index 4c554e281f..41a3cd69ff 100644 --- a/src/software/pipeline/main_imageMatching.cpp +++ b/src/software/pipeline/main_imageMatching.cpp @@ -31,7 +31,7 @@ // These constants define the current software version. // They must be updated when the command line is changed. #define ALICEVISION_SOFTWARE_VERSION_MAJOR 1 -#define ALICEVISION_SOFTWARE_VERSION_MINOR 0 +#define ALICEVISION_SOFTWARE_VERSION_MINOR 1 using namespace aliceVision; using namespace aliceVision::voctree; @@ -66,6 +66,8 @@ int aliceVision_main(int argc, char** argv) std::string weightsFilepath; /// flag for the optional weights file bool withWeights = false; + /// Do we remove views from A if they belong to B ? + bool removeDuplicates = true; // multiple SfM parameters @@ -119,7 +121,8 @@ int aliceVision_main(int argc, char** argv) ("matchingMode", po::value(&matchingModeName)->default_value(matchingModeName), EImageMatchingMode_description().c_str()) ("outputCombinedSfM", po::value(&outputCombinedSfM)->default_value(outputCombinedSfM), - "Output file path for the combined SfMData file (if empty, don't combine)."); + "Output file path for the combined SfMData file (if empty, don't combine).") + ("removeDuplicates", po::value(&removeDuplicates)->default_value(removeDuplicates), "Do we remove views from A if they belong to B ?"); // clang-format on CmdLine cmdline("The objective of this software is to find images that are looking to the same areas of the scene. " @@ -166,11 +169,14 @@ int aliceVision_main(int argc, char** argv) } // remove duplicated view - for (const auto& viewPair : sfmDataB.getViews()) + if (removeDuplicates) { - sfmData::Views::iterator it = sfmDataA.getViews().find(viewPair.first); - if (it != sfmDataA.getViews().end()) - sfmDataA.getViews().erase(it); + for (const auto& viewPair : sfmDataB.getViews()) + { + sfmData::Views::iterator it = sfmDataA.getViews().find(viewPair.first); + if (it != sfmDataA.getViews().end()) + sfmDataA.getViews().erase(it); + } } }