SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
CoreThresholdPartitionConfig.cpp
Go to the documentation of this file.
1
17/*
18 * CoreThresholdPartitionConfig.cpp
19 *
20 * Created on: May 28, 2019
21 * Author: mkuemmel@usm.lmu.de
22 */
23
24#include <Configuration/ProgramOptionsHelper.h>
25
27
31
32
33namespace po = boost::program_options;
34using namespace Euclid::Configuration;
35
36namespace SourceXtractor {
37
38static const std::string CORE_THRESHOLD {"core-threshold-value" };
39static const std::string CORE_MINAREA {"core-minimum-area" };
40static const std::string CORE_THRESH_USE {"partition-corethreshold" };
41
48
50 return {{"Core threshold partitioning", {
51 {CORE_THRESHOLD.c_str(), po::value<double>()->default_value(0.0), "The core threshold level"},
52 {CORE_MINAREA.c_str(), po::value<int>()->default_value(0), "The minimum pixel area for partitioning"},
53 {CORE_THRESH_USE.c_str(), po::value<bool>()->default_value(false), "Activate core threshold partitioning"}
54 }}};
55}
56
58 m_core_threshold = args.find(CORE_THRESHOLD)->second.as<double>();
59 m_core_minarea = args.find(CORE_MINAREA)->second.as<int>();
60
61 if (m_core_threshold < 0.) {
62 throw Elements::Exception() << "Invalid " << CORE_THRESHOLD << " value: " << m_core_threshold;
63 }
64 if (m_core_minarea < 0) {
65 throw Elements::Exception() << "Invalid " << CORE_MINAREA << " value: " << m_core_minarea;
66 }
67
68 if (m_core_threshold > 0.0 && m_core_minarea > 0 && args.at(CORE_THRESH_USE).as<bool>()) {
73 }
74}
75
79
83
84} // end SExtractor
static ConfigManager & getInstance(long id)
std::map< std::string, OptionDescriptionList > getProgramOptions() override
static const std::string CORE_MINAREA
static const std::string CORE_THRESH_USE
static const std::string CORE_THRESHOLD