43 #ifndef vpFernClassifier_H
44 #define vpFernClassifier_H
46 #include <visp/vpConfig.h>
50 #if (VISP_HAVE_OPENCV_VERSION >= 0x020000) && (VISP_HAVE_OPENCV_VERSION < 0x030000) // Require opencv >= 2.0.0 and < 3.0.0
51 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1
52 # include <opencv2/imgproc/imgproc.hpp>
53 # include <opencv2/features2d/features2d.hpp>
54 # include <opencv2/legacy/legacy.hpp>
55 #elif (VISP_HAVE_OPENCV_VERSION >= 0x020000) // Require opencv >= 2.0.0
60 #include <visp/vpBasicKeyPoint.h>
225 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408)
242 std::vector<cv::Point2f>
refPt, curPt;
247 vpFernClassifier(
const std::string& _dataFile,
const std::string& _objectName);
254 const unsigned int height,
const unsigned int width);
262 const unsigned int height,
const unsigned int width);
273 void load(
const std::string& _dataFile,
const std::string& );
274 void record(
const std::string& _objectName,
const std::string& _dataFile);
286 inline void setBlurSettings(
const bool _blur,
int _sigma,
int _size);
316 const std::vector<cv::Point2f>&
getRefPt()
const {
return refPt;}
323 const std::vector<cv::Point2f>&
getCurPt()
const {
return curPt;}
class that defines what is a Keypoint. This class provides all the basic elements to implement classe...
std::vector< cv::KeyPoint > imgKeypoints
the vector containing the points in the current image.
bool blurImage
Flag to specify whether the reference image have to be blurred or not in order to improve the recogni...
bool hasLearn
Flag to indicate whether the classifier has been trained or not.
Class to define colors available for display functionnalities.
int nbClassfier
Number of classifier.
int nbView
Number of view to generate for the training.
cv::Rect modelROI_Ref
the ROI in the reference image.
cv::PatchGenerator gen
The patch generator (OpenCV format).
unsigned int nbMinPoint
Number of minimum point below which the homography is not estimated (must be at least four) ...
cv::LDetector ldetector
The points of interest detector.
const std::vector< cv::Point2f > & getRefPt() const
static const vpColor green
int radius
Radius for the detector.
int nbPoints
Maximal number of points.
int patchSize
Size of the patch.
int sigmaBlur
Sigma of the kernel used to blur the image.
int nbOctave
Number of octave for the multi scale.
virtual unsigned int buildReference(const vpImage< unsigned char > &I)=0
const std::vector< cv::Point2f > & getCurPt() const
std::vector< cv::KeyPoint > objKeypoints
keypoints detected in the reference image.
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
int threshold
Threshold to accept or reject points (usually around 20)
cv::Rect getModelROI() const
cv::FernClassifier fernClassifier
The Fern classifier.
int dist
Minimal distance between two points.
std::vector< cv::Point2f > refPt
vector in the OpenCV format to be used by the detector.
Defines a rectangle in the plane.
int radiusBlur
Radius of the kernel used to blur the image.
cv::Mat curImg
The current image in the OpenCV format.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
std::vector< cv::KeyPoint > modelPoints
the vector containing the points in the model.
void setBlurSetting(const bool _blur)
int ClassifierSize
Size of the classifier.
cv::Rect modelROI
the ROI for the reference image.
Class that implements the Fern classifier and the YAPE detector thanks to the OpenCV library...