version 1.0

This commit is contained in:
Paul Leroy
2024-02-16 09:53:04 +01:00
parent b542d0e1ff
commit 4b4227bf6a
6 changed files with 10 additions and 19 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ if (PLUGIN_STANDARD_3DMASC)
project( Q3DMASC_PLUGIN )
AddPlugin( NAME ${PROJECT_NAME} )
set(Q3DMASC_PLUGIN_VERSION "0.12+")
set(Q3DMASC_PLUGIN_VERSION "1.0")
include( CMakePolicies NO_POLICY_SCOPE )
+1 -6
View File
@@ -32,8 +32,7 @@ QColor getColor(double value, double r1, double g1, double b1)
return QColor(r, g, b);
}
ConfusionMatrix::ConfusionMatrix(const std::vector<ScalarType> &actual, const std::vector<ScalarType> &predicted, QWidget *parent, ccMainAppInterface *app) :
QWidget(parent),
ConfusionMatrix::ConfusionMatrix(const std::vector<ScalarType> &actual, const std::vector<ScalarType> &predicted) :
ui(new Ui::ConfusionMatrix)
{
ui->setupUi(this);
@@ -41,10 +40,6 @@ ConfusionMatrix::ConfusionMatrix(const std::vector<ScalarType> &actual, const st
compute(actual, predicted);
if (app)
{
this->show();
}
this->ui->tableWidget->resizeColumnsToContents();
this->ui->tableWidget->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
QSize tableSize = this->ui->tableWidget->sizeHint();
+2 -4
View File
@@ -25,10 +25,8 @@ public:
F1_SCORE = 2
};
explicit ConfusionMatrix( const std::vector<ScalarType>& actual,
const std::vector<ScalarType>& predicted,
QWidget *parent = nullptr,
ccMainAppInterface* app = nullptr);
explicit ConfusionMatrix(const std::vector<ScalarType>& actual,
const std::vector<ScalarType>& predicted);
~ConfusionMatrix() override;
void computePrecisionRecallF1Score(cv::Mat& matrix, cv::Mat& precisionRecallF1Score, cv::Mat &vec_TP_FN);
-1
View File
@@ -425,7 +425,6 @@ void q3DMASCPlugin::doTrainAction()
//compute the core points (if necessary)
ccProgressDialog progressDlg(true, m_app->getMainWindow());
progressDlg.setAutoClose(false);
ccLog::Error("Qt::WA_DeleteOnClose " + QString::number(progressDlg.testAttribute(Qt::WA_DeleteOnClose)));
if (!corePoints.prepare(&progressDlg))
{
m_app->dispToConsole("Failed to compute/prepare the core points!", ccMainAppInterface::ERR_CONSOLE_MESSAGE);
+6 -1
View File
@@ -481,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, nullptr, app));
ConfusionMatrix* confusionMatrix = new ConfusionMatrix(actualClass, predictectedClass);
train3DMASCDialog.addConfusionMatrixAndSaveTraces(confusionMatrix);
if (app)
{
confusionMatrix->show();
}
//show the Classification_prediction field by default
if (outSF)
-6
View File
@@ -1231,7 +1231,6 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
ccLog::Print(logMessage);
CCCoreLib::NormalizedProgress nProgress(progressCb, pointCount);
QMutex mutex;
bool cancelled = false;
#ifndef _DEBUG
@@ -1386,15 +1385,12 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
if (!localSuccess)
{
mutex.lock();
cancelled = true;
success = false;
errorStr = "Feature computation failed for point " + QString::number(i) + " (using OpenMP with " + QString::number(omp_get_num_threads()) + " threads)";
ccLog::Error(localErrorStr);
mutex.unlock();
}
mutex.lock();
if (progressCb)
{
if (!cancelled)
@@ -1405,12 +1401,10 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
//process cancelled by the user
errorStr = "Process cancelled at point " + QString::number(i) + " (using OpenMP with " + QString::number(omp_get_num_threads()) + " threads)";
ccLog::Warning(errorStr);
ccLog::Error(localErrorStr);
success = false;
}
}
}
mutex.unlock();
}
} //for each point