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> 180 cv::LDetector ldetector;
183 cv::FernClassifier fernClassifier;
186 cv::PatchGenerator gen;
222 unsigned int nbMinPoint;
225 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) 232 std::vector<cv::KeyPoint> objKeypoints;
234 cv::Rect modelROI_Ref;
238 std::vector<cv::KeyPoint> modelPoints;
240 std::vector<cv::KeyPoint> imgKeypoints;
242 std::vector<cv::Point2f> refPt, curPt;
246 vpFernClassifier(
const std::string &_dataFile,
const std::string &_objectName);
247 virtual ~vpFernClassifier();
252 const unsigned int height,
const unsigned int width);
258 const unsigned int width);
263 unsigned int size = 3);
268 void load(
const std::string &_dataFile,
const std::string & );
269 void record(
const std::string &_objectName,
const std::string &_dataFile);
278 inline void setBlurSetting(
const bool _blur) { blurImage = _blur; }
279 inline void setBlurSettings(
const bool _blur,
int _sigma,
int _size);
288 inline bool getBlurSetting() {
return blurImage; }
295 inline int getBlurSigma() {
return this->sigmaBlur; }
302 inline int getBlurSize() {
return this->radiusBlur; }
309 const std::vector<cv::Point2f> &getRefPt()
const {
return refPt; }
316 const std::vector<cv::Point2f> &getCurPt()
const {
return curPt; }
321 cv::Rect getModelROI()
const {
return modelROI; }
class that defines what is a Keypoint. This class provides all the basic elements to implement classe...
Class to define colors available for display functionnalities.
static const vpColor green
virtual unsigned int buildReference(const vpImage< unsigned char > &I)=0
virtual void display(const vpImage< unsigned char > &Iref, const vpImage< unsigned char > &Icurrent, unsigned int size=3)=0
virtual unsigned int matchPoint(const vpImage< unsigned char > &I)=0
Defines a rectangle in the plane.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...