71 unsigned int m_sampleStep;
73 unsigned int m_border;
75 double m_depthThreshold;
76 bool m_thresholdIsRelative;
77 bool m_preferPreviousPoints;
79 void sampleWithoutReplacement(
size_t count,
size_t vectorSize, std::vector<size_t> &indices,
vpUniRand &random)
const
81 count = std::min(count, vectorSize);
82 indices.resize(count);
84 for (
size_t i = 0; i < vectorSize; ++i) {
85 const double randomVal = random.
uniform(0.0, 1.0);
86 if ((vectorSize - i) * randomVal < (count - added)) {
115 if (m_sampleStep == 0) {
121 std::vector<std::pair<unsigned int, unsigned int>> getSilhouetteCandidates(
124 const std::vector<vpRBSilhouettePoint> &previousPoints,
long randomSeed = 41)
const;
126#if defined(VISP_HAVE_NLOHMANN_JSON)
135 nlohmann::json thresholdSettings = j.at(
"threshold");
136 std::string thresholdType = thresholdSettings.at(
"type");
137 settings.m_thresholdIsRelative = thresholdType ==
"relative";
138 settings.m_depthThreshold = thresholdSettings.at(
"value");
140 nlohmann::json samplingSettings = j.at(
"sampling");
141 settings.m_preferPreviousPoints = samplingSettings.at(
"reusePreviousPoints");
142 settings.m_maxNumPoints = samplingSettings.at(
"numPoints");