42 #ifndef VPPLANAROBJECTDETECTOR_H_
43 #define VPPLANAROBJECTDETECTOR_H_
45 #include <visp/vpConfig.h>
47 #if (VISP_HAVE_OPENCV_VERSION >= 0x020000) && (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/imgproc/imgproc.hpp>
51 # include <opencv2/features2d/features2d.hpp>
52 # include <opencv2/calib3d/calib3d.hpp>
53 #elif (VISP_HAVE_OPENCV_VERSION >= 0x020000) // Require opencv >= 2.0.0
58 #include <visp/vpImagePoint.h>
59 #include <visp/vpImage.h>
60 #include <visp/vpRect.h>
61 #include <visp/vpImagePoint.h>
62 #include <visp/vpPoint.h>
63 #include <visp/vpHomogeneousMatrix.h>
64 #include <visp/vpCameraParameters.h>
65 #include <visp/vpHomography.h>
66 #include <visp/vpFernClassifier.h>
187 unsigned int height,
unsigned int width);
194 const vpImagePoint &iP,
const unsigned int height,
const unsigned int width);
197 void recordDetector(
const std::string& objectName,
const std::string& dataFile);
198 void load(
const std::string& dataFilename,
const std::string& objName);
212 std::vector<vpImagePoint> getDetectedCorners()
const;
234 inline unsigned int getNbRefPoints() {
return (
unsigned int)currentImagePoints.size() ;}
244 void getReferencePoint(
const unsigned int _i,
vpImagePoint& _imPoint);
275 void computeRoi(
vpImagePoint* ip,
const unsigned int nbpt);
276 void initialiseRefCorners(
const cv::Rect& _modelROI);
unsigned int getNbRefPoints()
vpFernClassifier & getFernClassifier()
void getHomography(vpHomography &_H) const
std::vector< cv::Point2f > ref_corners
The corners in the reference image.
cv::Rect modelROI
The ROI for the reference image.
cv::Mat H
Computed homography in the OpenCV format.
void setMinNbPointValidation(const unsigned int _min)
This class aims to compute the homography wrt.two images.
std::vector< cv::Point2f > dst_corners
The estimated new coordinates of the corners (reprojected using the homography).
vpFernClassifier fern
Fern Classifier used to match the points between a reference image and the current image...
std::vector< vpImagePoint > currentImagePoints
Vector of the image point in the current image that match after the deletion of the outliers with the...
vpHomography homography
Computed homography in the ViSP format.
unsigned int getMinNbPointValidation() const
bool isCorrect
Flag to indicate wether the last computed homography is correct or not.
unsigned int minNbMatching
Minimal number of point to after the ransac needed to suppose that the homography has been correctly ...
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 ...
Class used to detect a planar surface.
std::vector< vpImagePoint > refImagePoints
Vector of the image point in the reference image that match after the deletion of the outliers with t...
Class that implements the Fern classifier and the YAPE detector thanks to the OpenCV library...