ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
masc::Classifier Class Reference

#include <q3DMASCClassifier.h>

Classes

struct  AccuracyMetrics
 Classifier accuracy metrics. More...
 

Public Member Functions

 Classifier ()
 Default constructor. More...
 
bool 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. 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...
 

Detailed Description

Definition at line 47 of file q3DMASCClassifier.h.

Constructor & Destructor Documentation

◆ Classifier()

Classifier::Classifier ( )

Default constructor.

Definition at line 46 of file q3DMASCClassifier.cpp.

Member Function Documentation

◆ classify()

◆ evaluate()

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 
)

◆ fromFile()

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().

◆ getVarImportance()

cv::Mat masc::Classifier::getVarImportance ( ) const
inline

Definition at line 94 of file q3DMASCClassifier.h.

References m_rtrees.

Referenced by q3DMASCPlugin::doTrainAction().

◆ isValid()

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().

◆ toFile()

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().

◆ train()

Member Data Documentation

◆ m_rtrees

cv::Ptr<cv::ml::RTrees> masc::Classifier::m_rtrees
protected

Random trees (OpenCV)

Definition at line 100 of file q3DMASCClassifier.h.

Referenced by classify(), evaluate(), fromFile(), getVarImportance(), isValid(), toFile(), and train().


The documentation for this class was generated from the following files: