34 #ifndef _vpPlanarObjectDetector_h_
35 #define _vpPlanarObjectDetector_h_
37 #include <visp3/core/vpConfig.h>
39 #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) && \
40 (VISP_HAVE_OPENCV_VERSION < 0x030000)
42 #include <opencv2/calib3d/calib3d.hpp>
43 #include <opencv2/features2d/features2d.hpp>
44 #include <opencv2/imgproc/imgproc.hpp>
46 #include <visp3/core/vpCameraParameters.h>
47 #include <visp3/core/vpHomogeneousMatrix.h>
48 #include <visp3/core/vpImage.h>
49 #include <visp3/core/vpImagePoint.h>
50 #include <visp3/core/vpPoint.h>
51 #include <visp3/core/vpRect.h>
52 #include <visp3/vision/vpFernClassifier.h>
53 #include <visp3/vision/vpHomography.h>
130 class VISP_EXPORT vpPlanarObjectDetector
135 vpFernClassifier fern;
144 std::vector<cv::Point2f> dst_corners;
150 std::vector<cv::Point2f> ref_corners;
157 std::vector<vpImagePoint> currentImagePoints;
160 std::vector<vpImagePoint> refImagePoints;
164 unsigned int minNbMatching;
168 vpPlanarObjectDetector();
169 vpPlanarObjectDetector(
const std::string &dataFile,
const std::string &objectName);
170 virtual ~vpPlanarObjectDetector();
184 void recordDetector(
const std::string &objectName,
const std::string &dataFile);
185 void load(
const std::string &dataFilename,
const std::string &objName);
197 std::vector<vpImagePoint> getDetectedCorners()
const;
204 vpFernClassifier &getFernClassifier() {
return this->fern; }
212 inline void getHomography(
vpHomography &_H)
const { _H = this->homography; }
219 inline unsigned int getNbRefPoints() {
return (
unsigned int)currentImagePoints.
size(); }
229 void getReferencePoint(
const unsigned int _i,
vpImagePoint &_imPoint);
250 void setMinNbPointValidation(
const unsigned int _min) { this->minNbMatching = _min; }
258 unsigned int getMinNbPointValidation()
const {
return this->minNbMatching; }
263 void initialiseRefCorners(
const cv::Rect &_modelROI);
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of an homography and operations on homographies.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Defines a rectangle in the plane.