![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <q3DMASCClassifier.h>
Classes | |
| struct | AccuracyMetrics |
| Classifier accuracy metrics. More... | |
Public Member Functions | |
| Classifier () | |
| Default constructor. More... | |
| bool | train (const ccPointCloud *cloud, const RandomTreesParams ¶ms, const Feature::Source::Set &featureSources, QString &errorMessage, cloudViewer::ReferenceCloud *trainSubset=nullptr, ecvMainAppInterface *app=nullptr, QWidget *parentWidget=nullptr) |
| Train the classifier. More... | |
| bool | evaluate (const Feature::Source::Set &featureSources, ccPointCloud *testCloud, AccuracyMetrics &metrics, QString &errorMessage, Train3DMASCDialog &train3DMASCDialog, cloudViewer::ReferenceCloud *testSubset=nullptr, QString outputSFName=QString(), QWidget *parentWidget=nullptr, ecvMainAppInterface *app=nullptr) |
| Evaluates the classifier. More... | |
| bool | classify (const Feature::Source::Set &featureSources, ccPointCloud *cloud, QString &errorMessage, QWidget *parentWidget=nullptr, ecvMainAppInterface *app=nullptr) |
| Applies the classifier. More... | |
| bool | isValid () const |
| Returns whether the classifier is valid or not. More... | |
| bool | toFile (QString filename, QWidget *parentWidget=nullptr) const |
| Saves the classifier to file. More... | |
| bool | fromFile (QString filename, QWidget *parentWidget=nullptr) |
| Loads the classifier from file. More... | |
| cv::Mat | getVarImportance () const |
Protected Attributes | |
| cv::Ptr< cv::ml::RTrees > | m_rtrees |
| Random trees (OpenCV) More... | |
Definition at line 47 of file q3DMASCClassifier.h.
| Classifier::Classifier | ( | ) |
Default constructor.
Definition at line 46 of file q3DMASCClassifier.cpp.
| bool Classifier::classify | ( | const Feature::Source::Set & | featureSources, |
| ccPointCloud * | cloud, | ||
| QString & | errorMessage, | ||
| QWidget * | parentWidget = nullptr, |
||
| ecvMainAppInterface * | app = nullptr |
||
| ) |
Applies the classifier.
Definition at line 101 of file q3DMASCClassifier.cpp.
References ccPointCloud::addScalarField(), cloudViewer::ScalarField::computeMinAndMax(), ccScalarField::computeMinAndMax(), ccPointCloud::deleteScalarField(), cloudViewer::ScalarField::fill(), masc::Tools::GetClassificationSF(), cloudViewer::ScalarField::getName(), cloudViewer::PointCloudTpl< T >::getScalarField(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), GetSource(), isValid(), LAS_CLASSIFICATION, LAS_FIELD_NAMES, m_rtrees, masc::Feature::Source::name, NAN_VALUE, nProgress, cloudViewer::NormalizedProgress::oneStep(), CVLog::Print(), ecvDisplayTools::RedrawDisplay(), CCShareable::release(), cloudViewer::ScalarField::resizeSafe(), result, ccPointCloud::setCurrentDisplayedScalarField(), cloudViewer::ScalarField::setName(), ccHObject::setRedrawFlagRecursive(), ecvDisplayTools::SetRedrawRecursive(), cloudViewer::ScalarField::setValue(), ccDrawableObject::showSF(), cloudViewer::PointCloudTpl< T >::size(), and CVLog::Warning().
Referenced by q3DMASCPlugin::doClassifyAction(), and Command3DMASCClassif::process().
| bool Classifier::evaluate | ( | const Feature::Source::Set & | featureSources, |
| ccPointCloud * | testCloud, | ||
| AccuracyMetrics & | metrics, | ||
| QString & | errorMessage, | ||
| Train3DMASCDialog & | train3DMASCDialog, | ||
| cloudViewer::ReferenceCloud * | testSubset = nullptr, |
||
| QString | outputSFName = QString(), |
||
| QWidget * | parentWidget = nullptr, |
||
| ecvMainAppInterface * | app = nullptr |
||
| ) |
Evaluates the classifier.
Definition at line 294 of file q3DMASCClassifier.cpp.
References Train3DMASCDialog::addConfusionMatrixAndSaveTraces(), ccPointCloud::addScalarField(), ccScalarField::computeMinAndMax(), ccPointCloud::deleteScalarField(), cloudViewer::ReferenceCloud::getAssociatedCloud(), masc::Tools::GetClassificationSF(), cloudViewer::ScalarField::getName(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), cloudViewer::PointCloudTpl< T >::getScalarField(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), GetSource(), cloudViewer::ScalarField::getValue(), masc::Classifier::AccuracyMetrics::goodGuess, m_rtrees, masc::Feature::Source::name, NAN_VALUE, nProgress, cloudViewer::NormalizedProgress::oneStep(), CVLog::Print(), masc::Classifier::AccuracyMetrics::ratio, ecvDisplayTools::RedrawDisplay(), result, masc::Classifier::AccuracyMetrics::sampleCount, ccPointCloud::setCurrentDisplayedScalarField(), ccDrawableObject::setRedraw(), ecvDisplayTools::SetRedrawRecursive(), cloudViewer::ScalarField::setValue(), ccDrawableObject::showSF(), cloudViewer::PointCloudTpl< T >::size(), and cloudViewer::ReferenceCloud::size().
Referenced by q3DMASCPlugin::doTrainAction().
| bool Classifier::fromFile | ( | QString | filename, |
| QWidget * | parentWidget = nullptr |
||
| ) |
Loads the classifier from file.
Definition at line 730 of file q3DMASCClassifier.cpp.
References CVLog::Error(), filename, m_rtrees, and CVLog::Warning().
Referenced by masc::Tools::LoadFile().
|
inline |
Definition at line 94 of file q3DMASCClassifier.h.
References m_rtrees.
Referenced by q3DMASCPlugin::doTrainAction().
| bool Classifier::isValid | ( | ) | const |
Returns whether the classifier is valid or not.
Definition at line 48 of file q3DMASCClassifier.cpp.
References m_rtrees.
Referenced by classify(), q3DMASCPlugin::doClassifyAction(), and masc::Tools::LoadFile().
| bool Classifier::toFile | ( | QString | filename, |
| QWidget * | parentWidget = nullptr |
||
| ) | const |
Saves the classifier to file.
Definition at line 704 of file q3DMASCClassifier.cpp.
References filename, m_rtrees, CVLog::Print(), and CVLog::Warning().
Referenced by masc::Tools::SaveClassifier().
| bool Classifier::train | ( | const ccPointCloud * | cloud, |
| const RandomTreesParams & | params, | ||
| const Feature::Source::Set & | featureSources, | ||
| QString & | errorMessage, | ||
| cloudViewer::ReferenceCloud * | trainSubset = nullptr, |
||
| ecvMainAppInterface * | app = nullptr, |
||
| QWidget * | parentWidget = nullptr |
||
| ) |
Train the classifier.
Definition at line 509 of file q3DMASCClassifier.cpp.
References ecvMainAppInterface::dispToConsole(), cloudViewer::ReferenceCloud::getAssociatedCloud(), masc::Tools::GetClassificationSF(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), GetSource(), cloudViewer::ScalarField::getValue(), m_rtrees, masc::Feature::Source::name, params, cloudViewer::PointCloudTpl< T >::size(), cloudViewer::ReferenceCloud::size(), and cloudViewer::utility::Sleep().
Referenced by q3DMASCPlugin::doTrainAction().
|
protected |
Random trees (OpenCV)
Definition at line 100 of file q3DMASCClassifier.h.
Referenced by classify(), evaluate(), fromFile(), getVarImportance(), isValid(), toFile(), and train().