40 #ifndef vpFernClassifier_H
41 #define vpFernClassifier_H
43 #include <visp3/core/vpConfig.h>
47 #if (VISP_HAVE_OPENCV_VERSION >= 0x020000) && \
48 (VISP_HAVE_OPENCV_VERSION < 0x030000) // Require opencv >= 2.0.0 and < 3.0.0
49 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1
50 #include <opencv2/features2d/features2d.hpp>
51 #include <opencv2/imgproc/imgproc.hpp>
52 #include <opencv2/legacy/legacy.hpp>
53 #elif (VISP_HAVE_OPENCV_VERSION >= 0x020000) // Require opencv >= 2.0.0
58 #include <visp3/vision/vpBasicKeyPoint.h>
178 cv::LDetector ldetector;
181 cv::FernClassifier fernClassifier;
184 cv::PatchGenerator gen;
220 unsigned int nbMinPoint;
223 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
230 std::vector<cv::KeyPoint> objKeypoints;
232 cv::Rect modelROI_Ref;
236 std::vector<cv::KeyPoint> modelPoints;
238 std::vector<cv::KeyPoint> imgKeypoints;
240 std::vector<cv::Point2f> refPt, curPt;
244 vpFernClassifier(
const std::string &_dataFile,
const std::string &_objectName);
245 virtual ~vpFernClassifier();
250 unsigned int height,
unsigned int width);
261 unsigned int size = 3);
266 void load(
const std::string &_dataFile,
const std::string & );
267 void record(
const std::string &_objectName,
const std::string &_dataFile);
276 inline void setBlurSetting(
const bool _blur) { blurImage = _blur; }
277 inline void setBlurSettings(
const bool _blur,
int _sigma,
int _size);
286 inline bool getBlurSetting() {
return blurImage; }
293 inline int getBlurSigma() {
return this->sigmaBlur; }
300 inline int getBlurSize() {
return this->radiusBlur; }
307 const std::vector<cv::Point2f> &getRefPt()
const {
return refPt; }
314 const std::vector<cv::Point2f> &getCurPt()
const {
return curPt; }
319 cv::Rect getModelROI()
const {
return modelROI; }