OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
otb::CvRTreesWrapper Class Reference

#include <otbCvRTreesWrapper.h>

+ Inheritance diagram for otb::CvRTreesWrapper:
+ Collaboration diagram for otb::CvRTreesWrapper:

Public Types

typedef std::vector< unsigned int > VotesVectorType
 

Public Member Functions

 CvRTreesWrapper ()
 
void get_votes (const cv::Mat &sample, const cv::Mat &missing, VotesVectorType &vote_count) const
 
virtual cv::String getDefaultName () const override
 
virtual int getVarCount () const override
 
virtual cv::Mat getVarImportance () const override
 
virtual bool isClassifier () const override
 
virtual bool isTrained () const override
 
virtual float predict (cv::InputArray samples, cv::OutputArray results=cv::noArray(), int flags=0) const override
 
float predict_confidence (const cv::Mat &sample, const cv::Mat &missing=cv::Mat()) const
 
float predict_margin (const cv::Mat &sample, const cv::Mat &missing=cv::Mat()) const
 
virtual void read (const cv::FileNode &fn) override
 
virtual void save (const cv::String &filename) const override
 
virtual bool train (const cv::Ptr< cv::ml::TrainData > &trainData, int flags=0) override
 
virtual bool train (cv::InputArray samples, int layout, cv::InputArray responses) override
 
virtual void write (cv::FileStorage &fs) const override
 
 ~CvRTreesWrapper () override=default
 

Static Public Member Functions

static cv::Ptr< CvRTreesWrappercreate ()
 

Private Attributes

cv::Ptr< cv::ml::RTrees > m_Impl
 

Detailed Description

Wrapper for OpenCV Random Trees.

Definition at line 35 of file otbCvRTreesWrapper.h.

Member Typedef Documentation

◆ VotesVectorType

typedef std::vector<unsigned int> otb::CvRTreesWrapper::VotesVectorType

Definition at line 39 of file otbCvRTreesWrapper.h.

Constructor & Destructor Documentation

◆ CvRTreesWrapper()

otb::CvRTreesWrapper::CvRTreesWrapper ( )

◆ ~CvRTreesWrapper()

otb::CvRTreesWrapper::~CvRTreesWrapper ( )
overridedefault

Member Function Documentation

◆ create()

static cv::Ptr<CvRTreesWrapper> otb::CvRTreesWrapper::create ( )
static

◆ get_votes()

void otb::CvRTreesWrapper::get_votes ( const cv::Mat &  sample,
const cv::Mat &  missing,
VotesVectorType vote_count 
) const

Compute the number of votes for each class.

◆ getDefaultName()

virtual cv::String otb::CvRTreesWrapper::getDefaultName ( ) const
overridevirtual

◆ getVarCount()

virtual int otb::CvRTreesWrapper::getVarCount ( ) const
overridevirtual

◆ getVarImportance()

virtual cv::Mat otb::CvRTreesWrapper::getVarImportance ( ) const
overridevirtual

◆ isClassifier()

virtual bool otb::CvRTreesWrapper::isClassifier ( ) const
overridevirtual

◆ isTrained()

virtual bool otb::CvRTreesWrapper::isTrained ( ) const
overridevirtual

◆ predict()

virtual float otb::CvRTreesWrapper::predict ( cv::InputArray  samples,
cv::OutputArray  results = cv::noArray(),
int  flags = 0 
) const
overridevirtual

◆ predict_confidence()

float otb::CvRTreesWrapper::predict_confidence ( const cv::Mat &  sample,
const cv::Mat &  missing = cv::Mat() 
) const

Predict the confidence of the classifcation by computing the proportion of trees which voted for the majority class.

◆ predict_margin()

float otb::CvRTreesWrapper::predict_margin ( const cv::Mat &  sample,
const cv::Mat &  missing = cv::Mat() 
) const

Predict the confidence margin of the classifcation by computing the difference in votes between the first and second most voted classes. This measure is preferred to the proportion of votes of the majority class, since it provides information about the conflict between the most likely classes.

◆ read()

virtual void otb::CvRTreesWrapper::read ( const cv::FileNode &  fn)
overridevirtual

◆ save()

virtual void otb::CvRTreesWrapper::save ( const cv::String &  filename) const
overridevirtual

◆ train() [1/2]

virtual bool otb::CvRTreesWrapper::train ( const cv::Ptr< cv::ml::TrainData > &  trainData,
int  flags = 0 
)
overridevirtual

◆ train() [2/2]

virtual bool otb::CvRTreesWrapper::train ( cv::InputArray  samples,
int  layout,
cv::InputArray  responses 
)
overridevirtual

◆ write()

virtual void otb::CvRTreesWrapper::write ( cv::FileStorage &  fs) const
overridevirtual

Member Data Documentation

◆ m_Impl

cv::Ptr<cv::ml::RTrees> otb::CvRTreesWrapper::m_Impl
private

Definition at line 124 of file otbCvRTreesWrapper.h.


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