From 9319da0d458e69dccf29178cbebb3e46994e04b7 Mon Sep 17 00:00:00 2001 From: kerautret Date: Sun, 23 Feb 2025 12:36:24 +0100 Subject: [PATCH 1/3] add option to avoid filtering when no confidence --- bin/extractAccOrigins.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/bin/extractAccOrigins.cpp b/bin/extractAccOrigins.cpp index c6490a4..c5d5401 100644 --- a/bin/extractAccOrigins.cpp +++ b/bin/extractAccOrigins.cpp @@ -44,7 +44,7 @@ int main(int argc, char *const *argv) unsigned int thAcc {50}; double radius {5.0}; bool invertNormal {false}; - + bool extractNoConf {false}; // parse command line using CLI ---------------------------------------------- CLI::App app; @@ -54,10 +54,10 @@ int main(int argc, char *const *argv) ->required() ->check(CLI::ExistingFile); app.add_option("--output,-o,2",outputAccOrigins,"output accumulation origins.", true); - app.add_option("--radius,-r", radius, "radius of accumulation analysis.", true); app.add_flag("--invertNormal", invertNormal, "export the accumulation vectors."); - app.add_option("--maxThAccVectors", thAcc, "threshold the value of accumulations used to decide to export the accumulations vectors (used with outputAccVectors) .", true); + app.add_flag("--extractNoConf", extractNoConf, "extract even when no face is voting with a maximal score to the voxel (ie confidence equal to 0)."); + auto optTh = app.add_option("--maxThAccVectors", thAcc, "threshold the value of accumulations used to decide to export the accumulations vectors (used with outputAccVectors) .", true); app.get_formatter()->column_width(40); CLI11_PARSE(app, argc, argv); @@ -87,17 +87,20 @@ int main(int argc, char *const *argv) for(const auto &p: imageAccumulation.domain()) { - if(imageAccumulation(p)>thAcc) + if(imageAccumulation(p)>thAcc || optTh->count() == 0) { NormalAccumulator::PointIndexContainer setIndexPt = normAcc.getAssociatedIndexPoints(p); - if(setIndexPt.size()!=0){ - fout << p[0] << " " << p[1] << " " << p[2] << " " << imageAccumulation(p) << " " << imageConfVote(p) << " "; + if (setIndexPt.size() != 0){ + fout << p[0] << " " << p[1] << " " << p[2] << " " << imageAccumulation(p) << " " << imageConfVote(p) << " "; for(const auto &i: setIndexPt) - { - fout << i << " "; - } + { + fout << i << " "; + } fout << std::endl; - } + }else if (extractNoConf){ + fout << p[0] << " " << p[1] << " " << p[2] << " " << imageAccumulation(p) << " " << imageConfVote(p); + fout << std::endl; + } } } fout.close(); From d54b96923ce85a80aa23f4023a6eab4cba5bfcfc Mon Sep 17 00:00:00 2001 From: kerautret Date: Sun, 23 Feb 2025 12:37:38 +0100 Subject: [PATCH 2/3] add option to avoid filtering when no confidence --- bin/extractAccOrigins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/extractAccOrigins.cpp b/bin/extractAccOrigins.cpp index c5d5401..430f5d4 100644 --- a/bin/extractAccOrigins.cpp +++ b/bin/extractAccOrigins.cpp @@ -87,7 +87,7 @@ int main(int argc, char *const *argv) for(const auto &p: imageAccumulation.domain()) { - if(imageAccumulation(p)>thAcc || optTh->count() == 0) + if(imageAccumulation(p) >= thAcc || optTh->count() == 0) { NormalAccumulator::PointIndexContainer setIndexPt = normAcc.getAssociatedIndexPoints(p); if (setIndexPt.size() != 0){ From 47d363bed5aec6f31a2d05e583646d41b1e9771b Mon Sep 17 00:00:00 2001 From: kerautret Date: Sun, 23 Feb 2025 12:39:32 +0100 Subject: [PATCH 3/3] threshold included --- bin/extractAccOrigins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/extractAccOrigins.cpp b/bin/extractAccOrigins.cpp index 430f5d4..4203caa 100644 --- a/bin/extractAccOrigins.cpp +++ b/bin/extractAccOrigins.cpp @@ -57,7 +57,7 @@ int main(int argc, char *const *argv) app.add_option("--radius,-r", radius, "radius of accumulation analysis.", true); app.add_flag("--invertNormal", invertNormal, "export the accumulation vectors."); app.add_flag("--extractNoConf", extractNoConf, "extract even when no face is voting with a maximal score to the voxel (ie confidence equal to 0)."); - auto optTh = app.add_option("--maxThAccVectors", thAcc, "threshold the value of accumulations used to decide to export the accumulations vectors (used with outputAccVectors) .", true); + auto optTh = app.add_option("--maxThAccVectors", thAcc, "threshold the value of accumulations used to decide to export the accumulations vectors (used with outputAccVectors). All voxel with accumulation greated or equal than the threshold are selected for output.", true); app.get_formatter()->column_width(40); CLI11_PARSE(app, argc, argv);