From f60f3fd570016542562b85b4286fe24a31a36759 Mon Sep 17 00:00:00 2001 From: Paul Leroy Date: Thu, 24 Feb 2022 16:44:59 +0100 Subject: [PATCH 1/2] wip --- q3DMASCClassifier.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/q3DMASCClassifier.cpp b/q3DMASCClassifier.cpp index ee8ab84..3a41121 100644 --- a/q3DMASCClassifier.cpp +++ b/q3DMASCClassifier.cpp @@ -524,19 +524,15 @@ bool Classifier::train( const ccPointCloud* cloud, m_rtrees->setMaxDepth(params.maxDepth); m_rtrees->setMinSampleCount(params.minSampleCount); m_rtrees->setRegressionAccuracy(0); + // If true then surrogate splits will be built. These splits allow to work with missing data and compute variable importance correctly. Default value is false. m_rtrees->setUseSurrogates(false); m_rtrees->setPriors(cv::Mat()); //m_rtrees->setMaxCategories(params.maxCategories); //not important? m_rtrees->setCalculateVarImportance(true); m_rtrees->setActiveVarCount(params.activeVarCount); - //cv::TermCriteria terminationCriteria(cv::TermCriteria::MAX_ITER, params.maxTreeCount, std::numeric_limits::epsilon()); - cv::TermCriteria terminationCriteria(cv::TermCriteria::MAX_ITER, params.maxTreeCount, 0.1); + cv::TermCriteria terminationCriteria(cv::TermCriteria::MAX_ITER, params.maxTreeCount, std::numeric_limits::epsilon()); m_rtrees->setTermCriteria(terminationCriteria); - ccLog::Warning("[Classifier::train] hardware_concurrency " + QString::number(std::thread::hardware_concurrency())); - ccLog::Warning("[Classifier::train] cv::getNumThreads " + QString::number(cv::getNumThreads())); - ccLog::Warning("[Classifier::train] cv::getNumberOfCPUs " + QString::number(cv::getNumberOfCPUs())); - cv::setNumThreads(50); ccLog::Warning("[Classifier::train] cv::getNumThreads " + QString::number(cv::getNumThreads())); QFuture future = QtConcurrent::run([&]() @@ -544,8 +540,6 @@ bool Classifier::train( const ccPointCloud* cloud, // Code in this block will run in another thread try { - ccLog::Warning("[QFuture] cv::getNumThreads " + QString::number(cv::getNumThreads())); - cv::setNumThreads(50); ccLog::Warning("[QFuture] cv::getNumThreads " + QString::number(cv::getNumThreads())); cv::Mat sampleIndexes = cv::Mat::zeros(1, training_data.rows, CV_8U); cv::Mat trainSamples = sampleIndexes.colRange(0, sampleCount); From bf102776f98faf940317e89b57b28f8bcad449cb Mon Sep 17 00:00:00 2001 From: Paul Leroy Date: Tue, 15 Mar 2022 09:17:11 +0100 Subject: [PATCH 2/2] Old structure in DgmOctree does not exists anymore --- q3DMASCTools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/q3DMASCTools.cpp b/q3DMASCTools.cpp index b9360cc..11c8c02 100644 --- a/q3DMASCTools.cpp +++ b/q3DMASCTools.cpp @@ -1127,7 +1127,7 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features for (int i = 0; i < static_cast(pointCount); ++i) { //spherical neighborhood extraction structure - CCCoreLib::DgmOctree::NearestNeighboursSphericalSearchStruct nNSS; + CCCoreLib::DgmOctree::NearestNeighboursSearchStruct nNSS; { nNSS.level = octreeLevel; nNSS.queryPoint = *corePoints.cloud->getPoint(i);