mirror of
https://github.com/dgirardeau/q3DMASC.git
synced 2026-08-29 16:40:49 +08:00
Merge branch 'master' into linux_compilation
This commit is contained in:
+27
-7
@@ -30,7 +30,7 @@
|
||||
//qPDALIO
|
||||
#include "../../../core/IO/qPDALIO/include/LASFields.h"
|
||||
|
||||
//qCC_plugins
|
||||
//CCPluginAPI
|
||||
#include <ccMainAppInterface.h>
|
||||
|
||||
//Qt
|
||||
@@ -110,7 +110,8 @@ static IScalarFieldWrapper::Shared GetSource(const Feature::Source& fs, const cc
|
||||
bool Classifier::classify( const Feature::Source::Set& featureSources,
|
||||
ccPointCloud* cloud,
|
||||
QString& errorMessage,
|
||||
QWidget* parentWidget/*=nullptr*/
|
||||
QWidget* parentWidget/*=nullptr*/,
|
||||
ccMainAppInterface* app/*nullptr*/
|
||||
)
|
||||
{
|
||||
if (!cloud)
|
||||
@@ -206,13 +207,15 @@ bool Classifier::classify( const Feature::Source::Set& featureSources,
|
||||
|
||||
bool success = true;
|
||||
int numberOfTrees = static_cast<int>(m_rtrees->getRoots().size());
|
||||
bool cancelled = false;
|
||||
|
||||
#ifndef _DEBUG
|
||||
#if defined(_OPENMP)
|
||||
omp_set_num_threads(std::max(1, omp_get_max_threads() - 2));
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel for num_threads(omp_get_max_threads() - 2)
|
||||
#endif
|
||||
#endif
|
||||
for (int i = 0; i < static_cast<int>(cloud->size()); ++i)
|
||||
{
|
||||
{
|
||||
//allocate the data matrix
|
||||
cv::Mat test_data;
|
||||
@@ -224,8 +227,11 @@ bool Classifier::classify( const Feature::Source::Set& featureSources,
|
||||
{
|
||||
errorMessage = cvex.msg.c_str();
|
||||
success = false;
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
if (!cancelled)
|
||||
{
|
||||
for (int fIndex = 0; fIndex < attributesPerSample; ++fIndex)
|
||||
{
|
||||
double value = wrappers[fIndex]->pointValue(i);
|
||||
@@ -256,7 +262,10 @@ bool Classifier::classify( const Feature::Source::Set& featureSources,
|
||||
{
|
||||
//process cancelled by the user
|
||||
success = false;
|
||||
cancelled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
classificationSF->computeMinAndMax();
|
||||
@@ -276,7 +285,12 @@ bool Classifier::classify( const Feature::Source::Set& featureSources,
|
||||
}
|
||||
|
||||
if (classifSFBackup != nullptr)
|
||||
ConfusionMatrix *confusionMatrix = new ConfusionMatrix(*classifSFBackup, *classificationSF);
|
||||
{
|
||||
if (app)
|
||||
{
|
||||
ConfusionMatrix *confusionMatrix = new ConfusionMatrix(*classifSFBackup, *classificationSF);
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -288,7 +302,8 @@ bool Classifier::evaluate(const Feature::Source::Set& featureSources,
|
||||
Train3DMASCDialog& train3DMASCDialog,
|
||||
CCCoreLib::ReferenceCloud* testSubset/*=nullptr=*/,
|
||||
QString outputSFName/*=QString()*/,
|
||||
QWidget* parentWidget/*=nullptr*/)
|
||||
QWidget* parentWidget/*=nullptr*/,
|
||||
ccMainAppInterface *app/*=nullptr*/)
|
||||
{
|
||||
if (!testCloud)
|
||||
{
|
||||
@@ -466,7 +481,12 @@ bool Classifier::evaluate(const Feature::Source::Set& featureSources,
|
||||
metrics.ratio = static_cast<float>(metrics.goodGuess) / metrics.sampleCount;
|
||||
}
|
||||
|
||||
train3DMASCDialog.addConfusionMatrixAndSaveTraces(new ConfusionMatrix(actualClass, predictectedClass));
|
||||
ConfusionMatrix* confusionMatrix = new ConfusionMatrix(actualClass, predictectedClass);
|
||||
train3DMASCDialog.addConfusionMatrixAndSaveTraces(confusionMatrix);
|
||||
if (app)
|
||||
{
|
||||
confusionMatrix->show();
|
||||
}
|
||||
|
||||
//show the Classification_prediction field by default
|
||||
if (outSF)
|
||||
|
||||
Reference in New Issue
Block a user