Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _Aruco_BoardDetector_H
00029 #define _Aruco_BoardDetector_H
00030 #include <opencv2/core/core.hpp>
00031 #include "exports.h"
00032 #include "board.h"
00033 #include "cameraparameters.h"
00034 #include "markerdetector.h"
00035 using namespace std;
00036
00037 namespace aruco {
00038
00064 class ARUCO_EXPORTS BoardDetector {
00065 public:
00069 BoardDetector(bool setYPerpendicular = false);
00070
00071
00075 void setParams(const BoardConfiguration &bc, const CameraParameters &cp, float markerSizeMeters = -1);
00076 void setParams(const BoardConfiguration &bc);
00081 float detect(const cv::Mat &im) throw(cv::Exception);
00084 Board &getDetectedBoard() { return _boardDetected; }
00087 MarkerDetector &getMarkerDetector() { return _mdetector; }
00090 vector< Marker > &getDetectedMarkers() { return _vmarkers; }
00091
00092
00093
00094
00106 float detect(const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, cv::Mat camMatrix = cv::Mat(),
00107 cv::Mat distCoeff = cv::Mat(), float markerSizeMeters = -1) throw(cv::Exception);
00108 float detect(const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, const CameraParameters &cp,
00109 float markerSizeMeters = -1) throw(cv::Exception);
00110
00118 static Board detect(const cv::Mat &Image, const BoardConfiguration &bc, const CameraParameters &cp, float markerSizeMeters = -1);
00119
00125 void setYPerpendicular(bool enable) { _setYPerpendicular = enable; }
00126 void setYPerperdicular(bool enable) { setYPerpendicular(enable); }
00127 bool isYPerpendicular() { return _setYPerpendicular; }
00128
00133 void set_repj_err_thres(float Repj_err_thres) { repj_err_thres = Repj_err_thres; }
00134 float get_repj_err_thres() const { return repj_err_thres; }
00135
00136
00137 private:
00138 void rotateXAxis(cv::Mat &rotation);
00139 bool _setYPerpendicular;
00140
00141
00142 bool _areParamsSet;
00143 BoardConfiguration _bconf;
00144 Board _boardDetected;
00145 float _markerSize, repj_err_thres;
00146 CameraParameters _camParams;
00147 MarkerDetector _mdetector;
00148 vector< Marker > _vmarkers;
00149 };
00150 };
00151 #endif