21 #ifndef otbCvRTreesWrapper_h
22 #define otbCvRTreesWrapper_h
36 :
public cv::ml::RTrees
44 void get_votes(
const cv::Mat& sample,
const cv::Mat& missing,
VotesVectorType& vote_count)
const;
49 float predict_confidence(
const cv::Mat& sample,
const cv::Mat& missing = cv::Mat())
const;
57 float predict_margin(
const cv::Mat& sample,
const cv::Mat& missing = cv::Mat())
const;
60 #define OTB_CV_WRAP_PROPERTY(type, name) \
61 virtual type get##name() const override; \
62 virtual void set##name(type val) override;
64 #define OTB_CV_WRAP_PROPERTY_REF(type, name) \
65 virtual type get##name() const override; \
66 virtual void set##name(const type& val) override;
68 #define OTB_CV_WRAP_CSTREF_GET(type, name) virtual const type& get##name() const override;
71 virtual int getVarCount()
const override;
73 virtual bool isTrained()
const override;
75 virtual bool isClassifier()
const override;
98 virtual void getVotes(cv::InputArray samples, cv::OutputArray results,
int flags)
const override;
101 virtual cv::Mat getVarImportance()
const override;
103 virtual cv::String getDefaultName()
const override;
105 virtual void read(
const cv::FileNode& fn)
override;
107 virtual void write(cv::FileStorage& fs)
const override;
109 virtual void save(
const cv::String& filename)
const override;
111 virtual bool train(cv::InputArray samples,
int layout, cv::InputArray responses)
override;
113 virtual bool train(
const cv::Ptr<cv::ml::TrainData>& trainData,
int flags = 0)
override;
115 virtual float predict(cv::InputArray samples, cv::OutputArray results = cv::noArray(),
int flags = 0)
const override;
117 static cv::Ptr<CvRTreesWrapper> create();
119 #undef OTB_CV_WRAP_PROPERTY
120 #undef OTB_CV_WRAP_PROPERTY_REF
121 #undef OTB_CV_WRAP_CSTREF_GET