From 928d69e85d8a5fb0f702509b728a9e777fd856a9 Mon Sep 17 00:00:00 2001 From: raffaele2692 Date: Thu, 10 Sep 2020 16:49:28 +0200 Subject: [PATCH 1/4] new param minVis --- src/aliceVision/fuseCut/DelaunayGraphCut.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/aliceVision/fuseCut/DelaunayGraphCut.hpp b/src/aliceVision/fuseCut/DelaunayGraphCut.hpp index c9333df241..10a61afd4c 100644 --- a/src/aliceVision/fuseCut/DelaunayGraphCut.hpp +++ b/src/aliceVision/fuseCut/DelaunayGraphCut.hpp @@ -42,6 +42,8 @@ struct FuseParams /// The step used to load depth values from depth maps is computed from maxInputPts. Here we define the minimal value for this step, /// so on small datasets we will not spend too much time at the beginning loading all depth values. int minStep = 2; + /// After fusion, filter points based on their number of observations + int minVis = 2; float simFactor = 15.0f; float angleFactor = 15.0f; From 07b6f80a0e1c9baa2e7713eb72fcc996d64dfb7f Mon Sep 17 00:00:00 2001 From: raffaele2692 Date: Thu, 10 Sep 2020 16:54:42 +0200 Subject: [PATCH 2/4] Update DelaunayGraphCut.cpp Added a condition in DelaunayGraphCut::fuseFromDepthMaps to filter out points based on their number of observations (passed via the minVis parameter). --- src/aliceVision/fuseCut/DelaunayGraphCut.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/aliceVision/fuseCut/DelaunayGraphCut.cpp b/src/aliceVision/fuseCut/DelaunayGraphCut.cpp index 0d51ba517d..bd7c88c50f 100644 --- a/src/aliceVision/fuseCut/DelaunayGraphCut.cpp +++ b/src/aliceVision/fuseCut/DelaunayGraphCut.cpp @@ -1078,6 +1078,13 @@ void DelaunayGraphCut::fuseFromDepthMaps(const StaticVector& cams, const Po pixSizePrepare[vIndex] = -1; continue; } + // Filter points based on their number of observations + if(visCams.size() < params.minVis) + { + ALICEVISION_LOG_DEBUG("minVis value:" << params.minVis); + pixSizePrepare[vIndex] = -1; + continue; + } const double angleScore = 1.0 + params.angleFactor / maxAngle; // Combine angleScore with simScore From 2ce4a31c65e9be14eb785a0a0137e51af7265c3e Mon Sep 17 00:00:00 2001 From: raffaele2692 Date: Thu, 10 Sep 2020 16:58:36 +0200 Subject: [PATCH 3/4] new parameter minVis --- src/software/pipeline/main_meshing.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/software/pipeline/main_meshing.cpp b/src/software/pipeline/main_meshing.cpp index 737cf99c9f..03fca301bd 100644 --- a/src/software/pipeline/main_meshing.cpp +++ b/src/software/pipeline/main_meshing.cpp @@ -303,6 +303,8 @@ int aliceVision_main(int argc, char* argv[]) "simFactor") ("angleFactor", po::value(&fuseParams.angleFactor)->default_value(fuseParams.angleFactor), "angleFactor") + ("minVis", po::value(&fuseParams.minVis)->default_value(fuseParams.minVis), + "Filter points based on their number of observations") ("partitioning", po::value(&partitioningMode)->default_value(partitioningMode), "Partitioning: 'singleBlock' or 'auto'.") ("repartition", po::value(&repartitionMode)->default_value(repartitionMode), From 3eca2c4341474f5f9f2a897c509711f9cf164ddd Mon Sep 17 00:00:00 2001 From: raffaele2692 Date: Mon, 21 Sep 2020 10:28:04 +0200 Subject: [PATCH 4/4] post-review update add counter for points filtered out (not enough observation) add info log for total count add info log for parameter minVis in log header --- src/aliceVision/fuseCut/DelaunayGraphCut.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/aliceVision/fuseCut/DelaunayGraphCut.cpp b/src/aliceVision/fuseCut/DelaunayGraphCut.cpp index bd7c88c50f..e3ecaf247d 100644 --- a/src/aliceVision/fuseCut/DelaunayGraphCut.cpp +++ b/src/aliceVision/fuseCut/DelaunayGraphCut.cpp @@ -871,12 +871,16 @@ void DelaunayGraphCut::fuseFromDepthMaps(const StaticVector& cams, const Po verticesCoordsPrepare.resize(realMaxVertices); std::vector pixSizePrepare(realMaxVertices); std::vector simScorePrepare(realMaxVertices); + + // counter for points filtered based on the number of observations (minVis) + int minVisCounter = 0; ALICEVISION_LOG_INFO("simFactor: " << params.simFactor); ALICEVISION_LOG_INFO("nbPixels: " << nbPixels); ALICEVISION_LOG_INFO("maxVertices: " << params.maxPoints); ALICEVISION_LOG_INFO("step: " << step); ALICEVISION_LOG_INFO("realMaxVertices: " << realMaxVertices); + ALICEVISION_LOG_INFO("minVis: " << params.minVis); ALICEVISION_LOG_INFO("Load depth maps and add points."); { @@ -1081,8 +1085,8 @@ void DelaunayGraphCut::fuseFromDepthMaps(const StaticVector& cams, const Po // Filter points based on their number of observations if(visCams.size() < params.minVis) { - ALICEVISION_LOG_DEBUG("minVis value:" << params.minVis); pixSizePrepare[vIndex] = -1; + minVisCounter += 1; continue; } @@ -1102,6 +1106,7 @@ void DelaunayGraphCut::fuseFromDepthMaps(const StaticVector& cams, const Po ALICEVISION_LOG_INFO("Angle min: " << stat_minAngle << ", max: " << stat_maxAngle << "."); ALICEVISION_LOG_INFO("Angle score min: " << stat_minAngleScore << ", max: " << stat_maxAngleScore << "."); #endif + ALICEVISION_LOG_INFO((minVisCounter) << " points filtered based on the number of observations (minVis). "); removeInvalidPoints(verticesCoordsPrepare, pixSizePrepare, simScorePrepare, verticesAttrPrepare); ALICEVISION_LOG_INFO("Filter by angle score and sim score");